From c8d0b2c6eae6ef4f66f53bb53e821dc87c700eaa Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 30 Dec 2023 07:44:02 +0000 Subject: [PATCH] feat(schema): update TDLib to the latest layer --- _schema/tdapi.tl | 430 ++-- tdapi/tl_accent_color_gen.go | 78 +- tdapi/tl_add_application_changelog_gen.go | 206 -- tdapi/tl_background_gen.go | 3 +- tdapi/tl_background_type_gen.go | 181 ++ tdapi/tl_chat_background_gen.go | 3 +- tdapi/tl_chat_boost_features_gen.go | 221 ++ tdapi/tl_chat_boost_level_features_gen.go | 534 +++++ tdapi/tl_chat_event_action_gen.go | 756 ++++++- tdapi/tl_chat_gen.go | 351 +-- tdapi/tl_chat_permissions_gen.go | 4 +- tdapi/tl_delete_default_background_gen.go | 206 ++ tdapi/tl_get_background_url_gen.go | 2 +- tdapi/tl_get_backgrounds_gen.go | 206 -- tdapi/tl_get_chat_boost_features_gen.go | 169 ++ tdapi/tl_get_chat_boost_level_features_gen.go | 206 ++ tdapi/tl_get_chat_story_interactions_gen.go | 386 ++++ .../tl_get_default_chat_emoji_statuses_gen.go | 169 ++ ..._get_disallowed_chat_emoji_statuses_gen.go | 169 ++ tdapi/tl_get_installed_backgrounds_gen.go | 206 ++ tdapi/tl_get_message_public_forwards_gen.go | 48 +- tdapi/tl_get_premium_giveaway_info_gen.go | 2 +- tdapi/tl_get_story_interactions_gen.go | 412 ++++ tdapi/tl_get_story_public_forwards_gen.go | 42 +- tdapi/tl_get_story_viewers_gen.go | 376 ---- .../tl_get_themed_chat_emoji_statuses_gen.go | 169 ++ tdapi/tl_input_story_area_type_gen.go | 217 ++ tdapi/tl_input_story_areas_gen.go | 2 +- tdapi/tl_internal_link_type_gen.go | 181 ++ tdapi/tl_keyboard_button_type_gen.go | 170 +- tdapi/tl_message_content_gen.go | 996 +++++++-- tdapi/tl_open_chat_similar_chat_gen.go | 237 ++ tdapi/tl_payment_provider_gen.go | 64 +- tdapi/tl_premium_gift_code_info_gen.go | 7 +- ...tl_premium_gift_code_payment_option_gen.go | 2 +- tdapi/tl_premium_giveaway_parameters_gen.go | 116 +- tdapi/tl_premium_payment_option_gen.go | 2 +- tdapi/tl_prepaid_premium_giveaway_gen.go | 3 +- tdapi/tl_profile_accent_color_gen.go | 78 +- tdapi/tl_public_forward_gen.go | 501 +++++ tdapi/tl_public_forwards_gen.go | 295 +++ tdapi/tl_push_message_content_gen.go | 5 +- tdapi/tl_registry_gen.go | 1900 +++++++++-------- tdapi/tl_remove_background_gen.go | 206 -- tdapi/tl_remove_installed_background_gen.go | 206 ++ tdapi/tl_reset_backgrounds_gen.go | 169 -- tdapi/tl_reset_installed_backgrounds_gen.go | 169 ++ tdapi/tl_set_accent_color_gen.go | 3 +- tdapi/tl_set_background_gen.go | 293 --- tdapi/tl_set_chat_accent_color_gen.go | 7 +- tdapi/tl_set_chat_background_gen.go | 15 +- tdapi/tl_set_chat_emoji_status_gen.go | 237 ++ tdapi/tl_set_chat_profile_accent_color_gen.go | 275 +++ tdapi/tl_set_default_background_gen.go | 292 +++ tdapi/tl_set_message_reactions_gen.go | 339 +++ tdapi/tl_set_profile_accent_color_gen.go | 4 +- tdapi/tl_share_user_with_bot_gen.go | 340 --- tdapi/tl_share_users_with_bot_gen.go | 364 ++++ tdapi/tl_sticker_set_gen.go | 155 +- tdapi/tl_sticker_set_info_gen.go | 149 +- tdapi/tl_story_area_type_gen.go | 215 ++ tdapi/tl_story_gen.go | 184 +- tdapi/tl_story_interaction_gen.go | 325 +++ tdapi/tl_story_interaction_type_gen.go | 692 ++++++ tdapi/tl_story_interactions_gen.go | 357 ++++ tdapi/tl_story_public_forward_gen.go | 501 ----- tdapi/tl_story_public_forwards_gen.go | 295 --- tdapi/tl_story_viewer_gen.go | 315 --- tdapi/tl_story_viewers_gen.go | 323 --- tdapi/tl_suggested_action_gen.go | 146 ++ tdapi/tl_supergroup_gen.go | 146 +- tdapi/tl_telegram_payment_purpose_gen.go | 6 +- tdapi/tl_update_gen.go | 1792 +++++++++++----- tdapi/tl_user_gen.go | 4 +- 74 files changed, 13240 insertions(+), 5595 deletions(-) delete mode 100644 tdapi/tl_add_application_changelog_gen.go create mode 100644 tdapi/tl_chat_boost_features_gen.go create mode 100644 tdapi/tl_chat_boost_level_features_gen.go create mode 100644 tdapi/tl_delete_default_background_gen.go delete mode 100644 tdapi/tl_get_backgrounds_gen.go create mode 100644 tdapi/tl_get_chat_boost_features_gen.go create mode 100644 tdapi/tl_get_chat_boost_level_features_gen.go create mode 100644 tdapi/tl_get_chat_story_interactions_gen.go create mode 100644 tdapi/tl_get_default_chat_emoji_statuses_gen.go create mode 100644 tdapi/tl_get_disallowed_chat_emoji_statuses_gen.go create mode 100644 tdapi/tl_get_installed_backgrounds_gen.go create mode 100644 tdapi/tl_get_story_interactions_gen.go delete mode 100644 tdapi/tl_get_story_viewers_gen.go create mode 100644 tdapi/tl_get_themed_chat_emoji_statuses_gen.go create mode 100644 tdapi/tl_open_chat_similar_chat_gen.go create mode 100644 tdapi/tl_public_forward_gen.go create mode 100644 tdapi/tl_public_forwards_gen.go delete mode 100644 tdapi/tl_remove_background_gen.go create mode 100644 tdapi/tl_remove_installed_background_gen.go delete mode 100644 tdapi/tl_reset_backgrounds_gen.go create mode 100644 tdapi/tl_reset_installed_backgrounds_gen.go delete mode 100644 tdapi/tl_set_background_gen.go create mode 100644 tdapi/tl_set_chat_emoji_status_gen.go create mode 100644 tdapi/tl_set_chat_profile_accent_color_gen.go create mode 100644 tdapi/tl_set_default_background_gen.go create mode 100644 tdapi/tl_set_message_reactions_gen.go delete mode 100644 tdapi/tl_share_user_with_bot_gen.go create mode 100644 tdapi/tl_share_users_with_bot_gen.go create mode 100644 tdapi/tl_story_interaction_gen.go create mode 100644 tdapi/tl_story_interaction_type_gen.go create mode 100644 tdapi/tl_story_interactions_gen.go delete mode 100644 tdapi/tl_story_public_forward_gen.go delete mode 100644 tdapi/tl_story_public_forwards_gen.go delete mode 100644 tdapi/tl_story_viewer_gen.go delete mode 100644 tdapi/tl_story_viewers_gen.go diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index de3aae1818..5e9c3b8892 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: fcb6a2ad9fc6b974a27aed3ce5737d263ee5e45227ab674586aabd8ae0130c81 +// SHA256: 02ab4e6972e308f6b6ce2be916f491df6924ae301d0e437fb3362e957e4c1201 double#2210c154 ? = Double; @@ -514,7 +514,7 @@ poll#8c34a82a id:int64 question:string options:vector total_voter_co //@is_default True, if this is one of default backgrounds //@is_dark True, if the background is dark and is recommended to be used with dark theme //@name Unique background name -//@document Document with the background; may be null. Null only for filled backgrounds +//@document Document with the background; may be null. Null only for filled and chat theme backgrounds //@type Type of the background background#e65f291c id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; @@ -524,7 +524,7 @@ backgrounds#b4671319 backgrounds:vector = Backgrounds; //@description Describes a background set for a specific chat //@background The background -//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background chatBackground#62891968 background:background dark_theme_dimming:int32 = ChatBackground; //@description Describes a user profile photo @@ -642,7 +642,7 @@ inputChatPhotoAnimation#56a3422 animation:InputFile main_frame_timestamp:double inputChatPhotoSticker#4e6e735d sticker:chatPhotoSticker = InputChatPhoto; //@description Describes actions that a user is allowed to take in a chat -//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues //@can_send_audios True, if the user can send music files //@can_send_documents True, if the user can send documents //@can_send_photos True, if the user can send photos @@ -680,7 +680,7 @@ chatAdministratorRights#5f4f9044 can_manage_chat:Bool can_change_info:Bool can_p //@currency ISO 4217 currency code for Telegram Premium subscription payment //@amount The amount to pay, in the smallest units of the currency //@discount_percentage The discount associated with this option, as a percentage -//@month_count Number of month the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option //@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available premiumPaymentOption#8c0c5fb2 currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; @@ -696,7 +696,7 @@ premiumStatePaymentOption#7d06b579 payment_option:premiumPaymentOption is_curren //@currency ISO 4217 currency code for Telegram Premium gift code payment //@amount The amount to pay, in the smallest units of the currency //@user_count Number of users which will be able to activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option; may be empty if none //@store_product_quantity Number of times the store product must be paid premiumGiftCodePaymentOption#e2f40fef currency:string amount:int53 user_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; @@ -706,11 +706,11 @@ premiumGiftCodePaymentOption#e2f40fef currency:string amount:int53 user_count:in premiumGiftCodePaymentOptions#97a8cf2e options:vector = PremiumGiftCodePaymentOptions; //@description Contains information about a Telegram Premium gift code -//@creator_id Identifier of a chat or a user that created the gift code +//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used //@creation_date Point in time (Unix timestamp) when the code was created //@is_from_giveaway True, if the gift code was created for a giveaway //@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@user_id Identifier of a user for which the code was created; 0 if none //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none premiumGiftCodeInfo#b88fa8de creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; @@ -757,7 +757,8 @@ premiumGiveawayInfoCompleted#fc8b501b creation_date:int32 actual_winners_selecti //@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 //@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes //@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes -accentColor#83d57cd6 id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; +//@min_chat_boost_level The minimum chat boost level required to use the color +accentColor#ed4c76c9 id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector min_chat_boost_level:int32 = AccentColor; //@description Contains information about supported accent colors for user profile photo background in RGB format //@palette_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings @@ -767,16 +768,17 @@ profileAccentColors#218e9367 palette_colors:vector background_colors:vect //@description Contains information about supported accent color for user profile photo background //@id Profile accent color identifier -//@light_theme_colors Description of accent colors expected to be used in light themes -//@dark_theme_colors Description of accent colors expected to be used in dark themes -profileAccentColor#2bea798e id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors = ProfileAccentColor; +//@light_theme_colors Accent colors expected to be used in light themes +//@dark_theme_colors Accent colors expected to be used in dark themes +//@min_chat_boost_level The minimum chat boost level required to use the color +profileAccentColor#87d7df12 id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_chat_boost_level:int32 = ProfileAccentColor; //@description Describes a custom emoji to be shown instead of the Telegram Premium badge //@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format //@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never emojiStatus#dbd91636 custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; -//@description Contains a list of custom emoji identifiers, which can be set as emoji statuses +//@description Contains a list of custom emoji identifiers for emoji statuses //@custom_emoji_ids The list of custom emoji identifiers emojiStatuses#eaeb9bdc custom_emoji_ids:vector = EmojiStatuses; @@ -795,7 +797,7 @@ usernames#bf343063 active_usernames:vector disabled_usernames:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat#70f33afe id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats //@total_count Approximate total number of chats found @@ -1763,13 +1769,14 @@ keyboardButtonTypeRequestLocation#f8828cfd = KeyboardButtonType; //@force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll#7164dcb8 force_regular:Bool force_quiz:Bool = KeyboardButtonType; -//@description A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request +//@description A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request //@id Unique button identifier -//@restrict_user_is_bot True, if the shared user must or must not be a bot -//@user_is_bot True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false -//@restrict_user_is_premium True, if the shared user must or must not be a Telegram Premium user -//@user_is_premium True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false -keyboardButtonTypeRequestUser#88ffb430 id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool = KeyboardButtonType; +//@restrict_user_is_bot True, if the shared users must or must not be bots +//@user_is_bot True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false +//@restrict_user_is_premium True, if the shared users must or must not be Telegram Premium users +//@user_is_premium True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false +//@max_quantity The maximum number of users to share +keyboardButtonTypeRequestUsers#7e63ef90 id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool max_quantity:int32 = KeyboardButtonType; //@description A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request //@id Unique button identifier @@ -2384,7 +2391,8 @@ inputCredentialsGooglePay#32544764 data:string = InputCredentials; //@description Smart Glocal payment provider //@public_token Public payment token -paymentProviderSmartGlocal#6b5122ee public_token:string = PaymentProvider; +//@tokenize_url URL for sending card tokenization requests +paymentProviderSmartGlocal#ba047774 public_token:string tokenize_url:string = PaymentProvider; //@description Stripe payment provider //@publishable_key Stripe API publishable key @@ -2486,8 +2494,10 @@ messageExtendedMediaUnsupported#141f5020 caption:formattedText = MessageExtended //@additional_chat_ids Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats //@winners_selection_date Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways //@only_new_members True, if only new members of the chats will be eligible for the giveaway +//@has_public_winners True, if the list of winners of the giveaway will be available to everyone //@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. -premiumGiveawayParameters#de917baf boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool country_codes:vector = PremiumGiveawayParameters; +//@prize_description Additional description of the giveaway prize; 0-128 characters +premiumGiveawayParameters#f9f5bf5e boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool has_public_winners:Bool country_codes:vector prize_description:string = PremiumGiveawayParameters; //@description File with the date it was uploaded //@file The file @@ -3084,8 +3094,8 @@ messagePaymentSuccessfulBot#68e13eb9 currency:string total_amount:int53 is_recur //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none -//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency -//@month_count Number of month the Telegram Premium subscription will be active +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none +//@month_count Number of months the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown messageGiftedPremium#78d1d0a gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; @@ -3093,10 +3103,14 @@ messageGiftedPremium#78d1d0a gifter_user_id:int53 currency:string amount:int53 c //@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown //@is_from_giveaway True, if the gift code was created for a giveaway //@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@currency Currency for the paid amount; empty if unknown +//@amount The paid amount, in the smallest units of the currency; 0 if unknown +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none or unknown +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if unknown +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown //@code The gift code -messagePremiumGiftCode#7a9c468f creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool month_count:int32 sticker:sticker code:string = MessageContent; +messagePremiumGiftCode#26bd1bf3 creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; //@description A Telegram Premium giveaway was created for the chat messagePremiumGiveawayCreated#270f2c44 = MessageContent; @@ -3104,23 +3118,37 @@ messagePremiumGiveawayCreated#270f2c44 = MessageContent; //@description A Telegram Premium giveaway //@parameters Giveaway parameters //@winner_count Number of users which will receive Telegram Premium subscription gift codes -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown messagePremiumGiveaway#4aa0d0b0 parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent; -//@description A Telegram Premium giveaway has been completed for the chat +//@description A Telegram Premium giveaway without public winners has been completed for the chat //@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted //@winner_count Number of winners in the giveaway //@unclaimed_prize_count Number of undistributed prizes messagePremiumGiveawayCompleted#80533949 giveaway_message_id:int53 winner_count:int32 unclaimed_prize_count:int32 = MessageContent; +//@description A Telegram Premium giveaway with public winners has been completed for the chat +//@boosted_chat_id Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat +//@additional_chat_count Number of other chats that participated in the giveaway +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@only_new_members True, if only new members of the chats were eligible for the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@prize_description Additional description of the giveaway prize +//@winner_count Total number of winners in the giveaway +//@winner_user_ids Up to 100 user identifiers of the winners of the giveaway +//@unclaimed_prize_count Number of undistributed prizes +messagePremiumGiveawayWinners#815d5f31 boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool month_count:int32 prize_description:string winner_count:int32 winner_user_ids:vector unclaimed_prize_count:int32 = MessageContent; + //@description A contact has registered with Telegram messageContactRegistered#a678fcff = MessageContent; -//@description The current user shared a user, which was requested by the bot -//@user_id Identifier of the shared user +//@description The current user shared users, which were requested by the bot +//@user_ids Identifier of the shared users //@button_id Identifier of the keyboard button with the request -messageUserShared#d4dcb77c user_id:int53 button_id:int32 = MessageContent; +messageUsersShared#95dca529 user_ids:vector button_id:int32 = MessageContent; //@description The current user shared a chat, which was requested by the bot //@chat_id Identifier of the shared chat @@ -3262,7 +3290,7 @@ messageSelfDestructTypeImmediately#c23c9005 = MessageSelfDestructType; //@only_preview Pass true to get a fake message instead of actually sending them messageSendOptions#9cca9fb3 disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false //@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false @@ -3559,16 +3587,17 @@ emojis#77274a16 emojis:vector = Emojis; //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji 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#ac3cff8b id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet#133c3db9 id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat 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 +//@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 //@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 @@ -3576,10 +3605,11 @@ stickerSet#ac3cff8b id:int64 title:string name:string thumbnail:thumbnail thumbn //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@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#cbbbedfd id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo#fb991fda id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat 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 @@ -3613,20 +3643,6 @@ emojiCategoryTypeEmojiStatus#5254b347 = EmojiCategoryType; //@description The category must be used for chat photo emoji selection emojiCategoryTypeChatPhoto#3f200529 = EmojiCategoryType; -//@description Represents a viewer of a story -//@user_id User identifier of the viewer -//@view_date Approximate point in time (Unix timestamp) when the story was viewed -//@block_list Block list to which the user is added; may be null if none -//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none -storyViewer#cf0fb132 user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer; - -//@description Represents a list of story viewers -//@total_count Approximate total number of story viewers found -//@total_reaction_count Approximate total number of reactions set by found story viewers -//@viewers List of story viewers -//@next_offset The offset for the next request. If empty, then there are no more results -storyViewers#9ae27d98 total_count:int32 total_reaction_count:int32 viewers:vector next_offset:string = StoryViewers; - //@description Describes position of a clickable rectangle area on a story media //@x_percentage The abscissa of the rectangle's center, as a percentage of the media width //@y_percentage The ordinate of the rectangle's center, as a percentage of the media height @@ -3652,6 +3668,11 @@ storyAreaTypeVenue#18ae4d06 venue:venue = StoryAreaType; //@is_flipped True, if reaction corner is flipped storyAreaTypeSuggestedReaction#f95f927c reaction_type:ReactionType total_count:int32 is_dark:Bool is_flipped:Bool = StoryAreaType; +//@description An area pointing to a message +//@chat_id Identifier of the chat with the message +//@message_id Identifier of the message +storyAreaTypeMessage#bfef76b4 chat_id:int53 message_id:int53 = StoryAreaType; + //@description Describes a clickable rectangle area on a story media //@position Position of the area //@type Type of the area @@ -3679,13 +3700,18 @@ inputStoryAreaTypePreviousVenue#6e124e0c venue_provider:string venue_id:string = //@is_flipped True, if reaction corner is flipped inputStoryAreaTypeSuggestedReaction#7d4751d3 reaction_type:ReactionType is_dark:Bool is_flipped:Bool = InputStoryAreaType; +//@description An area pointing to a message +//@chat_id Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat +//@message_id Identifier of the message. Only successfully sent non-scheduled messages can be specified +inputStoryAreaTypeMessage#f01be457 chat_id:int53 message_id:int53 = InputStoryAreaType; + //@description Describes a clickable rectangle area on a story media to be added //@position Position of the area //@type Type of the area inputStoryArea#752ae7f position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; //@description Contains a list of story areas to be added -//@areas List of 0-10 input story areas +//@areas List of input story areas. Currently, a story can have inputStoryAreas#b8ba29fe areas:vector = InputStoryAreas; //@description Describes a video file sent in a story @@ -3774,7 +3800,7 @@ storyInteractionInfo#e1557fc7 view_count:int32 forward_count:int32 reaction_coun //@can_be_replied True, if the story can be replied in the chat with the story sender //@can_toggle_is_pinned True, if the story's is_pinned value can be changed //@can_get_statistics True, if the story statistics are available through getStoryStatistics -//@can_get_viewers True, if users viewed the story can be received through getStoryViewers +//@can_get_interactions True, if interactions with the story can be received through getStoryInteractions //@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago //@repost_info Information about the original story; may be null if the story wasn't reposted //@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions @@ -3783,7 +3809,7 @@ storyInteractionInfo#e1557fc7 view_count:int32 forward_count:int32 reaction_coun //@content Content of the story //@areas Clickable areas to be shown on the story content //@caption Caption of the story -story#29dd2b0d id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_statistics:Bool can_get_viewers:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; +story#8e358ca2 id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; //@description Represents a list of stories //@total_count Approximate total number of stories found @@ -3809,21 +3835,68 @@ storyInfo#8997c352 story_id:int32 date:int32 is_for_close_friends:Bool = StoryIn //@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) chatActiveStories#d923d773 chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector = ChatActiveStories; -//@class StoryPublicForward @description Describes a public forward or repost of a story +//@class StoryInteractionType @description Describes type of interaction with a story + +//@description A view of the story +//@chosen_reaction_type Type of the reaction that was chosen by the viewer; may be null if none +storyInteractionTypeView#53e337d0 chosen_reaction_type:ReactionType = StoryInteractionType; + +//@description A forward of the story as a message +//@message The message with story forward +storyInteractionTypeForward#27d23cff message:message = StoryInteractionType; + +//@description A repost of the story as a story +//@story The reposted story +storyInteractionTypeRepost#c32279c4 story:story = StoryInteractionType; + +//@description Represents interaction with a story +//@actor_id Identifier of the user or chat that made the interaction +//@interaction_date Approximate point in time (Unix timestamp) when the interaction happened +//@block_list Block list to which the actor is added; may be null if none or for chat stories +//@type Type of the interaction +storyInteraction#d624d222 actor_id:MessageSender interaction_date:int32 block_list:BlockList type:StoryInteractionType = StoryInteraction; -//@description Contains a public forward of a story as a message -//@message Information about the message with the story -storyPublicForwardMessage#fd39c20c message:message = StoryPublicForward; +//@description Represents a list of interactions with a story +//@total_count Approximate total number of interactions found +//@total_forward_count Approximate total number of found forwards and reposts; always 0 for chat stories +//@total_reaction_count Approximate total number of found reactions; always 0 for chat stories +//@interactions List of story interactions +//@next_offset The offset for the next request. If empty, then there are no more results +storyInteractions#f9f5d50f total_count:int32 total_forward_count:int32 total_reaction_count:int32 interactions:vector next_offset:string = StoryInteractions; + +//@class PublicForward @description Describes a public forward or repost of a story + +//@description Contains a public forward as a message +//@message Information about the message +publicForwardMessage#317b3d2 message:message = PublicForward; -//@description Contains a public repost of a story as a story -//@story Information about the reposted story -storyPublicForwardStory#f7e6c146 story:story = StoryPublicForward; +//@description Contains a public repost to a story +//@story Information about the story +publicForwardStory#7fdf26af story:story = PublicForward; -//@description Represents a list of public forwards and reposts of a story +//@description Represents a list of public forwards and reposts as a story of a message or a story //@total_count Approximate total number of messages and stories found //@forwards List of found public forwards and reposts //@next_offset The offset for the next request. If empty, then there are no more results -storyPublicForwards#fcacb389 total_count:int32 forwards:vector next_offset:string = StoryPublicForwards; +publicForwards#3ed29447 total_count:int32 forwards:vector next_offset:string = PublicForwards; + +//@description Contains a list of features available on a specific chat boost level +//@level Target chat boost level +//@story_per_day_count Number of stories that the chat can publish daily +//@custom_emoji_reaction_count Number of custom emoji reactions that can be added to the list of available reactions +//@title_color_count Number of custom colors for chat title +//@profile_accent_color_count Number of custom colors for profile photo background +//@can_set_profile_background_custom_emoji True, if custom emoji for profile background can be set +//@accent_color_count Number of custom colors for background of empty chat photo, replies to messages and link previews +//@can_set_background_custom_emoji True, if custom emoji for reply header and link preview background can be set +//@can_set_emoji_status True, if emoji status can be set +//@chat_theme_background_count Number of chat theme backgrounds that can be set as chat background +//@can_set_custom_background True, if custom background can be set in the chat for all users +chatBoostLevelFeatures#fe9f29de level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool = ChatBoostLevelFeatures; + +//@description Contains a list of features available on the first chat boost levels +//@features The list of features +chatBoostFeatures#b9672a54 features:vector = ChatBoostFeatures; //@class ChatBoostSource @description Describes source of a chat boost @@ -3846,7 +3919,7 @@ chatBoostSourcePremium#ed4eb user_id:int53 = ChatBoostSource; //@description Describes a prepaid Telegram Premium giveaway //@id Unique identifier of the prepaid giveaway //@winner_count Number of users which will receive Telegram Premium subscription gift codes -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@payment_date Point in time (Unix timestamp) when the giveaway was paid prepaidPremiumGiveaway#6bd53140 id:int64 winner_count:int32 month_count:int32 payment_date:int32 = PrepaidPremiumGiveaway; @@ -4587,11 +4660,21 @@ chatEventMemberRestricted#5f951e05 member_id:MessageSender old_status:ChatMember //@new_available_reactions New chat available reactions chatEventAvailableReactionsChanged#97b8e0bf old_available_reactions:ChatAvailableReactions new_available_reactions:ChatAvailableReactions = ChatEventAction; +//@description The chat background was changed +//@old_background Previous background; may be null if none +//@new_background New background; may be null if none +chatEventBackgroundChanged#b6ed6d38 old_background:chatBackground new_background:chatBackground = ChatEventAction; + //@description The chat description was changed //@old_description Previous chat description //@new_description New chat description chatEventDescriptionChanged#254cf1e old_description:string new_description:string = ChatEventAction; +//@description The chat emoji status was changed +//@old_emoji_status Previous emoji status; may be null if none +//@new_emoji_status New emoji status; may be null if none +chatEventEmojiStatusChanged#83e97b1e old_emoji_status:emojiStatus new_emoji_status:emojiStatus = ChatEventAction; + //@description The linked chat of a supergroup was changed //@old_linked_chat_id Previous supergroup linked chat identifier //@new_linked_chat_id New supergroup linked chat identifier @@ -4642,15 +4725,19 @@ chatEventUsernameChanged#6707b56b old_username:string new_username:string = Chat //@new_usernames New list of active usernames chatEventActiveUsernamesChanged#95e54656 old_usernames:vector new_usernames:vector = ChatEventAction; -//@description The chat accent color was changed +//@description The chat accent color or background custom emoji were changed //@old_accent_color_id Previous identifier of chat accent color -//@new_accent_color_id New identifier of chat accent color -chatEventAccentColorChanged#2a327e32 old_accent_color_id:int32 new_accent_color_id:int32 = ChatEventAction; - -//@description The chat's custom emoji for reply background was changed //@old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_accent_color_id New identifier of chat accent color //@new_background_custom_emoji_id New identifier of the custom emoji; 0 if none -chatEventBackgroundCustomEmojiChanged#d2671e9a old_background_custom_emoji_id:int64 new_background_custom_emoji_id:int64 = ChatEventAction; +chatEventAccentColorChanged#e6837733 old_accent_color_id:int32 old_background_custom_emoji_id:int64 new_accent_color_id:int32 new_background_custom_emoji_id:int64 = ChatEventAction; + +//@description The chat's profile accent color or profile background custom emoji were changed +//@old_profile_accent_color_id Previous identifier of chat's profile accent color; -1 if none +//@old_profile_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_profile_accent_color_id New identifier of chat's profile accent color; -1 if none +//@new_profile_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventProfileAccentColorChanged#a5b8da64 old_profile_accent_color_id:int32 old_profile_background_custom_emoji_id:int64 new_profile_accent_color_id:int32 new_profile_background_custom_emoji_id:int64 = ChatEventAction; //@description The has_protected_content setting of a channel was toggled //@has_protected_content New value of has_protected_content @@ -5023,7 +5110,7 @@ storePaymentPurposePremiumGiveaway#504790d9 parameters:premiumGiveawayParameters //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@user_ids Identifiers of the users which can activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active for the users +//@month_count Number of months the Telegram Premium subscription will be active for the users telegramPaymentPurposePremiumGiftCodes#91009cc boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 = TelegramPaymentPurpose; //@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels @@ -5031,7 +5118,7 @@ telegramPaymentPurposePremiumGiftCodes#91009cc boosted_chat_id:int53 currency:st //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@winner_count Number of users which will be able to activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active for the users +//@month_count Number of months the Telegram Premium subscription will be active for the users telegramPaymentPurposePremiumGiveaway#bfd4a227 parameters:premiumGiveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. @@ -5129,6 +5216,10 @@ backgroundTypePattern#4ce716fd fill:BackgroundFill intensity:int32 is_inverted:B //@fill The background fill backgroundTypeFill#3b301c2c fill:BackgroundFill = BackgroundType; +//@description A background from a chat theme; can be used only as a chat background in channels +//@theme_name Name of the chat theme +backgroundTypeChatTheme#4d7a9752 theme_name:string = BackgroundType; + //@class InputBackground @description Contains information about background to set //@description A background from a local file @@ -5321,12 +5412,12 @@ pushMessageContentPhoto#861dc52 photo:photo caption:string is_secret:Bool is_pin pushMessageContentPoll#fd5a743a question:string is_regular:Bool is_pinned:Bool = PushMessageContent; //@description A message with a Telegram Premium gift code created for the user -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation pushMessageContentPremiumGiftCode#18a15025 month_count:int32 = PushMessageContent; //@description A message with a Telegram Premium giveaway //@winner_count Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message -//@month_count Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPremiumGiveaway#57d26df1 winner_count:int32 month_count:int32 is_pinned:Bool = PushMessageContent; @@ -5879,6 +5970,10 @@ internalLinkTypePhoneNumberConfirmation#68bf6b16 hash:string phone_number:string //@referrer Referrer specified in the link internalLinkTypePremiumFeatures#48884f49 referrer:string = InternalLinkType; +//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends +//@referrer Referrer specified in the link +internalLinkTypePremiumGift#5ad56d41 referrer:string = InternalLinkType; + //@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode //@code The Telegram Premium gift code internalLinkTypePremiumGiftCode#de5c9892 code:string = InternalLinkType; @@ -6276,6 +6371,9 @@ suggestedActionRestorePremium#e909dd64 = SuggestedAction; //@description Suggests the user to subscribe to the Premium subscription with annual payments suggestedActionSubscribeToAnnualPremium#164978bb = SuggestedAction; +//@description Suggests the user to gift Telegram Premium to friends for Christmas +suggestedActionGiftPremiumForChristmas#93b3ee6f = SuggestedAction; + //@description Contains a counter //@count Count count#4d38f104 count:int32 = Count; @@ -6592,15 +6690,13 @@ updateChatTitle#f58b85a4 chat_id:int53 title:string = Update; //@photo The new chat photo; may be null updateChatPhoto#eca5423f chat_id:int53 photo:chatPhotoInfo = Update; -//@description A chat accent color has changed +//@description Chat accent colors have changed //@chat_id Chat identifier //@accent_color_id The new chat accent color identifier -updateChatAccentColor#fc111634 chat_id:int53 accent_color_id:int32 = Update; - -//@description A chat's custom emoji for reply background has changed -//@chat_id Chat identifier -//@background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header background; 0 if none -updateChatBackgroundCustomEmoji#dcbad97a chat_id:int53 background_custom_emoji_id:int64 = Update; +//@background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +//@profile_accent_color_id The new chat profile accent color identifier; -1 if none +//@profile_background_custom_emoji_id The new identifier of a custom emoji to be shown on the profile background; 0 if none +updateChatAccentColors#b7b8f8f9 chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Update; //@description Chat permissions were changed //@chat_id Chat identifier @@ -6645,6 +6741,11 @@ updateChatAvailableReactions#8ab413f9 chat_id:int53 available_reactions:ChatAvai //@positions The new chat positions in the chat lists updateChatDraftMessage#2bf257d4 chat_id:int53 draft_message:draftMessage positions:vector = Update; +//@description Chat emoji status has changed +//@chat_id Chat identifier +//@emoji_status The new chat emoji status; may be null +updateChatEmojiStatus#77796510 chat_id:int53 emoji_status:emojiStatus = Update; + //@description The message sender that is selected to send messages in a chat has changed //@chat_id Chat identifier //@message_sender_id New value of message_sender_id; may be null if the user can't change message sender @@ -6976,10 +7077,10 @@ updateSavedAnimations#1084a1c8 animation_ids:vector = Update; //@notification_sound_ids The new list of identifiers of saved notification sounds updateSavedNotificationSounds#5a6653b4 notification_sound_ids:vector = Update; -//@description The selected background has changed -//@for_dark_theme True, if background for dark theme has changed -//@background The new selected background; may be null -updateSelectedBackground#99bd205d for_dark_theme:Bool background:background = Update; +//@description The default background has changed +//@for_dark_theme True, if default background for dark theme has changed +//@background The new default background; may be null +updateDefaultBackground#d550952f for_dark_theme:Bool background:background = Update; //@description The list of available chat themes has changed //@chat_themes The new list of chat themes @@ -6992,7 +7093,7 @@ updateAccentColors#1316555e colors:vector available_accent_color_id //@description The list of supported accent colors for user profiles has changed //@colors Information about supported colors -//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor. The colors must be shown in the specififed order +//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order updateProfileAccentColors#bf8e7430 colors:vector available_accent_color_ids:vector = Update; //@description Some language pack strings have been updated @@ -7164,6 +7265,22 @@ updateNewChatJoinRequest#7e48b843 chat_id:int53 request:chatJoinRequest user_cha //@boost New information about the boost updateChatBoost#50727e24 chat_id:int53 boost:chatBoost = Update; +//@description User changed its reactions on a message with public reactions; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@actor_id Identifier of the user or chat that changed reactions +//@date Point in time (Unix timestamp) when the reactions were changed +//@old_reaction_types Old list of chosen reactions +//@new_reaction_types New list of chosen reactions +updateMessageReaction#f46c854a chat_id:int53 message_id:int53 actor_id:MessageSender date:int32 old_reaction_types:vector new_reaction_types:vector = Update; + +//@description Reactions added to a message with anonymous reactions have changed; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@date Point in time (Unix timestamp) when the reactions were changed +//@reactions The list of reactions added to the message +updateMessageReactions#bd5618e9 chat_id:int53 message_id:int53 date:int32 reactions:vector = Update; + //@description Contains a list of updates //@updates List of updates updates#b9829222 updates:vector = Updates; @@ -7516,6 +7633,11 @@ getChatSimilarChats#bb508f83 chat_id:int53 = Chats; //@return_local Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally getChatSimilarChatCount#463e968e chat_id:int53 return_local:Bool = Count; +//@description Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +//@chat_id Identifier of the original chat, which similar chats were requested +//@opened_chat_id Identifier of the opened chat +openChatSimilarChat#8fa6f413 chat_id:int53 opened_chat_id:int53 = Ok; + //@description Returns a list of frequently used chats //@category Category of chats to be returned //@limit The maximum number of chats to be returned; up to 30 @@ -7999,6 +8121,13 @@ addMessageReaction#549855ed chat_id:int53 message_id:int53 reaction_type:Reactio //@reaction_type Type of the reaction to remove removeMessageReaction#97474d7b chat_id:int53 message_id:int53 reaction_type:ReactionType = Ok; +//@description Sets reactions on a message; for bots only +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@reaction_types Types of the reaction to set +//@is_big Pass true if the reactions are added with a big animation +setMessageReactions#71fa9e8f chat_id:int53 message_id:int53 reaction_types:vector is_big:Bool = Ok; + //@description Returns reactions added for a message, along with their sender //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message @@ -8102,13 +8231,13 @@ getLoginUrlInfo#ccc99db3 chat_id:int53 message_id:int53 button_id:int53 = LoginU //@allow_write_access Pass true to allow the bot to send messages to the current user getLoginUrl#2f3295d1 chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; -//@description Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot +//@description Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot //@chat_id Identifier of the chat with the bot //@message_id Identifier of the message with the button //@button_id Identifier of the button -//@shared_user_id Identifier of the shared user -//@only_check Pass true to check that the user can be shared by the button instead of actually sharing them -shareUserWithBot#f132ffdc chat_id:int53 message_id:int53 button_id:int32 shared_user_id:int53 only_check:Bool = Ok; +//@shared_user_ids Identifiers of the shared users +//@only_check Pass true to check that the users can be shared by the button instead of actually sharing them +shareUsersWithBot#58448550 chat_id:int53 message_id:int53 button_id:int32 shared_user_ids:vector only_check:Bool = Ok; //@description Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot //@chat_id Identifier of the chat with the bot @@ -8458,28 +8587,39 @@ setChatTitle#9cabebf chat_id:int53 title:string = Ok; //@photo New chat photo; pass null to delete the chat photo setChatPhoto#e97b8d03 chat_id:int53 photo:InputChatPhoto = Ok; -//@description Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +//@description Changes accent color and background custom emoji of a chat. Requires can_change_info administrator right //@chat_id Chat identifier -//@accent_color_id Identifier of the accent color to use -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +//@accent_color_id Identifier of the accent color to use. The chat must have at least accentColor.min_chat_boost_level boost level to pass the corresponding color +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set setChatAccentColor#349f57ca chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; +//@description Changes accent color and background custom emoji for profile of a chat. Requires can_change_info administrator right +//@chat_id Chat identifier +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding color +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set +setChatProfileAccentColor#4227ae7a chat_id:int53 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; + //@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels //@chat_id Chat identifier //@message_auto_delete_time New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically setChatMessageAutoDeleteTime#a641b4ff chat_id:int53 message_auto_delete_time:int32 = Ok; +//@description Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right +//@chat_id Chat identifier +//@emoji_status New emoji status; pass null to remove emoji status +setChatEmojiStatus#55881912 chat_id:int53 emoji_status:emojiStatus = Ok; + //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right //@chat_id Chat identifier //@permissions New non-administrator members permissions in the chat setChatPermissions#7f7706fe chat_id:int53 permissions:chatPermissions = Ok; -//@description Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users +//@description Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right //@chat_id Chat identifier -//@background The input background to use; pass null to create a new filled background -//@type Background type; pass null to use default background type for the chosen background -//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 -//@only_for_self Pass true to set background only for self; pass false to set background for both chat users. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious +//@background The input background to use; pass null to create a new filled or chat theme background +//@type Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background +//@only_for_self Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious setChatBackground#eb4c3fe chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 only_for_self:Bool = Ok; //@description Deletes background in a specific chat @@ -8786,14 +8926,24 @@ getStoryAvailableReactions#23854d3b row_size:int32 = AvailableReactions; //@update_recent_reactions Pass true if the reaction needs to be added to recent reactions setStoryReaction#ac8b4fa7 story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; -//@description Returns viewers of a story. The method can be called only for stories posted on behalf of the current user +//@description Returns interactions with a story. The method can be called only for stories posted on behalf of the current user +//@story_id Story identifier +//@query Query to search for in names, usernames and titles; may be empty to get all relevant interactions +//@only_contacts Pass true to get only interactions by contacts; pass false to get all relevant interactions +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date +//@prefer_with_reaction Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true +//@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 story interactions to return +getStoryInteractions#1cd1400d story_id:int32 query:string only_contacts:Bool prefer_forwards:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryInteractions; + +//@description Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat +//@story_sender_chat_id The identifier of the sender of the story //@story_id Story identifier -//@query Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers -//@only_contacts Pass true to get only contacts; pass false to get all relevant viewers -//@prefer_with_reaction Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date +//@reaction_type Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date //@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 story viewers to return -getStoryViewers#40df8dba story_id:int32 query:string only_contacts:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryViewers; +//@limit The maximum number of story interactions to return +getChatStoryInteractions#c5ec7376 story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType prefer_forwards:Bool offset:string limit:int32 = StoryInteractions; //@description Reports a story to the Telegram moderators //@story_sender_chat_id The identifier of the sender of the story to report @@ -8810,7 +8960,14 @@ activateStoryStealthMode#c3db8491 = Ok; //@story_id The identifier of the story //@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 messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit -getStoryPublicForwards#8b835be9 story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = StoryPublicForwards; +getStoryPublicForwards#68f7dcbb story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = PublicForwards; + +//@description Returns list of features available on the specific chat boost level; this is an offline request +//@level Chat boost level +getChatBoostLevelFeatures#71f15dfb level:int32 = ChatBoostLevelFeatures; + +//@description Returns list of features available on the first 10 chat boost levels; this is an offline request +getChatBoostFeatures#34e76822 = ChatBoostFeatures; //@description Returns the list of available chat boost slots for the current user getAvailableChatBoostSlots#7307ebd5 = ChatBoostSlots; @@ -8854,18 +9011,27 @@ getAttachmentMenuBot#3da561fb bot_user_id:int53 = AttachmentMenuBot; //@allow_write_access Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false toggleBotIsAddedToAttachmentMenu#8e59de9a bot_user_id:int53 is_added:Bool allow_write_access:Bool = Ok; -//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status getThemedEmojiStatuses#6ac5c8c2 = EmojiStatuses; -//@description Returns recent emoji statuses +//@description Returns recent emoji statuses for self status getRecentEmojiStatuses#ae3a3d29 = EmojiStatuses; -//@description Returns default emoji statuses +//@description Returns default emoji statuses for self status getDefaultEmojiStatuses#24e45ec3 = EmojiStatuses; -//@description Clears the list of recently used emoji statuses +//@description Clears the list of recently used emoji statuses for self status clearRecentEmojiStatuses#e671cb5e = Ok; +//@description Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats +getThemedChatEmojiStatuses#fb735cb5 = EmojiStatuses; + +//@description Returns default emoji statuses for chats +getDefaultChatEmojiStatuses#a7aa86e6 = EmojiStatuses; + +//@description Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true +getDisallowedChatEmojiStatuses#d2144da0 = EmojiStatuses; + //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download //@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first @@ -9527,12 +9693,12 @@ deleteProfilePhoto#4eaa77c1 profile_photo_id:int64 = Ok; //@description Changes accent color and background custom emoji for the current user; for Telegram Premium users only //@accent_color_id Identifier of the accent color to use -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none setAccentColor#6389cb39 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; //@description Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only //@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none -//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown in the on the user's profile photo background; 0 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none setProfileAccentColor#899bc168 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; //@description Changes the first and last name of the current user @@ -9853,31 +10019,35 @@ createInvoiceLink#cebe921 invoice:InputMessageContent = HttpUrl; //@description Returns a user that can be contacted to get support getSupportUser#98acec9c = User; -//@description Returns backgrounds installed by the user -//@for_dark_theme Pass true to order returned backgrounds for a dark theme -getBackgrounds#ed88bf9 for_dark_theme:Bool = Backgrounds; - //@description Constructs a persistent HTTP URL for a background //@name Background name -//@type Background type +//@type Background type; backgroundTypeChatTheme isn't supported getBackgroundUrl#2bbc6fd2 name:string type:BackgroundType = HttpUrl; //@description Searches for a background by its name //@name The name of the background searchBackground#80fb9121 name:string = Background; -//@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme Pass true if the background is changed for a dark theme -setBackground#c2487387 background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; +//@description Sets default background for chats; adds the background to the list of installed backgrounds +//@background The input background to use; pass null to create a new filled background +//@type Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported +//@for_dark_theme Pass true if the background is set for a dark theme +setDefaultBackground#89d1a8a1 background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; + +//@description Deletes default background for chats +//@for_dark_theme Pass true if the background is deleted for a dark theme +deleteDefaultBackground#b2a4ed3e for_dark_theme:Bool = Ok; + +//@description Returns backgrounds installed by the user +//@for_dark_theme Pass true to order returned backgrounds for a dark theme +getInstalledBackgrounds#c154d05f for_dark_theme:Bool = Backgrounds; //@description Removes background from the list of installed backgrounds //@background_id The background identifier -removeBackground#a783a196 background_id:int64 = Ok; +removeInstalledBackground#5041253c background_id:int64 = Ok; //@description Resets list of installed backgrounds to its default value -resetBackgrounds#c35cb78 = Ok; +resetInstalledBackgrounds#70540157 = Ok; //@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization //@only_local Pass true to get only locally available information without sending network requests @@ -10007,12 +10177,12 @@ getChatStatistics#137e8198 chat_id:int53 is_dark:Bool = ChatStatistics; //@is_dark Pass true if a dark theme is used by the application getMessageStatistics#4bb5a1d8 chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; -//@description Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib +//@description Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier //@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 messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -getMessagePublicForwards#6006a949 chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; +//@limit The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getMessagePublicForwards#519da4b4 chat_id:int53 message_id:int53 offset:string limit:int32 = PublicForwards; //@description Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true //@chat_id Chat identifier @@ -10295,7 +10465,7 @@ launchPrepaidPremiumGiveaway#5328fea1 giveaway_id:int64 parameters:premiumGiveaw //@description Returns information about a Telegram Premium giveaway //@chat_id Identifier of the channel chat which started the giveaway -//@message_id Identifier of the giveaway message in the chat +//@message_id Identifier of the giveaway or a giveaway winners message in the chat getPremiumGiveawayInfo#6adb7b97 chat_id:int53 message_id:int53 = PremiumGiveawayInfo; //@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @@ -10361,10 +10531,6 @@ getDeepLinkInfo#28923f7e link:string = DeepLinkInfo; //@description Returns application config, provided by the server. Can be called before authorization getApplicationConfig#93550682 = JsonValue; -//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed -//@previous_application_version The previous application version -addApplicationChangelog#8bf37fc9 previous_application_version:string = Ok; - //@description Saves application log event on the server. Can be called before authorization //@type Event type //@chat_id Optional chat identifier, associated with the event diff --git a/tdapi/tl_accent_color_gen.go b/tdapi/tl_accent_color_gen.go index 40016c1126..2655246797 100644 --- a/tdapi/tl_accent_color_gen.go +++ b/tdapi/tl_accent_color_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// AccentColor represents TL type `accentColor#83d57cd6`. +// AccentColor represents TL type `accentColor#ed4c76c9`. type AccentColor struct { // Accent color identifier ID int32 @@ -43,10 +43,12 @@ type AccentColor struct { // The list of 1-3 colors in RGB format, describing the accent color, as expected to be // shown in dark themes DarkThemeColors []int32 + // The minimum chat boost level required to use the color + MinChatBoostLevel int32 } // AccentColorTypeID is TL type id of AccentColor. -const AccentColorTypeID = 0x83d57cd6 +const AccentColorTypeID = 0xed4c76c9 // Ensuring interfaces in compile-time for AccentColor. var ( @@ -72,6 +74,9 @@ func (a *AccentColor) Zero() bool { if !(a.DarkThemeColors == nil) { return false } + if !(a.MinChatBoostLevel == 0) { + return false + } return true } @@ -124,6 +129,10 @@ func (a *AccentColor) TypeInfo() tdp.Type { Name: "DarkThemeColors", SchemaName: "dark_theme_colors", }, + { + Name: "MinChatBoostLevel", + SchemaName: "min_chat_boost_level", + }, } return typ } @@ -131,7 +140,7 @@ func (a *AccentColor) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *AccentColor) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode accentColor#83d57cd6 as nil") + return fmt.Errorf("can't encode accentColor#ed4c76c9 as nil") } b.PutID(AccentColorTypeID) return a.EncodeBare(b) @@ -140,7 +149,7 @@ func (a *AccentColor) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *AccentColor) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode accentColor#83d57cd6 as nil") + return fmt.Errorf("can't encode accentColor#ed4c76c9 as nil") } b.PutInt32(a.ID) b.PutInt32(a.BuiltInAccentColorID) @@ -152,16 +161,17 @@ func (a *AccentColor) EncodeBare(b *bin.Buffer) error { for _, v := range a.DarkThemeColors { b.PutInt32(v) } + b.PutInt32(a.MinChatBoostLevel) return nil } // Decode implements bin.Decoder. func (a *AccentColor) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode accentColor#83d57cd6 to nil") + return fmt.Errorf("can't decode accentColor#ed4c76c9 to nil") } if err := b.ConsumeID(AccentColorTypeID); err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: %w", err) } return a.DecodeBare(b) } @@ -169,26 +179,26 @@ func (a *AccentColor) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *AccentColor) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode accentColor#83d57cd6 to nil") + return fmt.Errorf("can't decode accentColor#ed4c76c9 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field id: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field id: %w", err) } a.ID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field built_in_accent_color_id: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field built_in_accent_color_id: %w", err) } a.BuiltInAccentColorID = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field light_theme_colors: %w", err) } if headerLen > 0 { @@ -197,7 +207,7 @@ func (a *AccentColor) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field light_theme_colors: %w", err) } a.LightThemeColors = append(a.LightThemeColors, value) } @@ -205,7 +215,7 @@ func (a *AccentColor) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field dark_theme_colors: %w", err) } if headerLen > 0 { @@ -214,18 +224,25 @@ func (a *AccentColor) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field dark_theme_colors: %w", err) } a.DarkThemeColors = append(a.DarkThemeColors, value) } } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field min_chat_boost_level: %w", err) + } + a.MinChatBoostLevel = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (a *AccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { if a == nil { - return fmt.Errorf("can't encode accentColor#83d57cd6 as nil") + return fmt.Errorf("can't encode accentColor#ed4c76c9 as nil") } b.ObjStart() b.PutID("accentColor") @@ -254,6 +271,9 @@ func (a *AccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("min_chat_boost_level") + b.PutInt32(a.MinChatBoostLevel) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -262,49 +282,55 @@ func (a *AccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (a *AccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { if a == nil { - return fmt.Errorf("can't decode accentColor#83d57cd6 to nil") + return fmt.Errorf("can't decode accentColor#ed4c76c9 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("accentColor"); err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: %w", err) } case "id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field id: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field id: %w", err) } a.ID = value case "built_in_accent_color_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field built_in_accent_color_id: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field built_in_accent_color_id: %w", err) } a.BuiltInAccentColorID = value case "light_theme_colors": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field light_theme_colors: %w", err) } a.LightThemeColors = append(a.LightThemeColors, value) return nil }); err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field light_theme_colors: %w", err) } case "dark_theme_colors": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field dark_theme_colors: %w", err) } a.DarkThemeColors = append(a.DarkThemeColors, value) return nil }); err != nil { - return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field dark_theme_colors: %w", err) } + case "min_chat_boost_level": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#ed4c76c9: field min_chat_boost_level: %w", err) + } + a.MinChatBoostLevel = value default: return b.Skip() } @@ -343,3 +369,11 @@ func (a *AccentColor) GetDarkThemeColors() (value []int32) { } return a.DarkThemeColors } + +// GetMinChatBoostLevel returns value of MinChatBoostLevel field. +func (a *AccentColor) GetMinChatBoostLevel() (value int32) { + if a == nil { + return + } + return a.MinChatBoostLevel +} diff --git a/tdapi/tl_add_application_changelog_gen.go b/tdapi/tl_add_application_changelog_gen.go deleted file mode 100644 index 639b4b2373..0000000000 --- a/tdapi/tl_add_application_changelog_gen.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// AddApplicationChangelogRequest represents TL type `addApplicationChangelog#8bf37fc9`. -type AddApplicationChangelogRequest struct { - // The previous application version - PreviousApplicationVersion string -} - -// AddApplicationChangelogRequestTypeID is TL type id of AddApplicationChangelogRequest. -const AddApplicationChangelogRequestTypeID = 0x8bf37fc9 - -// Ensuring interfaces in compile-time for AddApplicationChangelogRequest. -var ( - _ bin.Encoder = &AddApplicationChangelogRequest{} - _ bin.Decoder = &AddApplicationChangelogRequest{} - _ bin.BareEncoder = &AddApplicationChangelogRequest{} - _ bin.BareDecoder = &AddApplicationChangelogRequest{} -) - -func (a *AddApplicationChangelogRequest) Zero() bool { - if a == nil { - return true - } - if !(a.PreviousApplicationVersion == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (a *AddApplicationChangelogRequest) String() string { - if a == nil { - return "AddApplicationChangelogRequest(nil)" - } - type Alias AddApplicationChangelogRequest - return fmt.Sprintf("AddApplicationChangelogRequest%+v", Alias(*a)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*AddApplicationChangelogRequest) TypeID() uint32 { - return AddApplicationChangelogRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*AddApplicationChangelogRequest) TypeName() string { - return "addApplicationChangelog" -} - -// TypeInfo returns info about TL type. -func (a *AddApplicationChangelogRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "addApplicationChangelog", - ID: AddApplicationChangelogRequestTypeID, - } - if a == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "PreviousApplicationVersion", - SchemaName: "previous_application_version", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (a *AddApplicationChangelogRequest) Encode(b *bin.Buffer) error { - if a == nil { - return fmt.Errorf("can't encode addApplicationChangelog#8bf37fc9 as nil") - } - b.PutID(AddApplicationChangelogRequestTypeID) - return a.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (a *AddApplicationChangelogRequest) EncodeBare(b *bin.Buffer) error { - if a == nil { - return fmt.Errorf("can't encode addApplicationChangelog#8bf37fc9 as nil") - } - b.PutString(a.PreviousApplicationVersion) - return nil -} - -// Decode implements bin.Decoder. -func (a *AddApplicationChangelogRequest) Decode(b *bin.Buffer) error { - if a == nil { - return fmt.Errorf("can't decode addApplicationChangelog#8bf37fc9 to nil") - } - if err := b.ConsumeID(AddApplicationChangelogRequestTypeID); err != nil { - return fmt.Errorf("unable to decode addApplicationChangelog#8bf37fc9: %w", err) - } - return a.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (a *AddApplicationChangelogRequest) DecodeBare(b *bin.Buffer) error { - if a == nil { - return fmt.Errorf("can't decode addApplicationChangelog#8bf37fc9 to nil") - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode addApplicationChangelog#8bf37fc9: field previous_application_version: %w", err) - } - a.PreviousApplicationVersion = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (a *AddApplicationChangelogRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if a == nil { - return fmt.Errorf("can't encode addApplicationChangelog#8bf37fc9 as nil") - } - b.ObjStart() - b.PutID("addApplicationChangelog") - b.Comma() - b.FieldStart("previous_application_version") - b.PutString(a.PreviousApplicationVersion) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (a *AddApplicationChangelogRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if a == nil { - return fmt.Errorf("can't decode addApplicationChangelog#8bf37fc9 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("addApplicationChangelog"); err != nil { - return fmt.Errorf("unable to decode addApplicationChangelog#8bf37fc9: %w", err) - } - case "previous_application_version": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode addApplicationChangelog#8bf37fc9: field previous_application_version: %w", err) - } - a.PreviousApplicationVersion = value - default: - return b.Skip() - } - return nil - }) -} - -// GetPreviousApplicationVersion returns value of PreviousApplicationVersion field. -func (a *AddApplicationChangelogRequest) GetPreviousApplicationVersion() (value string) { - if a == nil { - return - } - return a.PreviousApplicationVersion -} - -// AddApplicationChangelog invokes method addApplicationChangelog#8bf37fc9 returning error if any. -func (c *Client) AddApplicationChangelog(ctx context.Context, previousapplicationversion string) error { - var ok Ok - - request := &AddApplicationChangelogRequest{ - PreviousApplicationVersion: previousapplicationversion, - } - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err - } - return nil -} diff --git a/tdapi/tl_background_gen.go b/tdapi/tl_background_gen.go index 4b2be77cfb..fccaefa007 100644 --- a/tdapi/tl_background_gen.go +++ b/tdapi/tl_background_gen.go @@ -41,7 +41,8 @@ type Background struct { IsDark bool // Unique background name Name string - // Document with the background; may be null. Null only for filled backgrounds + // Document with the background; may be null. Null only for filled and chat theme + // backgrounds Document Document // Type of the background Type BackgroundTypeClass diff --git a/tdapi/tl_background_type_gen.go b/tdapi/tl_background_type_gen.go index 199e7e67c6..57fac9aef6 100644 --- a/tdapi/tl_background_type_gen.go +++ b/tdapi/tl_background_type_gen.go @@ -687,6 +687,172 @@ func (b *BackgroundTypeFill) GetFill() (value BackgroundFillClass) { return b.Fill } +// BackgroundTypeChatTheme represents TL type `backgroundTypeChatTheme#4d7a9752`. +type BackgroundTypeChatTheme struct { + // Name of the chat theme + ThemeName string +} + +// BackgroundTypeChatThemeTypeID is TL type id of BackgroundTypeChatTheme. +const BackgroundTypeChatThemeTypeID = 0x4d7a9752 + +// construct implements constructor of BackgroundTypeClass. +func (b BackgroundTypeChatTheme) construct() BackgroundTypeClass { return &b } + +// Ensuring interfaces in compile-time for BackgroundTypeChatTheme. +var ( + _ bin.Encoder = &BackgroundTypeChatTheme{} + _ bin.Decoder = &BackgroundTypeChatTheme{} + _ bin.BareEncoder = &BackgroundTypeChatTheme{} + _ bin.BareDecoder = &BackgroundTypeChatTheme{} + + _ BackgroundTypeClass = &BackgroundTypeChatTheme{} +) + +func (b *BackgroundTypeChatTheme) Zero() bool { + if b == nil { + return true + } + if !(b.ThemeName == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (b *BackgroundTypeChatTheme) String() string { + if b == nil { + return "BackgroundTypeChatTheme(nil)" + } + type Alias BackgroundTypeChatTheme + return fmt.Sprintf("BackgroundTypeChatTheme%+v", Alias(*b)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*BackgroundTypeChatTheme) TypeID() uint32 { + return BackgroundTypeChatThemeTypeID +} + +// TypeName returns name of type in TL schema. +func (*BackgroundTypeChatTheme) TypeName() string { + return "backgroundTypeChatTheme" +} + +// TypeInfo returns info about TL type. +func (b *BackgroundTypeChatTheme) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "backgroundTypeChatTheme", + ID: BackgroundTypeChatThemeTypeID, + } + if b == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ThemeName", + SchemaName: "theme_name", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (b *BackgroundTypeChatTheme) Encode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode backgroundTypeChatTheme#4d7a9752 as nil") + } + buf.PutID(BackgroundTypeChatThemeTypeID) + return b.EncodeBare(buf) +} + +// EncodeBare implements bin.BareEncoder. +func (b *BackgroundTypeChatTheme) EncodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode backgroundTypeChatTheme#4d7a9752 as nil") + } + buf.PutString(b.ThemeName) + return nil +} + +// Decode implements bin.Decoder. +func (b *BackgroundTypeChatTheme) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode backgroundTypeChatTheme#4d7a9752 to nil") + } + if err := buf.ConsumeID(BackgroundTypeChatThemeTypeID); err != nil { + return fmt.Errorf("unable to decode backgroundTypeChatTheme#4d7a9752: %w", err) + } + return b.DecodeBare(buf) +} + +// DecodeBare implements bin.BareDecoder. +func (b *BackgroundTypeChatTheme) DecodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode backgroundTypeChatTheme#4d7a9752 to nil") + } + { + value, err := buf.String() + if err != nil { + return fmt.Errorf("unable to decode backgroundTypeChatTheme#4d7a9752: field theme_name: %w", err) + } + b.ThemeName = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (b *BackgroundTypeChatTheme) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil { + return fmt.Errorf("can't encode backgroundTypeChatTheme#4d7a9752 as nil") + } + buf.ObjStart() + buf.PutID("backgroundTypeChatTheme") + buf.Comma() + buf.FieldStart("theme_name") + buf.PutString(b.ThemeName) + buf.Comma() + buf.StripComma() + buf.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (b *BackgroundTypeChatTheme) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("can't decode backgroundTypeChatTheme#4d7a9752 to nil") + } + + return buf.Obj(func(buf tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := buf.ConsumeID("backgroundTypeChatTheme"); err != nil { + return fmt.Errorf("unable to decode backgroundTypeChatTheme#4d7a9752: %w", err) + } + case "theme_name": + value, err := buf.String() + if err != nil { + return fmt.Errorf("unable to decode backgroundTypeChatTheme#4d7a9752: field theme_name: %w", err) + } + b.ThemeName = value + default: + return buf.Skip() + } + return nil + }) +} + +// GetThemeName returns value of ThemeName field. +func (b *BackgroundTypeChatTheme) GetThemeName() (value string) { + if b == nil { + return + } + return b.ThemeName +} + // BackgroundTypeClassName is schema name of BackgroundTypeClass. const BackgroundTypeClassName = "BackgroundType" @@ -702,6 +868,7 @@ const BackgroundTypeClassName = "BackgroundType" // case *tdapi.BackgroundTypeWallpaper: // backgroundTypeWallpaper#758c4c7b // case *tdapi.BackgroundTypePattern: // backgroundTypePattern#4ce716fd // case *tdapi.BackgroundTypeFill: // backgroundTypeFill#3b301c2c +// case *tdapi.BackgroundTypeChatTheme: // backgroundTypeChatTheme#4d7a9752 // default: panic(v) // } type BackgroundTypeClass interface { @@ -754,6 +921,13 @@ func DecodeBackgroundType(buf *bin.Buffer) (BackgroundTypeClass, error) { return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", err) } return &v, nil + case BackgroundTypeChatThemeTypeID: + // Decoding backgroundTypeChatTheme#4d7a9752. + v := BackgroundTypeChatTheme{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -787,6 +961,13 @@ func DecodeTDLibJSONBackgroundType(buf tdjson.Decoder) (BackgroundTypeClass, err return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", err) } return &v, nil + case "backgroundTypeChatTheme": + // Decoding backgroundTypeChatTheme#4d7a9752. + v := BackgroundTypeChatTheme{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode BackgroundTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_chat_background_gen.go b/tdapi/tl_chat_background_gen.go index 88a7d336e8..455ff9baad 100644 --- a/tdapi/tl_chat_background_gen.go +++ b/tdapi/tl_chat_background_gen.go @@ -35,7 +35,8 @@ var ( type ChatBackground struct { // The background Background Background - // Dimming of the background in dark themes, as a percentage; 0-100 + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to + // Wallpaper and Fill types of background DarkThemeDimming int32 } diff --git a/tdapi/tl_chat_boost_features_gen.go b/tdapi/tl_chat_boost_features_gen.go new file mode 100644 index 0000000000..c2d97bffd6 --- /dev/null +++ b/tdapi/tl_chat_boost_features_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{} +) + +// ChatBoostFeatures represents TL type `chatBoostFeatures#b9672a54`. +type ChatBoostFeatures struct { + // The list of features + Features []ChatBoostLevelFeatures +} + +// ChatBoostFeaturesTypeID is TL type id of ChatBoostFeatures. +const ChatBoostFeaturesTypeID = 0xb9672a54 + +// Ensuring interfaces in compile-time for ChatBoostFeatures. +var ( + _ bin.Encoder = &ChatBoostFeatures{} + _ bin.Decoder = &ChatBoostFeatures{} + _ bin.BareEncoder = &ChatBoostFeatures{} + _ bin.BareDecoder = &ChatBoostFeatures{} +) + +func (c *ChatBoostFeatures) Zero() bool { + if c == nil { + return true + } + if !(c.Features == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostFeatures) String() string { + if c == nil { + return "ChatBoostFeatures(nil)" + } + type Alias ChatBoostFeatures + return fmt.Sprintf("ChatBoostFeatures%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostFeatures) TypeID() uint32 { + return ChatBoostFeaturesTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostFeatures) TypeName() string { + return "chatBoostFeatures" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostFeatures) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostFeatures", + ID: ChatBoostFeaturesTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Features", + SchemaName: "features", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostFeatures) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostFeatures#b9672a54 as nil") + } + b.PutID(ChatBoostFeaturesTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostFeatures) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostFeatures#b9672a54 as nil") + } + b.PutInt(len(c.Features)) + for idx, v := range c.Features { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare chatBoostFeatures#b9672a54: field features element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostFeatures) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostFeatures#b9672a54 to nil") + } + if err := b.ConsumeID(ChatBoostFeaturesTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostFeatures#b9672a54: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostFeatures) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostFeatures#b9672a54 to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode chatBoostFeatures#b9672a54: field features: %w", err) + } + + if headerLen > 0 { + c.Features = make([]ChatBoostLevelFeatures, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ChatBoostLevelFeatures + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare chatBoostFeatures#b9672a54: field features: %w", err) + } + c.Features = append(c.Features, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostFeatures) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostFeatures#b9672a54 as nil") + } + b.ObjStart() + b.PutID("chatBoostFeatures") + b.Comma() + b.FieldStart("features") + b.ArrStart() + for idx, v := range c.Features { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatBoostFeatures#b9672a54: field features 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 (c *ChatBoostFeatures) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostFeatures#b9672a54 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostFeatures"); err != nil { + return fmt.Errorf("unable to decode chatBoostFeatures#b9672a54: %w", err) + } + case "features": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ChatBoostLevelFeatures + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatBoostFeatures#b9672a54: field features: %w", err) + } + c.Features = append(c.Features, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode chatBoostFeatures#b9672a54: field features: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetFeatures returns value of Features field. +func (c *ChatBoostFeatures) GetFeatures() (value []ChatBoostLevelFeatures) { + if c == nil { + return + } + return c.Features +} diff --git a/tdapi/tl_chat_boost_level_features_gen.go b/tdapi/tl_chat_boost_level_features_gen.go new file mode 100644 index 0000000000..b6879cdc44 --- /dev/null +++ b/tdapi/tl_chat_boost_level_features_gen.go @@ -0,0 +1,534 @@ +// 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{} +) + +// ChatBoostLevelFeatures represents TL type `chatBoostLevelFeatures#fe9f29de`. +type ChatBoostLevelFeatures struct { + // Target chat boost level + Level int32 + // Number of stories that the chat can publish daily + StoryPerDayCount int32 + // Number of custom emoji reactions that can be added to the list of available reactions + CustomEmojiReactionCount int32 + // Number of custom colors for chat title + TitleColorCount int32 + // Number of custom colors for profile photo background + ProfileAccentColorCount int32 + // True, if custom emoji for profile background can be set + CanSetProfileBackgroundCustomEmoji bool + // Number of custom colors for background of empty chat photo, replies to messages and + // link previews + AccentColorCount int32 + // True, if custom emoji for reply header and link preview background can be set + CanSetBackgroundCustomEmoji bool + // True, if emoji status can be set + CanSetEmojiStatus bool + // Number of chat theme backgrounds that can be set as chat background + ChatThemeBackgroundCount int32 + // True, if custom background can be set in the chat for all users + CanSetCustomBackground bool +} + +// ChatBoostLevelFeaturesTypeID is TL type id of ChatBoostLevelFeatures. +const ChatBoostLevelFeaturesTypeID = 0xfe9f29de + +// Ensuring interfaces in compile-time for ChatBoostLevelFeatures. +var ( + _ bin.Encoder = &ChatBoostLevelFeatures{} + _ bin.Decoder = &ChatBoostLevelFeatures{} + _ bin.BareEncoder = &ChatBoostLevelFeatures{} + _ bin.BareDecoder = &ChatBoostLevelFeatures{} +) + +func (c *ChatBoostLevelFeatures) Zero() bool { + if c == nil { + return true + } + if !(c.Level == 0) { + return false + } + if !(c.StoryPerDayCount == 0) { + return false + } + if !(c.CustomEmojiReactionCount == 0) { + return false + } + if !(c.TitleColorCount == 0) { + return false + } + if !(c.ProfileAccentColorCount == 0) { + return false + } + if !(c.CanSetProfileBackgroundCustomEmoji == false) { + return false + } + if !(c.AccentColorCount == 0) { + return false + } + if !(c.CanSetBackgroundCustomEmoji == false) { + return false + } + if !(c.CanSetEmojiStatus == false) { + return false + } + if !(c.ChatThemeBackgroundCount == 0) { + return false + } + if !(c.CanSetCustomBackground == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostLevelFeatures) String() string { + if c == nil { + return "ChatBoostLevelFeatures(nil)" + } + type Alias ChatBoostLevelFeatures + return fmt.Sprintf("ChatBoostLevelFeatures%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostLevelFeatures) TypeID() uint32 { + return ChatBoostLevelFeaturesTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostLevelFeatures) TypeName() string { + return "chatBoostLevelFeatures" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostLevelFeatures) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostLevelFeatures", + ID: ChatBoostLevelFeaturesTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Level", + SchemaName: "level", + }, + { + Name: "StoryPerDayCount", + SchemaName: "story_per_day_count", + }, + { + Name: "CustomEmojiReactionCount", + SchemaName: "custom_emoji_reaction_count", + }, + { + Name: "TitleColorCount", + SchemaName: "title_color_count", + }, + { + Name: "ProfileAccentColorCount", + SchemaName: "profile_accent_color_count", + }, + { + Name: "CanSetProfileBackgroundCustomEmoji", + SchemaName: "can_set_profile_background_custom_emoji", + }, + { + Name: "AccentColorCount", + SchemaName: "accent_color_count", + }, + { + Name: "CanSetBackgroundCustomEmoji", + SchemaName: "can_set_background_custom_emoji", + }, + { + Name: "CanSetEmojiStatus", + SchemaName: "can_set_emoji_status", + }, + { + Name: "ChatThemeBackgroundCount", + SchemaName: "chat_theme_background_count", + }, + { + Name: "CanSetCustomBackground", + SchemaName: "can_set_custom_background", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostLevelFeatures) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostLevelFeatures#fe9f29de as nil") + } + b.PutID(ChatBoostLevelFeaturesTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostLevelFeatures) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostLevelFeatures#fe9f29de as nil") + } + b.PutInt32(c.Level) + b.PutInt32(c.StoryPerDayCount) + b.PutInt32(c.CustomEmojiReactionCount) + b.PutInt32(c.TitleColorCount) + b.PutInt32(c.ProfileAccentColorCount) + b.PutBool(c.CanSetProfileBackgroundCustomEmoji) + b.PutInt32(c.AccentColorCount) + b.PutBool(c.CanSetBackgroundCustomEmoji) + b.PutBool(c.CanSetEmojiStatus) + b.PutInt32(c.ChatThemeBackgroundCount) + b.PutBool(c.CanSetCustomBackground) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostLevelFeatures) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostLevelFeatures#fe9f29de to nil") + } + if err := b.ConsumeID(ChatBoostLevelFeaturesTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostLevelFeatures) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostLevelFeatures#fe9f29de to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field level: %w", err) + } + c.Level = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field story_per_day_count: %w", err) + } + c.StoryPerDayCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field custom_emoji_reaction_count: %w", err) + } + c.CustomEmojiReactionCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field title_color_count: %w", err) + } + c.TitleColorCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field profile_accent_color_count: %w", err) + } + c.ProfileAccentColorCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_profile_background_custom_emoji: %w", err) + } + c.CanSetProfileBackgroundCustomEmoji = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field accent_color_count: %w", err) + } + c.AccentColorCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_background_custom_emoji: %w", err) + } + c.CanSetBackgroundCustomEmoji = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_emoji_status: %w", err) + } + c.CanSetEmojiStatus = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field chat_theme_background_count: %w", err) + } + c.ChatThemeBackgroundCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_custom_background: %w", err) + } + c.CanSetCustomBackground = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostLevelFeatures) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostLevelFeatures#fe9f29de as nil") + } + b.ObjStart() + b.PutID("chatBoostLevelFeatures") + b.Comma() + b.FieldStart("level") + b.PutInt32(c.Level) + b.Comma() + b.FieldStart("story_per_day_count") + b.PutInt32(c.StoryPerDayCount) + b.Comma() + b.FieldStart("custom_emoji_reaction_count") + b.PutInt32(c.CustomEmojiReactionCount) + b.Comma() + b.FieldStart("title_color_count") + b.PutInt32(c.TitleColorCount) + b.Comma() + b.FieldStart("profile_accent_color_count") + b.PutInt32(c.ProfileAccentColorCount) + b.Comma() + b.FieldStart("can_set_profile_background_custom_emoji") + b.PutBool(c.CanSetProfileBackgroundCustomEmoji) + b.Comma() + b.FieldStart("accent_color_count") + b.PutInt32(c.AccentColorCount) + b.Comma() + b.FieldStart("can_set_background_custom_emoji") + b.PutBool(c.CanSetBackgroundCustomEmoji) + b.Comma() + b.FieldStart("can_set_emoji_status") + b.PutBool(c.CanSetEmojiStatus) + b.Comma() + b.FieldStart("chat_theme_background_count") + b.PutInt32(c.ChatThemeBackgroundCount) + b.Comma() + b.FieldStart("can_set_custom_background") + b.PutBool(c.CanSetCustomBackground) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatBoostLevelFeatures) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostLevelFeatures#fe9f29de to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostLevelFeatures"); err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: %w", err) + } + case "level": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field level: %w", err) + } + c.Level = value + case "story_per_day_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field story_per_day_count: %w", err) + } + c.StoryPerDayCount = value + case "custom_emoji_reaction_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field custom_emoji_reaction_count: %w", err) + } + c.CustomEmojiReactionCount = value + case "title_color_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field title_color_count: %w", err) + } + c.TitleColorCount = value + case "profile_accent_color_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field profile_accent_color_count: %w", err) + } + c.ProfileAccentColorCount = value + case "can_set_profile_background_custom_emoji": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_profile_background_custom_emoji: %w", err) + } + c.CanSetProfileBackgroundCustomEmoji = value + case "accent_color_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field accent_color_count: %w", err) + } + c.AccentColorCount = value + case "can_set_background_custom_emoji": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_background_custom_emoji: %w", err) + } + c.CanSetBackgroundCustomEmoji = value + case "can_set_emoji_status": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_emoji_status: %w", err) + } + c.CanSetEmojiStatus = value + case "chat_theme_background_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field chat_theme_background_count: %w", err) + } + c.ChatThemeBackgroundCount = value + case "can_set_custom_background": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostLevelFeatures#fe9f29de: field can_set_custom_background: %w", err) + } + c.CanSetCustomBackground = value + default: + return b.Skip() + } + return nil + }) +} + +// GetLevel returns value of Level field. +func (c *ChatBoostLevelFeatures) GetLevel() (value int32) { + if c == nil { + return + } + return c.Level +} + +// GetStoryPerDayCount returns value of StoryPerDayCount field. +func (c *ChatBoostLevelFeatures) GetStoryPerDayCount() (value int32) { + if c == nil { + return + } + return c.StoryPerDayCount +} + +// GetCustomEmojiReactionCount returns value of CustomEmojiReactionCount field. +func (c *ChatBoostLevelFeatures) GetCustomEmojiReactionCount() (value int32) { + if c == nil { + return + } + return c.CustomEmojiReactionCount +} + +// GetTitleColorCount returns value of TitleColorCount field. +func (c *ChatBoostLevelFeatures) GetTitleColorCount() (value int32) { + if c == nil { + return + } + return c.TitleColorCount +} + +// GetProfileAccentColorCount returns value of ProfileAccentColorCount field. +func (c *ChatBoostLevelFeatures) GetProfileAccentColorCount() (value int32) { + if c == nil { + return + } + return c.ProfileAccentColorCount +} + +// GetCanSetProfileBackgroundCustomEmoji returns value of CanSetProfileBackgroundCustomEmoji field. +func (c *ChatBoostLevelFeatures) GetCanSetProfileBackgroundCustomEmoji() (value bool) { + if c == nil { + return + } + return c.CanSetProfileBackgroundCustomEmoji +} + +// GetAccentColorCount returns value of AccentColorCount field. +func (c *ChatBoostLevelFeatures) GetAccentColorCount() (value int32) { + if c == nil { + return + } + return c.AccentColorCount +} + +// GetCanSetBackgroundCustomEmoji returns value of CanSetBackgroundCustomEmoji field. +func (c *ChatBoostLevelFeatures) GetCanSetBackgroundCustomEmoji() (value bool) { + if c == nil { + return + } + return c.CanSetBackgroundCustomEmoji +} + +// GetCanSetEmojiStatus returns value of CanSetEmojiStatus field. +func (c *ChatBoostLevelFeatures) GetCanSetEmojiStatus() (value bool) { + if c == nil { + return + } + return c.CanSetEmojiStatus +} + +// GetChatThemeBackgroundCount returns value of ChatThemeBackgroundCount field. +func (c *ChatBoostLevelFeatures) GetChatThemeBackgroundCount() (value int32) { + if c == nil { + return + } + return c.ChatThemeBackgroundCount +} + +// GetCanSetCustomBackground returns value of CanSetCustomBackground field. +func (c *ChatBoostLevelFeatures) GetCanSetCustomBackground() (value bool) { + if c == nil { + return + } + return c.CanSetCustomBackground +} diff --git a/tdapi/tl_chat_event_action_gen.go b/tdapi/tl_chat_event_action_gen.go index 434149ee2a..7560e0e6ec 100644 --- a/tdapi/tl_chat_event_action_gen.go +++ b/tdapi/tl_chat_event_action_gen.go @@ -2540,6 +2540,206 @@ func (c *ChatEventAvailableReactionsChanged) GetNewAvailableReactions() (value C return c.NewAvailableReactions } +// ChatEventBackgroundChanged represents TL type `chatEventBackgroundChanged#b6ed6d38`. +type ChatEventBackgroundChanged struct { + // Previous background; may be null if none + OldBackground ChatBackground + // New background; may be null if none + NewBackground ChatBackground +} + +// ChatEventBackgroundChangedTypeID is TL type id of ChatEventBackgroundChanged. +const ChatEventBackgroundChangedTypeID = 0xb6ed6d38 + +// construct implements constructor of ChatEventActionClass. +func (c ChatEventBackgroundChanged) construct() ChatEventActionClass { return &c } + +// Ensuring interfaces in compile-time for ChatEventBackgroundChanged. +var ( + _ bin.Encoder = &ChatEventBackgroundChanged{} + _ bin.Decoder = &ChatEventBackgroundChanged{} + _ bin.BareEncoder = &ChatEventBackgroundChanged{} + _ bin.BareDecoder = &ChatEventBackgroundChanged{} + + _ ChatEventActionClass = &ChatEventBackgroundChanged{} +) + +func (c *ChatEventBackgroundChanged) Zero() bool { + if c == nil { + return true + } + if !(c.OldBackground.Zero()) { + return false + } + if !(c.NewBackground.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatEventBackgroundChanged) String() string { + if c == nil { + return "ChatEventBackgroundChanged(nil)" + } + type Alias ChatEventBackgroundChanged + return fmt.Sprintf("ChatEventBackgroundChanged%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatEventBackgroundChanged) TypeID() uint32 { + return ChatEventBackgroundChangedTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatEventBackgroundChanged) TypeName() string { + return "chatEventBackgroundChanged" +} + +// TypeInfo returns info about TL type. +func (c *ChatEventBackgroundChanged) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatEventBackgroundChanged", + ID: ChatEventBackgroundChangedTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OldBackground", + SchemaName: "old_background", + }, + { + Name: "NewBackground", + SchemaName: "new_background", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatEventBackgroundChanged) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundChanged#b6ed6d38 as nil") + } + b.PutID(ChatEventBackgroundChangedTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatEventBackgroundChanged) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundChanged#b6ed6d38 as nil") + } + if err := c.OldBackground.Encode(b); err != nil { + return fmt.Errorf("unable to encode chatEventBackgroundChanged#b6ed6d38: field old_background: %w", err) + } + if err := c.NewBackground.Encode(b); err != nil { + return fmt.Errorf("unable to encode chatEventBackgroundChanged#b6ed6d38: field new_background: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatEventBackgroundChanged) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundChanged#b6ed6d38 to nil") + } + if err := b.ConsumeID(ChatEventBackgroundChangedTypeID); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatEventBackgroundChanged) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundChanged#b6ed6d38 to nil") + } + { + if err := c.OldBackground.Decode(b); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: field old_background: %w", err) + } + } + { + if err := c.NewBackground.Decode(b); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: field new_background: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatEventBackgroundChanged) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundChanged#b6ed6d38 as nil") + } + b.ObjStart() + b.PutID("chatEventBackgroundChanged") + b.Comma() + b.FieldStart("old_background") + if err := c.OldBackground.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatEventBackgroundChanged#b6ed6d38: field old_background: %w", err) + } + b.Comma() + b.FieldStart("new_background") + if err := c.NewBackground.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatEventBackgroundChanged#b6ed6d38: field new_background: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatEventBackgroundChanged) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundChanged#b6ed6d38 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatEventBackgroundChanged"); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: %w", err) + } + case "old_background": + if err := c.OldBackground.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: field old_background: %w", err) + } + case "new_background": + if err := c.NewBackground.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundChanged#b6ed6d38: field new_background: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetOldBackground returns value of OldBackground field. +func (c *ChatEventBackgroundChanged) GetOldBackground() (value ChatBackground) { + if c == nil { + return + } + return c.OldBackground +} + +// GetNewBackground returns value of NewBackground field. +func (c *ChatEventBackgroundChanged) GetNewBackground() (value ChatBackground) { + if c == nil { + return + } + return c.NewBackground +} + // ChatEventDescriptionChanged represents TL type `chatEventDescriptionChanged#254cf1e`. type ChatEventDescriptionChanged struct { // Previous chat description @@ -2740,6 +2940,206 @@ func (c *ChatEventDescriptionChanged) GetNewDescription() (value string) { return c.NewDescription } +// ChatEventEmojiStatusChanged represents TL type `chatEventEmojiStatusChanged#83e97b1e`. +type ChatEventEmojiStatusChanged struct { + // Previous emoji status; may be null if none + OldEmojiStatus EmojiStatus + // New emoji status; may be null if none + NewEmojiStatus EmojiStatus +} + +// ChatEventEmojiStatusChangedTypeID is TL type id of ChatEventEmojiStatusChanged. +const ChatEventEmojiStatusChangedTypeID = 0x83e97b1e + +// construct implements constructor of ChatEventActionClass. +func (c ChatEventEmojiStatusChanged) construct() ChatEventActionClass { return &c } + +// Ensuring interfaces in compile-time for ChatEventEmojiStatusChanged. +var ( + _ bin.Encoder = &ChatEventEmojiStatusChanged{} + _ bin.Decoder = &ChatEventEmojiStatusChanged{} + _ bin.BareEncoder = &ChatEventEmojiStatusChanged{} + _ bin.BareDecoder = &ChatEventEmojiStatusChanged{} + + _ ChatEventActionClass = &ChatEventEmojiStatusChanged{} +) + +func (c *ChatEventEmojiStatusChanged) Zero() bool { + if c == nil { + return true + } + if !(c.OldEmojiStatus.Zero()) { + return false + } + if !(c.NewEmojiStatus.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatEventEmojiStatusChanged) String() string { + if c == nil { + return "ChatEventEmojiStatusChanged(nil)" + } + type Alias ChatEventEmojiStatusChanged + return fmt.Sprintf("ChatEventEmojiStatusChanged%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatEventEmojiStatusChanged) TypeID() uint32 { + return ChatEventEmojiStatusChangedTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatEventEmojiStatusChanged) TypeName() string { + return "chatEventEmojiStatusChanged" +} + +// TypeInfo returns info about TL type. +func (c *ChatEventEmojiStatusChanged) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatEventEmojiStatusChanged", + ID: ChatEventEmojiStatusChangedTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OldEmojiStatus", + SchemaName: "old_emoji_status", + }, + { + Name: "NewEmojiStatus", + SchemaName: "new_emoji_status", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatEventEmojiStatusChanged) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventEmojiStatusChanged#83e97b1e as nil") + } + b.PutID(ChatEventEmojiStatusChangedTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatEventEmojiStatusChanged) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventEmojiStatusChanged#83e97b1e as nil") + } + if err := c.OldEmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode chatEventEmojiStatusChanged#83e97b1e: field old_emoji_status: %w", err) + } + if err := c.NewEmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode chatEventEmojiStatusChanged#83e97b1e: field new_emoji_status: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatEventEmojiStatusChanged) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventEmojiStatusChanged#83e97b1e to nil") + } + if err := b.ConsumeID(ChatEventEmojiStatusChangedTypeID); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatEventEmojiStatusChanged) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventEmojiStatusChanged#83e97b1e to nil") + } + { + if err := c.OldEmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: field old_emoji_status: %w", err) + } + } + { + if err := c.NewEmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: field new_emoji_status: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatEventEmojiStatusChanged) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatEventEmojiStatusChanged#83e97b1e as nil") + } + b.ObjStart() + b.PutID("chatEventEmojiStatusChanged") + b.Comma() + b.FieldStart("old_emoji_status") + if err := c.OldEmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatEventEmojiStatusChanged#83e97b1e: field old_emoji_status: %w", err) + } + b.Comma() + b.FieldStart("new_emoji_status") + if err := c.NewEmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatEventEmojiStatusChanged#83e97b1e: field new_emoji_status: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatEventEmojiStatusChanged) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatEventEmojiStatusChanged#83e97b1e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatEventEmojiStatusChanged"); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: %w", err) + } + case "old_emoji_status": + if err := c.OldEmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: field old_emoji_status: %w", err) + } + case "new_emoji_status": + if err := c.NewEmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatEventEmojiStatusChanged#83e97b1e: field new_emoji_status: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetOldEmojiStatus returns value of OldEmojiStatus field. +func (c *ChatEventEmojiStatusChanged) GetOldEmojiStatus() (value EmojiStatus) { + if c == nil { + return + } + return c.OldEmojiStatus +} + +// GetNewEmojiStatus returns value of NewEmojiStatus field. +func (c *ChatEventEmojiStatusChanged) GetNewEmojiStatus() (value EmojiStatus) { + if c == nil { + return + } + return c.NewEmojiStatus +} + // ChatEventLinkedChatChanged represents TL type `chatEventLinkedChatChanged#6b2271af`. type ChatEventLinkedChatChanged struct { // Previous supergroup linked chat identifier @@ -4788,16 +5188,20 @@ func (c *ChatEventActiveUsernamesChanged) GetNewUsernames() (value []string) { return c.NewUsernames } -// ChatEventAccentColorChanged represents TL type `chatEventAccentColorChanged#2a327e32`. +// ChatEventAccentColorChanged represents TL type `chatEventAccentColorChanged#e6837733`. type ChatEventAccentColorChanged struct { // Previous identifier of chat accent color OldAccentColorID int32 + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiID int64 // New identifier of chat accent color NewAccentColorID int32 + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiID int64 } // ChatEventAccentColorChangedTypeID is TL type id of ChatEventAccentColorChanged. -const ChatEventAccentColorChangedTypeID = 0x2a327e32 +const ChatEventAccentColorChangedTypeID = 0xe6837733 // construct implements constructor of ChatEventActionClass. func (c ChatEventAccentColorChanged) construct() ChatEventActionClass { return &c } @@ -4819,9 +5223,15 @@ func (c *ChatEventAccentColorChanged) Zero() bool { if !(c.OldAccentColorID == 0) { return false } + if !(c.OldBackgroundCustomEmojiID == 0) { + return false + } if !(c.NewAccentColorID == 0) { return false } + if !(c.NewBackgroundCustomEmojiID == 0) { + return false + } return true } @@ -4862,10 +5272,18 @@ func (c *ChatEventAccentColorChanged) TypeInfo() tdp.Type { Name: "OldAccentColorID", SchemaName: "old_accent_color_id", }, + { + Name: "OldBackgroundCustomEmojiID", + SchemaName: "old_background_custom_emoji_id", + }, { Name: "NewAccentColorID", SchemaName: "new_accent_color_id", }, + { + Name: "NewBackgroundCustomEmojiID", + SchemaName: "new_background_custom_emoji_id", + }, } return typ } @@ -4873,7 +5291,7 @@ func (c *ChatEventAccentColorChanged) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatEventAccentColorChanged) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEventAccentColorChanged#2a327e32 as nil") + return fmt.Errorf("can't encode chatEventAccentColorChanged#e6837733 as nil") } b.PutID(ChatEventAccentColorChangedTypeID) return c.EncodeBare(b) @@ -4882,20 +5300,22 @@ func (c *ChatEventAccentColorChanged) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatEventAccentColorChanged) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEventAccentColorChanged#2a327e32 as nil") + return fmt.Errorf("can't encode chatEventAccentColorChanged#e6837733 as nil") } b.PutInt32(c.OldAccentColorID) + b.PutLong(c.OldBackgroundCustomEmojiID) b.PutInt32(c.NewAccentColorID) + b.PutLong(c.NewBackgroundCustomEmojiID) return nil } // Decode implements bin.Decoder. func (c *ChatEventAccentColorChanged) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEventAccentColorChanged#2a327e32 to nil") + return fmt.Errorf("can't decode chatEventAccentColorChanged#e6837733 to nil") } if err := b.ConsumeID(ChatEventAccentColorChangedTypeID); err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: %w", err) } return c.DecodeBare(b) } @@ -4903,29 +5323,43 @@ func (c *ChatEventAccentColorChanged) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatEventAccentColorChanged) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEventAccentColorChanged#2a327e32 to nil") + return fmt.Errorf("can't decode chatEventAccentColorChanged#e6837733 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field old_accent_color_id: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field old_accent_color_id: %w", err) } c.OldAccentColorID = value } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field old_background_custom_emoji_id: %w", err) + } + c.OldBackgroundCustomEmojiID = value + } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field new_accent_color_id: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field new_accent_color_id: %w", err) } c.NewAccentColorID = value } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field new_background_custom_emoji_id: %w", err) + } + c.NewBackgroundCustomEmojiID = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *ChatEventAccentColorChanged) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chatEventAccentColorChanged#2a327e32 as nil") + return fmt.Errorf("can't encode chatEventAccentColorChanged#e6837733 as nil") } b.ObjStart() b.PutID("chatEventAccentColorChanged") @@ -4933,9 +5367,15 @@ func (c *ChatEventAccentColorChanged) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("old_accent_color_id") b.PutInt32(c.OldAccentColorID) b.Comma() + b.FieldStart("old_background_custom_emoji_id") + b.PutLong(c.OldBackgroundCustomEmojiID) + b.Comma() b.FieldStart("new_accent_color_id") b.PutInt32(c.NewAccentColorID) b.Comma() + b.FieldStart("new_background_custom_emoji_id") + b.PutLong(c.NewBackgroundCustomEmojiID) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -4944,27 +5384,39 @@ func (c *ChatEventAccentColorChanged) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *ChatEventAccentColorChanged) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chatEventAccentColorChanged#2a327e32 to nil") + return fmt.Errorf("can't decode chatEventAccentColorChanged#e6837733 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("chatEventAccentColorChanged"); err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: %w", err) } case "old_accent_color_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field old_accent_color_id: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field old_accent_color_id: %w", err) } c.OldAccentColorID = value + case "old_background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field old_background_custom_emoji_id: %w", err) + } + c.OldBackgroundCustomEmojiID = value case "new_accent_color_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field new_accent_color_id: %w", err) + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field new_accent_color_id: %w", err) } c.NewAccentColorID = value + case "new_background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#e6837733: field new_background_custom_emoji_id: %w", err) + } + c.NewBackgroundCustomEmojiID = value default: return b.Skip() } @@ -4980,6 +5432,14 @@ func (c *ChatEventAccentColorChanged) GetOldAccentColorID() (value int32) { return c.OldAccentColorID } +// GetOldBackgroundCustomEmojiID returns value of OldBackgroundCustomEmojiID field. +func (c *ChatEventAccentColorChanged) GetOldBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.OldBackgroundCustomEmojiID +} + // GetNewAccentColorID returns value of NewAccentColorID field. func (c *ChatEventAccentColorChanged) GetNewAccentColorID() (value int32) { if c == nil { @@ -4988,38 +5448,56 @@ func (c *ChatEventAccentColorChanged) GetNewAccentColorID() (value int32) { return c.NewAccentColorID } -// ChatEventBackgroundCustomEmojiChanged represents TL type `chatEventBackgroundCustomEmojiChanged#d2671e9a`. -type ChatEventBackgroundCustomEmojiChanged struct { +// GetNewBackgroundCustomEmojiID returns value of NewBackgroundCustomEmojiID field. +func (c *ChatEventAccentColorChanged) GetNewBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.NewBackgroundCustomEmojiID +} + +// ChatEventProfileAccentColorChanged represents TL type `chatEventProfileAccentColorChanged#a5b8da64`. +type ChatEventProfileAccentColorChanged struct { + // Previous identifier of chat's profile accent color; -1 if none + OldProfileAccentColorID int32 // Previous identifier of the custom emoji; 0 if none - OldBackgroundCustomEmojiID int64 + OldProfileBackgroundCustomEmojiID int64 + // New identifier of chat's profile accent color; -1 if none + NewProfileAccentColorID int32 // New identifier of the custom emoji; 0 if none - NewBackgroundCustomEmojiID int64 + NewProfileBackgroundCustomEmojiID int64 } -// ChatEventBackgroundCustomEmojiChangedTypeID is TL type id of ChatEventBackgroundCustomEmojiChanged. -const ChatEventBackgroundCustomEmojiChangedTypeID = 0xd2671e9a +// ChatEventProfileAccentColorChangedTypeID is TL type id of ChatEventProfileAccentColorChanged. +const ChatEventProfileAccentColorChangedTypeID = 0xa5b8da64 // construct implements constructor of ChatEventActionClass. -func (c ChatEventBackgroundCustomEmojiChanged) construct() ChatEventActionClass { return &c } +func (c ChatEventProfileAccentColorChanged) construct() ChatEventActionClass { return &c } -// Ensuring interfaces in compile-time for ChatEventBackgroundCustomEmojiChanged. +// Ensuring interfaces in compile-time for ChatEventProfileAccentColorChanged. var ( - _ bin.Encoder = &ChatEventBackgroundCustomEmojiChanged{} - _ bin.Decoder = &ChatEventBackgroundCustomEmojiChanged{} - _ bin.BareEncoder = &ChatEventBackgroundCustomEmojiChanged{} - _ bin.BareDecoder = &ChatEventBackgroundCustomEmojiChanged{} + _ bin.Encoder = &ChatEventProfileAccentColorChanged{} + _ bin.Decoder = &ChatEventProfileAccentColorChanged{} + _ bin.BareEncoder = &ChatEventProfileAccentColorChanged{} + _ bin.BareDecoder = &ChatEventProfileAccentColorChanged{} - _ ChatEventActionClass = &ChatEventBackgroundCustomEmojiChanged{} + _ ChatEventActionClass = &ChatEventProfileAccentColorChanged{} ) -func (c *ChatEventBackgroundCustomEmojiChanged) Zero() bool { +func (c *ChatEventProfileAccentColorChanged) Zero() bool { if c == nil { return true } - if !(c.OldBackgroundCustomEmojiID == 0) { + if !(c.OldProfileAccentColorID == 0) { return false } - if !(c.NewBackgroundCustomEmojiID == 0) { + if !(c.OldProfileBackgroundCustomEmojiID == 0) { + return false + } + if !(c.NewProfileAccentColorID == 0) { + return false + } + if !(c.NewProfileBackgroundCustomEmojiID == 0) { return false } @@ -5027,31 +5505,31 @@ func (c *ChatEventBackgroundCustomEmojiChanged) Zero() bool { } // String implements fmt.Stringer. -func (c *ChatEventBackgroundCustomEmojiChanged) String() string { +func (c *ChatEventProfileAccentColorChanged) String() string { if c == nil { - return "ChatEventBackgroundCustomEmojiChanged(nil)" + return "ChatEventProfileAccentColorChanged(nil)" } - type Alias ChatEventBackgroundCustomEmojiChanged - return fmt.Sprintf("ChatEventBackgroundCustomEmojiChanged%+v", Alias(*c)) + type Alias ChatEventProfileAccentColorChanged + return fmt.Sprintf("ChatEventProfileAccentColorChanged%+v", Alias(*c)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ChatEventBackgroundCustomEmojiChanged) TypeID() uint32 { - return ChatEventBackgroundCustomEmojiChangedTypeID +func (*ChatEventProfileAccentColorChanged) TypeID() uint32 { + return ChatEventProfileAccentColorChangedTypeID } // TypeName returns name of type in TL schema. -func (*ChatEventBackgroundCustomEmojiChanged) TypeName() string { - return "chatEventBackgroundCustomEmojiChanged" +func (*ChatEventProfileAccentColorChanged) TypeName() string { + return "chatEventProfileAccentColorChanged" } // TypeInfo returns info about TL type. -func (c *ChatEventBackgroundCustomEmojiChanged) TypeInfo() tdp.Type { +func (c *ChatEventProfileAccentColorChanged) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "chatEventBackgroundCustomEmojiChanged", - ID: ChatEventBackgroundCustomEmojiChangedTypeID, + Name: "chatEventProfileAccentColorChanged", + ID: ChatEventProfileAccentColorChangedTypeID, } if c == nil { typ.Null = true @@ -5059,82 +5537,112 @@ func (c *ChatEventBackgroundCustomEmojiChanged) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "OldBackgroundCustomEmojiID", - SchemaName: "old_background_custom_emoji_id", + Name: "OldProfileAccentColorID", + SchemaName: "old_profile_accent_color_id", }, { - Name: "NewBackgroundCustomEmojiID", - SchemaName: "new_background_custom_emoji_id", + Name: "OldProfileBackgroundCustomEmojiID", + SchemaName: "old_profile_background_custom_emoji_id", + }, + { + Name: "NewProfileAccentColorID", + SchemaName: "new_profile_accent_color_id", + }, + { + Name: "NewProfileBackgroundCustomEmojiID", + SchemaName: "new_profile_background_custom_emoji_id", }, } return typ } // Encode implements bin.Encoder. -func (c *ChatEventBackgroundCustomEmojiChanged) Encode(b *bin.Buffer) error { +func (c *ChatEventProfileAccentColorChanged) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + return fmt.Errorf("can't encode chatEventProfileAccentColorChanged#a5b8da64 as nil") } - b.PutID(ChatEventBackgroundCustomEmojiChangedTypeID) + b.PutID(ChatEventProfileAccentColorChangedTypeID) return c.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (c *ChatEventBackgroundCustomEmojiChanged) EncodeBare(b *bin.Buffer) error { +func (c *ChatEventProfileAccentColorChanged) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + return fmt.Errorf("can't encode chatEventProfileAccentColorChanged#a5b8da64 as nil") } - b.PutLong(c.OldBackgroundCustomEmojiID) - b.PutLong(c.NewBackgroundCustomEmojiID) + b.PutInt32(c.OldProfileAccentColorID) + b.PutLong(c.OldProfileBackgroundCustomEmojiID) + b.PutInt32(c.NewProfileAccentColorID) + b.PutLong(c.NewProfileBackgroundCustomEmojiID) return nil } // Decode implements bin.Decoder. -func (c *ChatEventBackgroundCustomEmojiChanged) Decode(b *bin.Buffer) error { +func (c *ChatEventProfileAccentColorChanged) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a to nil") + return fmt.Errorf("can't decode chatEventProfileAccentColorChanged#a5b8da64 to nil") } - if err := b.ConsumeID(ChatEventBackgroundCustomEmojiChangedTypeID); err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: %w", err) + if err := b.ConsumeID(ChatEventProfileAccentColorChangedTypeID); err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: %w", err) } return c.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (c *ChatEventBackgroundCustomEmojiChanged) DecodeBare(b *bin.Buffer) error { +func (c *ChatEventProfileAccentColorChanged) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a to nil") + return fmt.Errorf("can't decode chatEventProfileAccentColorChanged#a5b8da64 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field old_profile_accent_color_id: %w", err) + } + c.OldProfileAccentColorID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field old_background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field old_profile_background_custom_emoji_id: %w", err) } - c.OldBackgroundCustomEmojiID = value + c.OldProfileBackgroundCustomEmojiID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field new_profile_accent_color_id: %w", err) + } + c.NewProfileAccentColorID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field new_background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field new_profile_background_custom_emoji_id: %w", err) } - c.NewBackgroundCustomEmojiID = value + c.NewProfileBackgroundCustomEmojiID = value } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *ChatEventBackgroundCustomEmojiChanged) EncodeTDLibJSON(b tdjson.Encoder) error { +func (c *ChatEventProfileAccentColorChanged) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + return fmt.Errorf("can't encode chatEventProfileAccentColorChanged#a5b8da64 as nil") } b.ObjStart() - b.PutID("chatEventBackgroundCustomEmojiChanged") + b.PutID("chatEventProfileAccentColorChanged") b.Comma() - b.FieldStart("old_background_custom_emoji_id") - b.PutLong(c.OldBackgroundCustomEmojiID) + b.FieldStart("old_profile_accent_color_id") + b.PutInt32(c.OldProfileAccentColorID) b.Comma() - b.FieldStart("new_background_custom_emoji_id") - b.PutLong(c.NewBackgroundCustomEmojiID) + b.FieldStart("old_profile_background_custom_emoji_id") + b.PutLong(c.OldProfileBackgroundCustomEmojiID) + b.Comma() + b.FieldStart("new_profile_accent_color_id") + b.PutInt32(c.NewProfileAccentColorID) + b.Comma() + b.FieldStart("new_profile_background_custom_emoji_id") + b.PutLong(c.NewProfileBackgroundCustomEmojiID) b.Comma() b.StripComma() b.ObjEnd() @@ -5142,29 +5650,41 @@ func (c *ChatEventBackgroundCustomEmojiChanged) EncodeTDLibJSON(b tdjson.Encoder } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *ChatEventBackgroundCustomEmojiChanged) DecodeTDLibJSON(b tdjson.Decoder) error { +func (c *ChatEventProfileAccentColorChanged) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a to nil") + return fmt.Errorf("can't decode chatEventProfileAccentColorChanged#a5b8da64 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("chatEventBackgroundCustomEmojiChanged"); err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: %w", err) + if err := b.ConsumeID("chatEventProfileAccentColorChanged"); err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: %w", err) } - case "old_background_custom_emoji_id": + case "old_profile_accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field old_profile_accent_color_id: %w", err) + } + c.OldProfileAccentColorID = value + case "old_profile_background_custom_emoji_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field old_background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field old_profile_background_custom_emoji_id: %w", err) } - c.OldBackgroundCustomEmojiID = value - case "new_background_custom_emoji_id": + c.OldProfileBackgroundCustomEmojiID = value + case "new_profile_accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field new_profile_accent_color_id: %w", err) + } + c.NewProfileAccentColorID = value + case "new_profile_background_custom_emoji_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field new_background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chatEventProfileAccentColorChanged#a5b8da64: field new_profile_background_custom_emoji_id: %w", err) } - c.NewBackgroundCustomEmojiID = value + c.NewProfileBackgroundCustomEmojiID = value default: return b.Skip() } @@ -5172,20 +5692,36 @@ func (c *ChatEventBackgroundCustomEmojiChanged) DecodeTDLibJSON(b tdjson.Decoder }) } -// GetOldBackgroundCustomEmojiID returns value of OldBackgroundCustomEmojiID field. -func (c *ChatEventBackgroundCustomEmojiChanged) GetOldBackgroundCustomEmojiID() (value int64) { +// GetOldProfileAccentColorID returns value of OldProfileAccentColorID field. +func (c *ChatEventProfileAccentColorChanged) GetOldProfileAccentColorID() (value int32) { if c == nil { return } - return c.OldBackgroundCustomEmojiID + return c.OldProfileAccentColorID } -// GetNewBackgroundCustomEmojiID returns value of NewBackgroundCustomEmojiID field. -func (c *ChatEventBackgroundCustomEmojiChanged) GetNewBackgroundCustomEmojiID() (value int64) { +// GetOldProfileBackgroundCustomEmojiID returns value of OldProfileBackgroundCustomEmojiID field. +func (c *ChatEventProfileAccentColorChanged) GetOldProfileBackgroundCustomEmojiID() (value int64) { if c == nil { return } - return c.NewBackgroundCustomEmojiID + return c.OldProfileBackgroundCustomEmojiID +} + +// GetNewProfileAccentColorID returns value of NewProfileAccentColorID field. +func (c *ChatEventProfileAccentColorChanged) GetNewProfileAccentColorID() (value int32) { + if c == nil { + return + } + return c.NewProfileAccentColorID +} + +// GetNewProfileBackgroundCustomEmojiID returns value of NewProfileBackgroundCustomEmojiID field. +func (c *ChatEventProfileAccentColorChanged) GetNewProfileBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.NewProfileBackgroundCustomEmojiID } // ChatEventHasProtectedContentToggled represents TL type `chatEventHasProtectedContentToggled#f5044201`. @@ -8725,7 +9261,9 @@ const ChatEventActionClassName = "ChatEventAction" // case *tdapi.ChatEventMemberPromoted: // chatEventMemberPromoted#1f4f6861 // case *tdapi.ChatEventMemberRestricted: // chatEventMemberRestricted#5f951e05 // case *tdapi.ChatEventAvailableReactionsChanged: // chatEventAvailableReactionsChanged#97b8e0bf +// case *tdapi.ChatEventBackgroundChanged: // chatEventBackgroundChanged#b6ed6d38 // case *tdapi.ChatEventDescriptionChanged: // chatEventDescriptionChanged#254cf1e +// case *tdapi.ChatEventEmojiStatusChanged: // chatEventEmojiStatusChanged#83e97b1e // case *tdapi.ChatEventLinkedChatChanged: // chatEventLinkedChatChanged#6b2271af // case *tdapi.ChatEventLocationChanged: // chatEventLocationChanged#e7cdfd4e // case *tdapi.ChatEventMessageAutoDeleteTimeChanged: // chatEventMessageAutoDeleteTimeChanged#1083f24 @@ -8736,8 +9274,8 @@ const ChatEventActionClassName = "ChatEventAction" // case *tdapi.ChatEventTitleChanged: // chatEventTitleChanged#43990ad2 // case *tdapi.ChatEventUsernameChanged: // chatEventUsernameChanged#6707b56b // case *tdapi.ChatEventActiveUsernamesChanged: // chatEventActiveUsernamesChanged#95e54656 -// case *tdapi.ChatEventAccentColorChanged: // chatEventAccentColorChanged#2a327e32 -// case *tdapi.ChatEventBackgroundCustomEmojiChanged: // chatEventBackgroundCustomEmojiChanged#d2671e9a +// case *tdapi.ChatEventAccentColorChanged: // chatEventAccentColorChanged#e6837733 +// case *tdapi.ChatEventProfileAccentColorChanged: // chatEventProfileAccentColorChanged#a5b8da64 // case *tdapi.ChatEventHasProtectedContentToggled: // chatEventHasProtectedContentToggled#f5044201 // case *tdapi.ChatEventInvitesToggled: // chatEventInvitesToggled#fc45966b // case *tdapi.ChatEventIsAllHistoryAvailableToggled: // chatEventIsAllHistoryAvailableToggled#a0b03c15 @@ -8880,6 +9418,13 @@ func DecodeChatEventAction(buf *bin.Buffer) (ChatEventActionClass, error) { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case ChatEventBackgroundChangedTypeID: + // Decoding chatEventBackgroundChanged#b6ed6d38. + v := ChatEventBackgroundChanged{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case ChatEventDescriptionChangedTypeID: // Decoding chatEventDescriptionChanged#254cf1e. v := ChatEventDescriptionChanged{} @@ -8887,6 +9432,13 @@ func DecodeChatEventAction(buf *bin.Buffer) (ChatEventActionClass, error) { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case ChatEventEmojiStatusChangedTypeID: + // Decoding chatEventEmojiStatusChanged#83e97b1e. + v := ChatEventEmojiStatusChanged{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case ChatEventLinkedChatChangedTypeID: // Decoding chatEventLinkedChatChanged#6b2271af. v := ChatEventLinkedChatChanged{} @@ -8958,15 +9510,15 @@ func DecodeChatEventAction(buf *bin.Buffer) (ChatEventActionClass, error) { } return &v, nil case ChatEventAccentColorChangedTypeID: - // Decoding chatEventAccentColorChanged#2a327e32. + // Decoding chatEventAccentColorChanged#e6837733. v := ChatEventAccentColorChanged{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil - case ChatEventBackgroundCustomEmojiChangedTypeID: - // Decoding chatEventBackgroundCustomEmojiChanged#d2671e9a. - v := ChatEventBackgroundCustomEmojiChanged{} + case ChatEventProfileAccentColorChangedTypeID: + // Decoding chatEventProfileAccentColorChanged#a5b8da64. + v := ChatEventProfileAccentColorChanged{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } @@ -9214,6 +9766,13 @@ func DecodeTDLibJSONChatEventAction(buf tdjson.Decoder) (ChatEventActionClass, e return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case "chatEventBackgroundChanged": + // Decoding chatEventBackgroundChanged#b6ed6d38. + v := ChatEventBackgroundChanged{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case "chatEventDescriptionChanged": // Decoding chatEventDescriptionChanged#254cf1e. v := ChatEventDescriptionChanged{} @@ -9221,6 +9780,13 @@ func DecodeTDLibJSONChatEventAction(buf tdjson.Decoder) (ChatEventActionClass, e return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case "chatEventEmojiStatusChanged": + // Decoding chatEventEmojiStatusChanged#83e97b1e. + v := ChatEventEmojiStatusChanged{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case "chatEventLinkedChatChanged": // Decoding chatEventLinkedChatChanged#6b2271af. v := ChatEventLinkedChatChanged{} @@ -9292,15 +9858,15 @@ func DecodeTDLibJSONChatEventAction(buf tdjson.Decoder) (ChatEventActionClass, e } return &v, nil case "chatEventAccentColorChanged": - // Decoding chatEventAccentColorChanged#2a327e32. + // Decoding chatEventAccentColorChanged#e6837733. v := ChatEventAccentColorChanged{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil - case "chatEventBackgroundCustomEmojiChanged": - // Decoding chatEventBackgroundCustomEmojiChanged#d2671e9a. - v := ChatEventBackgroundCustomEmojiChanged{} + case "chatEventProfileAccentColorChanged": + // Decoding chatEventProfileAccentColorChanged#a5b8da64. + v := ChatEventProfileAccentColorChanged{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } diff --git a/tdapi/tl_chat_gen.go b/tdapi/tl_chat_gen.go index ab8fc3ae4e..f882902ba2 100644 --- a/tdapi/tl_chat_gen.go +++ b/tdapi/tl_chat_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Chat represents TL type `chat#4dd64d7d`. +// Chat represents TL type `chat#70f33afe`. type Chat struct { // Chat unique identifier ID int64 @@ -44,9 +44,14 @@ type Chat struct { // Identifier of the accent color for message sender name, and backgrounds of chat photo, // reply header, and link preview AccentColorID int32 - // Identifier of a custom emoji to be shown on the reply header background in replies to - // messages sent by the chat; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview + // background for messages sent by the chat; 0 if none BackgroundCustomEmojiID int64 + // Identifier of the profile accent color for the chat's profile; -1 if none + ProfileAccentColorID int32 + // Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if + // none + ProfileBackgroundCustomEmojiID int64 // Actions that non-administrator chat members are allowed to take in the chat Permissions ChatPermissions // Last message in the chat; may be null if none or unknown @@ -98,6 +103,8 @@ type Chat struct { // if disabled. Self-destruct timer in secret chats starts after the message or its // content is viewed. Auto-delete timer in other chats starts from the send date MessageAutoDeleteTime int32 + // Emoji status to be shown along with chat title; may be null + EmojiStatus EmojiStatus // Background set for the chat; may be null if none Background ChatBackground // If non-empty, name of a theme, set for the chat @@ -121,7 +128,7 @@ type Chat struct { } // ChatTypeID is TL type id of Chat. -const ChatTypeID = 0x4dd64d7d +const ChatTypeID = 0x70f33afe // Ensuring interfaces in compile-time for Chat. var ( @@ -153,6 +160,12 @@ func (c *Chat) Zero() bool { if !(c.BackgroundCustomEmojiID == 0) { return false } + if !(c.ProfileAccentColorID == 0) { + return false + } + if !(c.ProfileBackgroundCustomEmojiID == 0) { + return false + } if !(c.Permissions.Zero()) { return false } @@ -219,6 +232,9 @@ func (c *Chat) Zero() bool { if !(c.MessageAutoDeleteTime == 0) { return false } + if !(c.EmojiStatus.Zero()) { + return false + } if !(c.Background.Zero()) { return false } @@ -303,6 +319,14 @@ func (c *Chat) TypeInfo() tdp.Type { Name: "BackgroundCustomEmojiID", SchemaName: "background_custom_emoji_id", }, + { + Name: "ProfileAccentColorID", + SchemaName: "profile_accent_color_id", + }, + { + Name: "ProfileBackgroundCustomEmojiID", + SchemaName: "profile_background_custom_emoji_id", + }, { Name: "Permissions", SchemaName: "permissions", @@ -391,6 +415,10 @@ func (c *Chat) TypeInfo() tdp.Type { Name: "MessageAutoDeleteTime", SchemaName: "message_auto_delete_time", }, + { + Name: "EmojiStatus", + SchemaName: "emoji_status", + }, { Name: "Background", SchemaName: "background", @@ -430,7 +458,7 @@ func (c *Chat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *Chat) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chat#4dd64d7d as nil") + return fmt.Errorf("can't encode chat#70f33afe as nil") } b.PutID(ChatTypeID) return c.EncodeBare(b) @@ -439,44 +467,46 @@ func (c *Chat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Chat) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chat#4dd64d7d as nil") + return fmt.Errorf("can't encode chat#70f33afe as nil") } b.PutInt53(c.ID) if c.Type == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field type is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field type is nil") } if err := c.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field type: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field type: %w", err) } b.PutString(c.Title) if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field photo: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field photo: %w", err) } b.PutInt32(c.AccentColorID) b.PutLong(c.BackgroundCustomEmojiID) + b.PutInt32(c.ProfileAccentColorID) + b.PutLong(c.ProfileBackgroundCustomEmojiID) if err := c.Permissions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field permissions: %w", err) } if err := c.LastMessage.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field last_message: %w", err) } b.PutInt(len(c.Positions)) for idx, v := range c.Positions { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare chat#4dd64d7d: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare chat#70f33afe: field positions element with index %d: %w", idx, err) } } if c.MessageSenderID == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field message_sender_id is nil") } if err := c.MessageSenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field message_sender_id: %w", err) } if c.BlockList == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field block_list is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field block_list is nil") } if err := c.BlockList.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field block_list: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field block_list: %w", err) } b.PutBool(c.HasProtectedContent) b.PutBool(c.IsTranslatable) @@ -493,34 +523,37 @@ func (c *Chat) EncodeBare(b *bin.Buffer) error { b.PutInt32(c.UnreadMentionCount) b.PutInt32(c.UnreadReactionCount) if err := c.NotificationSettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field notification_settings: %w", err) } if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field available_reactions is nil") } if err := c.AvailableReactions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field available_reactions: %w", err) } b.PutInt32(c.MessageAutoDeleteTime) + if err := c.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode chat#70f33afe: field emoji_status: %w", err) + } if err := c.Background.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field background: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field background: %w", err) } b.PutString(c.ThemeName) if c.ActionBar == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field action_bar is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field action_bar is nil") } if err := c.ActionBar.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field action_bar: %w", err) } if err := c.VideoChat.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field video_chat: %w", err) } if err := c.PendingJoinRequests.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field pending_join_requests: %w", err) } b.PutInt53(c.ReplyMarkupMessageID) if err := c.DraftMessage.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field draft_message: %w", err) } b.PutString(c.ClientData) return nil @@ -529,10 +562,10 @@ func (c *Chat) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *Chat) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chat#4dd64d7d to nil") + return fmt.Errorf("can't decode chat#70f33afe to nil") } if err := b.ConsumeID(ChatTypeID); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: %w", err) } return c.DecodeBare(b) } @@ -540,62 +573,76 @@ func (c *Chat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *Chat) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chat#4dd64d7d to nil") + return fmt.Errorf("can't decode chat#70f33afe to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field id: %w", err) } c.ID = value } { value, err := DecodeChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field type: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field type: %w", err) } c.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field title: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field title: %w", err) } c.Title = value } { if err := c.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field photo: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field photo: %w", err) } } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field accent_color_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field accent_color_id: %w", err) } c.AccentColorID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field background_custom_emoji_id: %w", err) } c.BackgroundCustomEmojiID = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field profile_accent_color_id: %w", err) + } + c.ProfileAccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field profile_background_custom_emoji_id: %w", err) + } + c.ProfileBackgroundCustomEmojiID = value + } { if err := c.Permissions.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field permissions: %w", err) } } { if err := c.LastMessage.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_message: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field positions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field positions: %w", err) } if headerLen > 0 { @@ -604,7 +651,7 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value ChatPosition if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare chat#4dd64d7d: field positions: %w", err) + return fmt.Errorf("unable to decode bare chat#70f33afe: field positions: %w", err) } c.Positions = append(c.Positions, value) } @@ -612,179 +659,184 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field message_sender_id: %w", err) } c.MessageSenderID = value } { value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field block_list: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field block_list: %w", err) } c.BlockList = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field has_protected_content: %w", err) } c.HasProtectedContent = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field is_translatable: %w", err) } c.IsTranslatable = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field is_marked_as_unread: %w", err) } c.IsMarkedAsUnread = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field view_as_topics: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field view_as_topics: %w", err) } c.ViewAsTopics = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field has_scheduled_messages: %w", err) } c.HasScheduledMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_deleted_only_for_self: %w", err) } c.CanBeDeletedOnlyForSelf = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_deleted_for_all_users: %w", err) } c.CanBeDeletedForAllUsers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_reported: %w", err) } c.CanBeReported = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field default_disable_notification: %w", err) } c.DefaultDisableNotification = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_count: %w", err) } c.UnreadCount = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_read_inbox_message_id: %w", err) } c.LastReadInboxMessageID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_read_outbox_message_id: %w", err) } c.LastReadOutboxMessageID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_mention_count: %w", err) } c.UnreadMentionCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_reaction_count: %w", err) } c.UnreadReactionCount = value } { if err := c.NotificationSettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field notification_settings: %w", err) } } { value, err := DecodeChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field available_reactions: %w", err) } c.AvailableReactions = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field message_auto_delete_time: %w", err) } c.MessageAutoDeleteTime = value } + { + if err := c.EmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field emoji_status: %w", err) + } + } { if err := c.Background.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field background: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field background: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field theme_name: %w", err) } c.ThemeName = value } { value, err := DecodeChatActionBar(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field action_bar: %w", err) } c.ActionBar = value } { if err := c.VideoChat.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field video_chat: %w", err) } } { if err := c.PendingJoinRequests.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field pending_join_requests: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field reply_markup_message_id: %w", err) } c.ReplyMarkupMessageID = value } { if err := c.DraftMessage.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field draft_message: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field client_data: %w", err) } c.ClientData = value } @@ -794,7 +846,7 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chat#4dd64d7d as nil") + return fmt.Errorf("can't encode chat#70f33afe as nil") } b.ObjStart() b.PutID("chat") @@ -804,10 +856,10 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("type") if c.Type == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field type is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field type is nil") } if err := c.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field type: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field type: %w", err) } b.Comma() b.FieldStart("title") @@ -815,7 +867,7 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("photo") if err := c.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field photo: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field photo: %w", err) } b.Comma() b.FieldStart("accent_color_id") @@ -824,21 +876,27 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("background_custom_emoji_id") b.PutLong(c.BackgroundCustomEmojiID) b.Comma() + b.FieldStart("profile_accent_color_id") + b.PutInt32(c.ProfileAccentColorID) + b.Comma() + b.FieldStart("profile_background_custom_emoji_id") + b.PutLong(c.ProfileBackgroundCustomEmojiID) + b.Comma() b.FieldStart("permissions") if err := c.Permissions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field permissions: %w", err) } b.Comma() b.FieldStart("last_message") if err := c.LastMessage.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field last_message: %w", err) } b.Comma() b.FieldStart("positions") b.ArrStart() for idx, v := range c.Positions { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode chat#70f33afe: field positions element with index %d: %w", idx, err) } b.Comma() } @@ -847,18 +905,18 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("message_sender_id") if c.MessageSenderID == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field message_sender_id is nil") } if err := c.MessageSenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field message_sender_id: %w", err) } b.Comma() b.FieldStart("block_list") if c.BlockList == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field block_list is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field block_list is nil") } if err := c.BlockList.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field block_list: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field block_list: %w", err) } b.Comma() b.FieldStart("has_protected_content") @@ -905,23 +963,28 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("notification_settings") if err := c.NotificationSettings.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field notification_settings: %w", err) } b.Comma() b.FieldStart("available_reactions") if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field available_reactions is nil") } if err := c.AvailableReactions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field available_reactions: %w", err) } b.Comma() b.FieldStart("message_auto_delete_time") b.PutInt32(c.MessageAutoDeleteTime) b.Comma() + b.FieldStart("emoji_status") + if err := c.EmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chat#70f33afe: field emoji_status: %w", err) + } + b.Comma() b.FieldStart("background") if err := c.Background.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field background: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field background: %w", err) } b.Comma() b.FieldStart("theme_name") @@ -929,20 +992,20 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("action_bar") if c.ActionBar == nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field action_bar is nil") + return fmt.Errorf("unable to encode chat#70f33afe: field action_bar is nil") } if err := c.ActionBar.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field action_bar: %w", err) } b.Comma() b.FieldStart("video_chat") if err := c.VideoChat.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field video_chat: %w", err) } b.Comma() b.FieldStart("pending_join_requests") if err := c.PendingJoinRequests.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field pending_join_requests: %w", err) } b.Comma() b.FieldStart("reply_markup_message_id") @@ -950,7 +1013,7 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("draft_message") if err := c.DraftMessage.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#4dd64d7d: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#70f33afe: field draft_message: %w", err) } b.Comma() b.FieldStart("client_data") @@ -964,218 +1027,234 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *Chat) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chat#4dd64d7d to nil") + return fmt.Errorf("can't decode chat#70f33afe to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("chat"); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field id: %w", err) } c.ID = value case "type": value, err := DecodeTDLibJSONChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field type: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field type: %w", err) } c.Type = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field title: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field title: %w", err) } c.Title = value case "photo": if err := c.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field photo: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field photo: %w", err) } case "accent_color_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field accent_color_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field accent_color_id: %w", err) } c.AccentColorID = value case "background_custom_emoji_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field background_custom_emoji_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field background_custom_emoji_id: %w", err) } c.BackgroundCustomEmojiID = value + case "profile_accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field profile_accent_color_id: %w", err) + } + c.ProfileAccentColorID = value + case "profile_background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field profile_background_custom_emoji_id: %w", err) + } + c.ProfileBackgroundCustomEmojiID = value case "permissions": if err := c.Permissions.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field permissions: %w", err) } case "last_message": if err := c.LastMessage.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_message: %w", err) } case "positions": if err := b.Arr(func(b tdjson.Decoder) error { var value ChatPosition if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field positions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field positions: %w", err) } c.Positions = append(c.Positions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field positions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field positions: %w", err) } case "message_sender_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field message_sender_id: %w", err) } c.MessageSenderID = value case "block_list": value, err := DecodeTDLibJSONBlockList(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field block_list: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field block_list: %w", err) } c.BlockList = value case "has_protected_content": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field has_protected_content: %w", err) } c.HasProtectedContent = value case "is_translatable": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field is_translatable: %w", err) } c.IsTranslatable = value case "is_marked_as_unread": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field is_marked_as_unread: %w", err) } c.IsMarkedAsUnread = value case "view_as_topics": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field view_as_topics: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field view_as_topics: %w", err) } c.ViewAsTopics = value case "has_scheduled_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field has_scheduled_messages: %w", err) } c.HasScheduledMessages = value case "can_be_deleted_only_for_self": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_deleted_only_for_self: %w", err) } c.CanBeDeletedOnlyForSelf = value case "can_be_deleted_for_all_users": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_deleted_for_all_users: %w", err) } c.CanBeDeletedForAllUsers = value case "can_be_reported": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field can_be_reported: %w", err) } c.CanBeReported = value case "default_disable_notification": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field default_disable_notification: %w", err) } c.DefaultDisableNotification = value case "unread_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_count: %w", err) } c.UnreadCount = value case "last_read_inbox_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_read_inbox_message_id: %w", err) } c.LastReadInboxMessageID = value case "last_read_outbox_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field last_read_outbox_message_id: %w", err) } c.LastReadOutboxMessageID = value case "unread_mention_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_mention_count: %w", err) } c.UnreadMentionCount = value case "unread_reaction_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field unread_reaction_count: %w", err) } c.UnreadReactionCount = value case "notification_settings": if err := c.NotificationSettings.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field notification_settings: %w", err) } case "available_reactions": value, err := DecodeTDLibJSONChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field available_reactions: %w", err) } c.AvailableReactions = value case "message_auto_delete_time": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field message_auto_delete_time: %w", err) } c.MessageAutoDeleteTime = value + case "emoji_status": + if err := c.EmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chat#70f33afe: field emoji_status: %w", err) + } case "background": if err := c.Background.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field background: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field background: %w", err) } case "theme_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field theme_name: %w", err) } c.ThemeName = value case "action_bar": value, err := DecodeTDLibJSONChatActionBar(b) if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field action_bar: %w", err) } c.ActionBar = value case "video_chat": if err := c.VideoChat.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field video_chat: %w", err) } case "pending_join_requests": if err := c.PendingJoinRequests.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field pending_join_requests: %w", err) } case "reply_markup_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field reply_markup_message_id: %w", err) } c.ReplyMarkupMessageID = value case "draft_message": if err := c.DraftMessage.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field draft_message: %w", err) } case "client_data": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#4dd64d7d: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#70f33afe: field client_data: %w", err) } c.ClientData = value default: @@ -1233,6 +1312,22 @@ func (c *Chat) GetBackgroundCustomEmojiID() (value int64) { return c.BackgroundCustomEmojiID } +// GetProfileAccentColorID returns value of ProfileAccentColorID field. +func (c *Chat) GetProfileAccentColorID() (value int32) { + if c == nil { + return + } + return c.ProfileAccentColorID +} + +// GetProfileBackgroundCustomEmojiID returns value of ProfileBackgroundCustomEmojiID field. +func (c *Chat) GetProfileBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.ProfileBackgroundCustomEmojiID +} + // GetPermissions returns value of Permissions field. func (c *Chat) GetPermissions() (value ChatPermissions) { if c == nil { @@ -1409,6 +1504,14 @@ func (c *Chat) GetMessageAutoDeleteTime() (value int32) { return c.MessageAutoDeleteTime } +// GetEmojiStatus returns value of EmojiStatus field. +func (c *Chat) GetEmojiStatus() (value EmojiStatus) { + if c == nil { + return + } + return c.EmojiStatus +} + // GetBackground returns value of Background field. func (c *Chat) GetBackground() (value ChatBackground) { if c == nil { diff --git a/tdapi/tl_chat_permissions_gen.go b/tdapi/tl_chat_permissions_gen.go index 6effc04a7d..1adaf78edf 100644 --- a/tdapi/tl_chat_permissions_gen.go +++ b/tdapi/tl_chat_permissions_gen.go @@ -33,8 +33,8 @@ var ( // ChatPermissions represents TL type `chatPermissions#af3b61cb`. type ChatPermissions struct { - // True, if the user can send text messages, contacts, giveaways, invoices, locations, - // and venues + // True, if the user can send text messages, contacts, giveaways, giveaway winners, + // invoices, locations, and venues CanSendBasicMessages bool // True, if the user can send music files CanSendAudios bool diff --git a/tdapi/tl_delete_default_background_gen.go b/tdapi/tl_delete_default_background_gen.go new file mode 100644 index 0000000000..63c26b154a --- /dev/null +++ b/tdapi/tl_delete_default_background_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{} +) + +// DeleteDefaultBackgroundRequest represents TL type `deleteDefaultBackground#b2a4ed3e`. +type DeleteDefaultBackgroundRequest struct { + // Pass true if the background is deleted for a dark theme + ForDarkTheme bool +} + +// DeleteDefaultBackgroundRequestTypeID is TL type id of DeleteDefaultBackgroundRequest. +const DeleteDefaultBackgroundRequestTypeID = 0xb2a4ed3e + +// Ensuring interfaces in compile-time for DeleteDefaultBackgroundRequest. +var ( + _ bin.Encoder = &DeleteDefaultBackgroundRequest{} + _ bin.Decoder = &DeleteDefaultBackgroundRequest{} + _ bin.BareEncoder = &DeleteDefaultBackgroundRequest{} + _ bin.BareDecoder = &DeleteDefaultBackgroundRequest{} +) + +func (d *DeleteDefaultBackgroundRequest) Zero() bool { + if d == nil { + return true + } + if !(d.ForDarkTheme == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (d *DeleteDefaultBackgroundRequest) String() string { + if d == nil { + return "DeleteDefaultBackgroundRequest(nil)" + } + type Alias DeleteDefaultBackgroundRequest + return fmt.Sprintf("DeleteDefaultBackgroundRequest%+v", Alias(*d)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*DeleteDefaultBackgroundRequest) TypeID() uint32 { + return DeleteDefaultBackgroundRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*DeleteDefaultBackgroundRequest) TypeName() string { + return "deleteDefaultBackground" +} + +// TypeInfo returns info about TL type. +func (d *DeleteDefaultBackgroundRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "deleteDefaultBackground", + ID: DeleteDefaultBackgroundRequestTypeID, + } + if d == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ForDarkTheme", + SchemaName: "for_dark_theme", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (d *DeleteDefaultBackgroundRequest) Encode(b *bin.Buffer) error { + if d == nil { + return fmt.Errorf("can't encode deleteDefaultBackground#b2a4ed3e as nil") + } + b.PutID(DeleteDefaultBackgroundRequestTypeID) + return d.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (d *DeleteDefaultBackgroundRequest) EncodeBare(b *bin.Buffer) error { + if d == nil { + return fmt.Errorf("can't encode deleteDefaultBackground#b2a4ed3e as nil") + } + b.PutBool(d.ForDarkTheme) + return nil +} + +// Decode implements bin.Decoder. +func (d *DeleteDefaultBackgroundRequest) Decode(b *bin.Buffer) error { + if d == nil { + return fmt.Errorf("can't decode deleteDefaultBackground#b2a4ed3e to nil") + } + if err := b.ConsumeID(DeleteDefaultBackgroundRequestTypeID); err != nil { + return fmt.Errorf("unable to decode deleteDefaultBackground#b2a4ed3e: %w", err) + } + return d.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (d *DeleteDefaultBackgroundRequest) DecodeBare(b *bin.Buffer) error { + if d == nil { + return fmt.Errorf("can't decode deleteDefaultBackground#b2a4ed3e to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode deleteDefaultBackground#b2a4ed3e: field for_dark_theme: %w", err) + } + d.ForDarkTheme = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (d *DeleteDefaultBackgroundRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if d == nil { + return fmt.Errorf("can't encode deleteDefaultBackground#b2a4ed3e as nil") + } + b.ObjStart() + b.PutID("deleteDefaultBackground") + b.Comma() + b.FieldStart("for_dark_theme") + b.PutBool(d.ForDarkTheme) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (d *DeleteDefaultBackgroundRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if d == nil { + return fmt.Errorf("can't decode deleteDefaultBackground#b2a4ed3e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("deleteDefaultBackground"); err != nil { + return fmt.Errorf("unable to decode deleteDefaultBackground#b2a4ed3e: %w", err) + } + case "for_dark_theme": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode deleteDefaultBackground#b2a4ed3e: field for_dark_theme: %w", err) + } + d.ForDarkTheme = value + default: + return b.Skip() + } + return nil + }) +} + +// GetForDarkTheme returns value of ForDarkTheme field. +func (d *DeleteDefaultBackgroundRequest) GetForDarkTheme() (value bool) { + if d == nil { + return + } + return d.ForDarkTheme +} + +// DeleteDefaultBackground invokes method deleteDefaultBackground#b2a4ed3e returning error if any. +func (c *Client) DeleteDefaultBackground(ctx context.Context, fordarktheme bool) error { + var ok Ok + + request := &DeleteDefaultBackgroundRequest{ + ForDarkTheme: fordarktheme, + } + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_get_background_url_gen.go b/tdapi/tl_get_background_url_gen.go index cd7b28f60a..f74cdb53ed 100644 --- a/tdapi/tl_get_background_url_gen.go +++ b/tdapi/tl_get_background_url_gen.go @@ -35,7 +35,7 @@ var ( type GetBackgroundURLRequest struct { // Background name Name string - // Background type + // Background type; backgroundTypeChatTheme isn't supported Type BackgroundTypeClass } diff --git a/tdapi/tl_get_backgrounds_gen.go b/tdapi/tl_get_backgrounds_gen.go deleted file mode 100644 index 800973aba4..0000000000 --- a/tdapi/tl_get_backgrounds_gen.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// GetBackgroundsRequest represents TL type `getBackgrounds#ed88bf9`. -type GetBackgroundsRequest struct { - // Pass true to order returned backgrounds for a dark theme - ForDarkTheme bool -} - -// GetBackgroundsRequestTypeID is TL type id of GetBackgroundsRequest. -const GetBackgroundsRequestTypeID = 0xed88bf9 - -// Ensuring interfaces in compile-time for GetBackgroundsRequest. -var ( - _ bin.Encoder = &GetBackgroundsRequest{} - _ bin.Decoder = &GetBackgroundsRequest{} - _ bin.BareEncoder = &GetBackgroundsRequest{} - _ bin.BareDecoder = &GetBackgroundsRequest{} -) - -func (g *GetBackgroundsRequest) Zero() bool { - if g == nil { - return true - } - if !(g.ForDarkTheme == false) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (g *GetBackgroundsRequest) String() string { - if g == nil { - return "GetBackgroundsRequest(nil)" - } - type Alias GetBackgroundsRequest - return fmt.Sprintf("GetBackgroundsRequest%+v", Alias(*g)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*GetBackgroundsRequest) TypeID() uint32 { - return GetBackgroundsRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*GetBackgroundsRequest) TypeName() string { - return "getBackgrounds" -} - -// TypeInfo returns info about TL type. -func (g *GetBackgroundsRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "getBackgrounds", - ID: GetBackgroundsRequestTypeID, - } - if g == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ForDarkTheme", - SchemaName: "for_dark_theme", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (g *GetBackgroundsRequest) Encode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode getBackgrounds#ed88bf9 as nil") - } - b.PutID(GetBackgroundsRequestTypeID) - return g.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (g *GetBackgroundsRequest) EncodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode getBackgrounds#ed88bf9 as nil") - } - b.PutBool(g.ForDarkTheme) - return nil -} - -// Decode implements bin.Decoder. -func (g *GetBackgroundsRequest) Decode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode getBackgrounds#ed88bf9 to nil") - } - if err := b.ConsumeID(GetBackgroundsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getBackgrounds#ed88bf9: %w", err) - } - return g.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (g *GetBackgroundsRequest) DecodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode getBackgrounds#ed88bf9 to nil") - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getBackgrounds#ed88bf9: field for_dark_theme: %w", err) - } - g.ForDarkTheme = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (g *GetBackgroundsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if g == nil { - return fmt.Errorf("can't encode getBackgrounds#ed88bf9 as nil") - } - b.ObjStart() - b.PutID("getBackgrounds") - b.Comma() - b.FieldStart("for_dark_theme") - b.PutBool(g.ForDarkTheme) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (g *GetBackgroundsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if g == nil { - return fmt.Errorf("can't decode getBackgrounds#ed88bf9 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("getBackgrounds"); err != nil { - return fmt.Errorf("unable to decode getBackgrounds#ed88bf9: %w", err) - } - case "for_dark_theme": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getBackgrounds#ed88bf9: field for_dark_theme: %w", err) - } - g.ForDarkTheme = value - default: - return b.Skip() - } - return nil - }) -} - -// GetForDarkTheme returns value of ForDarkTheme field. -func (g *GetBackgroundsRequest) GetForDarkTheme() (value bool) { - if g == nil { - return - } - return g.ForDarkTheme -} - -// GetBackgrounds invokes method getBackgrounds#ed88bf9 returning error if any. -func (c *Client) GetBackgrounds(ctx context.Context, fordarktheme bool) (*Backgrounds, error) { - var result Backgrounds - - request := &GetBackgroundsRequest{ - ForDarkTheme: fordarktheme, - } - if err := c.rpc.Invoke(ctx, request, &result); err != nil { - return nil, err - } - return &result, nil -} diff --git a/tdapi/tl_get_chat_boost_features_gen.go b/tdapi/tl_get_chat_boost_features_gen.go new file mode 100644 index 0000000000..537f6edcc9 --- /dev/null +++ b/tdapi/tl_get_chat_boost_features_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetChatBoostFeaturesRequest represents TL type `getChatBoostFeatures#34e76822`. +type GetChatBoostFeaturesRequest struct { +} + +// GetChatBoostFeaturesRequestTypeID is TL type id of GetChatBoostFeaturesRequest. +const GetChatBoostFeaturesRequestTypeID = 0x34e76822 + +// Ensuring interfaces in compile-time for GetChatBoostFeaturesRequest. +var ( + _ bin.Encoder = &GetChatBoostFeaturesRequest{} + _ bin.Decoder = &GetChatBoostFeaturesRequest{} + _ bin.BareEncoder = &GetChatBoostFeaturesRequest{} + _ bin.BareDecoder = &GetChatBoostFeaturesRequest{} +) + +func (g *GetChatBoostFeaturesRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetChatBoostFeaturesRequest) String() string { + if g == nil { + return "GetChatBoostFeaturesRequest(nil)" + } + type Alias GetChatBoostFeaturesRequest + return fmt.Sprintf("GetChatBoostFeaturesRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetChatBoostFeaturesRequest) TypeID() uint32 { + return GetChatBoostFeaturesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetChatBoostFeaturesRequest) TypeName() string { + return "getChatBoostFeatures" +} + +// TypeInfo returns info about TL type. +func (g *GetChatBoostFeaturesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getChatBoostFeatures", + ID: GetChatBoostFeaturesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetChatBoostFeaturesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostFeatures#34e76822 as nil") + } + b.PutID(GetChatBoostFeaturesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetChatBoostFeaturesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostFeatures#34e76822 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetChatBoostFeaturesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostFeatures#34e76822 to nil") + } + if err := b.ConsumeID(GetChatBoostFeaturesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getChatBoostFeatures#34e76822: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetChatBoostFeaturesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostFeatures#34e76822 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetChatBoostFeaturesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostFeatures#34e76822 as nil") + } + b.ObjStart() + b.PutID("getChatBoostFeatures") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetChatBoostFeaturesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostFeatures#34e76822 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getChatBoostFeatures"); err != nil { + return fmt.Errorf("unable to decode getChatBoostFeatures#34e76822: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatBoostFeatures invokes method getChatBoostFeatures#34e76822 returning error if any. +func (c *Client) GetChatBoostFeatures(ctx context.Context) (*ChatBoostFeatures, error) { + var result ChatBoostFeatures + + request := &GetChatBoostFeaturesRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_chat_boost_level_features_gen.go b/tdapi/tl_get_chat_boost_level_features_gen.go new file mode 100644 index 0000000000..f0626a0c97 --- /dev/null +++ b/tdapi/tl_get_chat_boost_level_features_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{} +) + +// GetChatBoostLevelFeaturesRequest represents TL type `getChatBoostLevelFeatures#71f15dfb`. +type GetChatBoostLevelFeaturesRequest struct { + // Chat boost level + Level int32 +} + +// GetChatBoostLevelFeaturesRequestTypeID is TL type id of GetChatBoostLevelFeaturesRequest. +const GetChatBoostLevelFeaturesRequestTypeID = 0x71f15dfb + +// Ensuring interfaces in compile-time for GetChatBoostLevelFeaturesRequest. +var ( + _ bin.Encoder = &GetChatBoostLevelFeaturesRequest{} + _ bin.Decoder = &GetChatBoostLevelFeaturesRequest{} + _ bin.BareEncoder = &GetChatBoostLevelFeaturesRequest{} + _ bin.BareDecoder = &GetChatBoostLevelFeaturesRequest{} +) + +func (g *GetChatBoostLevelFeaturesRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Level == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetChatBoostLevelFeaturesRequest) String() string { + if g == nil { + return "GetChatBoostLevelFeaturesRequest(nil)" + } + type Alias GetChatBoostLevelFeaturesRequest + return fmt.Sprintf("GetChatBoostLevelFeaturesRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetChatBoostLevelFeaturesRequest) TypeID() uint32 { + return GetChatBoostLevelFeaturesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetChatBoostLevelFeaturesRequest) TypeName() string { + return "getChatBoostLevelFeatures" +} + +// TypeInfo returns info about TL type. +func (g *GetChatBoostLevelFeaturesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getChatBoostLevelFeatures", + ID: GetChatBoostLevelFeaturesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Level", + SchemaName: "level", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetChatBoostLevelFeaturesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostLevelFeatures#71f15dfb as nil") + } + b.PutID(GetChatBoostLevelFeaturesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetChatBoostLevelFeaturesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostLevelFeatures#71f15dfb as nil") + } + b.PutInt32(g.Level) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetChatBoostLevelFeaturesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostLevelFeatures#71f15dfb to nil") + } + if err := b.ConsumeID(GetChatBoostLevelFeaturesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getChatBoostLevelFeatures#71f15dfb: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetChatBoostLevelFeaturesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostLevelFeatures#71f15dfb to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatBoostLevelFeatures#71f15dfb: field level: %w", err) + } + g.Level = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetChatBoostLevelFeaturesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getChatBoostLevelFeatures#71f15dfb as nil") + } + b.ObjStart() + b.PutID("getChatBoostLevelFeatures") + b.Comma() + b.FieldStart("level") + b.PutInt32(g.Level) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetChatBoostLevelFeaturesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getChatBoostLevelFeatures#71f15dfb to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getChatBoostLevelFeatures"); err != nil { + return fmt.Errorf("unable to decode getChatBoostLevelFeatures#71f15dfb: %w", err) + } + case "level": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatBoostLevelFeatures#71f15dfb: field level: %w", err) + } + g.Level = value + default: + return b.Skip() + } + return nil + }) +} + +// GetLevel returns value of Level field. +func (g *GetChatBoostLevelFeaturesRequest) GetLevel() (value int32) { + if g == nil { + return + } + return g.Level +} + +// GetChatBoostLevelFeatures invokes method getChatBoostLevelFeatures#71f15dfb returning error if any. +func (c *Client) GetChatBoostLevelFeatures(ctx context.Context, level int32) (*ChatBoostLevelFeatures, error) { + var result ChatBoostLevelFeatures + + request := &GetChatBoostLevelFeaturesRequest{ + Level: level, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_chat_story_interactions_gen.go b/tdapi/tl_get_chat_story_interactions_gen.go new file mode 100644 index 0000000000..590b0ee82d --- /dev/null +++ b/tdapi/tl_get_chat_story_interactions_gen.go @@ -0,0 +1,386 @@ +// 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{} +) + +// GetChatStoryInteractionsRequest represents TL type `getChatStoryInteractions#c5ec7376`. +type GetChatStoryInteractionsRequest struct { + // The identifier of the sender of the story + StorySenderChatID int64 + // Story identifier + StoryID int32 + // Pass the default heart reaction or a suggested reaction type to receive only + // interactions with the specified reaction type; pass null to receive all interactions + ReactionType ReactionTypeClass + // Pass true to get forwards and reposts first, then reactions, then other views; pass + // false to get interactions sorted just by interaction date + PreferForwards bool + // Offset of the first entry to return as received from the previous request; use empty + // string to get the first chunk of results + Offset string + // The maximum number of story interactions to return + Limit int32 +} + +// GetChatStoryInteractionsRequestTypeID is TL type id of GetChatStoryInteractionsRequest. +const GetChatStoryInteractionsRequestTypeID = 0xc5ec7376 + +// Ensuring interfaces in compile-time for GetChatStoryInteractionsRequest. +var ( + _ bin.Encoder = &GetChatStoryInteractionsRequest{} + _ bin.Decoder = &GetChatStoryInteractionsRequest{} + _ bin.BareEncoder = &GetChatStoryInteractionsRequest{} + _ bin.BareDecoder = &GetChatStoryInteractionsRequest{} +) + +func (g *GetChatStoryInteractionsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.StorySenderChatID == 0) { + return false + } + if !(g.StoryID == 0) { + return false + } + if !(g.ReactionType == nil) { + return false + } + if !(g.PreferForwards == false) { + return false + } + if !(g.Offset == "") { + return false + } + if !(g.Limit == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetChatStoryInteractionsRequest) String() string { + if g == nil { + return "GetChatStoryInteractionsRequest(nil)" + } + type Alias GetChatStoryInteractionsRequest + return fmt.Sprintf("GetChatStoryInteractionsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetChatStoryInteractionsRequest) TypeID() uint32 { + return GetChatStoryInteractionsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetChatStoryInteractionsRequest) TypeName() string { + return "getChatStoryInteractions" +} + +// TypeInfo returns info about TL type. +func (g *GetChatStoryInteractionsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getChatStoryInteractions", + ID: GetChatStoryInteractionsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StorySenderChatID", + SchemaName: "story_sender_chat_id", + }, + { + Name: "StoryID", + SchemaName: "story_id", + }, + { + Name: "ReactionType", + SchemaName: "reaction_type", + }, + { + Name: "PreferForwards", + SchemaName: "prefer_forwards", + }, + { + Name: "Offset", + SchemaName: "offset", + }, + { + Name: "Limit", + SchemaName: "limit", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetChatStoryInteractionsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatStoryInteractions#c5ec7376 as nil") + } + b.PutID(GetChatStoryInteractionsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetChatStoryInteractionsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getChatStoryInteractions#c5ec7376 as nil") + } + b.PutInt53(g.StorySenderChatID) + b.PutInt32(g.StoryID) + if g.ReactionType == nil { + return fmt.Errorf("unable to encode getChatStoryInteractions#c5ec7376: field reaction_type is nil") + } + if err := g.ReactionType.Encode(b); err != nil { + return fmt.Errorf("unable to encode getChatStoryInteractions#c5ec7376: field reaction_type: %w", err) + } + b.PutBool(g.PreferForwards) + b.PutString(g.Offset) + b.PutInt32(g.Limit) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetChatStoryInteractionsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatStoryInteractions#c5ec7376 to nil") + } + if err := b.ConsumeID(GetChatStoryInteractionsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetChatStoryInteractionsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getChatStoryInteractions#c5ec7376 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field story_sender_chat_id: %w", err) + } + g.StorySenderChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field story_id: %w", err) + } + g.StoryID = value + } + { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field reaction_type: %w", err) + } + g.ReactionType = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field prefer_forwards: %w", err) + } + g.PreferForwards = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field offset: %w", err) + } + g.Offset = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field limit: %w", err) + } + g.Limit = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetChatStoryInteractionsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getChatStoryInteractions#c5ec7376 as nil") + } + b.ObjStart() + b.PutID("getChatStoryInteractions") + b.Comma() + b.FieldStart("story_sender_chat_id") + b.PutInt53(g.StorySenderChatID) + b.Comma() + b.FieldStart("story_id") + b.PutInt32(g.StoryID) + b.Comma() + b.FieldStart("reaction_type") + if g.ReactionType == nil { + return fmt.Errorf("unable to encode getChatStoryInteractions#c5ec7376: field reaction_type is nil") + } + if err := g.ReactionType.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getChatStoryInteractions#c5ec7376: field reaction_type: %w", err) + } + b.Comma() + b.FieldStart("prefer_forwards") + b.PutBool(g.PreferForwards) + b.Comma() + b.FieldStart("offset") + b.PutString(g.Offset) + b.Comma() + b.FieldStart("limit") + b.PutInt32(g.Limit) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetChatStoryInteractionsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getChatStoryInteractions#c5ec7376 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getChatStoryInteractions"); err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: %w", err) + } + case "story_sender_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field story_sender_chat_id: %w", err) + } + g.StorySenderChatID = value + case "story_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field story_id: %w", err) + } + g.StoryID = value + case "reaction_type": + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field reaction_type: %w", err) + } + g.ReactionType = value + case "prefer_forwards": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field prefer_forwards: %w", err) + } + g.PreferForwards = value + case "offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field offset: %w", err) + } + g.Offset = value + case "limit": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getChatStoryInteractions#c5ec7376: field limit: %w", err) + } + g.Limit = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStorySenderChatID returns value of StorySenderChatID field. +func (g *GetChatStoryInteractionsRequest) GetStorySenderChatID() (value int64) { + if g == nil { + return + } + return g.StorySenderChatID +} + +// GetStoryID returns value of StoryID field. +func (g *GetChatStoryInteractionsRequest) GetStoryID() (value int32) { + if g == nil { + return + } + return g.StoryID +} + +// GetReactionType returns value of ReactionType field. +func (g *GetChatStoryInteractionsRequest) GetReactionType() (value ReactionTypeClass) { + if g == nil { + return + } + return g.ReactionType +} + +// GetPreferForwards returns value of PreferForwards field. +func (g *GetChatStoryInteractionsRequest) GetPreferForwards() (value bool) { + if g == nil { + return + } + return g.PreferForwards +} + +// GetOffset returns value of Offset field. +func (g *GetChatStoryInteractionsRequest) GetOffset() (value string) { + if g == nil { + return + } + return g.Offset +} + +// GetLimit returns value of Limit field. +func (g *GetChatStoryInteractionsRequest) GetLimit() (value int32) { + if g == nil { + return + } + return g.Limit +} + +// GetChatStoryInteractions invokes method getChatStoryInteractions#c5ec7376 returning error if any. +func (c *Client) GetChatStoryInteractions(ctx context.Context, request *GetChatStoryInteractionsRequest) (*StoryInteractions, error) { + var result StoryInteractions + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_default_chat_emoji_statuses_gen.go b/tdapi/tl_get_default_chat_emoji_statuses_gen.go new file mode 100644 index 0000000000..57c31df19b --- /dev/null +++ b/tdapi/tl_get_default_chat_emoji_statuses_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetDefaultChatEmojiStatusesRequest represents TL type `getDefaultChatEmojiStatuses#a7aa86e6`. +type GetDefaultChatEmojiStatusesRequest struct { +} + +// GetDefaultChatEmojiStatusesRequestTypeID is TL type id of GetDefaultChatEmojiStatusesRequest. +const GetDefaultChatEmojiStatusesRequestTypeID = 0xa7aa86e6 + +// Ensuring interfaces in compile-time for GetDefaultChatEmojiStatusesRequest. +var ( + _ bin.Encoder = &GetDefaultChatEmojiStatusesRequest{} + _ bin.Decoder = &GetDefaultChatEmojiStatusesRequest{} + _ bin.BareEncoder = &GetDefaultChatEmojiStatusesRequest{} + _ bin.BareDecoder = &GetDefaultChatEmojiStatusesRequest{} +) + +func (g *GetDefaultChatEmojiStatusesRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetDefaultChatEmojiStatusesRequest) String() string { + if g == nil { + return "GetDefaultChatEmojiStatusesRequest(nil)" + } + type Alias GetDefaultChatEmojiStatusesRequest + return fmt.Sprintf("GetDefaultChatEmojiStatusesRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetDefaultChatEmojiStatusesRequest) TypeID() uint32 { + return GetDefaultChatEmojiStatusesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetDefaultChatEmojiStatusesRequest) TypeName() string { + return "getDefaultChatEmojiStatuses" +} + +// TypeInfo returns info about TL type. +func (g *GetDefaultChatEmojiStatusesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getDefaultChatEmojiStatuses", + ID: GetDefaultChatEmojiStatusesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetDefaultChatEmojiStatusesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultChatEmojiStatuses#a7aa86e6 as nil") + } + b.PutID(GetDefaultChatEmojiStatusesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetDefaultChatEmojiStatusesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultChatEmojiStatuses#a7aa86e6 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetDefaultChatEmojiStatusesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultChatEmojiStatuses#a7aa86e6 to nil") + } + if err := b.ConsumeID(GetDefaultChatEmojiStatusesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getDefaultChatEmojiStatuses#a7aa86e6: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetDefaultChatEmojiStatusesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultChatEmojiStatuses#a7aa86e6 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetDefaultChatEmojiStatusesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultChatEmojiStatuses#a7aa86e6 as nil") + } + b.ObjStart() + b.PutID("getDefaultChatEmojiStatuses") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetDefaultChatEmojiStatusesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultChatEmojiStatuses#a7aa86e6 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getDefaultChatEmojiStatuses"); err != nil { + return fmt.Errorf("unable to decode getDefaultChatEmojiStatuses#a7aa86e6: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetDefaultChatEmojiStatuses invokes method getDefaultChatEmojiStatuses#a7aa86e6 returning error if any. +func (c *Client) GetDefaultChatEmojiStatuses(ctx context.Context) (*EmojiStatuses, error) { + var result EmojiStatuses + + request := &GetDefaultChatEmojiStatusesRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_disallowed_chat_emoji_statuses_gen.go b/tdapi/tl_get_disallowed_chat_emoji_statuses_gen.go new file mode 100644 index 0000000000..1c289da2ae --- /dev/null +++ b/tdapi/tl_get_disallowed_chat_emoji_statuses_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetDisallowedChatEmojiStatusesRequest represents TL type `getDisallowedChatEmojiStatuses#d2144da0`. +type GetDisallowedChatEmojiStatusesRequest struct { +} + +// GetDisallowedChatEmojiStatusesRequestTypeID is TL type id of GetDisallowedChatEmojiStatusesRequest. +const GetDisallowedChatEmojiStatusesRequestTypeID = 0xd2144da0 + +// Ensuring interfaces in compile-time for GetDisallowedChatEmojiStatusesRequest. +var ( + _ bin.Encoder = &GetDisallowedChatEmojiStatusesRequest{} + _ bin.Decoder = &GetDisallowedChatEmojiStatusesRequest{} + _ bin.BareEncoder = &GetDisallowedChatEmojiStatusesRequest{} + _ bin.BareDecoder = &GetDisallowedChatEmojiStatusesRequest{} +) + +func (g *GetDisallowedChatEmojiStatusesRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetDisallowedChatEmojiStatusesRequest) String() string { + if g == nil { + return "GetDisallowedChatEmojiStatusesRequest(nil)" + } + type Alias GetDisallowedChatEmojiStatusesRequest + return fmt.Sprintf("GetDisallowedChatEmojiStatusesRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetDisallowedChatEmojiStatusesRequest) TypeID() uint32 { + return GetDisallowedChatEmojiStatusesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetDisallowedChatEmojiStatusesRequest) TypeName() string { + return "getDisallowedChatEmojiStatuses" +} + +// TypeInfo returns info about TL type. +func (g *GetDisallowedChatEmojiStatusesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getDisallowedChatEmojiStatuses", + ID: GetDisallowedChatEmojiStatusesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetDisallowedChatEmojiStatusesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDisallowedChatEmojiStatuses#d2144da0 as nil") + } + b.PutID(GetDisallowedChatEmojiStatusesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetDisallowedChatEmojiStatusesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDisallowedChatEmojiStatuses#d2144da0 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetDisallowedChatEmojiStatusesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDisallowedChatEmojiStatuses#d2144da0 to nil") + } + if err := b.ConsumeID(GetDisallowedChatEmojiStatusesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getDisallowedChatEmojiStatuses#d2144da0: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetDisallowedChatEmojiStatusesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDisallowedChatEmojiStatuses#d2144da0 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetDisallowedChatEmojiStatusesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getDisallowedChatEmojiStatuses#d2144da0 as nil") + } + b.ObjStart() + b.PutID("getDisallowedChatEmojiStatuses") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetDisallowedChatEmojiStatusesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getDisallowedChatEmojiStatuses#d2144da0 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getDisallowedChatEmojiStatuses"); err != nil { + return fmt.Errorf("unable to decode getDisallowedChatEmojiStatuses#d2144da0: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetDisallowedChatEmojiStatuses invokes method getDisallowedChatEmojiStatuses#d2144da0 returning error if any. +func (c *Client) GetDisallowedChatEmojiStatuses(ctx context.Context) (*EmojiStatuses, error) { + var result EmojiStatuses + + request := &GetDisallowedChatEmojiStatusesRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_installed_backgrounds_gen.go b/tdapi/tl_get_installed_backgrounds_gen.go new file mode 100644 index 0000000000..4f3420f4ee --- /dev/null +++ b/tdapi/tl_get_installed_backgrounds_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{} +) + +// GetInstalledBackgroundsRequest represents TL type `getInstalledBackgrounds#c154d05f`. +type GetInstalledBackgroundsRequest struct { + // Pass true to order returned backgrounds for a dark theme + ForDarkTheme bool +} + +// GetInstalledBackgroundsRequestTypeID is TL type id of GetInstalledBackgroundsRequest. +const GetInstalledBackgroundsRequestTypeID = 0xc154d05f + +// Ensuring interfaces in compile-time for GetInstalledBackgroundsRequest. +var ( + _ bin.Encoder = &GetInstalledBackgroundsRequest{} + _ bin.Decoder = &GetInstalledBackgroundsRequest{} + _ bin.BareEncoder = &GetInstalledBackgroundsRequest{} + _ bin.BareDecoder = &GetInstalledBackgroundsRequest{} +) + +func (g *GetInstalledBackgroundsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.ForDarkTheme == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetInstalledBackgroundsRequest) String() string { + if g == nil { + return "GetInstalledBackgroundsRequest(nil)" + } + type Alias GetInstalledBackgroundsRequest + return fmt.Sprintf("GetInstalledBackgroundsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetInstalledBackgroundsRequest) TypeID() uint32 { + return GetInstalledBackgroundsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetInstalledBackgroundsRequest) TypeName() string { + return "getInstalledBackgrounds" +} + +// TypeInfo returns info about TL type. +func (g *GetInstalledBackgroundsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getInstalledBackgrounds", + ID: GetInstalledBackgroundsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ForDarkTheme", + SchemaName: "for_dark_theme", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetInstalledBackgroundsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getInstalledBackgrounds#c154d05f as nil") + } + b.PutID(GetInstalledBackgroundsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetInstalledBackgroundsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getInstalledBackgrounds#c154d05f as nil") + } + b.PutBool(g.ForDarkTheme) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetInstalledBackgroundsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getInstalledBackgrounds#c154d05f to nil") + } + if err := b.ConsumeID(GetInstalledBackgroundsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getInstalledBackgrounds#c154d05f: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetInstalledBackgroundsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getInstalledBackgrounds#c154d05f to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getInstalledBackgrounds#c154d05f: field for_dark_theme: %w", err) + } + g.ForDarkTheme = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetInstalledBackgroundsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getInstalledBackgrounds#c154d05f as nil") + } + b.ObjStart() + b.PutID("getInstalledBackgrounds") + b.Comma() + b.FieldStart("for_dark_theme") + b.PutBool(g.ForDarkTheme) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetInstalledBackgroundsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getInstalledBackgrounds#c154d05f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getInstalledBackgrounds"); err != nil { + return fmt.Errorf("unable to decode getInstalledBackgrounds#c154d05f: %w", err) + } + case "for_dark_theme": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getInstalledBackgrounds#c154d05f: field for_dark_theme: %w", err) + } + g.ForDarkTheme = value + default: + return b.Skip() + } + return nil + }) +} + +// GetForDarkTheme returns value of ForDarkTheme field. +func (g *GetInstalledBackgroundsRequest) GetForDarkTheme() (value bool) { + if g == nil { + return + } + return g.ForDarkTheme +} + +// GetInstalledBackgrounds invokes method getInstalledBackgrounds#c154d05f returning error if any. +func (c *Client) GetInstalledBackgrounds(ctx context.Context, fordarktheme bool) (*Backgrounds, error) { + var result Backgrounds + + request := &GetInstalledBackgroundsRequest{ + ForDarkTheme: fordarktheme, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_message_public_forwards_gen.go b/tdapi/tl_get_message_public_forwards_gen.go index 1e028c9ac5..ff6f747e58 100644 --- a/tdapi/tl_get_message_public_forwards_gen.go +++ b/tdapi/tl_get_message_public_forwards_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// GetMessagePublicForwardsRequest represents TL type `getMessagePublicForwards#6006a949`. +// GetMessagePublicForwardsRequest represents TL type `getMessagePublicForwards#519da4b4`. type GetMessagePublicForwardsRequest struct { // Chat identifier of the message ChatID int64 @@ -40,14 +40,14 @@ type GetMessagePublicForwardsRequest struct { // Offset of the first entry to return as received from the previous request; use empty // string to get the first chunk of results Offset string - // The maximum number of messages to be returned; must be positive and can't be greater - // than 100. For optimal performance, the number of returned messages is chosen by TDLib - // and can be smaller than the specified limit + // The maximum number of messages and stories to be returned; must be positive and can't + // be greater than 100. For optimal performance, the number of returned objects is chosen + // by TDLib and can be smaller than the specified limit Limit int32 } // GetMessagePublicForwardsRequestTypeID is TL type id of GetMessagePublicForwardsRequest. -const GetMessagePublicForwardsRequestTypeID = 0x6006a949 +const GetMessagePublicForwardsRequestTypeID = 0x519da4b4 // Ensuring interfaces in compile-time for GetMessagePublicForwardsRequest. var ( @@ -132,7 +132,7 @@ func (g *GetMessagePublicForwardsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetMessagePublicForwardsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getMessagePublicForwards#6006a949 as nil") + return fmt.Errorf("can't encode getMessagePublicForwards#519da4b4 as nil") } b.PutID(GetMessagePublicForwardsRequestTypeID) return g.EncodeBare(b) @@ -141,7 +141,7 @@ func (g *GetMessagePublicForwardsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetMessagePublicForwardsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getMessagePublicForwards#6006a949 as nil") + return fmt.Errorf("can't encode getMessagePublicForwards#519da4b4 as nil") } b.PutInt53(g.ChatID) b.PutInt53(g.MessageID) @@ -153,10 +153,10 @@ func (g *GetMessagePublicForwardsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetMessagePublicForwardsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getMessagePublicForwards#6006a949 to nil") + return fmt.Errorf("can't decode getMessagePublicForwards#519da4b4 to nil") } if err := b.ConsumeID(GetMessagePublicForwardsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: %w", err) } return g.DecodeBare(b) } @@ -164,33 +164,33 @@ func (g *GetMessagePublicForwardsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetMessagePublicForwardsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getMessagePublicForwards#6006a949 to nil") + return fmt.Errorf("can't decode getMessagePublicForwards#519da4b4 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field chat_id: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field chat_id: %w", err) } g.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field message_id: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field message_id: %w", err) } g.MessageID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field offset: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field offset: %w", err) } g.Offset = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field limit: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field limit: %w", err) } g.Limit = value } @@ -200,7 +200,7 @@ func (g *GetMessagePublicForwardsRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetMessagePublicForwardsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getMessagePublicForwards#6006a949 as nil") + return fmt.Errorf("can't encode getMessagePublicForwards#519da4b4 as nil") } b.ObjStart() b.PutID("getMessagePublicForwards") @@ -225,37 +225,37 @@ func (g *GetMessagePublicForwardsRequest) EncodeTDLibJSON(b tdjson.Encoder) erro // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetMessagePublicForwardsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getMessagePublicForwards#6006a949 to nil") + return fmt.Errorf("can't decode getMessagePublicForwards#519da4b4 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getMessagePublicForwards"); err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field chat_id: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field chat_id: %w", err) } g.ChatID = value case "message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field message_id: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field message_id: %w", err) } g.MessageID = value case "offset": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field offset: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field offset: %w", err) } g.Offset = value case "limit": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getMessagePublicForwards#6006a949: field limit: %w", err) + return fmt.Errorf("unable to decode getMessagePublicForwards#519da4b4: field limit: %w", err) } g.Limit = value default: @@ -297,9 +297,9 @@ func (g *GetMessagePublicForwardsRequest) GetLimit() (value int32) { return g.Limit } -// GetMessagePublicForwards invokes method getMessagePublicForwards#6006a949 returning error if any. -func (c *Client) GetMessagePublicForwards(ctx context.Context, request *GetMessagePublicForwardsRequest) (*FoundMessages, error) { - var result FoundMessages +// GetMessagePublicForwards invokes method getMessagePublicForwards#519da4b4 returning error if any. +func (c *Client) GetMessagePublicForwards(ctx context.Context, request *GetMessagePublicForwardsRequest) (*PublicForwards, error) { + var result PublicForwards if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err diff --git a/tdapi/tl_get_premium_giveaway_info_gen.go b/tdapi/tl_get_premium_giveaway_info_gen.go index 014b745c88..b58fafd3a6 100644 --- a/tdapi/tl_get_premium_giveaway_info_gen.go +++ b/tdapi/tl_get_premium_giveaway_info_gen.go @@ -35,7 +35,7 @@ var ( type GetPremiumGiveawayInfoRequest struct { // Identifier of the channel chat which started the giveaway ChatID int64 - // Identifier of the giveaway message in the chat + // Identifier of the giveaway or a giveaway winners message in the chat MessageID int64 } diff --git a/tdapi/tl_get_story_interactions_gen.go b/tdapi/tl_get_story_interactions_gen.go new file mode 100644 index 0000000000..8d76c768b2 --- /dev/null +++ b/tdapi/tl_get_story_interactions_gen.go @@ -0,0 +1,412 @@ +// 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{} +) + +// GetStoryInteractionsRequest represents TL type `getStoryInteractions#1cd1400d`. +type GetStoryInteractionsRequest struct { + // Story identifier + StoryID int32 + // Query to search for in names, usernames and titles; may be empty to get all relevant + // interactions + Query string + // Pass true to get only interactions by contacts; pass false to get all relevant + // interactions + OnlyContacts bool + // Pass true to get forwards and reposts first, then reactions, then other views; pass + // false to get interactions sorted just by interaction date + PreferForwards bool + // Pass true to get interactions with reaction first; pass false to get interactions + // sorted just by interaction date. Ignored if prefer_forwards == true + PreferWithReaction bool + // Offset of the first entry to return as received from the previous request; use empty + // string to get the first chunk of results + Offset string + // The maximum number of story interactions to return + Limit int32 +} + +// GetStoryInteractionsRequestTypeID is TL type id of GetStoryInteractionsRequest. +const GetStoryInteractionsRequestTypeID = 0x1cd1400d + +// Ensuring interfaces in compile-time for GetStoryInteractionsRequest. +var ( + _ bin.Encoder = &GetStoryInteractionsRequest{} + _ bin.Decoder = &GetStoryInteractionsRequest{} + _ bin.BareEncoder = &GetStoryInteractionsRequest{} + _ bin.BareDecoder = &GetStoryInteractionsRequest{} +) + +func (g *GetStoryInteractionsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.StoryID == 0) { + return false + } + if !(g.Query == "") { + return false + } + if !(g.OnlyContacts == false) { + return false + } + if !(g.PreferForwards == false) { + return false + } + if !(g.PreferWithReaction == false) { + return false + } + if !(g.Offset == "") { + return false + } + if !(g.Limit == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetStoryInteractionsRequest) String() string { + if g == nil { + return "GetStoryInteractionsRequest(nil)" + } + type Alias GetStoryInteractionsRequest + return fmt.Sprintf("GetStoryInteractionsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetStoryInteractionsRequest) TypeID() uint32 { + return GetStoryInteractionsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetStoryInteractionsRequest) TypeName() string { + return "getStoryInteractions" +} + +// TypeInfo returns info about TL type. +func (g *GetStoryInteractionsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getStoryInteractions", + ID: GetStoryInteractionsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StoryID", + SchemaName: "story_id", + }, + { + Name: "Query", + SchemaName: "query", + }, + { + Name: "OnlyContacts", + SchemaName: "only_contacts", + }, + { + Name: "PreferForwards", + SchemaName: "prefer_forwards", + }, + { + Name: "PreferWithReaction", + SchemaName: "prefer_with_reaction", + }, + { + Name: "Offset", + SchemaName: "offset", + }, + { + Name: "Limit", + SchemaName: "limit", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetStoryInteractionsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStoryInteractions#1cd1400d as nil") + } + b.PutID(GetStoryInteractionsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetStoryInteractionsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStoryInteractions#1cd1400d as nil") + } + b.PutInt32(g.StoryID) + b.PutString(g.Query) + b.PutBool(g.OnlyContacts) + b.PutBool(g.PreferForwards) + b.PutBool(g.PreferWithReaction) + b.PutString(g.Offset) + b.PutInt32(g.Limit) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetStoryInteractionsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStoryInteractions#1cd1400d to nil") + } + if err := b.ConsumeID(GetStoryInteractionsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetStoryInteractionsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStoryInteractions#1cd1400d to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field story_id: %w", err) + } + g.StoryID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field query: %w", err) + } + g.Query = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field only_contacts: %w", err) + } + g.OnlyContacts = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field prefer_forwards: %w", err) + } + g.PreferForwards = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field prefer_with_reaction: %w", err) + } + g.PreferWithReaction = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field offset: %w", err) + } + g.Offset = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field limit: %w", err) + } + g.Limit = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetStoryInteractionsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getStoryInteractions#1cd1400d as nil") + } + b.ObjStart() + b.PutID("getStoryInteractions") + b.Comma() + b.FieldStart("story_id") + b.PutInt32(g.StoryID) + b.Comma() + b.FieldStart("query") + b.PutString(g.Query) + b.Comma() + b.FieldStart("only_contacts") + b.PutBool(g.OnlyContacts) + b.Comma() + b.FieldStart("prefer_forwards") + b.PutBool(g.PreferForwards) + b.Comma() + b.FieldStart("prefer_with_reaction") + b.PutBool(g.PreferWithReaction) + b.Comma() + b.FieldStart("offset") + b.PutString(g.Offset) + b.Comma() + b.FieldStart("limit") + b.PutInt32(g.Limit) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetStoryInteractionsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getStoryInteractions#1cd1400d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getStoryInteractions"); err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: %w", err) + } + case "story_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field story_id: %w", err) + } + g.StoryID = value + case "query": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field query: %w", err) + } + g.Query = value + case "only_contacts": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field only_contacts: %w", err) + } + g.OnlyContacts = value + case "prefer_forwards": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field prefer_forwards: %w", err) + } + g.PreferForwards = value + case "prefer_with_reaction": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field prefer_with_reaction: %w", err) + } + g.PreferWithReaction = value + case "offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field offset: %w", err) + } + g.Offset = value + case "limit": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryInteractions#1cd1400d: field limit: %w", err) + } + g.Limit = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStoryID returns value of StoryID field. +func (g *GetStoryInteractionsRequest) GetStoryID() (value int32) { + if g == nil { + return + } + return g.StoryID +} + +// GetQuery returns value of Query field. +func (g *GetStoryInteractionsRequest) GetQuery() (value string) { + if g == nil { + return + } + return g.Query +} + +// GetOnlyContacts returns value of OnlyContacts field. +func (g *GetStoryInteractionsRequest) GetOnlyContacts() (value bool) { + if g == nil { + return + } + return g.OnlyContacts +} + +// GetPreferForwards returns value of PreferForwards field. +func (g *GetStoryInteractionsRequest) GetPreferForwards() (value bool) { + if g == nil { + return + } + return g.PreferForwards +} + +// GetPreferWithReaction returns value of PreferWithReaction field. +func (g *GetStoryInteractionsRequest) GetPreferWithReaction() (value bool) { + if g == nil { + return + } + return g.PreferWithReaction +} + +// GetOffset returns value of Offset field. +func (g *GetStoryInteractionsRequest) GetOffset() (value string) { + if g == nil { + return + } + return g.Offset +} + +// GetLimit returns value of Limit field. +func (g *GetStoryInteractionsRequest) GetLimit() (value int32) { + if g == nil { + return + } + return g.Limit +} + +// GetStoryInteractions invokes method getStoryInteractions#1cd1400d returning error if any. +func (c *Client) GetStoryInteractions(ctx context.Context, request *GetStoryInteractionsRequest) (*StoryInteractions, error) { + var result StoryInteractions + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_story_public_forwards_gen.go b/tdapi/tl_get_story_public_forwards_gen.go index b1149781ea..d482942122 100644 --- a/tdapi/tl_get_story_public_forwards_gen.go +++ b/tdapi/tl_get_story_public_forwards_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// GetStoryPublicForwardsRequest represents TL type `getStoryPublicForwards#8b835be9`. +// GetStoryPublicForwardsRequest represents TL type `getStoryPublicForwards#68f7dcbb`. type GetStoryPublicForwardsRequest struct { // The identifier of the sender of the story StorySenderChatID int64 @@ -47,7 +47,7 @@ type GetStoryPublicForwardsRequest struct { } // GetStoryPublicForwardsRequestTypeID is TL type id of GetStoryPublicForwardsRequest. -const GetStoryPublicForwardsRequestTypeID = 0x8b835be9 +const GetStoryPublicForwardsRequestTypeID = 0x68f7dcbb // Ensuring interfaces in compile-time for GetStoryPublicForwardsRequest. var ( @@ -132,7 +132,7 @@ func (g *GetStoryPublicForwardsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetStoryPublicForwardsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getStoryPublicForwards#8b835be9 as nil") + return fmt.Errorf("can't encode getStoryPublicForwards#68f7dcbb as nil") } b.PutID(GetStoryPublicForwardsRequestTypeID) return g.EncodeBare(b) @@ -141,7 +141,7 @@ func (g *GetStoryPublicForwardsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetStoryPublicForwardsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getStoryPublicForwards#8b835be9 as nil") + return fmt.Errorf("can't encode getStoryPublicForwards#68f7dcbb as nil") } b.PutInt53(g.StorySenderChatID) b.PutInt32(g.StoryID) @@ -153,10 +153,10 @@ func (g *GetStoryPublicForwardsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetStoryPublicForwardsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getStoryPublicForwards#8b835be9 to nil") + return fmt.Errorf("can't decode getStoryPublicForwards#68f7dcbb to nil") } if err := b.ConsumeID(GetStoryPublicForwardsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: %w", err) } return g.DecodeBare(b) } @@ -164,33 +164,33 @@ func (g *GetStoryPublicForwardsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetStoryPublicForwardsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getStoryPublicForwards#8b835be9 to nil") + return fmt.Errorf("can't decode getStoryPublicForwards#68f7dcbb to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field story_sender_chat_id: %w", err) } g.StorySenderChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field story_id: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field story_id: %w", err) } g.StoryID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field offset: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field offset: %w", err) } g.Offset = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field limit: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field limit: %w", err) } g.Limit = value } @@ -200,7 +200,7 @@ func (g *GetStoryPublicForwardsRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetStoryPublicForwardsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getStoryPublicForwards#8b835be9 as nil") + return fmt.Errorf("can't encode getStoryPublicForwards#68f7dcbb as nil") } b.ObjStart() b.PutID("getStoryPublicForwards") @@ -225,37 +225,37 @@ func (g *GetStoryPublicForwardsRequest) EncodeTDLibJSON(b tdjson.Encoder) error // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetStoryPublicForwardsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getStoryPublicForwards#8b835be9 to nil") + return fmt.Errorf("can't decode getStoryPublicForwards#68f7dcbb to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getStoryPublicForwards"); err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: %w", err) } case "story_sender_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field story_sender_chat_id: %w", err) } g.StorySenderChatID = value case "story_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field story_id: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field story_id: %w", err) } g.StoryID = value case "offset": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field offset: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field offset: %w", err) } g.Offset = value case "limit": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryPublicForwards#8b835be9: field limit: %w", err) + return fmt.Errorf("unable to decode getStoryPublicForwards#68f7dcbb: field limit: %w", err) } g.Limit = value default: @@ -297,9 +297,9 @@ func (g *GetStoryPublicForwardsRequest) GetLimit() (value int32) { return g.Limit } -// GetStoryPublicForwards invokes method getStoryPublicForwards#8b835be9 returning error if any. -func (c *Client) GetStoryPublicForwards(ctx context.Context, request *GetStoryPublicForwardsRequest) (*StoryPublicForwards, error) { - var result StoryPublicForwards +// GetStoryPublicForwards invokes method getStoryPublicForwards#68f7dcbb returning error if any. +func (c *Client) GetStoryPublicForwards(ctx context.Context, request *GetStoryPublicForwardsRequest) (*PublicForwards, error) { + var result PublicForwards if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err diff --git a/tdapi/tl_get_story_viewers_gen.go b/tdapi/tl_get_story_viewers_gen.go deleted file mode 100644 index 89bbf83364..0000000000 --- a/tdapi/tl_get_story_viewers_gen.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// GetStoryViewersRequest represents TL type `getStoryViewers#40df8dba`. -type GetStoryViewersRequest struct { - // Story identifier - StoryID int32 - // Query to search for in names and usernames of the viewers; may be empty to get all - // relevant viewers - Query string - // Pass true to get only contacts; pass false to get all relevant viewers - OnlyContacts bool - // Pass true to get viewers with reaction first; pass false to get viewers sorted just by - // view_date - PreferWithReaction bool - // Offset of the first entry to return as received from the previous request; use empty - // string to get the first chunk of results - Offset string - // The maximum number of story viewers to return - Limit int32 -} - -// GetStoryViewersRequestTypeID is TL type id of GetStoryViewersRequest. -const GetStoryViewersRequestTypeID = 0x40df8dba - -// Ensuring interfaces in compile-time for GetStoryViewersRequest. -var ( - _ bin.Encoder = &GetStoryViewersRequest{} - _ bin.Decoder = &GetStoryViewersRequest{} - _ bin.BareEncoder = &GetStoryViewersRequest{} - _ bin.BareDecoder = &GetStoryViewersRequest{} -) - -func (g *GetStoryViewersRequest) Zero() bool { - if g == nil { - return true - } - if !(g.StoryID == 0) { - return false - } - if !(g.Query == "") { - return false - } - if !(g.OnlyContacts == false) { - return false - } - if !(g.PreferWithReaction == false) { - return false - } - if !(g.Offset == "") { - return false - } - if !(g.Limit == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (g *GetStoryViewersRequest) String() string { - if g == nil { - return "GetStoryViewersRequest(nil)" - } - type Alias GetStoryViewersRequest - return fmt.Sprintf("GetStoryViewersRequest%+v", Alias(*g)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*GetStoryViewersRequest) TypeID() uint32 { - return GetStoryViewersRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*GetStoryViewersRequest) TypeName() string { - return "getStoryViewers" -} - -// TypeInfo returns info about TL type. -func (g *GetStoryViewersRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "getStoryViewers", - ID: GetStoryViewersRequestTypeID, - } - if g == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "StoryID", - SchemaName: "story_id", - }, - { - Name: "Query", - SchemaName: "query", - }, - { - Name: "OnlyContacts", - SchemaName: "only_contacts", - }, - { - Name: "PreferWithReaction", - SchemaName: "prefer_with_reaction", - }, - { - Name: "Offset", - SchemaName: "offset", - }, - { - Name: "Limit", - SchemaName: "limit", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (g *GetStoryViewersRequest) Encode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") - } - b.PutID(GetStoryViewersRequestTypeID) - return g.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (g *GetStoryViewersRequest) EncodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") - } - b.PutInt32(g.StoryID) - b.PutString(g.Query) - b.PutBool(g.OnlyContacts) - b.PutBool(g.PreferWithReaction) - b.PutString(g.Offset) - b.PutInt32(g.Limit) - return nil -} - -// Decode implements bin.Decoder. -func (g *GetStoryViewersRequest) Decode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") - } - if err := b.ConsumeID(GetStoryViewersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: %w", err) - } - return g.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (g *GetStoryViewersRequest) DecodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field story_id: %w", err) - } - g.StoryID = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field query: %w", err) - } - g.Query = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field only_contacts: %w", err) - } - g.OnlyContacts = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field prefer_with_reaction: %w", err) - } - g.PreferWithReaction = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field offset: %w", err) - } - g.Offset = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field limit: %w", err) - } - g.Limit = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (g *GetStoryViewersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if g == nil { - return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") - } - b.ObjStart() - b.PutID("getStoryViewers") - b.Comma() - b.FieldStart("story_id") - b.PutInt32(g.StoryID) - b.Comma() - b.FieldStart("query") - b.PutString(g.Query) - b.Comma() - b.FieldStart("only_contacts") - b.PutBool(g.OnlyContacts) - b.Comma() - b.FieldStart("prefer_with_reaction") - b.PutBool(g.PreferWithReaction) - b.Comma() - b.FieldStart("offset") - b.PutString(g.Offset) - b.Comma() - b.FieldStart("limit") - b.PutInt32(g.Limit) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (g *GetStoryViewersRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if g == nil { - return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("getStoryViewers"); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: %w", err) - } - case "story_id": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field story_id: %w", err) - } - g.StoryID = value - case "query": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field query: %w", err) - } - g.Query = value - case "only_contacts": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field only_contacts: %w", err) - } - g.OnlyContacts = value - case "prefer_with_reaction": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field prefer_with_reaction: %w", err) - } - g.PreferWithReaction = value - case "offset": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field offset: %w", err) - } - g.Offset = value - case "limit": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field limit: %w", err) - } - g.Limit = value - default: - return b.Skip() - } - return nil - }) -} - -// GetStoryID returns value of StoryID field. -func (g *GetStoryViewersRequest) GetStoryID() (value int32) { - if g == nil { - return - } - return g.StoryID -} - -// GetQuery returns value of Query field. -func (g *GetStoryViewersRequest) GetQuery() (value string) { - if g == nil { - return - } - return g.Query -} - -// GetOnlyContacts returns value of OnlyContacts field. -func (g *GetStoryViewersRequest) GetOnlyContacts() (value bool) { - if g == nil { - return - } - return g.OnlyContacts -} - -// GetPreferWithReaction returns value of PreferWithReaction field. -func (g *GetStoryViewersRequest) GetPreferWithReaction() (value bool) { - if g == nil { - return - } - return g.PreferWithReaction -} - -// GetOffset returns value of Offset field. -func (g *GetStoryViewersRequest) GetOffset() (value string) { - if g == nil { - return - } - return g.Offset -} - -// GetLimit returns value of Limit field. -func (g *GetStoryViewersRequest) GetLimit() (value int32) { - if g == nil { - return - } - return g.Limit -} - -// GetStoryViewers invokes method getStoryViewers#40df8dba returning error if any. -func (c *Client) GetStoryViewers(ctx context.Context, request *GetStoryViewersRequest) (*StoryViewers, error) { - var result StoryViewers - - if err := c.rpc.Invoke(ctx, request, &result); err != nil { - return nil, err - } - return &result, nil -} diff --git a/tdapi/tl_get_themed_chat_emoji_statuses_gen.go b/tdapi/tl_get_themed_chat_emoji_statuses_gen.go new file mode 100644 index 0000000000..26a7c073b7 --- /dev/null +++ b/tdapi/tl_get_themed_chat_emoji_statuses_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetThemedChatEmojiStatusesRequest represents TL type `getThemedChatEmojiStatuses#fb735cb5`. +type GetThemedChatEmojiStatusesRequest struct { +} + +// GetThemedChatEmojiStatusesRequestTypeID is TL type id of GetThemedChatEmojiStatusesRequest. +const GetThemedChatEmojiStatusesRequestTypeID = 0xfb735cb5 + +// Ensuring interfaces in compile-time for GetThemedChatEmojiStatusesRequest. +var ( + _ bin.Encoder = &GetThemedChatEmojiStatusesRequest{} + _ bin.Decoder = &GetThemedChatEmojiStatusesRequest{} + _ bin.BareEncoder = &GetThemedChatEmojiStatusesRequest{} + _ bin.BareDecoder = &GetThemedChatEmojiStatusesRequest{} +) + +func (g *GetThemedChatEmojiStatusesRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetThemedChatEmojiStatusesRequest) String() string { + if g == nil { + return "GetThemedChatEmojiStatusesRequest(nil)" + } + type Alias GetThemedChatEmojiStatusesRequest + return fmt.Sprintf("GetThemedChatEmojiStatusesRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetThemedChatEmojiStatusesRequest) TypeID() uint32 { + return GetThemedChatEmojiStatusesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetThemedChatEmojiStatusesRequest) TypeName() string { + return "getThemedChatEmojiStatuses" +} + +// TypeInfo returns info about TL type. +func (g *GetThemedChatEmojiStatusesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getThemedChatEmojiStatuses", + ID: GetThemedChatEmojiStatusesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetThemedChatEmojiStatusesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getThemedChatEmojiStatuses#fb735cb5 as nil") + } + b.PutID(GetThemedChatEmojiStatusesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetThemedChatEmojiStatusesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getThemedChatEmojiStatuses#fb735cb5 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetThemedChatEmojiStatusesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getThemedChatEmojiStatuses#fb735cb5 to nil") + } + if err := b.ConsumeID(GetThemedChatEmojiStatusesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getThemedChatEmojiStatuses#fb735cb5: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetThemedChatEmojiStatusesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getThemedChatEmojiStatuses#fb735cb5 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetThemedChatEmojiStatusesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getThemedChatEmojiStatuses#fb735cb5 as nil") + } + b.ObjStart() + b.PutID("getThemedChatEmojiStatuses") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetThemedChatEmojiStatusesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getThemedChatEmojiStatuses#fb735cb5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getThemedChatEmojiStatuses"); err != nil { + return fmt.Errorf("unable to decode getThemedChatEmojiStatuses#fb735cb5: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetThemedChatEmojiStatuses invokes method getThemedChatEmojiStatuses#fb735cb5 returning error if any. +func (c *Client) GetThemedChatEmojiStatuses(ctx context.Context) (*EmojiStatuses, error) { + var result EmojiStatuses + + request := &GetThemedChatEmojiStatusesRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_input_story_area_type_gen.go b/tdapi/tl_input_story_area_type_gen.go index 3c5d268744..e2a25079df 100644 --- a/tdapi/tl_input_story_area_type_gen.go +++ b/tdapi/tl_input_story_area_type_gen.go @@ -841,6 +841,208 @@ func (i *InputStoryAreaTypeSuggestedReaction) GetIsFlipped() (value bool) { return i.IsFlipped } +// InputStoryAreaTypeMessage represents TL type `inputStoryAreaTypeMessage#f01be457`. +type InputStoryAreaTypeMessage struct { + // Identifier of the chat with the message. Currently, the chat must be a supergroup or a + // channel chat + ChatID int64 + // Identifier of the message. Only successfully sent non-scheduled messages can be + // specified + MessageID int64 +} + +// InputStoryAreaTypeMessageTypeID is TL type id of InputStoryAreaTypeMessage. +const InputStoryAreaTypeMessageTypeID = 0xf01be457 + +// construct implements constructor of InputStoryAreaTypeClass. +func (i InputStoryAreaTypeMessage) construct() InputStoryAreaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputStoryAreaTypeMessage. +var ( + _ bin.Encoder = &InputStoryAreaTypeMessage{} + _ bin.Decoder = &InputStoryAreaTypeMessage{} + _ bin.BareEncoder = &InputStoryAreaTypeMessage{} + _ bin.BareDecoder = &InputStoryAreaTypeMessage{} + + _ InputStoryAreaTypeClass = &InputStoryAreaTypeMessage{} +) + +func (i *InputStoryAreaTypeMessage) Zero() bool { + if i == nil { + return true + } + if !(i.ChatID == 0) { + return false + } + if !(i.MessageID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryAreaTypeMessage) String() string { + if i == nil { + return "InputStoryAreaTypeMessage(nil)" + } + type Alias InputStoryAreaTypeMessage + return fmt.Sprintf("InputStoryAreaTypeMessage%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryAreaTypeMessage) TypeID() uint32 { + return InputStoryAreaTypeMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryAreaTypeMessage) TypeName() string { + return "inputStoryAreaTypeMessage" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryAreaTypeMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryAreaTypeMessage", + ID: InputStoryAreaTypeMessageTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryAreaTypeMessage) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeMessage#f01be457 as nil") + } + b.PutID(InputStoryAreaTypeMessageTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryAreaTypeMessage) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeMessage#f01be457 as nil") + } + b.PutInt53(i.ChatID) + b.PutInt53(i.MessageID) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryAreaTypeMessage) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeMessage#f01be457 to nil") + } + if err := b.ConsumeID(InputStoryAreaTypeMessageTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryAreaTypeMessage) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeMessage#f01be457 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: field chat_id: %w", err) + } + i.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: field message_id: %w", err) + } + i.MessageID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryAreaTypeMessage) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeMessage#f01be457 as nil") + } + b.ObjStart() + b.PutID("inputStoryAreaTypeMessage") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(i.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(i.MessageID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputStoryAreaTypeMessage) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeMessage#f01be457 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryAreaTypeMessage"); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: field chat_id: %w", err) + } + i.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeMessage#f01be457: field message_id: %w", err) + } + i.MessageID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (i *InputStoryAreaTypeMessage) GetChatID() (value int64) { + if i == nil { + return + } + return i.ChatID +} + +// GetMessageID returns value of MessageID field. +func (i *InputStoryAreaTypeMessage) GetMessageID() (value int64) { + if i == nil { + return + } + return i.MessageID +} + // InputStoryAreaTypeClassName is schema name of InputStoryAreaTypeClass. const InputStoryAreaTypeClassName = "InputStoryAreaType" @@ -857,6 +1059,7 @@ const InputStoryAreaTypeClassName = "InputStoryAreaType" // case *tdapi.InputStoryAreaTypeFoundVenue: // inputStoryAreaTypeFoundVenue#accda496 // case *tdapi.InputStoryAreaTypePreviousVenue: // inputStoryAreaTypePreviousVenue#6e124e0c // case *tdapi.InputStoryAreaTypeSuggestedReaction: // inputStoryAreaTypeSuggestedReaction#7d4751d3 +// case *tdapi.InputStoryAreaTypeMessage: // inputStoryAreaTypeMessage#f01be457 // default: panic(v) // } type InputStoryAreaTypeClass interface { @@ -916,6 +1119,13 @@ func DecodeInputStoryAreaType(buf *bin.Buffer) (InputStoryAreaTypeClass, error) return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) } return &v, nil + case InputStoryAreaTypeMessageTypeID: + // Decoding inputStoryAreaTypeMessage#f01be457. + v := InputStoryAreaTypeMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -956,6 +1166,13 @@ func DecodeTDLibJSONInputStoryAreaType(buf tdjson.Decoder) (InputStoryAreaTypeCl return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) } return &v, nil + case "inputStoryAreaTypeMessage": + // Decoding inputStoryAreaTypeMessage#f01be457. + v := InputStoryAreaTypeMessage{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_input_story_areas_gen.go b/tdapi/tl_input_story_areas_gen.go index c4d5a7edb5..aac6bcab82 100644 --- a/tdapi/tl_input_story_areas_gen.go +++ b/tdapi/tl_input_story_areas_gen.go @@ -33,7 +33,7 @@ var ( // InputStoryAreas represents TL type `inputStoryAreas#b8ba29fe`. type InputStoryAreas struct { - // List of 0-10 input story areas + // List of input story areas. Currently, a story can have Areas []InputStoryArea } diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index e1c0afaf00..1344b36871 100644 --- a/tdapi/tl_internal_link_type_gen.go +++ b/tdapi/tl_internal_link_type_gen.go @@ -4331,6 +4331,172 @@ func (i *InternalLinkTypePremiumFeatures) GetReferrer() (value string) { return i.Referrer } +// InternalLinkTypePremiumGift represents TL type `internalLinkTypePremiumGift#5ad56d41`. +type InternalLinkTypePremiumGift struct { + // Referrer specified in the link + Referrer string +} + +// InternalLinkTypePremiumGiftTypeID is TL type id of InternalLinkTypePremiumGift. +const InternalLinkTypePremiumGiftTypeID = 0x5ad56d41 + +// construct implements constructor of InternalLinkTypeClass. +func (i InternalLinkTypePremiumGift) construct() InternalLinkTypeClass { return &i } + +// Ensuring interfaces in compile-time for InternalLinkTypePremiumGift. +var ( + _ bin.Encoder = &InternalLinkTypePremiumGift{} + _ bin.Decoder = &InternalLinkTypePremiumGift{} + _ bin.BareEncoder = &InternalLinkTypePremiumGift{} + _ bin.BareDecoder = &InternalLinkTypePremiumGift{} + + _ InternalLinkTypeClass = &InternalLinkTypePremiumGift{} +) + +func (i *InternalLinkTypePremiumGift) Zero() bool { + if i == nil { + return true + } + if !(i.Referrer == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InternalLinkTypePremiumGift) String() string { + if i == nil { + return "InternalLinkTypePremiumGift(nil)" + } + type Alias InternalLinkTypePremiumGift + return fmt.Sprintf("InternalLinkTypePremiumGift%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InternalLinkTypePremiumGift) TypeID() uint32 { + return InternalLinkTypePremiumGiftTypeID +} + +// TypeName returns name of type in TL schema. +func (*InternalLinkTypePremiumGift) TypeName() string { + return "internalLinkTypePremiumGift" +} + +// TypeInfo returns info about TL type. +func (i *InternalLinkTypePremiumGift) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "internalLinkTypePremiumGift", + ID: InternalLinkTypePremiumGiftTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Referrer", + SchemaName: "referrer", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InternalLinkTypePremiumGift) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGift#5ad56d41 as nil") + } + b.PutID(InternalLinkTypePremiumGiftTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InternalLinkTypePremiumGift) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGift#5ad56d41 as nil") + } + b.PutString(i.Referrer) + return nil +} + +// Decode implements bin.Decoder. +func (i *InternalLinkTypePremiumGift) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGift#5ad56d41 to nil") + } + if err := b.ConsumeID(InternalLinkTypePremiumGiftTypeID); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGift#5ad56d41: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InternalLinkTypePremiumGift) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGift#5ad56d41 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGift#5ad56d41: field referrer: %w", err) + } + i.Referrer = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InternalLinkTypePremiumGift) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGift#5ad56d41 as nil") + } + b.ObjStart() + b.PutID("internalLinkTypePremiumGift") + b.Comma() + b.FieldStart("referrer") + b.PutString(i.Referrer) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InternalLinkTypePremiumGift) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGift#5ad56d41 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("internalLinkTypePremiumGift"); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGift#5ad56d41: %w", err) + } + case "referrer": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGift#5ad56d41: field referrer: %w", err) + } + i.Referrer = value + default: + return b.Skip() + } + return nil + }) +} + +// GetReferrer returns value of Referrer field. +func (i *InternalLinkTypePremiumGift) GetReferrer() (value string) { + if i == nil { + return + } + return i.Referrer +} + // InternalLinkTypePremiumGiftCode represents TL type `internalLinkTypePremiumGiftCode#de5c9892`. type InternalLinkTypePremiumGiftCode struct { // The Telegram Premium gift code @@ -7463,6 +7629,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypePassportDataRequest: // internalLinkTypePassportDataRequest#c50fce81 // case *tdapi.InternalLinkTypePhoneNumberConfirmation: // internalLinkTypePhoneNumberConfirmation#68bf6b16 // case *tdapi.InternalLinkTypePremiumFeatures: // internalLinkTypePremiumFeatures#48884f49 +// case *tdapi.InternalLinkTypePremiumGift: // internalLinkTypePremiumGift#5ad56d41 // case *tdapi.InternalLinkTypePremiumGiftCode: // internalLinkTypePremiumGiftCode#de5c9892 // case *tdapi.InternalLinkTypePrivacyAndSecuritySettings: // internalLinkTypePrivacyAndSecuritySettings#ad5f6acf // case *tdapi.InternalLinkTypeProxy: // internalLinkTypeProxy#b1b12cea @@ -7680,6 +7847,13 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case InternalLinkTypePremiumGiftTypeID: + // Decoding internalLinkTypePremiumGift#5ad56d41. + v := InternalLinkTypePremiumGift{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case InternalLinkTypePremiumGiftCodeTypeID: // Decoding internalLinkTypePremiumGiftCode#de5c9892. v := InternalLinkTypePremiumGiftCode{} @@ -7986,6 +8160,13 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case "internalLinkTypePremiumGift": + // Decoding internalLinkTypePremiumGift#5ad56d41. + v := InternalLinkTypePremiumGift{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case "internalLinkTypePremiumGiftCode": // Decoding internalLinkTypePremiumGiftCode#de5c9892. v := InternalLinkTypePremiumGiftCode{} diff --git a/tdapi/tl_keyboard_button_type_gen.go b/tdapi/tl_keyboard_button_type_gen.go index 1d40a636d2..c661a818d0 100644 --- a/tdapi/tl_keyboard_button_type_gen.go +++ b/tdapi/tl_keyboard_button_type_gen.go @@ -624,39 +624,41 @@ func (k *KeyboardButtonTypeRequestPoll) GetForceQuiz() (value bool) { return k.ForceQuiz } -// KeyboardButtonTypeRequestUser represents TL type `keyboardButtonTypeRequestUser#88ffb430`. -type KeyboardButtonTypeRequestUser struct { +// KeyboardButtonTypeRequestUsers represents TL type `keyboardButtonTypeRequestUsers#7e63ef90`. +type KeyboardButtonTypeRequestUsers struct { // Unique button identifier ID int32 - // True, if the shared user must or must not be a bot + // True, if the shared users must or must not be bots RestrictUserIsBot bool - // True, if the shared user must be a bot; otherwise, the shared user must no be a bot. + // True, if the shared users must be bots; otherwise, the shared users must not be bots. // Ignored if restrict_user_is_bot is false UserIsBot bool - // True, if the shared user must or must not be a Telegram Premium user + // True, if the shared users must or must not be Telegram Premium users RestrictUserIsPremium bool - // True, if the shared user must be a Telegram Premium user; otherwise, the shared user - // must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false + // True, if the shared users must be Telegram Premium users; otherwise, the shared users + // must not be Telegram Premium users. Ignored if restrict_user_is_premium is false UserIsPremium bool + // The maximum number of users to share + MaxQuantity int32 } -// KeyboardButtonTypeRequestUserTypeID is TL type id of KeyboardButtonTypeRequestUser. -const KeyboardButtonTypeRequestUserTypeID = 0x88ffb430 +// KeyboardButtonTypeRequestUsersTypeID is TL type id of KeyboardButtonTypeRequestUsers. +const KeyboardButtonTypeRequestUsersTypeID = 0x7e63ef90 // construct implements constructor of KeyboardButtonTypeClass. -func (k KeyboardButtonTypeRequestUser) construct() KeyboardButtonTypeClass { return &k } +func (k KeyboardButtonTypeRequestUsers) construct() KeyboardButtonTypeClass { return &k } -// Ensuring interfaces in compile-time for KeyboardButtonTypeRequestUser. +// Ensuring interfaces in compile-time for KeyboardButtonTypeRequestUsers. var ( - _ bin.Encoder = &KeyboardButtonTypeRequestUser{} - _ bin.Decoder = &KeyboardButtonTypeRequestUser{} - _ bin.BareEncoder = &KeyboardButtonTypeRequestUser{} - _ bin.BareDecoder = &KeyboardButtonTypeRequestUser{} + _ bin.Encoder = &KeyboardButtonTypeRequestUsers{} + _ bin.Decoder = &KeyboardButtonTypeRequestUsers{} + _ bin.BareEncoder = &KeyboardButtonTypeRequestUsers{} + _ bin.BareDecoder = &KeyboardButtonTypeRequestUsers{} - _ KeyboardButtonTypeClass = &KeyboardButtonTypeRequestUser{} + _ KeyboardButtonTypeClass = &KeyboardButtonTypeRequestUsers{} ) -func (k *KeyboardButtonTypeRequestUser) Zero() bool { +func (k *KeyboardButtonTypeRequestUsers) Zero() bool { if k == nil { return true } @@ -675,36 +677,39 @@ func (k *KeyboardButtonTypeRequestUser) Zero() bool { if !(k.UserIsPremium == false) { return false } + if !(k.MaxQuantity == 0) { + return false + } return true } // String implements fmt.Stringer. -func (k *KeyboardButtonTypeRequestUser) String() string { +func (k *KeyboardButtonTypeRequestUsers) String() string { if k == nil { - return "KeyboardButtonTypeRequestUser(nil)" + return "KeyboardButtonTypeRequestUsers(nil)" } - type Alias KeyboardButtonTypeRequestUser - return fmt.Sprintf("KeyboardButtonTypeRequestUser%+v", Alias(*k)) + type Alias KeyboardButtonTypeRequestUsers + return fmt.Sprintf("KeyboardButtonTypeRequestUsers%+v", Alias(*k)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*KeyboardButtonTypeRequestUser) TypeID() uint32 { - return KeyboardButtonTypeRequestUserTypeID +func (*KeyboardButtonTypeRequestUsers) TypeID() uint32 { + return KeyboardButtonTypeRequestUsersTypeID } // TypeName returns name of type in TL schema. -func (*KeyboardButtonTypeRequestUser) TypeName() string { - return "keyboardButtonTypeRequestUser" +func (*KeyboardButtonTypeRequestUsers) TypeName() string { + return "keyboardButtonTypeRequestUsers" } // TypeInfo returns info about TL type. -func (k *KeyboardButtonTypeRequestUser) TypeInfo() tdp.Type { +func (k *KeyboardButtonTypeRequestUsers) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "keyboardButtonTypeRequestUser", - ID: KeyboardButtonTypeRequestUserTypeID, + Name: "keyboardButtonTypeRequestUsers", + ID: KeyboardButtonTypeRequestUsersTypeID, } if k == nil { typ.Null = true @@ -731,93 +736,105 @@ func (k *KeyboardButtonTypeRequestUser) TypeInfo() tdp.Type { Name: "UserIsPremium", SchemaName: "user_is_premium", }, + { + Name: "MaxQuantity", + SchemaName: "max_quantity", + }, } return typ } // Encode implements bin.Encoder. -func (k *KeyboardButtonTypeRequestUser) Encode(b *bin.Buffer) error { +func (k *KeyboardButtonTypeRequestUsers) Encode(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't encode keyboardButtonTypeRequestUser#88ffb430 as nil") + return fmt.Errorf("can't encode keyboardButtonTypeRequestUsers#7e63ef90 as nil") } - b.PutID(KeyboardButtonTypeRequestUserTypeID) + b.PutID(KeyboardButtonTypeRequestUsersTypeID) return k.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (k *KeyboardButtonTypeRequestUser) EncodeBare(b *bin.Buffer) error { +func (k *KeyboardButtonTypeRequestUsers) EncodeBare(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't encode keyboardButtonTypeRequestUser#88ffb430 as nil") + return fmt.Errorf("can't encode keyboardButtonTypeRequestUsers#7e63ef90 as nil") } b.PutInt32(k.ID) b.PutBool(k.RestrictUserIsBot) b.PutBool(k.UserIsBot) b.PutBool(k.RestrictUserIsPremium) b.PutBool(k.UserIsPremium) + b.PutInt32(k.MaxQuantity) return nil } // Decode implements bin.Decoder. -func (k *KeyboardButtonTypeRequestUser) Decode(b *bin.Buffer) error { +func (k *KeyboardButtonTypeRequestUsers) Decode(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't decode keyboardButtonTypeRequestUser#88ffb430 to nil") + return fmt.Errorf("can't decode keyboardButtonTypeRequestUsers#7e63ef90 to nil") } - if err := b.ConsumeID(KeyboardButtonTypeRequestUserTypeID); err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: %w", err) + if err := b.ConsumeID(KeyboardButtonTypeRequestUsersTypeID); err != nil { + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: %w", err) } return k.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (k *KeyboardButtonTypeRequestUser) DecodeBare(b *bin.Buffer) error { +func (k *KeyboardButtonTypeRequestUsers) DecodeBare(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't decode keyboardButtonTypeRequestUser#88ffb430 to nil") + return fmt.Errorf("can't decode keyboardButtonTypeRequestUsers#7e63ef90 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field id: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field id: %w", err) } k.ID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field restrict_user_is_bot: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field restrict_user_is_bot: %w", err) } k.RestrictUserIsBot = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field user_is_bot: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field user_is_bot: %w", err) } k.UserIsBot = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field restrict_user_is_premium: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field restrict_user_is_premium: %w", err) } k.RestrictUserIsPremium = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field user_is_premium: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field user_is_premium: %w", err) } k.UserIsPremium = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field max_quantity: %w", err) + } + k.MaxQuantity = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (k *KeyboardButtonTypeRequestUser) EncodeTDLibJSON(b tdjson.Encoder) error { +func (k *KeyboardButtonTypeRequestUsers) EncodeTDLibJSON(b tdjson.Encoder) error { if k == nil { - return fmt.Errorf("can't encode keyboardButtonTypeRequestUser#88ffb430 as nil") + return fmt.Errorf("can't encode keyboardButtonTypeRequestUsers#7e63ef90 as nil") } b.ObjStart() - b.PutID("keyboardButtonTypeRequestUser") + b.PutID("keyboardButtonTypeRequestUsers") b.Comma() b.FieldStart("id") b.PutInt32(k.ID) @@ -834,53 +851,62 @@ func (k *KeyboardButtonTypeRequestUser) EncodeTDLibJSON(b tdjson.Encoder) error b.FieldStart("user_is_premium") b.PutBool(k.UserIsPremium) b.Comma() + b.FieldStart("max_quantity") + b.PutInt32(k.MaxQuantity) + b.Comma() b.StripComma() b.ObjEnd() return nil } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (k *KeyboardButtonTypeRequestUser) DecodeTDLibJSON(b tdjson.Decoder) error { +func (k *KeyboardButtonTypeRequestUsers) DecodeTDLibJSON(b tdjson.Decoder) error { if k == nil { - return fmt.Errorf("can't decode keyboardButtonTypeRequestUser#88ffb430 to nil") + return fmt.Errorf("can't decode keyboardButtonTypeRequestUsers#7e63ef90 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("keyboardButtonTypeRequestUser"); err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: %w", err) + if err := b.ConsumeID("keyboardButtonTypeRequestUsers"); err != nil { + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: %w", err) } case "id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field id: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field id: %w", err) } k.ID = value case "restrict_user_is_bot": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field restrict_user_is_bot: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field restrict_user_is_bot: %w", err) } k.RestrictUserIsBot = value case "user_is_bot": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field user_is_bot: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field user_is_bot: %w", err) } k.UserIsBot = value case "restrict_user_is_premium": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field restrict_user_is_premium: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field restrict_user_is_premium: %w", err) } k.RestrictUserIsPremium = value case "user_is_premium": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonTypeRequestUser#88ffb430: field user_is_premium: %w", err) + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field user_is_premium: %w", err) } k.UserIsPremium = value + case "max_quantity": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode keyboardButtonTypeRequestUsers#7e63ef90: field max_quantity: %w", err) + } + k.MaxQuantity = value default: return b.Skip() } @@ -889,7 +915,7 @@ func (k *KeyboardButtonTypeRequestUser) DecodeTDLibJSON(b tdjson.Decoder) error } // GetID returns value of ID field. -func (k *KeyboardButtonTypeRequestUser) GetID() (value int32) { +func (k *KeyboardButtonTypeRequestUsers) GetID() (value int32) { if k == nil { return } @@ -897,7 +923,7 @@ func (k *KeyboardButtonTypeRequestUser) GetID() (value int32) { } // GetRestrictUserIsBot returns value of RestrictUserIsBot field. -func (k *KeyboardButtonTypeRequestUser) GetRestrictUserIsBot() (value bool) { +func (k *KeyboardButtonTypeRequestUsers) GetRestrictUserIsBot() (value bool) { if k == nil { return } @@ -905,7 +931,7 @@ func (k *KeyboardButtonTypeRequestUser) GetRestrictUserIsBot() (value bool) { } // GetUserIsBot returns value of UserIsBot field. -func (k *KeyboardButtonTypeRequestUser) GetUserIsBot() (value bool) { +func (k *KeyboardButtonTypeRequestUsers) GetUserIsBot() (value bool) { if k == nil { return } @@ -913,7 +939,7 @@ func (k *KeyboardButtonTypeRequestUser) GetUserIsBot() (value bool) { } // GetRestrictUserIsPremium returns value of RestrictUserIsPremium field. -func (k *KeyboardButtonTypeRequestUser) GetRestrictUserIsPremium() (value bool) { +func (k *KeyboardButtonTypeRequestUsers) GetRestrictUserIsPremium() (value bool) { if k == nil { return } @@ -921,13 +947,21 @@ func (k *KeyboardButtonTypeRequestUser) GetRestrictUserIsPremium() (value bool) } // GetUserIsPremium returns value of UserIsPremium field. -func (k *KeyboardButtonTypeRequestUser) GetUserIsPremium() (value bool) { +func (k *KeyboardButtonTypeRequestUsers) GetUserIsPremium() (value bool) { if k == nil { return } return k.UserIsPremium } +// GetMaxQuantity returns value of MaxQuantity field. +func (k *KeyboardButtonTypeRequestUsers) GetMaxQuantity() (value int32) { + if k == nil { + return + } + return k.MaxQuantity +} + // KeyboardButtonTypeRequestChat represents TL type `keyboardButtonTypeRequestChat#103ea7a2`. type KeyboardButtonTypeRequestChat struct { // Unique button identifier @@ -1586,7 +1620,7 @@ const KeyboardButtonTypeClassName = "KeyboardButtonType" // case *tdapi.KeyboardButtonTypeRequestPhoneNumber: // keyboardButtonTypeRequestPhoneNumber#a4d9b7b9 // case *tdapi.KeyboardButtonTypeRequestLocation: // keyboardButtonTypeRequestLocation#f8828cfd // case *tdapi.KeyboardButtonTypeRequestPoll: // keyboardButtonTypeRequestPoll#7164dcb8 -// case *tdapi.KeyboardButtonTypeRequestUser: // keyboardButtonTypeRequestUser#88ffb430 +// case *tdapi.KeyboardButtonTypeRequestUsers: // keyboardButtonTypeRequestUsers#7e63ef90 // case *tdapi.KeyboardButtonTypeRequestChat: // keyboardButtonTypeRequestChat#103ea7a2 // case *tdapi.KeyboardButtonTypeWebApp: // keyboardButtonTypeWebApp#70c8ff62 // default: panic(v) @@ -1648,9 +1682,9 @@ func DecodeKeyboardButtonType(buf *bin.Buffer) (KeyboardButtonTypeClass, error) return nil, fmt.Errorf("unable to decode KeyboardButtonTypeClass: %w", err) } return &v, nil - case KeyboardButtonTypeRequestUserTypeID: - // Decoding keyboardButtonTypeRequestUser#88ffb430. - v := KeyboardButtonTypeRequestUser{} + case KeyboardButtonTypeRequestUsersTypeID: + // Decoding keyboardButtonTypeRequestUsers#7e63ef90. + v := KeyboardButtonTypeRequestUsers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode KeyboardButtonTypeClass: %w", err) } @@ -1709,9 +1743,9 @@ func DecodeTDLibJSONKeyboardButtonType(buf tdjson.Decoder) (KeyboardButtonTypeCl return nil, fmt.Errorf("unable to decode KeyboardButtonTypeClass: %w", err) } return &v, nil - case "keyboardButtonTypeRequestUser": - // Decoding keyboardButtonTypeRequestUser#88ffb430. - v := KeyboardButtonTypeRequestUser{} + case "keyboardButtonTypeRequestUsers": + // Decoding keyboardButtonTypeRequestUsers#7e63ef90. + v := KeyboardButtonTypeRequestUsers{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode KeyboardButtonTypeClass: %w", err) } diff --git a/tdapi/tl_message_content_gen.go b/tdapi/tl_message_content_gen.go index 5a077091cc..378bc8923e 100644 --- a/tdapi/tl_message_content_gen.go +++ b/tdapi/tl_message_content_gen.go @@ -10510,9 +10510,9 @@ type MessageGiftedPremium struct { Amount int64 // Cryptocurrency used to pay for the gift; may be empty if none Cryptocurrency string - // The paid amount, in the smallest units of the cryptocurrency + // The paid amount, in the smallest units of the cryptocurrency; 0 if none CryptocurrencyAmount int64 - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 // A sticker to be shown in the message; may be null if unknown Sticker Sticker @@ -10870,7 +10870,7 @@ func (m *MessageGiftedPremium) GetSticker() (value Sticker) { return m.Sticker } -// MessagePremiumGiftCode represents TL type `messagePremiumGiftCode#7a9c468f`. +// MessagePremiumGiftCode represents TL type `messagePremiumGiftCode#26bd1bf3`. type MessagePremiumGiftCode struct { // Identifier of a chat or a user that created the gift code; may be null if unknown CreatorID MessageSenderClass @@ -10878,7 +10878,16 @@ type MessagePremiumGiftCode struct { IsFromGiveaway bool // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen IsUnclaimed bool - // Number of month the Telegram Premium subscription will be active after code activation + // Currency for the paid amount; empty if unknown + Currency string + // The paid amount, in the smallest units of the currency; 0 if unknown + Amount int64 + // Cryptocurrency used to pay for the gift; may be empty if none or unknown + Cryptocurrency string + // The paid amount, in the smallest units of the cryptocurrency; 0 if unknown + CryptocurrencyAmount int64 + // Number of months the Telegram Premium subscription will be active after code + // activation MonthCount int32 // A sticker to be shown in the message; may be null if unknown Sticker Sticker @@ -10887,7 +10896,7 @@ type MessagePremiumGiftCode struct { } // MessagePremiumGiftCodeTypeID is TL type id of MessagePremiumGiftCode. -const MessagePremiumGiftCodeTypeID = 0x7a9c468f +const MessagePremiumGiftCodeTypeID = 0x26bd1bf3 // construct implements constructor of MessageContentClass. func (m MessagePremiumGiftCode) construct() MessageContentClass { return &m } @@ -10915,6 +10924,18 @@ func (m *MessagePremiumGiftCode) Zero() bool { if !(m.IsUnclaimed == false) { return false } + if !(m.Currency == "") { + return false + } + if !(m.Amount == 0) { + return false + } + if !(m.Cryptocurrency == "") { + return false + } + if !(m.CryptocurrencyAmount == 0) { + return false + } if !(m.MonthCount == 0) { return false } @@ -10972,6 +10993,22 @@ func (m *MessagePremiumGiftCode) TypeInfo() tdp.Type { Name: "IsUnclaimed", SchemaName: "is_unclaimed", }, + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + { + Name: "Cryptocurrency", + SchemaName: "cryptocurrency", + }, + { + Name: "CryptocurrencyAmount", + SchemaName: "cryptocurrency_amount", + }, { Name: "MonthCount", SchemaName: "month_count", @@ -10991,7 +11028,7 @@ func (m *MessagePremiumGiftCode) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessagePremiumGiftCode) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#26bd1bf3 as nil") } b.PutID(MessagePremiumGiftCodeTypeID) return m.EncodeBare(b) @@ -11000,19 +11037,23 @@ func (m *MessagePremiumGiftCode) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessagePremiumGiftCode) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#26bd1bf3 as nil") } if m.CreatorID == nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field creator_id is nil") + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field creator_id is nil") } if err := m.CreatorID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field creator_id: %w", err) + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field creator_id: %w", err) } b.PutBool(m.IsFromGiveaway) b.PutBool(m.IsUnclaimed) + b.PutString(m.Currency) + b.PutInt53(m.Amount) + b.PutString(m.Cryptocurrency) + b.PutLong(m.CryptocurrencyAmount) b.PutInt32(m.MonthCount) if err := m.Sticker.Encode(b); err != nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field sticker: %w", err) + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field sticker: %w", err) } b.PutString(m.Code) return nil @@ -11021,10 +11062,10 @@ func (m *MessagePremiumGiftCode) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessagePremiumGiftCode) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#26bd1bf3 to nil") } if err := b.ConsumeID(MessagePremiumGiftCodeTypeID); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: %w", err) } return m.DecodeBare(b) } @@ -11032,45 +11073,73 @@ func (m *MessagePremiumGiftCode) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessagePremiumGiftCode) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#26bd1bf3 to nil") } { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field creator_id: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field creator_id: %w", err) } m.CreatorID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field is_from_giveaway: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field is_from_giveaway: %w", err) } m.IsFromGiveaway = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field is_unclaimed: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field is_unclaimed: %w", err) } m.IsUnclaimed = value } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field currency: %w", err) + } + m.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field amount: %w", err) + } + m.Amount = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field cryptocurrency: %w", err) + } + m.Cryptocurrency = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field cryptocurrency_amount: %w", err) + } + m.CryptocurrencyAmount = value + } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field month_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field month_count: %w", err) } m.MonthCount = value } { if err := m.Sticker.Decode(b); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field sticker: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field sticker: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field code: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field code: %w", err) } m.Code = value } @@ -11080,17 +11149,17 @@ func (m *MessagePremiumGiftCode) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessagePremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#26bd1bf3 as nil") } b.ObjStart() b.PutID("messagePremiumGiftCode") b.Comma() b.FieldStart("creator_id") if m.CreatorID == nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field creator_id is nil") + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field creator_id is nil") } if err := m.CreatorID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field creator_id: %w", err) + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field creator_id: %w", err) } b.Comma() b.FieldStart("is_from_giveaway") @@ -11099,12 +11168,24 @@ func (m *MessagePremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("is_unclaimed") b.PutBool(m.IsUnclaimed) b.Comma() + b.FieldStart("currency") + b.PutString(m.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(m.Amount) + b.Comma() + b.FieldStart("cryptocurrency") + b.PutString(m.Cryptocurrency) + b.Comma() + b.FieldStart("cryptocurrency_amount") + b.PutLong(m.CryptocurrencyAmount) + b.Comma() b.FieldStart("month_count") b.PutInt32(m.MonthCount) b.Comma() b.FieldStart("sticker") if err := m.Sticker.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field sticker: %w", err) + return fmt.Errorf("unable to encode messagePremiumGiftCode#26bd1bf3: field sticker: %w", err) } b.Comma() b.FieldStart("code") @@ -11118,47 +11199,71 @@ func (m *MessagePremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessagePremiumGiftCode) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#26bd1bf3 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messagePremiumGiftCode"); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: %w", err) } case "creator_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field creator_id: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field creator_id: %w", err) } m.CreatorID = value case "is_from_giveaway": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field is_from_giveaway: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field is_from_giveaway: %w", err) } m.IsFromGiveaway = value case "is_unclaimed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field is_unclaimed: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field is_unclaimed: %w", err) } m.IsUnclaimed = value + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field currency: %w", err) + } + m.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field amount: %w", err) + } + m.Amount = value + case "cryptocurrency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field cryptocurrency: %w", err) + } + m.Cryptocurrency = value + case "cryptocurrency_amount": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field cryptocurrency_amount: %w", err) + } + m.CryptocurrencyAmount = value case "month_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field month_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field month_count: %w", err) } m.MonthCount = value case "sticker": if err := m.Sticker.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field sticker: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field sticker: %w", err) } case "code": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field code: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiftCode#26bd1bf3: field code: %w", err) } m.Code = value default: @@ -11192,6 +11297,38 @@ func (m *MessagePremiumGiftCode) GetIsUnclaimed() (value bool) { return m.IsUnclaimed } +// GetCurrency returns value of Currency field. +func (m *MessagePremiumGiftCode) GetCurrency() (value string) { + if m == nil { + return + } + return m.Currency +} + +// GetAmount returns value of Amount field. +func (m *MessagePremiumGiftCode) GetAmount() (value int64) { + if m == nil { + return + } + return m.Amount +} + +// GetCryptocurrency returns value of Cryptocurrency field. +func (m *MessagePremiumGiftCode) GetCryptocurrency() (value string) { + if m == nil { + return + } + return m.Cryptocurrency +} + +// GetCryptocurrencyAmount returns value of CryptocurrencyAmount field. +func (m *MessagePremiumGiftCode) GetCryptocurrencyAmount() (value int64) { + if m == nil { + return + } + return m.CryptocurrencyAmount +} + // GetMonthCount returns value of MonthCount field. func (m *MessagePremiumGiftCode) GetMonthCount() (value int32) { if m == nil { @@ -11353,7 +11490,8 @@ type MessagePremiumGiveaway struct { Parameters PremiumGiveawayParameters // Number of users which will receive Telegram Premium subscription gift codes WinnerCount int32 - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code + // activation MonthCount int32 // A sticker to be shown in the message; may be null if unknown Sticker Sticker @@ -11659,45 +11797,354 @@ func (m *MessagePremiumGiveawayCompleted) Zero() bool { } // String implements fmt.Stringer. -func (m *MessagePremiumGiveawayCompleted) String() string { +func (m *MessagePremiumGiveawayCompleted) String() string { + if m == nil { + return "MessagePremiumGiveawayCompleted(nil)" + } + type Alias MessagePremiumGiveawayCompleted + return fmt.Sprintf("MessagePremiumGiveawayCompleted%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessagePremiumGiveawayCompleted) TypeID() uint32 { + return MessagePremiumGiveawayCompletedTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessagePremiumGiveawayCompleted) TypeName() string { + return "messagePremiumGiveawayCompleted" +} + +// TypeInfo returns info about TL type. +func (m *MessagePremiumGiveawayCompleted) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messagePremiumGiveawayCompleted", + ID: MessagePremiumGiveawayCompletedTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "GiveawayMessageID", + SchemaName: "giveaway_message_id", + }, + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "UnclaimedPrizeCount", + SchemaName: "unclaimed_prize_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessagePremiumGiveawayCompleted) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + } + b.PutID(MessagePremiumGiveawayCompletedTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessagePremiumGiveawayCompleted) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + } + b.PutInt53(m.GiveawayMessageID) + b.PutInt32(m.WinnerCount) + b.PutInt32(m.UnclaimedPrizeCount) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessagePremiumGiveawayCompleted) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + } + if err := b.ConsumeID(MessagePremiumGiveawayCompletedTypeID); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessagePremiumGiveawayCompleted) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field giveaway_message_id: %w", err) + } + m.GiveawayMessageID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field winner_count: %w", err) + } + m.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field unclaimed_prize_count: %w", err) + } + m.UnclaimedPrizeCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessagePremiumGiveawayCompleted) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + } + b.ObjStart() + b.PutID("messagePremiumGiveawayCompleted") + b.Comma() + b.FieldStart("giveaway_message_id") + b.PutInt53(m.GiveawayMessageID) + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(m.WinnerCount) + b.Comma() + b.FieldStart("unclaimed_prize_count") + b.PutInt32(m.UnclaimedPrizeCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessagePremiumGiveawayCompleted) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messagePremiumGiveawayCompleted"); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: %w", err) + } + case "giveaway_message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field giveaway_message_id: %w", err) + } + m.GiveawayMessageID = value + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field winner_count: %w", err) + } + m.WinnerCount = value + case "unclaimed_prize_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field unclaimed_prize_count: %w", err) + } + m.UnclaimedPrizeCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetGiveawayMessageID returns value of GiveawayMessageID field. +func (m *MessagePremiumGiveawayCompleted) GetGiveawayMessageID() (value int64) { + if m == nil { + return + } + return m.GiveawayMessageID +} + +// GetWinnerCount returns value of WinnerCount field. +func (m *MessagePremiumGiveawayCompleted) GetWinnerCount() (value int32) { + if m == nil { + return + } + return m.WinnerCount +} + +// GetUnclaimedPrizeCount returns value of UnclaimedPrizeCount field. +func (m *MessagePremiumGiveawayCompleted) GetUnclaimedPrizeCount() (value int32) { + if m == nil { + return + } + return m.UnclaimedPrizeCount +} + +// MessagePremiumGiveawayWinners represents TL type `messagePremiumGiveawayWinners#815d5f31`. +type MessagePremiumGiveawayWinners struct { + // Identifier of the channel chat, which was automatically boosted by the winners of the + // giveaway for duration of the Premium subscription + BoostedChatID int64 + // Identifier of the message with the giveaway in the boosted chat + GiveawayMessageID int64 + // Number of other chats that participated in the giveaway + AdditionalChatCount int32 + // Point in time (Unix timestamp) when the winners were selected. May be bigger than + // winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 + // True, if only new members of the chats were eligible for the giveaway + OnlyNewMembers bool + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool + // Number of months the Telegram Premium subscription will be active after code + // activation + MonthCount int32 + // Additional description of the giveaway prize + PrizeDescription string + // Total number of winners in the giveaway + WinnerCount int32 + // Up to 100 user identifiers of the winners of the giveaway + WinnerUserIDs []int64 + // Number of undistributed prizes + UnclaimedPrizeCount int32 +} + +// MessagePremiumGiveawayWinnersTypeID is TL type id of MessagePremiumGiveawayWinners. +const MessagePremiumGiveawayWinnersTypeID = 0x815d5f31 + +// construct implements constructor of MessageContentClass. +func (m MessagePremiumGiveawayWinners) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessagePremiumGiveawayWinners. +var ( + _ bin.Encoder = &MessagePremiumGiveawayWinners{} + _ bin.Decoder = &MessagePremiumGiveawayWinners{} + _ bin.BareEncoder = &MessagePremiumGiveawayWinners{} + _ bin.BareDecoder = &MessagePremiumGiveawayWinners{} + + _ MessageContentClass = &MessagePremiumGiveawayWinners{} +) + +func (m *MessagePremiumGiveawayWinners) Zero() bool { + if m == nil { + return true + } + if !(m.BoostedChatID == 0) { + return false + } + if !(m.GiveawayMessageID == 0) { + return false + } + if !(m.AdditionalChatCount == 0) { + return false + } + if !(m.ActualWinnersSelectionDate == 0) { + return false + } + if !(m.OnlyNewMembers == false) { + return false + } + if !(m.WasRefunded == false) { + return false + } + if !(m.MonthCount == 0) { + return false + } + if !(m.PrizeDescription == "") { + return false + } + if !(m.WinnerCount == 0) { + return false + } + if !(m.WinnerUserIDs == nil) { + return false + } + if !(m.UnclaimedPrizeCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessagePremiumGiveawayWinners) String() string { if m == nil { - return "MessagePremiumGiveawayCompleted(nil)" + return "MessagePremiumGiveawayWinners(nil)" } - type Alias MessagePremiumGiveawayCompleted - return fmt.Sprintf("MessagePremiumGiveawayCompleted%+v", Alias(*m)) + type Alias MessagePremiumGiveawayWinners + return fmt.Sprintf("MessagePremiumGiveawayWinners%+v", Alias(*m)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessagePremiumGiveawayCompleted) TypeID() uint32 { - return MessagePremiumGiveawayCompletedTypeID +func (*MessagePremiumGiveawayWinners) TypeID() uint32 { + return MessagePremiumGiveawayWinnersTypeID } // TypeName returns name of type in TL schema. -func (*MessagePremiumGiveawayCompleted) TypeName() string { - return "messagePremiumGiveawayCompleted" +func (*MessagePremiumGiveawayWinners) TypeName() string { + return "messagePremiumGiveawayWinners" } // TypeInfo returns info about TL type. -func (m *MessagePremiumGiveawayCompleted) TypeInfo() tdp.Type { +func (m *MessagePremiumGiveawayWinners) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "messagePremiumGiveawayCompleted", - ID: MessagePremiumGiveawayCompletedTypeID, + Name: "messagePremiumGiveawayWinners", + ID: MessagePremiumGiveawayWinnersTypeID, } if m == nil { typ.Null = true return typ } typ.Fields = []tdp.Field{ + { + Name: "BoostedChatID", + SchemaName: "boosted_chat_id", + }, { Name: "GiveawayMessageID", SchemaName: "giveaway_message_id", }, + { + Name: "AdditionalChatCount", + SchemaName: "additional_chat_count", + }, + { + Name: "ActualWinnersSelectionDate", + SchemaName: "actual_winners_selection_date", + }, + { + Name: "OnlyNewMembers", + SchemaName: "only_new_members", + }, + { + Name: "WasRefunded", + SchemaName: "was_refunded", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "PrizeDescription", + SchemaName: "prize_description", + }, { Name: "WinnerCount", SchemaName: "winner_count", }, + { + Name: "WinnerUserIDs", + SchemaName: "winner_user_ids", + }, { Name: "UnclaimedPrizeCount", SchemaName: "unclaimed_prize_count", @@ -11707,59 +12154,136 @@ func (m *MessagePremiumGiveawayCompleted) TypeInfo() tdp.Type { } // Encode implements bin.Encoder. -func (m *MessagePremiumGiveawayCompleted) Encode(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayWinners) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + return fmt.Errorf("can't encode messagePremiumGiveawayWinners#815d5f31 as nil") } - b.PutID(MessagePremiumGiveawayCompletedTypeID) + b.PutID(MessagePremiumGiveawayWinnersTypeID) return m.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (m *MessagePremiumGiveawayCompleted) EncodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayWinners) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + return fmt.Errorf("can't encode messagePremiumGiveawayWinners#815d5f31 as nil") } + b.PutInt53(m.BoostedChatID) b.PutInt53(m.GiveawayMessageID) + b.PutInt32(m.AdditionalChatCount) + b.PutInt32(m.ActualWinnersSelectionDate) + b.PutBool(m.OnlyNewMembers) + b.PutBool(m.WasRefunded) + b.PutInt32(m.MonthCount) + b.PutString(m.PrizeDescription) b.PutInt32(m.WinnerCount) + b.PutInt(len(m.WinnerUserIDs)) + for _, v := range m.WinnerUserIDs { + b.PutInt53(v) + } b.PutInt32(m.UnclaimedPrizeCount) return nil } // Decode implements bin.Decoder. -func (m *MessagePremiumGiveawayCompleted) Decode(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayWinners) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + return fmt.Errorf("can't decode messagePremiumGiveawayWinners#815d5f31 to nil") } - if err := b.ConsumeID(MessagePremiumGiveawayCompletedTypeID); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: %w", err) + if err := b.ConsumeID(MessagePremiumGiveawayWinnersTypeID); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: %w", err) } return m.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (m *MessagePremiumGiveawayCompleted) DecodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayWinners) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + return fmt.Errorf("can't decode messagePremiumGiveawayWinners#815d5f31 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field giveaway_message_id: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field boosted_chat_id: %w", err) + } + m.BoostedChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field giveaway_message_id: %w", err) } m.GiveawayMessageID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field winner_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field additional_chat_count: %w", err) + } + m.AdditionalChatCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field actual_winners_selection_date: %w", err) + } + m.ActualWinnersSelectionDate = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field only_new_members: %w", err) + } + m.OnlyNewMembers = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field was_refunded: %w", err) + } + m.WasRefunded = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field month_count: %w", err) + } + m.MonthCount = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field prize_description: %w", err) + } + m.PrizeDescription = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_count: %w", err) } m.WinnerCount = value } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_user_ids: %w", err) + } + + if headerLen > 0 { + m.WinnerUserIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_user_ids: %w", err) + } + m.WinnerUserIDs = append(m.WinnerUserIDs, value) + } + } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field unclaimed_prize_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field unclaimed_prize_count: %w", err) } m.UnclaimedPrizeCount = value } @@ -11767,19 +12291,49 @@ func (m *MessagePremiumGiveawayCompleted) DecodeBare(b *bin.Buffer) error { } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessagePremiumGiveawayCompleted) EncodeTDLibJSON(b tdjson.Encoder) error { +func (m *MessagePremiumGiveawayWinners) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messagePremiumGiveawayCompleted#80533949 as nil") + return fmt.Errorf("can't encode messagePremiumGiveawayWinners#815d5f31 as nil") } b.ObjStart() - b.PutID("messagePremiumGiveawayCompleted") + b.PutID("messagePremiumGiveawayWinners") + b.Comma() + b.FieldStart("boosted_chat_id") + b.PutInt53(m.BoostedChatID) b.Comma() b.FieldStart("giveaway_message_id") b.PutInt53(m.GiveawayMessageID) b.Comma() + b.FieldStart("additional_chat_count") + b.PutInt32(m.AdditionalChatCount) + b.Comma() + b.FieldStart("actual_winners_selection_date") + b.PutInt32(m.ActualWinnersSelectionDate) + b.Comma() + b.FieldStart("only_new_members") + b.PutBool(m.OnlyNewMembers) + b.Comma() + b.FieldStart("was_refunded") + b.PutBool(m.WasRefunded) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(m.MonthCount) + b.Comma() + b.FieldStart("prize_description") + b.PutString(m.PrizeDescription) + b.Comma() b.FieldStart("winner_count") b.PutInt32(m.WinnerCount) b.Comma() + b.FieldStart("winner_user_ids") + b.ArrStart() + for _, v := range m.WinnerUserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() b.FieldStart("unclaimed_prize_count") b.PutInt32(m.UnclaimedPrizeCount) b.Comma() @@ -11789,33 +12343,86 @@ func (m *MessagePremiumGiveawayCompleted) EncodeTDLibJSON(b tdjson.Encoder) erro } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessagePremiumGiveawayCompleted) DecodeTDLibJSON(b tdjson.Decoder) error { +func (m *MessagePremiumGiveawayWinners) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messagePremiumGiveawayCompleted#80533949 to nil") + return fmt.Errorf("can't decode messagePremiumGiveawayWinners#815d5f31 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("messagePremiumGiveawayCompleted"); err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: %w", err) + if err := b.ConsumeID("messagePremiumGiveawayWinners"); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: %w", err) + } + case "boosted_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field boosted_chat_id: %w", err) } + m.BoostedChatID = value case "giveaway_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field giveaway_message_id: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field giveaway_message_id: %w", err) } m.GiveawayMessageID = value + case "additional_chat_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field additional_chat_count: %w", err) + } + m.AdditionalChatCount = value + case "actual_winners_selection_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field actual_winners_selection_date: %w", err) + } + m.ActualWinnersSelectionDate = value + case "only_new_members": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field only_new_members: %w", err) + } + m.OnlyNewMembers = value + case "was_refunded": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field was_refunded: %w", err) + } + m.WasRefunded = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field month_count: %w", err) + } + m.MonthCount = value + case "prize_description": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field prize_description: %w", err) + } + m.PrizeDescription = value case "winner_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field winner_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_count: %w", err) } m.WinnerCount = value + case "winner_user_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_user_ids: %w", err) + } + m.WinnerUserIDs = append(m.WinnerUserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field winner_user_ids: %w", err) + } case "unclaimed_prize_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messagePremiumGiveawayCompleted#80533949: field unclaimed_prize_count: %w", err) + return fmt.Errorf("unable to decode messagePremiumGiveawayWinners#815d5f31: field unclaimed_prize_count: %w", err) } m.UnclaimedPrizeCount = value default: @@ -11825,24 +12432,88 @@ func (m *MessagePremiumGiveawayCompleted) DecodeTDLibJSON(b tdjson.Decoder) erro }) } +// GetBoostedChatID returns value of BoostedChatID field. +func (m *MessagePremiumGiveawayWinners) GetBoostedChatID() (value int64) { + if m == nil { + return + } + return m.BoostedChatID +} + // GetGiveawayMessageID returns value of GiveawayMessageID field. -func (m *MessagePremiumGiveawayCompleted) GetGiveawayMessageID() (value int64) { +func (m *MessagePremiumGiveawayWinners) GetGiveawayMessageID() (value int64) { if m == nil { return } return m.GiveawayMessageID } +// GetAdditionalChatCount returns value of AdditionalChatCount field. +func (m *MessagePremiumGiveawayWinners) GetAdditionalChatCount() (value int32) { + if m == nil { + return + } + return m.AdditionalChatCount +} + +// GetActualWinnersSelectionDate returns value of ActualWinnersSelectionDate field. +func (m *MessagePremiumGiveawayWinners) GetActualWinnersSelectionDate() (value int32) { + if m == nil { + return + } + return m.ActualWinnersSelectionDate +} + +// GetOnlyNewMembers returns value of OnlyNewMembers field. +func (m *MessagePremiumGiveawayWinners) GetOnlyNewMembers() (value bool) { + if m == nil { + return + } + return m.OnlyNewMembers +} + +// GetWasRefunded returns value of WasRefunded field. +func (m *MessagePremiumGiveawayWinners) GetWasRefunded() (value bool) { + if m == nil { + return + } + return m.WasRefunded +} + +// GetMonthCount returns value of MonthCount field. +func (m *MessagePremiumGiveawayWinners) GetMonthCount() (value int32) { + if m == nil { + return + } + return m.MonthCount +} + +// GetPrizeDescription returns value of PrizeDescription field. +func (m *MessagePremiumGiveawayWinners) GetPrizeDescription() (value string) { + if m == nil { + return + } + return m.PrizeDescription +} + // GetWinnerCount returns value of WinnerCount field. -func (m *MessagePremiumGiveawayCompleted) GetWinnerCount() (value int32) { +func (m *MessagePremiumGiveawayWinners) GetWinnerCount() (value int32) { if m == nil { return } return m.WinnerCount } +// GetWinnerUserIDs returns value of WinnerUserIDs field. +func (m *MessagePremiumGiveawayWinners) GetWinnerUserIDs() (value []int64) { + if m == nil { + return + } + return m.WinnerUserIDs +} + // GetUnclaimedPrizeCount returns value of UnclaimedPrizeCount field. -func (m *MessagePremiumGiveawayCompleted) GetUnclaimedPrizeCount() (value int32) { +func (m *MessagePremiumGiveawayWinners) GetUnclaimedPrizeCount() (value int32) { if m == nil { return } @@ -11980,35 +12651,35 @@ func (m *MessageContactRegistered) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// MessageUserShared represents TL type `messageUserShared#d4dcb77c`. -type MessageUserShared struct { - // Identifier of the shared user - UserID int64 +// MessageUsersShared represents TL type `messageUsersShared#95dca529`. +type MessageUsersShared struct { + // Identifier of the shared users + UserIDs []int64 // Identifier of the keyboard button with the request ButtonID int32 } -// MessageUserSharedTypeID is TL type id of MessageUserShared. -const MessageUserSharedTypeID = 0xd4dcb77c +// MessageUsersSharedTypeID is TL type id of MessageUsersShared. +const MessageUsersSharedTypeID = 0x95dca529 // construct implements constructor of MessageContentClass. -func (m MessageUserShared) construct() MessageContentClass { return &m } +func (m MessageUsersShared) construct() MessageContentClass { return &m } -// Ensuring interfaces in compile-time for MessageUserShared. +// Ensuring interfaces in compile-time for MessageUsersShared. var ( - _ bin.Encoder = &MessageUserShared{} - _ bin.Decoder = &MessageUserShared{} - _ bin.BareEncoder = &MessageUserShared{} - _ bin.BareDecoder = &MessageUserShared{} + _ bin.Encoder = &MessageUsersShared{} + _ bin.Decoder = &MessageUsersShared{} + _ bin.BareEncoder = &MessageUsersShared{} + _ bin.BareDecoder = &MessageUsersShared{} - _ MessageContentClass = &MessageUserShared{} + _ MessageContentClass = &MessageUsersShared{} ) -func (m *MessageUserShared) Zero() bool { +func (m *MessageUsersShared) Zero() bool { if m == nil { return true } - if !(m.UserID == 0) { + if !(m.UserIDs == nil) { return false } if !(m.ButtonID == 0) { @@ -12019,31 +12690,31 @@ func (m *MessageUserShared) Zero() bool { } // String implements fmt.Stringer. -func (m *MessageUserShared) String() string { +func (m *MessageUsersShared) String() string { if m == nil { - return "MessageUserShared(nil)" + return "MessageUsersShared(nil)" } - type Alias MessageUserShared - return fmt.Sprintf("MessageUserShared%+v", Alias(*m)) + type Alias MessageUsersShared + return fmt.Sprintf("MessageUsersShared%+v", Alias(*m)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageUserShared) TypeID() uint32 { - return MessageUserSharedTypeID +func (*MessageUsersShared) TypeID() uint32 { + return MessageUsersSharedTypeID } // TypeName returns name of type in TL schema. -func (*MessageUserShared) TypeName() string { - return "messageUserShared" +func (*MessageUsersShared) TypeName() string { + return "messageUsersShared" } // TypeInfo returns info about TL type. -func (m *MessageUserShared) TypeInfo() tdp.Type { +func (m *MessageUsersShared) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "messageUserShared", - ID: MessageUserSharedTypeID, + Name: "messageUsersShared", + ID: MessageUsersSharedTypeID, } if m == nil { typ.Null = true @@ -12051,8 +12722,8 @@ func (m *MessageUserShared) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "UserID", - SchemaName: "user_id", + Name: "UserIDs", + SchemaName: "user_ids", }, { Name: "ButtonID", @@ -12063,51 +12734,64 @@ func (m *MessageUserShared) TypeInfo() tdp.Type { } // Encode implements bin.Encoder. -func (m *MessageUserShared) Encode(b *bin.Buffer) error { +func (m *MessageUsersShared) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + return fmt.Errorf("can't encode messageUsersShared#95dca529 as nil") } - b.PutID(MessageUserSharedTypeID) + b.PutID(MessageUsersSharedTypeID) return m.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (m *MessageUserShared) EncodeBare(b *bin.Buffer) error { +func (m *MessageUsersShared) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + return fmt.Errorf("can't encode messageUsersShared#95dca529 as nil") + } + b.PutInt(len(m.UserIDs)) + for _, v := range m.UserIDs { + b.PutInt53(v) } - b.PutInt53(m.UserID) b.PutInt32(m.ButtonID) return nil } // Decode implements bin.Decoder. -func (m *MessageUserShared) Decode(b *bin.Buffer) error { +func (m *MessageUsersShared) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + return fmt.Errorf("can't decode messageUsersShared#95dca529 to nil") } - if err := b.ConsumeID(MessageUserSharedTypeID); err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: %w", err) + if err := b.ConsumeID(MessageUsersSharedTypeID); err != nil { + return fmt.Errorf("unable to decode messageUsersShared#95dca529: %w", err) } return m.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (m *MessageUserShared) DecodeBare(b *bin.Buffer) error { +func (m *MessageUsersShared) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + return fmt.Errorf("can't decode messageUsersShared#95dca529 to nil") } { - value, err := b.Int53() + headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field user_id: %w", err) + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field user_ids: %w", err) + } + + if headerLen > 0 { + m.UserIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field user_ids: %w", err) + } + m.UserIDs = append(m.UserIDs, value) } - m.UserID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field button_id: %w", err) + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field button_id: %w", err) } m.ButtonID = value } @@ -12115,15 +12799,21 @@ func (m *MessageUserShared) DecodeBare(b *bin.Buffer) error { } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageUserShared) EncodeTDLibJSON(b tdjson.Encoder) error { +func (m *MessageUsersShared) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + return fmt.Errorf("can't encode messageUsersShared#95dca529 as nil") } b.ObjStart() - b.PutID("messageUserShared") + b.PutID("messageUsersShared") b.Comma() - b.FieldStart("user_id") - b.PutInt53(m.UserID) + b.FieldStart("user_ids") + b.ArrStart() + for _, v := range m.UserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() b.Comma() b.FieldStart("button_id") b.PutInt32(m.ButtonID) @@ -12134,27 +12824,32 @@ func (m *MessageUserShared) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageUserShared) DecodeTDLibJSON(b tdjson.Decoder) error { +func (m *MessageUsersShared) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + return fmt.Errorf("can't decode messageUsersShared#95dca529 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("messageUserShared"); err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: %w", err) + if err := b.ConsumeID("messageUsersShared"); err != nil { + return fmt.Errorf("unable to decode messageUsersShared#95dca529: %w", err) } - case "user_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field user_id: %w", err) + case "user_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field user_ids: %w", err) + } + m.UserIDs = append(m.UserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field user_ids: %w", err) } - m.UserID = value case "button_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field button_id: %w", err) + return fmt.Errorf("unable to decode messageUsersShared#95dca529: field button_id: %w", err) } m.ButtonID = value default: @@ -12164,16 +12859,16 @@ func (m *MessageUserShared) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetUserID returns value of UserID field. -func (m *MessageUserShared) GetUserID() (value int64) { +// GetUserIDs returns value of UserIDs field. +func (m *MessageUsersShared) GetUserIDs() (value []int64) { if m == nil { return } - return m.UserID + return m.UserIDs } // GetButtonID returns value of ButtonID field. -func (m *MessageUserShared) GetButtonID() (value int32) { +func (m *MessageUsersShared) GetButtonID() (value int32) { if m == nil { return } @@ -13798,12 +14493,13 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessagePaymentSuccessful: // messagePaymentSuccessful#53d93cdc // case *tdapi.MessagePaymentSuccessfulBot: // messagePaymentSuccessfulBot#68e13eb9 // case *tdapi.MessageGiftedPremium: // messageGiftedPremium#78d1d0a -// case *tdapi.MessagePremiumGiftCode: // messagePremiumGiftCode#7a9c468f +// case *tdapi.MessagePremiumGiftCode: // messagePremiumGiftCode#26bd1bf3 // case *tdapi.MessagePremiumGiveawayCreated: // messagePremiumGiveawayCreated#270f2c44 // case *tdapi.MessagePremiumGiveaway: // messagePremiumGiveaway#4aa0d0b0 // case *tdapi.MessagePremiumGiveawayCompleted: // messagePremiumGiveawayCompleted#80533949 +// case *tdapi.MessagePremiumGiveawayWinners: // messagePremiumGiveawayWinners#815d5f31 // case *tdapi.MessageContactRegistered: // messageContactRegistered#a678fcff -// case *tdapi.MessageUserShared: // messageUserShared#d4dcb77c +// case *tdapi.MessageUsersShared: // messageUsersShared#95dca529 // case *tdapi.MessageChatShared: // messageChatShared#22db7091 // case *tdapi.MessageBotWriteAccessAllowed: // messageBotWriteAccessAllowed#9a8ab7b4 // case *tdapi.MessageWebAppDataSent: // messageWebAppDataSent#fb033912 @@ -14201,7 +14897,7 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { } return &v, nil case MessagePremiumGiftCodeTypeID: - // Decoding messagePremiumGiftCode#7a9c468f. + // Decoding messagePremiumGiftCode#26bd1bf3. v := MessagePremiumGiftCode{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -14228,6 +14924,13 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case MessagePremiumGiveawayWinnersTypeID: + // Decoding messagePremiumGiveawayWinners#815d5f31. + v := MessagePremiumGiveawayWinners{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case MessageContactRegisteredTypeID: // Decoding messageContactRegistered#a678fcff. v := MessageContactRegistered{} @@ -14235,9 +14938,9 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil - case MessageUserSharedTypeID: - // Decoding messageUserShared#d4dcb77c. - v := MessageUserShared{} + case MessageUsersSharedTypeID: + // Decoding messageUsersShared#95dca529. + v := MessageUsersShared{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } @@ -14668,7 +15371,7 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err } return &v, nil case "messagePremiumGiftCode": - // Decoding messagePremiumGiftCode#7a9c468f. + // Decoding messagePremiumGiftCode#26bd1bf3. v := MessagePremiumGiftCode{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -14695,6 +15398,13 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case "messagePremiumGiveawayWinners": + // Decoding messagePremiumGiveawayWinners#815d5f31. + v := MessagePremiumGiveawayWinners{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case "messageContactRegistered": // Decoding messageContactRegistered#a678fcff. v := MessageContactRegistered{} @@ -14702,9 +15412,9 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil - case "messageUserShared": - // Decoding messageUserShared#d4dcb77c. - v := MessageUserShared{} + case "messageUsersShared": + // Decoding messageUsersShared#95dca529. + v := MessageUsersShared{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } diff --git a/tdapi/tl_open_chat_similar_chat_gen.go b/tdapi/tl_open_chat_similar_chat_gen.go new file mode 100644 index 0000000000..38f8e9c4e4 --- /dev/null +++ b/tdapi/tl_open_chat_similar_chat_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{} +) + +// OpenChatSimilarChatRequest represents TL type `openChatSimilarChat#8fa6f413`. +type OpenChatSimilarChatRequest struct { + // Identifier of the original chat, which similar chats were requested + ChatID int64 + // Identifier of the opened chat + OpenedChatID int64 +} + +// OpenChatSimilarChatRequestTypeID is TL type id of OpenChatSimilarChatRequest. +const OpenChatSimilarChatRequestTypeID = 0x8fa6f413 + +// Ensuring interfaces in compile-time for OpenChatSimilarChatRequest. +var ( + _ bin.Encoder = &OpenChatSimilarChatRequest{} + _ bin.Decoder = &OpenChatSimilarChatRequest{} + _ bin.BareEncoder = &OpenChatSimilarChatRequest{} + _ bin.BareDecoder = &OpenChatSimilarChatRequest{} +) + +func (o *OpenChatSimilarChatRequest) Zero() bool { + if o == nil { + return true + } + if !(o.ChatID == 0) { + return false + } + if !(o.OpenedChatID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (o *OpenChatSimilarChatRequest) String() string { + if o == nil { + return "OpenChatSimilarChatRequest(nil)" + } + type Alias OpenChatSimilarChatRequest + return fmt.Sprintf("OpenChatSimilarChatRequest%+v", Alias(*o)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*OpenChatSimilarChatRequest) TypeID() uint32 { + return OpenChatSimilarChatRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*OpenChatSimilarChatRequest) TypeName() string { + return "openChatSimilarChat" +} + +// TypeInfo returns info about TL type. +func (o *OpenChatSimilarChatRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "openChatSimilarChat", + ID: OpenChatSimilarChatRequestTypeID, + } + if o == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "OpenedChatID", + SchemaName: "opened_chat_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (o *OpenChatSimilarChatRequest) Encode(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't encode openChatSimilarChat#8fa6f413 as nil") + } + b.PutID(OpenChatSimilarChatRequestTypeID) + return o.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (o *OpenChatSimilarChatRequest) EncodeBare(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't encode openChatSimilarChat#8fa6f413 as nil") + } + b.PutInt53(o.ChatID) + b.PutInt53(o.OpenedChatID) + return nil +} + +// Decode implements bin.Decoder. +func (o *OpenChatSimilarChatRequest) Decode(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't decode openChatSimilarChat#8fa6f413 to nil") + } + if err := b.ConsumeID(OpenChatSimilarChatRequestTypeID); err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: %w", err) + } + return o.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (o *OpenChatSimilarChatRequest) DecodeBare(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't decode openChatSimilarChat#8fa6f413 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: field chat_id: %w", err) + } + o.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: field opened_chat_id: %w", err) + } + o.OpenedChatID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (o *OpenChatSimilarChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if o == nil { + return fmt.Errorf("can't encode openChatSimilarChat#8fa6f413 as nil") + } + b.ObjStart() + b.PutID("openChatSimilarChat") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(o.ChatID) + b.Comma() + b.FieldStart("opened_chat_id") + b.PutInt53(o.OpenedChatID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (o *OpenChatSimilarChatRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if o == nil { + return fmt.Errorf("can't decode openChatSimilarChat#8fa6f413 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("openChatSimilarChat"); err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: field chat_id: %w", err) + } + o.ChatID = value + case "opened_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode openChatSimilarChat#8fa6f413: field opened_chat_id: %w", err) + } + o.OpenedChatID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (o *OpenChatSimilarChatRequest) GetChatID() (value int64) { + if o == nil { + return + } + return o.ChatID +} + +// GetOpenedChatID returns value of OpenedChatID field. +func (o *OpenChatSimilarChatRequest) GetOpenedChatID() (value int64) { + if o == nil { + return + } + return o.OpenedChatID +} + +// OpenChatSimilarChat invokes method openChatSimilarChat#8fa6f413 returning error if any. +func (c *Client) OpenChatSimilarChat(ctx context.Context, request *OpenChatSimilarChatRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_payment_provider_gen.go b/tdapi/tl_payment_provider_gen.go index c16478ba98..3b8b321372 100644 --- a/tdapi/tl_payment_provider_gen.go +++ b/tdapi/tl_payment_provider_gen.go @@ -31,14 +31,16 @@ var ( _ = tdjson.Encoder{} ) -// PaymentProviderSmartGlocal represents TL type `paymentProviderSmartGlocal#6b5122ee`. +// PaymentProviderSmartGlocal represents TL type `paymentProviderSmartGlocal#ba047774`. type PaymentProviderSmartGlocal struct { // Public payment token PublicToken string + // URL for sending card tokenization requests + TokenizeURL string } // PaymentProviderSmartGlocalTypeID is TL type id of PaymentProviderSmartGlocal. -const PaymentProviderSmartGlocalTypeID = 0x6b5122ee +const PaymentProviderSmartGlocalTypeID = 0xba047774 // construct implements constructor of PaymentProviderClass. func (p PaymentProviderSmartGlocal) construct() PaymentProviderClass { return &p } @@ -60,6 +62,9 @@ func (p *PaymentProviderSmartGlocal) Zero() bool { if !(p.PublicToken == "") { return false } + if !(p.TokenizeURL == "") { + return false + } return true } @@ -100,6 +105,10 @@ func (p *PaymentProviderSmartGlocal) TypeInfo() tdp.Type { Name: "PublicToken", SchemaName: "public_token", }, + { + Name: "TokenizeURL", + SchemaName: "tokenize_url", + }, } return typ } @@ -107,7 +116,7 @@ func (p *PaymentProviderSmartGlocal) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PaymentProviderSmartGlocal) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode paymentProviderSmartGlocal#6b5122ee as nil") + return fmt.Errorf("can't encode paymentProviderSmartGlocal#ba047774 as nil") } b.PutID(PaymentProviderSmartGlocalTypeID) return p.EncodeBare(b) @@ -116,19 +125,20 @@ func (p *PaymentProviderSmartGlocal) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PaymentProviderSmartGlocal) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode paymentProviderSmartGlocal#6b5122ee as nil") + return fmt.Errorf("can't encode paymentProviderSmartGlocal#ba047774 as nil") } b.PutString(p.PublicToken) + b.PutString(p.TokenizeURL) return nil } // Decode implements bin.Decoder. func (p *PaymentProviderSmartGlocal) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode paymentProviderSmartGlocal#6b5122ee to nil") + return fmt.Errorf("can't decode paymentProviderSmartGlocal#ba047774 to nil") } if err := b.ConsumeID(PaymentProviderSmartGlocalTypeID); err != nil { - return fmt.Errorf("unable to decode paymentProviderSmartGlocal#6b5122ee: %w", err) + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: %w", err) } return p.DecodeBare(b) } @@ -136,22 +146,29 @@ func (p *PaymentProviderSmartGlocal) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PaymentProviderSmartGlocal) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode paymentProviderSmartGlocal#6b5122ee to nil") + return fmt.Errorf("can't decode paymentProviderSmartGlocal#ba047774 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode paymentProviderSmartGlocal#6b5122ee: field public_token: %w", err) + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: field public_token: %w", err) } p.PublicToken = value } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: field tokenize_url: %w", err) + } + p.TokenizeURL = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (p *PaymentProviderSmartGlocal) EncodeTDLibJSON(b tdjson.Encoder) error { if p == nil { - return fmt.Errorf("can't encode paymentProviderSmartGlocal#6b5122ee as nil") + return fmt.Errorf("can't encode paymentProviderSmartGlocal#ba047774 as nil") } b.ObjStart() b.PutID("paymentProviderSmartGlocal") @@ -159,6 +176,9 @@ func (p *PaymentProviderSmartGlocal) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("public_token") b.PutString(p.PublicToken) b.Comma() + b.FieldStart("tokenize_url") + b.PutString(p.TokenizeURL) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -167,21 +187,27 @@ func (p *PaymentProviderSmartGlocal) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (p *PaymentProviderSmartGlocal) DecodeTDLibJSON(b tdjson.Decoder) error { if p == nil { - return fmt.Errorf("can't decode paymentProviderSmartGlocal#6b5122ee to nil") + return fmt.Errorf("can't decode paymentProviderSmartGlocal#ba047774 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("paymentProviderSmartGlocal"); err != nil { - return fmt.Errorf("unable to decode paymentProviderSmartGlocal#6b5122ee: %w", err) + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: %w", err) } case "public_token": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode paymentProviderSmartGlocal#6b5122ee: field public_token: %w", err) + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: field public_token: %w", err) } p.PublicToken = value + case "tokenize_url": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode paymentProviderSmartGlocal#ba047774: field tokenize_url: %w", err) + } + p.TokenizeURL = value default: return b.Skip() } @@ -197,6 +223,14 @@ func (p *PaymentProviderSmartGlocal) GetPublicToken() (value string) { return p.PublicToken } +// GetTokenizeURL returns value of TokenizeURL field. +func (p *PaymentProviderSmartGlocal) GetTokenizeURL() (value string) { + if p == nil { + return + } + return p.TokenizeURL +} + // PaymentProviderStripe represents TL type `paymentProviderStripe#1614e19b`. type PaymentProviderStripe struct { // Stripe API publishable key @@ -643,7 +677,7 @@ const PaymentProviderClassName = "PaymentProvider" // panic(err) // } // switch v := g.(type) { -// case *tdapi.PaymentProviderSmartGlocal: // paymentProviderSmartGlocal#6b5122ee +// case *tdapi.PaymentProviderSmartGlocal: // paymentProviderSmartGlocal#ba047774 // case *tdapi.PaymentProviderStripe: // paymentProviderStripe#1614e19b // case *tdapi.PaymentProviderOther: // paymentProviderOther#b050e0e4 // default: panic(v) @@ -678,7 +712,7 @@ func DecodePaymentProvider(buf *bin.Buffer) (PaymentProviderClass, error) { } switch id { case PaymentProviderSmartGlocalTypeID: - // Decoding paymentProviderSmartGlocal#6b5122ee. + // Decoding paymentProviderSmartGlocal#ba047774. v := PaymentProviderSmartGlocal{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PaymentProviderClass: %w", err) @@ -711,7 +745,7 @@ func DecodeTDLibJSONPaymentProvider(buf tdjson.Decoder) (PaymentProviderClass, e } switch id { case "paymentProviderSmartGlocal": - // Decoding paymentProviderSmartGlocal#6b5122ee. + // Decoding paymentProviderSmartGlocal#ba047774. v := PaymentProviderSmartGlocal{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode PaymentProviderClass: %w", err) diff --git a/tdapi/tl_premium_gift_code_info_gen.go b/tdapi/tl_premium_gift_code_info_gen.go index 432caa31c1..d379581373 100644 --- a/tdapi/tl_premium_gift_code_info_gen.go +++ b/tdapi/tl_premium_gift_code_info_gen.go @@ -33,7 +33,9 @@ var ( // PremiumGiftCodeInfo represents TL type `premiumGiftCodeInfo#b88fa8de`. type PremiumGiftCodeInfo struct { - // Identifier of a chat or a user that created the gift code + // Identifier of a chat or a user that created the gift code; may be null if unknown. If + // null and the code is from messagePremiumGiftCode message, then creator_id from the + // message can be used CreatorID MessageSenderClass // Point in time (Unix timestamp) when the code was created CreationDate int32 @@ -42,7 +44,8 @@ type PremiumGiftCodeInfo struct { // Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or // an identifier of a deleted message GiveawayMessageID int64 - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code + // activation MonthCount int32 // Identifier of a user for which the code was created; 0 if none UserID int64 diff --git a/tdapi/tl_premium_gift_code_payment_option_gen.go b/tdapi/tl_premium_gift_code_payment_option_gen.go index 0a4c2999ea..fbe1e21f7e 100644 --- a/tdapi/tl_premium_gift_code_payment_option_gen.go +++ b/tdapi/tl_premium_gift_code_payment_option_gen.go @@ -39,7 +39,7 @@ type PremiumGiftCodePaymentOption struct { Amount int64 // Number of users which will be able to activate the gift codes UserCount int32 - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 // Identifier of the store product associated with the option; may be empty if none StoreProductID string diff --git a/tdapi/tl_premium_giveaway_parameters_gen.go b/tdapi/tl_premium_giveaway_parameters_gen.go index 799aacafc4..e4de1e34b1 100644 --- a/tdapi/tl_premium_giveaway_parameters_gen.go +++ b/tdapi/tl_premium_giveaway_parameters_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// PremiumGiveawayParameters represents TL type `premiumGiveawayParameters#de917baf`. +// PremiumGiveawayParameters represents TL type `premiumGiveawayParameters#f9f5bf5e`. type PremiumGiveawayParameters struct { // Identifier of the channel chat, which will be automatically boosted by the winners of // the giveaway for duration of the Premium subscription @@ -45,13 +45,17 @@ type PremiumGiveawayParameters struct { WinnersSelectionDate int32 // True, if only new members of the chats will be eligible for the giveaway OnlyNewMembers bool + // True, if the list of winners of the giveaway will be available to everyone + HasPublicWinners bool // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be // eligible for the giveaway. If empty, then all users can participate in the giveaway. CountryCodes []string + // Additional description of the giveaway prize; 0-128 characters + PrizeDescription string } // PremiumGiveawayParametersTypeID is TL type id of PremiumGiveawayParameters. -const PremiumGiveawayParametersTypeID = 0xde917baf +const PremiumGiveawayParametersTypeID = 0xf9f5bf5e // Ensuring interfaces in compile-time for PremiumGiveawayParameters. var ( @@ -77,9 +81,15 @@ func (p *PremiumGiveawayParameters) Zero() bool { if !(p.OnlyNewMembers == false) { return false } + if !(p.HasPublicWinners == false) { + return false + } if !(p.CountryCodes == nil) { return false } + if !(p.PrizeDescription == "") { + return false + } return true } @@ -132,10 +142,18 @@ func (p *PremiumGiveawayParameters) TypeInfo() tdp.Type { Name: "OnlyNewMembers", SchemaName: "only_new_members", }, + { + Name: "HasPublicWinners", + SchemaName: "has_public_winners", + }, { Name: "CountryCodes", SchemaName: "country_codes", }, + { + Name: "PrizeDescription", + SchemaName: "prize_description", + }, } return typ } @@ -143,7 +161,7 @@ func (p *PremiumGiveawayParameters) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PremiumGiveawayParameters) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode premiumGiveawayParameters#de917baf as nil") + return fmt.Errorf("can't encode premiumGiveawayParameters#f9f5bf5e as nil") } b.PutID(PremiumGiveawayParametersTypeID) return p.EncodeBare(b) @@ -152,7 +170,7 @@ func (p *PremiumGiveawayParameters) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PremiumGiveawayParameters) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode premiumGiveawayParameters#de917baf as nil") + return fmt.Errorf("can't encode premiumGiveawayParameters#f9f5bf5e as nil") } b.PutInt53(p.BoostedChatID) b.PutInt(len(p.AdditionalChatIDs)) @@ -161,20 +179,22 @@ func (p *PremiumGiveawayParameters) EncodeBare(b *bin.Buffer) error { } b.PutInt32(p.WinnersSelectionDate) b.PutBool(p.OnlyNewMembers) + b.PutBool(p.HasPublicWinners) b.PutInt(len(p.CountryCodes)) for _, v := range p.CountryCodes { b.PutString(v) } + b.PutString(p.PrizeDescription) return nil } // Decode implements bin.Decoder. func (p *PremiumGiveawayParameters) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode premiumGiveawayParameters#de917baf to nil") + return fmt.Errorf("can't decode premiumGiveawayParameters#f9f5bf5e to nil") } if err := b.ConsumeID(PremiumGiveawayParametersTypeID); err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: %w", err) } return p.DecodeBare(b) } @@ -182,19 +202,19 @@ func (p *PremiumGiveawayParameters) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PremiumGiveawayParameters) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode premiumGiveawayParameters#de917baf to nil") + return fmt.Errorf("can't decode premiumGiveawayParameters#f9f5bf5e to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field boosted_chat_id: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field boosted_chat_id: %w", err) } p.BoostedChatID = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field additional_chat_ids: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field additional_chat_ids: %w", err) } if headerLen > 0 { @@ -203,7 +223,7 @@ func (p *PremiumGiveawayParameters) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field additional_chat_ids: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field additional_chat_ids: %w", err) } p.AdditionalChatIDs = append(p.AdditionalChatIDs, value) } @@ -211,21 +231,28 @@ func (p *PremiumGiveawayParameters) DecodeBare(b *bin.Buffer) error { { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field winners_selection_date: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field winners_selection_date: %w", err) } p.WinnersSelectionDate = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field only_new_members: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field only_new_members: %w", err) } p.OnlyNewMembers = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field has_public_winners: %w", err) + } + p.HasPublicWinners = value + } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field country_codes: %w", err) } if headerLen > 0 { @@ -234,18 +261,25 @@ func (p *PremiumGiveawayParameters) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field country_codes: %w", err) } p.CountryCodes = append(p.CountryCodes, value) } } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field prize_description: %w", err) + } + p.PrizeDescription = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (p *PremiumGiveawayParameters) EncodeTDLibJSON(b tdjson.Encoder) error { if p == nil { - return fmt.Errorf("can't encode premiumGiveawayParameters#de917baf as nil") + return fmt.Errorf("can't encode premiumGiveawayParameters#f9f5bf5e as nil") } b.ObjStart() b.PutID("premiumGiveawayParameters") @@ -268,6 +302,9 @@ func (p *PremiumGiveawayParameters) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("only_new_members") b.PutBool(p.OnlyNewMembers) b.Comma() + b.FieldStart("has_public_winners") + b.PutBool(p.HasPublicWinners) + b.Comma() b.FieldStart("country_codes") b.ArrStart() for _, v := range p.CountryCodes { @@ -277,6 +314,9 @@ func (p *PremiumGiveawayParameters) EncodeTDLibJSON(b tdjson.Encoder) error { b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("prize_description") + b.PutString(p.PrizeDescription) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -285,55 +325,67 @@ func (p *PremiumGiveawayParameters) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (p *PremiumGiveawayParameters) DecodeTDLibJSON(b tdjson.Decoder) error { if p == nil { - return fmt.Errorf("can't decode premiumGiveawayParameters#de917baf to nil") + return fmt.Errorf("can't decode premiumGiveawayParameters#f9f5bf5e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("premiumGiveawayParameters"); err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: %w", err) } case "boosted_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field boosted_chat_id: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field boosted_chat_id: %w", err) } p.BoostedChatID = value case "additional_chat_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field additional_chat_ids: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field additional_chat_ids: %w", err) } p.AdditionalChatIDs = append(p.AdditionalChatIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field additional_chat_ids: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field additional_chat_ids: %w", err) } case "winners_selection_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field winners_selection_date: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field winners_selection_date: %w", err) } p.WinnersSelectionDate = value case "only_new_members": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field only_new_members: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field only_new_members: %w", err) } p.OnlyNewMembers = value + case "has_public_winners": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field has_public_winners: %w", err) + } + p.HasPublicWinners = value case "country_codes": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field country_codes: %w", err) } p.CountryCodes = append(p.CountryCodes, value) return nil }); err != nil { - return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field country_codes: %w", err) } + case "prize_description": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#f9f5bf5e: field prize_description: %w", err) + } + p.PrizeDescription = value default: return b.Skip() } @@ -373,6 +425,14 @@ func (p *PremiumGiveawayParameters) GetOnlyNewMembers() (value bool) { return p.OnlyNewMembers } +// GetHasPublicWinners returns value of HasPublicWinners field. +func (p *PremiumGiveawayParameters) GetHasPublicWinners() (value bool) { + if p == nil { + return + } + return p.HasPublicWinners +} + // GetCountryCodes returns value of CountryCodes field. func (p *PremiumGiveawayParameters) GetCountryCodes() (value []string) { if p == nil { @@ -380,3 +440,11 @@ func (p *PremiumGiveawayParameters) GetCountryCodes() (value []string) { } return p.CountryCodes } + +// GetPrizeDescription returns value of PrizeDescription field. +func (p *PremiumGiveawayParameters) GetPrizeDescription() (value string) { + if p == nil { + return + } + return p.PrizeDescription +} diff --git a/tdapi/tl_premium_payment_option_gen.go b/tdapi/tl_premium_payment_option_gen.go index 0cc8deb327..397f4af0a6 100644 --- a/tdapi/tl_premium_payment_option_gen.go +++ b/tdapi/tl_premium_payment_option_gen.go @@ -39,7 +39,7 @@ type PremiumPaymentOption struct { Amount int64 // The discount associated with this option, as a percentage DiscountPercentage int32 - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 // Identifier of the store product associated with the option StoreProductID string diff --git a/tdapi/tl_prepaid_premium_giveaway_gen.go b/tdapi/tl_prepaid_premium_giveaway_gen.go index 4cceb6abb2..157fe4f35a 100644 --- a/tdapi/tl_prepaid_premium_giveaway_gen.go +++ b/tdapi/tl_prepaid_premium_giveaway_gen.go @@ -37,7 +37,8 @@ type PrepaidPremiumGiveaway struct { ID int64 // Number of users which will receive Telegram Premium subscription gift codes WinnerCount int32 - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code + // activation MonthCount int32 // Point in time (Unix timestamp) when the giveaway was paid PaymentDate int32 diff --git a/tdapi/tl_profile_accent_color_gen.go b/tdapi/tl_profile_accent_color_gen.go index 3d70f6cd77..545a200a1e 100644 --- a/tdapi/tl_profile_accent_color_gen.go +++ b/tdapi/tl_profile_accent_color_gen.go @@ -31,18 +31,20 @@ var ( _ = tdjson.Encoder{} ) -// ProfileAccentColor represents TL type `profileAccentColor#2bea798e`. +// ProfileAccentColor represents TL type `profileAccentColor#87d7df12`. type ProfileAccentColor struct { // Profile accent color identifier ID int32 - // Description of accent colors expected to be used in light themes + // Accent colors expected to be used in light themes LightThemeColors ProfileAccentColors - // Description of accent colors expected to be used in dark themes + // Accent colors expected to be used in dark themes DarkThemeColors ProfileAccentColors + // The minimum chat boost level required to use the color + MinChatBoostLevel int32 } // ProfileAccentColorTypeID is TL type id of ProfileAccentColor. -const ProfileAccentColorTypeID = 0x2bea798e +const ProfileAccentColorTypeID = 0x87d7df12 // Ensuring interfaces in compile-time for ProfileAccentColor. var ( @@ -65,6 +67,9 @@ func (p *ProfileAccentColor) Zero() bool { if !(p.DarkThemeColors.Zero()) { return false } + if !(p.MinChatBoostLevel == 0) { + return false + } return true } @@ -113,6 +118,10 @@ func (p *ProfileAccentColor) TypeInfo() tdp.Type { Name: "DarkThemeColors", SchemaName: "dark_theme_colors", }, + { + Name: "MinChatBoostLevel", + SchemaName: "min_chat_boost_level", + }, } return typ } @@ -120,7 +129,7 @@ func (p *ProfileAccentColor) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *ProfileAccentColor) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode profileAccentColor#2bea798e as nil") + return fmt.Errorf("can't encode profileAccentColor#87d7df12 as nil") } b.PutID(ProfileAccentColorTypeID) return p.EncodeBare(b) @@ -129,25 +138,26 @@ func (p *ProfileAccentColor) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *ProfileAccentColor) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode profileAccentColor#2bea798e as nil") + return fmt.Errorf("can't encode profileAccentColor#87d7df12 as nil") } b.PutInt32(p.ID) if err := p.LightThemeColors.Encode(b); err != nil { - return fmt.Errorf("unable to encode profileAccentColor#2bea798e: field light_theme_colors: %w", err) + return fmt.Errorf("unable to encode profileAccentColor#87d7df12: field light_theme_colors: %w", err) } if err := p.DarkThemeColors.Encode(b); err != nil { - return fmt.Errorf("unable to encode profileAccentColor#2bea798e: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to encode profileAccentColor#87d7df12: field dark_theme_colors: %w", err) } + b.PutInt32(p.MinChatBoostLevel) return nil } // Decode implements bin.Decoder. func (p *ProfileAccentColor) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode profileAccentColor#2bea798e to nil") + return fmt.Errorf("can't decode profileAccentColor#87d7df12 to nil") } if err := b.ConsumeID(ProfileAccentColorTypeID); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: %w", err) } return p.DecodeBare(b) } @@ -155,24 +165,31 @@ func (p *ProfileAccentColor) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *ProfileAccentColor) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode profileAccentColor#2bea798e to nil") + return fmt.Errorf("can't decode profileAccentColor#87d7df12 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field id: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field id: %w", err) } p.ID = value } { if err := p.LightThemeColors.Decode(b); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field light_theme_colors: %w", err) } } { if err := p.DarkThemeColors.Decode(b); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field dark_theme_colors: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field min_chat_boost_level: %w", err) } + p.MinChatBoostLevel = value } return nil } @@ -180,7 +197,7 @@ func (p *ProfileAccentColor) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (p *ProfileAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { if p == nil { - return fmt.Errorf("can't encode profileAccentColor#2bea798e as nil") + return fmt.Errorf("can't encode profileAccentColor#87d7df12 as nil") } b.ObjStart() b.PutID("profileAccentColor") @@ -190,14 +207,17 @@ func (p *ProfileAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("light_theme_colors") if err := p.LightThemeColors.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode profileAccentColor#2bea798e: field light_theme_colors: %w", err) + return fmt.Errorf("unable to encode profileAccentColor#87d7df12: field light_theme_colors: %w", err) } b.Comma() b.FieldStart("dark_theme_colors") if err := p.DarkThemeColors.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode profileAccentColor#2bea798e: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to encode profileAccentColor#87d7df12: field dark_theme_colors: %w", err) } b.Comma() + b.FieldStart("min_chat_boost_level") + b.PutInt32(p.MinChatBoostLevel) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -206,29 +226,35 @@ func (p *ProfileAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (p *ProfileAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { if p == nil { - return fmt.Errorf("can't decode profileAccentColor#2bea798e to nil") + return fmt.Errorf("can't decode profileAccentColor#87d7df12 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("profileAccentColor"); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: %w", err) } case "id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field id: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field id: %w", err) } p.ID = value case "light_theme_colors": if err := p.LightThemeColors.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field light_theme_colors: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field light_theme_colors: %w", err) } case "dark_theme_colors": if err := p.DarkThemeColors.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode profileAccentColor#2bea798e: field dark_theme_colors: %w", err) + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field dark_theme_colors: %w", err) } + case "min_chat_boost_level": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode profileAccentColor#87d7df12: field min_chat_boost_level: %w", err) + } + p.MinChatBoostLevel = value default: return b.Skip() } @@ -259,3 +285,11 @@ func (p *ProfileAccentColor) GetDarkThemeColors() (value ProfileAccentColors) { } return p.DarkThemeColors } + +// GetMinChatBoostLevel returns value of MinChatBoostLevel field. +func (p *ProfileAccentColor) GetMinChatBoostLevel() (value int32) { + if p == nil { + return + } + return p.MinChatBoostLevel +} diff --git a/tdapi/tl_public_forward_gen.go b/tdapi/tl_public_forward_gen.go new file mode 100644 index 0000000000..82bbf3ce75 --- /dev/null +++ b/tdapi/tl_public_forward_gen.go @@ -0,0 +1,501 @@ +// 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{} +) + +// PublicForwardMessage represents TL type `publicForwardMessage#317b3d2`. +type PublicForwardMessage struct { + // Information about the message + Message Message +} + +// PublicForwardMessageTypeID is TL type id of PublicForwardMessage. +const PublicForwardMessageTypeID = 0x317b3d2 + +// construct implements constructor of PublicForwardClass. +func (p PublicForwardMessage) construct() PublicForwardClass { return &p } + +// Ensuring interfaces in compile-time for PublicForwardMessage. +var ( + _ bin.Encoder = &PublicForwardMessage{} + _ bin.Decoder = &PublicForwardMessage{} + _ bin.BareEncoder = &PublicForwardMessage{} + _ bin.BareDecoder = &PublicForwardMessage{} + + _ PublicForwardClass = &PublicForwardMessage{} +) + +func (p *PublicForwardMessage) Zero() bool { + if p == nil { + return true + } + if !(p.Message.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PublicForwardMessage) String() string { + if p == nil { + return "PublicForwardMessage(nil)" + } + type Alias PublicForwardMessage + return fmt.Sprintf("PublicForwardMessage%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PublicForwardMessage) TypeID() uint32 { + return PublicForwardMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*PublicForwardMessage) TypeName() string { + return "publicForwardMessage" +} + +// TypeInfo returns info about TL type. +func (p *PublicForwardMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "publicForwardMessage", + ID: PublicForwardMessageTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Message", + SchemaName: "message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PublicForwardMessage) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardMessage#317b3d2 as nil") + } + b.PutID(PublicForwardMessageTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PublicForwardMessage) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardMessage#317b3d2 as nil") + } + if err := p.Message.Encode(b); err != nil { + return fmt.Errorf("unable to encode publicForwardMessage#317b3d2: field message: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PublicForwardMessage) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardMessage#317b3d2 to nil") + } + if err := b.ConsumeID(PublicForwardMessageTypeID); err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#317b3d2: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PublicForwardMessage) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardMessage#317b3d2 to nil") + } + { + if err := p.Message.Decode(b); err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#317b3d2: field message: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PublicForwardMessage) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardMessage#317b3d2 as nil") + } + b.ObjStart() + b.PutID("publicForwardMessage") + b.Comma() + b.FieldStart("message") + if err := p.Message.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode publicForwardMessage#317b3d2: field message: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PublicForwardMessage) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardMessage#317b3d2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("publicForwardMessage"); err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#317b3d2: %w", err) + } + case "message": + if err := p.Message.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#317b3d2: field message: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetMessage returns value of Message field. +func (p *PublicForwardMessage) GetMessage() (value Message) { + if p == nil { + return + } + return p.Message +} + +// PublicForwardStory represents TL type `publicForwardStory#7fdf26af`. +type PublicForwardStory struct { + // Information about the story + Story Story +} + +// PublicForwardStoryTypeID is TL type id of PublicForwardStory. +const PublicForwardStoryTypeID = 0x7fdf26af + +// construct implements constructor of PublicForwardClass. +func (p PublicForwardStory) construct() PublicForwardClass { return &p } + +// Ensuring interfaces in compile-time for PublicForwardStory. +var ( + _ bin.Encoder = &PublicForwardStory{} + _ bin.Decoder = &PublicForwardStory{} + _ bin.BareEncoder = &PublicForwardStory{} + _ bin.BareDecoder = &PublicForwardStory{} + + _ PublicForwardClass = &PublicForwardStory{} +) + +func (p *PublicForwardStory) Zero() bool { + if p == nil { + return true + } + if !(p.Story.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PublicForwardStory) String() string { + if p == nil { + return "PublicForwardStory(nil)" + } + type Alias PublicForwardStory + return fmt.Sprintf("PublicForwardStory%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PublicForwardStory) TypeID() uint32 { + return PublicForwardStoryTypeID +} + +// TypeName returns name of type in TL schema. +func (*PublicForwardStory) TypeName() string { + return "publicForwardStory" +} + +// TypeInfo returns info about TL type. +func (p *PublicForwardStory) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "publicForwardStory", + ID: PublicForwardStoryTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Story", + SchemaName: "story", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PublicForwardStory) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardStory#7fdf26af as nil") + } + b.PutID(PublicForwardStoryTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PublicForwardStory) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardStory#7fdf26af as nil") + } + if err := p.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode publicForwardStory#7fdf26af: field story: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PublicForwardStory) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardStory#7fdf26af to nil") + } + if err := b.ConsumeID(PublicForwardStoryTypeID); err != nil { + return fmt.Errorf("unable to decode publicForwardStory#7fdf26af: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PublicForwardStory) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardStory#7fdf26af to nil") + } + { + if err := p.Story.Decode(b); err != nil { + return fmt.Errorf("unable to decode publicForwardStory#7fdf26af: field story: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PublicForwardStory) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardStory#7fdf26af as nil") + } + b.ObjStart() + b.PutID("publicForwardStory") + b.Comma() + b.FieldStart("story") + if err := p.Story.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode publicForwardStory#7fdf26af: field story: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PublicForwardStory) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardStory#7fdf26af to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("publicForwardStory"); err != nil { + return fmt.Errorf("unable to decode publicForwardStory#7fdf26af: %w", err) + } + case "story": + if err := p.Story.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode publicForwardStory#7fdf26af: field story: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetStory returns value of Story field. +func (p *PublicForwardStory) GetStory() (value Story) { + if p == nil { + return + } + return p.Story +} + +// PublicForwardClassName is schema name of PublicForwardClass. +const PublicForwardClassName = "PublicForward" + +// PublicForwardClass represents PublicForward generic type. +// +// Example: +// +// g, err := tdapi.DecodePublicForward(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.PublicForwardMessage: // publicForwardMessage#317b3d2 +// case *tdapi.PublicForwardStory: // publicForwardStory#7fdf26af +// default: panic(v) +// } +type PublicForwardClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PublicForwardClass + + // 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 +} + +// DecodePublicForward implements binary de-serialization for PublicForwardClass. +func DecodePublicForward(buf *bin.Buffer) (PublicForwardClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PublicForwardMessageTypeID: + // Decoding publicForwardMessage#317b3d2. + v := PublicForwardMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + case PublicForwardStoryTypeID: + // Decoding publicForwardStory#7fdf26af. + v := PublicForwardStory{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONPublicForward implements binary de-serialization for PublicForwardClass. +func DecodeTDLibJSONPublicForward(buf tdjson.Decoder) (PublicForwardClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "publicForwardMessage": + // Decoding publicForwardMessage#317b3d2. + v := PublicForwardMessage{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + case "publicForwardStory": + // Decoding publicForwardStory#7fdf26af. + v := PublicForwardStory{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// PublicForward boxes the PublicForwardClass providing a helper. +type PublicForwardBox struct { + PublicForward PublicForwardClass +} + +// Decode implements bin.Decoder for PublicForwardBox. +func (b *PublicForwardBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PublicForwardBox to nil") + } + v, err := DecodePublicForward(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PublicForward = v + return nil +} + +// Encode implements bin.Encode for PublicForwardBox. +func (b *PublicForwardBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PublicForward == nil { + return fmt.Errorf("unable to encode PublicForwardClass as nil") + } + return b.PublicForward.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for PublicForwardBox. +func (b *PublicForwardBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode PublicForwardBox to nil") + } + v, err := DecodeTDLibJSONPublicForward(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PublicForward = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for PublicForwardBox. +func (b *PublicForwardBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.PublicForward == nil { + return fmt.Errorf("unable to encode PublicForwardClass as nil") + } + return b.PublicForward.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_public_forwards_gen.go b/tdapi/tl_public_forwards_gen.go new file mode 100644 index 0000000000..8d24ce8440 --- /dev/null +++ b/tdapi/tl_public_forwards_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{} +) + +// PublicForwards represents TL type `publicForwards#3ed29447`. +type PublicForwards struct { + // Approximate total number of messages and stories found + TotalCount int32 + // List of found public forwards and reposts + Forwards []PublicForwardClass + // The offset for the next request. If empty, then there are no more results + NextOffset string +} + +// PublicForwardsTypeID is TL type id of PublicForwards. +const PublicForwardsTypeID = 0x3ed29447 + +// Ensuring interfaces in compile-time for PublicForwards. +var ( + _ bin.Encoder = &PublicForwards{} + _ bin.Decoder = &PublicForwards{} + _ bin.BareEncoder = &PublicForwards{} + _ bin.BareDecoder = &PublicForwards{} +) + +func (p *PublicForwards) Zero() bool { + if p == nil { + return true + } + if !(p.TotalCount == 0) { + return false + } + if !(p.Forwards == nil) { + return false + } + if !(p.NextOffset == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PublicForwards) String() string { + if p == nil { + return "PublicForwards(nil)" + } + type Alias PublicForwards + return fmt.Sprintf("PublicForwards%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PublicForwards) TypeID() uint32 { + return PublicForwardsTypeID +} + +// TypeName returns name of type in TL schema. +func (*PublicForwards) TypeName() string { + return "publicForwards" +} + +// TypeInfo returns info about TL type. +func (p *PublicForwards) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "publicForwards", + ID: PublicForwardsTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "TotalCount", + SchemaName: "total_count", + }, + { + Name: "Forwards", + SchemaName: "forwards", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PublicForwards) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwards#3ed29447 as nil") + } + b.PutID(PublicForwardsTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PublicForwards) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwards#3ed29447 as nil") + } + b.PutInt32(p.TotalCount) + b.PutInt(len(p.Forwards)) + for idx, v := range p.Forwards { + if v == nil { + return fmt.Errorf("unable to encode publicForwards#3ed29447: field forwards element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare publicForwards#3ed29447: field forwards element with index %d: %w", idx, err) + } + } + b.PutString(p.NextOffset) + return nil +} + +// Decode implements bin.Decoder. +func (p *PublicForwards) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwards#3ed29447 to nil") + } + if err := b.ConsumeID(PublicForwardsTypeID); err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PublicForwards) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwards#3ed29447 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field total_count: %w", err) + } + p.TotalCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field forwards: %w", err) + } + + if headerLen > 0 { + p.Forwards = make([]PublicForwardClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodePublicForward(b) + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field forwards: %w", err) + } + p.Forwards = append(p.Forwards, value) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field next_offset: %w", err) + } + p.NextOffset = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PublicForwards) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode publicForwards#3ed29447 as nil") + } + b.ObjStart() + b.PutID("publicForwards") + b.Comma() + b.FieldStart("total_count") + b.PutInt32(p.TotalCount) + b.Comma() + b.FieldStart("forwards") + b.ArrStart() + for idx, v := range p.Forwards { + if v == nil { + return fmt.Errorf("unable to encode publicForwards#3ed29447: field forwards element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode publicForwards#3ed29447: field forwards element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("next_offset") + b.PutString(p.NextOffset) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PublicForwards) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode publicForwards#3ed29447 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("publicForwards"); err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: %w", err) + } + case "total_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field total_count: %w", err) + } + p.TotalCount = value + case "forwards": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONPublicForward(b) + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field forwards: %w", err) + } + p.Forwards = append(p.Forwards, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field forwards: %w", err) + } + case "next_offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode publicForwards#3ed29447: field next_offset: %w", err) + } + p.NextOffset = value + default: + return b.Skip() + } + return nil + }) +} + +// GetTotalCount returns value of TotalCount field. +func (p *PublicForwards) GetTotalCount() (value int32) { + if p == nil { + return + } + return p.TotalCount +} + +// GetForwards returns value of Forwards field. +func (p *PublicForwards) GetForwards() (value []PublicForwardClass) { + if p == nil { + return + } + return p.Forwards +} + +// GetNextOffset returns value of NextOffset field. +func (p *PublicForwards) GetNextOffset() (value string) { + if p == nil { + return + } + return p.NextOffset +} diff --git a/tdapi/tl_push_message_content_gen.go b/tdapi/tl_push_message_content_gen.go index 7a498fda41..24f96bf068 100644 --- a/tdapi/tl_push_message_content_gen.go +++ b/tdapi/tl_push_message_content_gen.go @@ -2500,7 +2500,8 @@ func (p *PushMessageContentPoll) GetIsPinned() (value bool) { // PushMessageContentPremiumGiftCode represents TL type `pushMessageContentPremiumGiftCode#18a15025`. type PushMessageContentPremiumGiftCode struct { - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code + // activation MonthCount int32 } @@ -2669,7 +2670,7 @@ type PushMessageContentPremiumGiveaway struct { // Number of users which will receive Telegram Premium subscription gift codes; 0 for // pinned message WinnerCount int32 - // Number of month the Telegram Premium subscription will be active after code + // Number of months the Telegram Premium subscription will be active after code // activation; 0 for pinned message MonthCount int32 // True, if the message is a pinned message with the specified content diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 9736537b7a..df06cd7d1d 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -165,9 +165,9 @@ func TypesMap() map[uint32]string { PremiumGiveawayParticipantStatusDisallowedCountryTypeID: "premiumGiveawayParticipantStatusDisallowedCountry#89684090", PremiumGiveawayInfoOngoingTypeID: "premiumGiveawayInfoOngoing#48d3ce6f", PremiumGiveawayInfoCompletedTypeID: "premiumGiveawayInfoCompleted#fc8b501b", - AccentColorTypeID: "accentColor#83d57cd6", + AccentColorTypeID: "accentColor#ed4c76c9", ProfileAccentColorsTypeID: "profileAccentColors#218e9367", - ProfileAccentColorTypeID: "profileAccentColor#2bea798e", + ProfileAccentColorTypeID: "profileAccentColor#87d7df12", EmojiStatusTypeID: "emojiStatus#dbd91636", EmojiStatusesTypeID: "emojiStatuses#eaeb9bdc", UsernamesTypeID: "usernames#bf343063", @@ -215,7 +215,7 @@ func TypesMap() map[uint32]string { ChatJoinRequestsInfoTypeID: "chatJoinRequestsInfo#6aff5df5", BasicGroupTypeID: "basicGroup#f464168f", BasicGroupFullInfoTypeID: "basicGroupFullInfo#d62e521e", - SupergroupTypeID: "supergroup#8b30b3c5", + SupergroupTypeID: "supergroup#39a14289", SupergroupFullInfoTypeID: "supergroupFullInfo#f2f19203", SecretChatStatePendingTypeID: "secretChatStatePending#9e6c967c", SecretChatStateReadyTypeID: "secretChatStateReady#9ff4b7e9", @@ -306,7 +306,7 @@ func TypesMap() map[uint32]string { ChatAvailableReactionsAllTypeID: "chatAvailableReactionsAll#dff07c4e", ChatAvailableReactionsSomeTypeID: "chatAvailableReactionsSome#d3cc0a6b", VideoChatTypeID: "videoChat#ae158d28", - ChatTypeID: "chat#4dd64d7d", + ChatTypeID: "chat#70f33afe", ChatsTypeID: "chats#9b93e3eb", ChatNearbyTypeID: "chatNearby#2de4255", ChatsNearbyTypeID: "chatsNearby#cc744cff", @@ -323,7 +323,7 @@ func TypesMap() map[uint32]string { KeyboardButtonTypeRequestPhoneNumberTypeID: "keyboardButtonTypeRequestPhoneNumber#a4d9b7b9", KeyboardButtonTypeRequestLocationTypeID: "keyboardButtonTypeRequestLocation#f8828cfd", KeyboardButtonTypeRequestPollTypeID: "keyboardButtonTypeRequestPoll#7164dcb8", - KeyboardButtonTypeRequestUserTypeID: "keyboardButtonTypeRequestUser#88ffb430", + KeyboardButtonTypeRequestUsersTypeID: "keyboardButtonTypeRequestUsers#7e63ef90", KeyboardButtonTypeRequestChatTypeID: "keyboardButtonTypeRequestChat#103ea7a2", KeyboardButtonTypeWebAppTypeID: "keyboardButtonTypeWebApp#70c8ff62", KeyboardButtonTypeID: "keyboardButton#84a0ce74", @@ -425,7 +425,7 @@ func TypesMap() map[uint32]string { InputCredentialsNewTypeID: "inputCredentialsNew#ce8bf12a", InputCredentialsApplePayTypeID: "inputCredentialsApplePay#b5b2d6d1", InputCredentialsGooglePayTypeID: "inputCredentialsGooglePay#32544764", - PaymentProviderSmartGlocalTypeID: "paymentProviderSmartGlocal#6b5122ee", + PaymentProviderSmartGlocalTypeID: "paymentProviderSmartGlocal#ba047774", PaymentProviderStripeTypeID: "paymentProviderStripe#1614e19b", PaymentProviderOtherTypeID: "paymentProviderOther#b050e0e4", PaymentOptionTypeID: "paymentOption#ee79989b", @@ -440,7 +440,7 @@ func TypesMap() map[uint32]string { MessageExtendedMediaPhotoTypeID: "messageExtendedMediaPhoto#c68b4530", MessageExtendedMediaVideoTypeID: "messageExtendedMediaVideo#11acbf3b", MessageExtendedMediaUnsupportedTypeID: "messageExtendedMediaUnsupported#141f5020", - PremiumGiveawayParametersTypeID: "premiumGiveawayParameters#de917baf", + PremiumGiveawayParametersTypeID: "premiumGiveawayParameters#f9f5bf5e", DatedFileTypeID: "datedFile#9247b09d", PassportElementTypePersonalDetailsTypeID: "passportElementTypePersonalDetails#c27ad953", PassportElementTypePassportTypeID: "passportElementTypePassport#e5fdab48", @@ -565,12 +565,13 @@ func TypesMap() map[uint32]string { MessagePaymentSuccessfulTypeID: "messagePaymentSuccessful#53d93cdc", MessagePaymentSuccessfulBotTypeID: "messagePaymentSuccessfulBot#68e13eb9", MessageGiftedPremiumTypeID: "messageGiftedPremium#78d1d0a", - MessagePremiumGiftCodeTypeID: "messagePremiumGiftCode#7a9c468f", + MessagePremiumGiftCodeTypeID: "messagePremiumGiftCode#26bd1bf3", MessagePremiumGiveawayCreatedTypeID: "messagePremiumGiveawayCreated#270f2c44", MessagePremiumGiveawayTypeID: "messagePremiumGiveaway#4aa0d0b0", MessagePremiumGiveawayCompletedTypeID: "messagePremiumGiveawayCompleted#80533949", + MessagePremiumGiveawayWinnersTypeID: "messagePremiumGiveawayWinners#815d5f31", MessageContactRegisteredTypeID: "messageContactRegistered#a678fcff", - MessageUserSharedTypeID: "messageUserShared#d4dcb77c", + MessageUsersSharedTypeID: "messageUsersShared#95dca529", MessageChatSharedTypeID: "messageChatShared#22db7091", MessageBotWriteAccessAllowedTypeID: "messageBotWriteAccessAllowed#9a8ab7b4", MessageWebAppDataSentTypeID: "messageWebAppDataSent#fb033912", @@ -665,8 +666,8 @@ func TypesMap() map[uint32]string { UserStatusLastMonthTypeID: "userStatusLastMonth#77ebc742", StickersTypeID: "stickers#83491d00", EmojisTypeID: "emojis#77274a16", - StickerSetTypeID: "stickerSet#ac3cff8b", - StickerSetInfoTypeID: "stickerSetInfo#cbbbedfd", + StickerSetTypeID: "stickerSet#133c3db9", + StickerSetInfoTypeID: "stickerSetInfo#fb991fda", StickerSetsTypeID: "stickerSets#b8a6490d", TrendingStickerSetsTypeID: "trendingStickerSets#298f12cc", EmojiCategoryTypeID: "emojiCategory#c6e9e5a4", @@ -674,17 +675,17 @@ func TypesMap() map[uint32]string { EmojiCategoryTypeDefaultTypeID: "emojiCategoryTypeDefault#46db626b", EmojiCategoryTypeEmojiStatusTypeID: "emojiCategoryTypeEmojiStatus#5254b347", EmojiCategoryTypeChatPhotoTypeID: "emojiCategoryTypeChatPhoto#3f200529", - StoryViewerTypeID: "storyViewer#cf0fb132", - StoryViewersTypeID: "storyViewers#9ae27d98", StoryAreaPositionTypeID: "storyAreaPosition#6389679", StoryAreaTypeLocationTypeID: "storyAreaTypeLocation#9ebe1186", StoryAreaTypeVenueTypeID: "storyAreaTypeVenue#18ae4d06", StoryAreaTypeSuggestedReactionTypeID: "storyAreaTypeSuggestedReaction#f95f927c", + StoryAreaTypeMessageTypeID: "storyAreaTypeMessage#bfef76b4", StoryAreaTypeID: "storyArea#c9ff075e", InputStoryAreaTypeLocationTypeID: "inputStoryAreaTypeLocation#6849d762", InputStoryAreaTypeFoundVenueTypeID: "inputStoryAreaTypeFoundVenue#accda496", InputStoryAreaTypePreviousVenueTypeID: "inputStoryAreaTypePreviousVenue#6e124e0c", InputStoryAreaTypeSuggestedReactionTypeID: "inputStoryAreaTypeSuggestedReaction#7d4751d3", + InputStoryAreaTypeMessageTypeID: "inputStoryAreaTypeMessage#f01be457", InputStoryAreaTypeID: "inputStoryArea#752ae7f", InputStoryAreasTypeID: "inputStoryAreas#b8ba29fe", StoryVideoTypeID: "storyVideo#8588ba3", @@ -699,14 +700,21 @@ func TypesMap() map[uint32]string { StoryOriginHiddenUserTypeID: "storyOriginHiddenUser#5a1f89ec", StoryRepostInfoTypeID: "storyRepostInfo#ff7fa440", StoryInteractionInfoTypeID: "storyInteractionInfo#e1557fc7", - StoryTypeID: "story#29dd2b0d", + StoryTypeID: "story#8e358ca2", StoriesTypeID: "stories#5a860711", StoryFullIDTypeID: "storyFullId#701d31f5", StoryInfoTypeID: "storyInfo#8997c352", ChatActiveStoriesTypeID: "chatActiveStories#d923d773", - StoryPublicForwardMessageTypeID: "storyPublicForwardMessage#fd39c20c", - StoryPublicForwardStoryTypeID: "storyPublicForwardStory#f7e6c146", - StoryPublicForwardsTypeID: "storyPublicForwards#fcacb389", + StoryInteractionTypeViewTypeID: "storyInteractionTypeView#53e337d0", + StoryInteractionTypeForwardTypeID: "storyInteractionTypeForward#27d23cff", + StoryInteractionTypeRepostTypeID: "storyInteractionTypeRepost#c32279c4", + StoryInteractionTypeID: "storyInteraction#d624d222", + StoryInteractionsTypeID: "storyInteractions#f9f5d50f", + PublicForwardMessageTypeID: "publicForwardMessage#317b3d2", + PublicForwardStoryTypeID: "publicForwardStory#7fdf26af", + PublicForwardsTypeID: "publicForwards#3ed29447", + ChatBoostLevelFeaturesTypeID: "chatBoostLevelFeatures#fe9f29de", + ChatBoostFeaturesTypeID: "chatBoostFeatures#b9672a54", ChatBoostSourceGiftCodeTypeID: "chatBoostSourceGiftCode#fa2412ba", ChatBoostSourceGiveawayTypeID: "chatBoostSourceGiveaway#90d1c70", ChatBoostSourcePremiumTypeID: "chatBoostSourcePremium#ed4eb", @@ -826,7 +834,9 @@ func TypesMap() map[uint32]string { ChatEventMemberPromotedTypeID: "chatEventMemberPromoted#1f4f6861", ChatEventMemberRestrictedTypeID: "chatEventMemberRestricted#5f951e05", ChatEventAvailableReactionsChangedTypeID: "chatEventAvailableReactionsChanged#97b8e0bf", + ChatEventBackgroundChangedTypeID: "chatEventBackgroundChanged#b6ed6d38", ChatEventDescriptionChangedTypeID: "chatEventDescriptionChanged#254cf1e", + ChatEventEmojiStatusChangedTypeID: "chatEventEmojiStatusChanged#83e97b1e", ChatEventLinkedChatChangedTypeID: "chatEventLinkedChatChanged#6b2271af", ChatEventLocationChangedTypeID: "chatEventLocationChanged#e7cdfd4e", ChatEventMessageAutoDeleteTimeChangedTypeID: "chatEventMessageAutoDeleteTimeChanged#1083f24", @@ -837,8 +847,8 @@ func TypesMap() map[uint32]string { ChatEventTitleChangedTypeID: "chatEventTitleChanged#43990ad2", ChatEventUsernameChangedTypeID: "chatEventUsernameChanged#6707b56b", ChatEventActiveUsernamesChangedTypeID: "chatEventActiveUsernamesChanged#95e54656", - ChatEventAccentColorChangedTypeID: "chatEventAccentColorChanged#2a327e32", - ChatEventBackgroundCustomEmojiChangedTypeID: "chatEventBackgroundCustomEmojiChanged#d2671e9a", + ChatEventAccentColorChangedTypeID: "chatEventAccentColorChanged#e6837733", + ChatEventProfileAccentColorChangedTypeID: "chatEventProfileAccentColorChanged#a5b8da64", ChatEventHasProtectedContentToggledTypeID: "chatEventHasProtectedContentToggled#f5044201", ChatEventInvitesToggledTypeID: "chatEventInvitesToggled#fc45966b", ChatEventIsAllHistoryAvailableToggledTypeID: "chatEventIsAllHistoryAvailableToggled#a0b03c15", @@ -946,6 +956,7 @@ func TypesMap() map[uint32]string { BackgroundTypeWallpaperTypeID: "backgroundTypeWallpaper#758c4c7b", BackgroundTypePatternTypeID: "backgroundTypePattern#4ce716fd", BackgroundTypeFillTypeID: "backgroundTypeFill#3b301c2c", + BackgroundTypeChatThemeTypeID: "backgroundTypeChatTheme#4d7a9752", InputBackgroundLocalTypeID: "inputBackgroundLocal#97dd74a4", InputBackgroundRemoteTypeID: "inputBackgroundRemote#ef9c3219", InputBackgroundPreviousTypeID: "inputBackgroundPrevious#eb06575e", @@ -1118,6 +1129,7 @@ func TypesMap() map[uint32]string { InternalLinkTypePassportDataRequestTypeID: "internalLinkTypePassportDataRequest#c50fce81", InternalLinkTypePhoneNumberConfirmationTypeID: "internalLinkTypePhoneNumberConfirmation#68bf6b16", InternalLinkTypePremiumFeaturesTypeID: "internalLinkTypePremiumFeatures#48884f49", + InternalLinkTypePremiumGiftTypeID: "internalLinkTypePremiumGift#5ad56d41", InternalLinkTypePremiumGiftCodeTypeID: "internalLinkTypePremiumGiftCode#de5c9892", InternalLinkTypePrivacyAndSecuritySettingsTypeID: "internalLinkTypePrivacyAndSecuritySettings#ad5f6acf", InternalLinkTypeProxyTypeID: "internalLinkTypeProxy#b1b12cea", @@ -1213,6 +1225,7 @@ func TypesMap() map[uint32]string { SuggestedActionUpgradePremiumTypeID: "suggestedActionUpgradePremium#70aa79fb", SuggestedActionRestorePremiumTypeID: "suggestedActionRestorePremium#e909dd64", SuggestedActionSubscribeToAnnualPremiumTypeID: "suggestedActionSubscribeToAnnualPremium#164978bb", + SuggestedActionGiftPremiumForChristmasTypeID: "suggestedActionGiftPremiumForChristmas#93b3ee6f", CountTypeID: "count#4d38f104", TextTypeID: "text#22765898", SecondsTypeID: "seconds#3936e58e", @@ -1267,8 +1280,7 @@ func TypesMap() map[uint32]string { UpdateNewChatTypeID: "updateNewChat#7bb98ccd", UpdateChatTitleTypeID: "updateChatTitle#f58b85a4", UpdateChatPhotoTypeID: "updateChatPhoto#eca5423f", - UpdateChatAccentColorTypeID: "updateChatAccentColor#fc111634", - UpdateChatBackgroundCustomEmojiTypeID: "updateChatBackgroundCustomEmoji#dcbad97a", + UpdateChatAccentColorsTypeID: "updateChatAccentColors#b7b8f8f9", UpdateChatPermissionsTypeID: "updateChatPermissions#9f52176d", UpdateChatLastMessageTypeID: "updateChatLastMessage#f10cab1d", UpdateChatPositionTypeID: "updateChatPosition#ff76fa77", @@ -1277,6 +1289,7 @@ func TypesMap() map[uint32]string { UpdateChatActionBarTypeID: "updateChatActionBar#d9a258c2", UpdateChatAvailableReactionsTypeID: "updateChatAvailableReactions#8ab413f9", UpdateChatDraftMessageTypeID: "updateChatDraftMessage#2bf257d4", + UpdateChatEmojiStatusTypeID: "updateChatEmojiStatus#77796510", UpdateChatMessageSenderTypeID: "updateChatMessageSender#77705241", UpdateChatMessageAutoDeleteTimeTypeID: "updateChatMessageAutoDeleteTime#71425de5", UpdateChatNotificationSettingsTypeID: "updateChatNotificationSettings#d020b456", @@ -1342,7 +1355,7 @@ func TypesMap() map[uint32]string { UpdateFavoriteStickersTypeID: "updateFavoriteStickers#113f2b6a", UpdateSavedAnimationsTypeID: "updateSavedAnimations#1084a1c8", UpdateSavedNotificationSoundsTypeID: "updateSavedNotificationSounds#5a6653b4", - UpdateSelectedBackgroundTypeID: "updateSelectedBackground#99bd205d", + UpdateDefaultBackgroundTypeID: "updateDefaultBackground#d550952f", UpdateChatThemesTypeID: "updateChatThemes#98dc58d5", UpdateAccentColorsTypeID: "updateAccentColors#1316555e", UpdateProfileAccentColorsTypeID: "updateProfileAccentColors#bf8e7430", @@ -1375,6 +1388,8 @@ func TypesMap() map[uint32]string { UpdateChatMemberTypeID: "updateChatMember#6000e29c", UpdateNewChatJoinRequestTypeID: "updateNewChatJoinRequest#7e48b843", UpdateChatBoostTypeID: "updateChatBoost#50727e24", + UpdateMessageReactionTypeID: "updateMessageReaction#f46c854a", + UpdateMessageReactionsTypeID: "updateMessageReactions#bd5618e9", UpdatesTypeID: "updates#b9829222", LogStreamDefaultTypeID: "logStreamDefault#52e296bc", LogStreamFileTypeID: "logStreamFile#5b528de5", @@ -1455,6 +1470,7 @@ func TypesMap() map[uint32]string { SearchChatsNearbyRequestTypeID: "searchChatsNearby#f445c81f", GetChatSimilarChatsRequestTypeID: "getChatSimilarChats#bb508f83", GetChatSimilarChatCountRequestTypeID: "getChatSimilarChatCount#463e968e", + OpenChatSimilarChatRequestTypeID: "openChatSimilarChat#8fa6f413", GetTopChatsRequestTypeID: "getTopChats#e8d95221", RemoveTopChatRequestTypeID: "removeTopChat#8e481e55", SearchRecentlyFoundChatsRequestTypeID: "searchRecentlyFoundChats#62320591", @@ -1538,6 +1554,7 @@ func TypesMap() map[uint32]string { ClearRecentReactionsRequestTypeID: "clearRecentReactions#4d61c752", AddMessageReactionRequestTypeID: "addMessageReaction#549855ed", RemoveMessageReactionRequestTypeID: "removeMessageReaction#97474d7b", + SetMessageReactionsRequestTypeID: "setMessageReactions#71fa9e8f", GetMessageAddedReactionsRequestTypeID: "getMessageAddedReactions#7dc6ae52", SetDefaultReactionTypeRequestTypeID: "setDefaultReactionType#65038a3d", SearchQuoteRequestTypeID: "searchQuote#6864011f", @@ -1558,7 +1575,7 @@ func TypesMap() map[uint32]string { HideSuggestedActionRequestTypeID: "hideSuggestedAction#a2ef2b7f", GetLoginURLInfoRequestTypeID: "getLoginUrlInfo#ccc99db3", GetLoginURLRequestTypeID: "getLoginUrl#2f3295d1", - ShareUserWithBotRequestTypeID: "shareUserWithBot#f132ffdc", + ShareUsersWithBotRequestTypeID: "shareUsersWithBot#58448550", ShareChatWithBotRequestTypeID: "shareChatWithBot#a6530ae2", GetInlineQueryResultsRequestTypeID: "getInlineQueryResults#79dcf86c", AnswerInlineQueryRequestTypeID: "answerInlineQuery#ac7cc5e6", @@ -1625,7 +1642,9 @@ func TypesMap() map[uint32]string { SetChatTitleRequestTypeID: "setChatTitle#9cabebf", SetChatPhotoRequestTypeID: "setChatPhoto#e97b8d03", SetChatAccentColorRequestTypeID: "setChatAccentColor#349f57ca", + SetChatProfileAccentColorRequestTypeID: "setChatProfileAccentColor#4227ae7a", SetChatMessageAutoDeleteTimeRequestTypeID: "setChatMessageAutoDeleteTime#a641b4ff", + SetChatEmojiStatusRequestTypeID: "setChatEmojiStatus#55881912", SetChatPermissionsRequestTypeID: "setChatPermissions#7f7706fe", SetChatBackgroundRequestTypeID: "setChatBackground#eb4c3fe", DeleteChatBackgroundRequestTypeID: "deleteChatBackground#1316e678", @@ -1688,10 +1707,13 @@ func TypesMap() map[uint32]string { CloseStoryRequestTypeID: "closeStory#443d0f55", GetStoryAvailableReactionsRequestTypeID: "getStoryAvailableReactions#23854d3b", SetStoryReactionRequestTypeID: "setStoryReaction#ac8b4fa7", - GetStoryViewersRequestTypeID: "getStoryViewers#40df8dba", + GetStoryInteractionsRequestTypeID: "getStoryInteractions#1cd1400d", + GetChatStoryInteractionsRequestTypeID: "getChatStoryInteractions#c5ec7376", ReportStoryRequestTypeID: "reportStory#9b5f709b", ActivateStoryStealthModeRequestTypeID: "activateStoryStealthMode#c3db8491", - GetStoryPublicForwardsRequestTypeID: "getStoryPublicForwards#8b835be9", + GetStoryPublicForwardsRequestTypeID: "getStoryPublicForwards#68f7dcbb", + GetChatBoostLevelFeaturesRequestTypeID: "getChatBoostLevelFeatures#71f15dfb", + GetChatBoostFeaturesRequestTypeID: "getChatBoostFeatures#34e76822", GetAvailableChatBoostSlotsRequestTypeID: "getAvailableChatBoostSlots#7307ebd5", GetChatBoostStatusRequestTypeID: "getChatBoostStatus#cfac8acf", BoostChatRequestTypeID: "boostChat#890ccd68", @@ -1705,6 +1727,9 @@ func TypesMap() map[uint32]string { GetRecentEmojiStatusesRequestTypeID: "getRecentEmojiStatuses#ae3a3d29", GetDefaultEmojiStatusesRequestTypeID: "getDefaultEmojiStatuses#24e45ec3", ClearRecentEmojiStatusesRequestTypeID: "clearRecentEmojiStatuses#e671cb5e", + GetThemedChatEmojiStatusesRequestTypeID: "getThemedChatEmojiStatuses#fb735cb5", + GetDefaultChatEmojiStatusesRequestTypeID: "getDefaultChatEmojiStatuses#a7aa86e6", + GetDisallowedChatEmojiStatusesRequestTypeID: "getDisallowedChatEmojiStatuses#d2144da0", DownloadFileRequestTypeID: "downloadFile#3f253234", GetFileDownloadedPrefixSizeRequestTypeID: "getFileDownloadedPrefixSize#3304bd2d", CancelDownloadFileRequestTypeID: "cancelDownloadFile#8b8052de", @@ -1906,12 +1931,13 @@ func TypesMap() map[uint32]string { DeleteSavedCredentialsRequestTypeID: "deleteSavedCredentials#314056d2", CreateInvoiceLinkRequestTypeID: "createInvoiceLink#cebe921", GetSupportUserRequestTypeID: "getSupportUser#98acec9c", - GetBackgroundsRequestTypeID: "getBackgrounds#ed88bf9", GetBackgroundURLRequestTypeID: "getBackgroundUrl#2bbc6fd2", SearchBackgroundRequestTypeID: "searchBackground#80fb9121", - SetBackgroundRequestTypeID: "setBackground#c2487387", - RemoveBackgroundRequestTypeID: "removeBackground#a783a196", - ResetBackgroundsRequestTypeID: "resetBackgrounds#c35cb78", + SetDefaultBackgroundRequestTypeID: "setDefaultBackground#89d1a8a1", + DeleteDefaultBackgroundRequestTypeID: "deleteDefaultBackground#b2a4ed3e", + GetInstalledBackgroundsRequestTypeID: "getInstalledBackgrounds#c154d05f", + RemoveInstalledBackgroundRequestTypeID: "removeInstalledBackground#5041253c", + ResetInstalledBackgroundsRequestTypeID: "resetInstalledBackgrounds#70540157", GetLocalizationTargetInfoRequestTypeID: "getLocalizationTargetInfo#6e3d1f86", GetLanguagePackInfoRequestTypeID: "getLanguagePackInfo#7bd8daa8", GetLanguagePackStringsRequestTypeID: "getLanguagePackStrings#b0b867bb", @@ -1940,7 +1966,7 @@ func TypesMap() map[uint32]string { ReportMessageReactionsRequestTypeID: "reportMessageReactions#36c88827", GetChatStatisticsRequestTypeID: "getChatStatistics#137e8198", GetMessageStatisticsRequestTypeID: "getMessageStatistics#4bb5a1d8", - GetMessagePublicForwardsRequestTypeID: "getMessagePublicForwards#6006a949", + GetMessagePublicForwardsRequestTypeID: "getMessagePublicForwards#519da4b4", GetStoryStatisticsRequestTypeID: "getStoryStatistics#3a964342", GetStatisticalGraphRequestTypeID: "getStatisticalGraph#419f8d9b", GetStorageStatisticsRequestTypeID: "getStorageStatistics#cd254b37", @@ -2016,7 +2042,6 @@ func TypesMap() map[uint32]string { GetPhoneNumberInfoSyncRequestTypeID: "getPhoneNumberInfoSync#209b7d38", GetDeepLinkInfoRequestTypeID: "getDeepLinkInfo#28923f7e", GetApplicationConfigRequestTypeID: "getApplicationConfig#93550682", - AddApplicationChangelogRequestTypeID: "addApplicationChangelog#8bf37fc9", SaveApplicationLogEventRequestTypeID: "saveApplicationLogEvent#cfa6c20e", GetApplicationDownloadLinkRequestTypeID: "getApplicationDownloadLink#6ad2fc4", AddProxyRequestTypeID: "addProxy#13c2bcd8", @@ -2346,7 +2371,7 @@ func NamesMap() map[string]uint32 { "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, - "keyboardButtonTypeRequestUser": KeyboardButtonTypeRequestUserTypeID, + "keyboardButtonTypeRequestUsers": KeyboardButtonTypeRequestUsersTypeID, "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, "keyboardButton": KeyboardButtonTypeID, @@ -2592,8 +2617,9 @@ func NamesMap() map[string]uint32 { "messagePremiumGiveawayCreated": MessagePremiumGiveawayCreatedTypeID, "messagePremiumGiveaway": MessagePremiumGiveawayTypeID, "messagePremiumGiveawayCompleted": MessagePremiumGiveawayCompletedTypeID, + "messagePremiumGiveawayWinners": MessagePremiumGiveawayWinnersTypeID, "messageContactRegistered": MessageContactRegisteredTypeID, - "messageUserShared": MessageUserSharedTypeID, + "messageUsersShared": MessageUsersSharedTypeID, "messageChatShared": MessageChatSharedTypeID, "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, "messageWebAppDataSent": MessageWebAppDataSentTypeID, @@ -2697,17 +2723,17 @@ func NamesMap() map[string]uint32 { "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, - "storyViewer": StoryViewerTypeID, - "storyViewers": StoryViewersTypeID, "storyAreaPosition": StoryAreaPositionTypeID, "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, + "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, "storyArea": StoryAreaTypeID, "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, + "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, "inputStoryArea": InputStoryAreaTypeID, "inputStoryAreas": InputStoryAreasTypeID, "storyVideo": StoryVideoTypeID, @@ -2727,9 +2753,16 @@ func NamesMap() map[string]uint32 { "storyFullId": StoryFullIDTypeID, "storyInfo": StoryInfoTypeID, "chatActiveStories": ChatActiveStoriesTypeID, - "storyPublicForwardMessage": StoryPublicForwardMessageTypeID, - "storyPublicForwardStory": StoryPublicForwardStoryTypeID, - "storyPublicForwards": StoryPublicForwardsTypeID, + "storyInteractionTypeView": StoryInteractionTypeViewTypeID, + "storyInteractionTypeForward": StoryInteractionTypeForwardTypeID, + "storyInteractionTypeRepost": StoryInteractionTypeRepostTypeID, + "storyInteraction": StoryInteractionTypeID, + "storyInteractions": StoryInteractionsTypeID, + "publicForwardMessage": PublicForwardMessageTypeID, + "publicForwardStory": PublicForwardStoryTypeID, + "publicForwards": PublicForwardsTypeID, + "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, + "chatBoostFeatures": ChatBoostFeaturesTypeID, "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, @@ -2849,7 +2882,9 @@ func NamesMap() map[string]uint32 { "chatEventMemberPromoted": ChatEventMemberPromotedTypeID, "chatEventMemberRestricted": ChatEventMemberRestrictedTypeID, "chatEventAvailableReactionsChanged": ChatEventAvailableReactionsChangedTypeID, + "chatEventBackgroundChanged": ChatEventBackgroundChangedTypeID, "chatEventDescriptionChanged": ChatEventDescriptionChangedTypeID, + "chatEventEmojiStatusChanged": ChatEventEmojiStatusChangedTypeID, "chatEventLinkedChatChanged": ChatEventLinkedChatChangedTypeID, "chatEventLocationChanged": ChatEventLocationChangedTypeID, "chatEventMessageAutoDeleteTimeChanged": ChatEventMessageAutoDeleteTimeChangedTypeID, @@ -2861,7 +2896,7 @@ func NamesMap() map[string]uint32 { "chatEventUsernameChanged": ChatEventUsernameChangedTypeID, "chatEventActiveUsernamesChanged": ChatEventActiveUsernamesChangedTypeID, "chatEventAccentColorChanged": ChatEventAccentColorChangedTypeID, - "chatEventBackgroundCustomEmojiChanged": ChatEventBackgroundCustomEmojiChangedTypeID, + "chatEventProfileAccentColorChanged": ChatEventProfileAccentColorChangedTypeID, "chatEventHasProtectedContentToggled": ChatEventHasProtectedContentToggledTypeID, "chatEventInvitesToggled": ChatEventInvitesToggledTypeID, "chatEventIsAllHistoryAvailableToggled": ChatEventIsAllHistoryAvailableToggledTypeID, @@ -2969,6 +3004,7 @@ func NamesMap() map[string]uint32 { "backgroundTypeWallpaper": BackgroundTypeWallpaperTypeID, "backgroundTypePattern": BackgroundTypePatternTypeID, "backgroundTypeFill": BackgroundTypeFillTypeID, + "backgroundTypeChatTheme": BackgroundTypeChatThemeTypeID, "inputBackgroundLocal": InputBackgroundLocalTypeID, "inputBackgroundRemote": InputBackgroundRemoteTypeID, "inputBackgroundPrevious": InputBackgroundPreviousTypeID, @@ -3141,6 +3177,7 @@ func NamesMap() map[string]uint32 { "internalLinkTypePassportDataRequest": InternalLinkTypePassportDataRequestTypeID, "internalLinkTypePhoneNumberConfirmation": InternalLinkTypePhoneNumberConfirmationTypeID, "internalLinkTypePremiumFeatures": InternalLinkTypePremiumFeaturesTypeID, + "internalLinkTypePremiumGift": InternalLinkTypePremiumGiftTypeID, "internalLinkTypePremiumGiftCode": InternalLinkTypePremiumGiftCodeTypeID, "internalLinkTypePrivacyAndSecuritySettings": InternalLinkTypePrivacyAndSecuritySettingsTypeID, "internalLinkTypeProxy": InternalLinkTypeProxyTypeID, @@ -3236,844 +3273,857 @@ func NamesMap() map[string]uint32 { "suggestedActionUpgradePremium": SuggestedActionUpgradePremiumTypeID, "suggestedActionRestorePremium": SuggestedActionRestorePremiumTypeID, "suggestedActionSubscribeToAnnualPremium": SuggestedActionSubscribeToAnnualPremiumTypeID, - "count": CountTypeID, - "text": TextTypeID, - "seconds": SecondsTypeID, - "fileDownloadedPrefixSize": FileDownloadedPrefixSizeTypeID, - "deepLinkInfo": DeepLinkInfoTypeID, - "textParseModeMarkdown": TextParseModeMarkdownTypeID, - "textParseModeHTML": TextParseModeHTMLTypeID, - "proxyTypeSocks5": ProxyTypeSocks5TypeID, - "proxyTypeHttp": ProxyTypeHTTPTypeID, - "proxyTypeMtproto": ProxyTypeMtprotoTypeID, - "proxy": ProxyTypeID, - "proxies": ProxiesTypeID, - "inputSticker": InputStickerTypeID, - "dateRange": DateRangeTypeID, - "statisticalValue": StatisticalValueTypeID, - "statisticalGraphData": StatisticalGraphDataTypeID, - "statisticalGraphAsync": StatisticalGraphAsyncTypeID, - "statisticalGraphError": StatisticalGraphErrorTypeID, - "chatStatisticsObjectTypeMessage": ChatStatisticsObjectTypeMessageTypeID, - "chatStatisticsObjectTypeStory": ChatStatisticsObjectTypeStoryTypeID, - "chatStatisticsInteractionInfo": ChatStatisticsInteractionInfoTypeID, - "chatStatisticsMessageSenderInfo": ChatStatisticsMessageSenderInfoTypeID, - "chatStatisticsAdministratorActionsInfo": ChatStatisticsAdministratorActionsInfoTypeID, - "chatStatisticsInviterInfo": ChatStatisticsInviterInfoTypeID, - "chatStatisticsSupergroup": ChatStatisticsSupergroupTypeID, - "chatStatisticsChannel": ChatStatisticsChannelTypeID, - "messageStatistics": MessageStatisticsTypeID, - "storyStatistics": StoryStatisticsTypeID, - "point": PointTypeID, - "vectorPathCommandLine": VectorPathCommandLineTypeID, - "vectorPathCommandCubicBezierCurve": VectorPathCommandCubicBezierCurveTypeID, - "botCommandScopeDefault": BotCommandScopeDefaultTypeID, - "botCommandScopeAllPrivateChats": BotCommandScopeAllPrivateChatsTypeID, - "botCommandScopeAllGroupChats": BotCommandScopeAllGroupChatsTypeID, - "botCommandScopeAllChatAdministrators": BotCommandScopeAllChatAdministratorsTypeID, - "botCommandScopeChat": BotCommandScopeChatTypeID, - "botCommandScopeChatAdministrators": BotCommandScopeChatAdministratorsTypeID, - "botCommandScopeChatMember": BotCommandScopeChatMemberTypeID, - "updateAuthorizationState": UpdateAuthorizationStateTypeID, - "updateNewMessage": UpdateNewMessageTypeID, - "updateMessageSendAcknowledged": UpdateMessageSendAcknowledgedTypeID, - "updateMessageSendSucceeded": UpdateMessageSendSucceededTypeID, - "updateMessageSendFailed": UpdateMessageSendFailedTypeID, - "updateMessageContent": UpdateMessageContentTypeID, - "updateMessageEdited": UpdateMessageEditedTypeID, - "updateMessageIsPinned": UpdateMessageIsPinnedTypeID, - "updateMessageInteractionInfo": UpdateMessageInteractionInfoTypeID, - "updateMessageContentOpened": UpdateMessageContentOpenedTypeID, - "updateMessageMentionRead": UpdateMessageMentionReadTypeID, - "updateMessageUnreadReactions": UpdateMessageUnreadReactionsTypeID, - "updateMessageLiveLocationViewed": UpdateMessageLiveLocationViewedTypeID, - "updateNewChat": UpdateNewChatTypeID, - "updateChatTitle": UpdateChatTitleTypeID, - "updateChatPhoto": UpdateChatPhotoTypeID, - "updateChatAccentColor": UpdateChatAccentColorTypeID, - "updateChatBackgroundCustomEmoji": UpdateChatBackgroundCustomEmojiTypeID, - "updateChatPermissions": UpdateChatPermissionsTypeID, - "updateChatLastMessage": UpdateChatLastMessageTypeID, - "updateChatPosition": UpdateChatPositionTypeID, - "updateChatReadInbox": UpdateChatReadInboxTypeID, - "updateChatReadOutbox": UpdateChatReadOutboxTypeID, - "updateChatActionBar": UpdateChatActionBarTypeID, - "updateChatAvailableReactions": UpdateChatAvailableReactionsTypeID, - "updateChatDraftMessage": UpdateChatDraftMessageTypeID, - "updateChatMessageSender": UpdateChatMessageSenderTypeID, - "updateChatMessageAutoDeleteTime": UpdateChatMessageAutoDeleteTimeTypeID, - "updateChatNotificationSettings": UpdateChatNotificationSettingsTypeID, - "updateChatPendingJoinRequests": UpdateChatPendingJoinRequestsTypeID, - "updateChatReplyMarkup": UpdateChatReplyMarkupTypeID, - "updateChatBackground": UpdateChatBackgroundTypeID, - "updateChatTheme": UpdateChatThemeTypeID, - "updateChatUnreadMentionCount": UpdateChatUnreadMentionCountTypeID, - "updateChatUnreadReactionCount": UpdateChatUnreadReactionCountTypeID, - "updateChatVideoChat": UpdateChatVideoChatTypeID, - "updateChatDefaultDisableNotification": UpdateChatDefaultDisableNotificationTypeID, - "updateChatHasProtectedContent": UpdateChatHasProtectedContentTypeID, - "updateChatIsTranslatable": UpdateChatIsTranslatableTypeID, - "updateChatIsMarkedAsUnread": UpdateChatIsMarkedAsUnreadTypeID, - "updateChatViewAsTopics": UpdateChatViewAsTopicsTypeID, - "updateChatBlockList": UpdateChatBlockListTypeID, - "updateChatHasScheduledMessages": UpdateChatHasScheduledMessagesTypeID, - "updateChatFolders": UpdateChatFoldersTypeID, - "updateChatOnlineMemberCount": UpdateChatOnlineMemberCountTypeID, - "updateForumTopicInfo": UpdateForumTopicInfoTypeID, - "updateScopeNotificationSettings": UpdateScopeNotificationSettingsTypeID, - "updateNotification": UpdateNotificationTypeID, - "updateNotificationGroup": UpdateNotificationGroupTypeID, - "updateActiveNotifications": UpdateActiveNotificationsTypeID, - "updateHavePendingNotifications": UpdateHavePendingNotificationsTypeID, - "updateDeleteMessages": UpdateDeleteMessagesTypeID, - "updateChatAction": UpdateChatActionTypeID, - "updateUserStatus": UpdateUserStatusTypeID, - "updateUser": UpdateUserTypeID, - "updateBasicGroup": UpdateBasicGroupTypeID, - "updateSupergroup": UpdateSupergroupTypeID, - "updateSecretChat": UpdateSecretChatTypeID, - "updateUserFullInfo": UpdateUserFullInfoTypeID, - "updateBasicGroupFullInfo": UpdateBasicGroupFullInfoTypeID, - "updateSupergroupFullInfo": UpdateSupergroupFullInfoTypeID, - "updateServiceNotification": UpdateServiceNotificationTypeID, - "updateFile": UpdateFileTypeID, - "updateFileGenerationStart": UpdateFileGenerationStartTypeID, - "updateFileGenerationStop": UpdateFileGenerationStopTypeID, - "updateFileDownloads": UpdateFileDownloadsTypeID, - "updateFileAddedToDownloads": UpdateFileAddedToDownloadsTypeID, - "updateFileDownload": UpdateFileDownloadTypeID, - "updateFileRemovedFromDownloads": UpdateFileRemovedFromDownloadsTypeID, - "updateCall": UpdateCallTypeID, - "updateGroupCall": UpdateGroupCallTypeID, - "updateGroupCallParticipant": UpdateGroupCallParticipantTypeID, - "updateNewCallSignalingData": UpdateNewCallSignalingDataTypeID, - "updateUserPrivacySettingRules": UpdateUserPrivacySettingRulesTypeID, - "updateUnreadMessageCount": UpdateUnreadMessageCountTypeID, - "updateUnreadChatCount": UpdateUnreadChatCountTypeID, - "updateStory": UpdateStoryTypeID, - "updateStoryDeleted": UpdateStoryDeletedTypeID, - "updateStorySendSucceeded": UpdateStorySendSucceededTypeID, - "updateStorySendFailed": UpdateStorySendFailedTypeID, - "updateChatActiveStories": UpdateChatActiveStoriesTypeID, - "updateStoryListChatCount": UpdateStoryListChatCountTypeID, - "updateStoryStealthMode": UpdateStoryStealthModeTypeID, - "updateOption": UpdateOptionTypeID, - "updateStickerSet": UpdateStickerSetTypeID, - "updateInstalledStickerSets": UpdateInstalledStickerSetsTypeID, - "updateTrendingStickerSets": UpdateTrendingStickerSetsTypeID, - "updateRecentStickers": UpdateRecentStickersTypeID, - "updateFavoriteStickers": UpdateFavoriteStickersTypeID, - "updateSavedAnimations": UpdateSavedAnimationsTypeID, - "updateSavedNotificationSounds": UpdateSavedNotificationSoundsTypeID, - "updateSelectedBackground": UpdateSelectedBackgroundTypeID, - "updateChatThemes": UpdateChatThemesTypeID, - "updateAccentColors": UpdateAccentColorsTypeID, - "updateProfileAccentColors": UpdateProfileAccentColorsTypeID, - "updateLanguagePackStrings": UpdateLanguagePackStringsTypeID, - "updateConnectionState": UpdateConnectionStateTypeID, - "updateTermsOfService": UpdateTermsOfServiceTypeID, - "updateUsersNearby": UpdateUsersNearbyTypeID, - "updateUnconfirmedSession": UpdateUnconfirmedSessionTypeID, - "updateAttachmentMenuBots": UpdateAttachmentMenuBotsTypeID, - "updateWebAppMessageSent": UpdateWebAppMessageSentTypeID, - "updateActiveEmojiReactions": UpdateActiveEmojiReactionsTypeID, - "updateDefaultReactionType": UpdateDefaultReactionTypeTypeID, - "updateSpeechRecognitionTrial": UpdateSpeechRecognitionTrialTypeID, - "updateDiceEmojis": UpdateDiceEmojisTypeID, - "updateAnimatedEmojiMessageClicked": UpdateAnimatedEmojiMessageClickedTypeID, - "updateAnimationSearchParameters": UpdateAnimationSearchParametersTypeID, - "updateSuggestedActions": UpdateSuggestedActionsTypeID, - "updateAddChatMembersPrivacyForbidden": UpdateAddChatMembersPrivacyForbiddenTypeID, - "updateAutosaveSettings": UpdateAutosaveSettingsTypeID, - "updateNewInlineQuery": UpdateNewInlineQueryTypeID, - "updateNewChosenInlineResult": UpdateNewChosenInlineResultTypeID, - "updateNewCallbackQuery": UpdateNewCallbackQueryTypeID, - "updateNewInlineCallbackQuery": UpdateNewInlineCallbackQueryTypeID, - "updateNewShippingQuery": UpdateNewShippingQueryTypeID, - "updateNewPreCheckoutQuery": UpdateNewPreCheckoutQueryTypeID, - "updateNewCustomEvent": UpdateNewCustomEventTypeID, - "updateNewCustomQuery": UpdateNewCustomQueryTypeID, - "updatePoll": UpdatePollTypeID, - "updatePollAnswer": UpdatePollAnswerTypeID, - "updateChatMember": UpdateChatMemberTypeID, - "updateNewChatJoinRequest": UpdateNewChatJoinRequestTypeID, - "updateChatBoost": UpdateChatBoostTypeID, - "updates": UpdatesTypeID, - "logStreamDefault": LogStreamDefaultTypeID, - "logStreamFile": LogStreamFileTypeID, - "logStreamEmpty": LogStreamEmptyTypeID, - "logVerbosityLevel": LogVerbosityLevelTypeID, - "logTags": LogTagsTypeID, - "userSupportInfo": UserSupportInfoTypeID, - "testInt": TestIntTypeID, - "testString": TestStringTypeID, - "testBytes": TestBytesTypeID, - "testVectorInt": TestVectorIntTypeID, - "testVectorIntObject": TestVectorIntObjectTypeID, - "testVectorString": TestVectorStringTypeID, - "testVectorStringObject": TestVectorStringObjectTypeID, - "getAuthorizationState": GetAuthorizationStateRequestTypeID, - "setTdlibParameters": SetTdlibParametersRequestTypeID, - "setAuthenticationPhoneNumber": SetAuthenticationPhoneNumberRequestTypeID, - "setAuthenticationEmailAddress": SetAuthenticationEmailAddressRequestTypeID, - "resendAuthenticationCode": ResendAuthenticationCodeRequestTypeID, - "checkAuthenticationEmailCode": CheckAuthenticationEmailCodeRequestTypeID, - "checkAuthenticationCode": CheckAuthenticationCodeRequestTypeID, - "requestQrCodeAuthentication": RequestQrCodeAuthenticationRequestTypeID, - "registerUser": RegisterUserRequestTypeID, - "resetAuthenticationEmailAddress": ResetAuthenticationEmailAddressRequestTypeID, - "checkAuthenticationPassword": CheckAuthenticationPasswordRequestTypeID, - "requestAuthenticationPasswordRecovery": RequestAuthenticationPasswordRecoveryRequestTypeID, - "checkAuthenticationPasswordRecoveryCode": CheckAuthenticationPasswordRecoveryCodeRequestTypeID, - "recoverAuthenticationPassword": RecoverAuthenticationPasswordRequestTypeID, - "sendAuthenticationFirebaseSms": SendAuthenticationFirebaseSMSRequestTypeID, - "checkAuthenticationBotToken": CheckAuthenticationBotTokenRequestTypeID, - "logOut": LogOutRequestTypeID, - "close": CloseRequestTypeID, - "destroy": DestroyRequestTypeID, - "confirmQrCodeAuthentication": ConfirmQrCodeAuthenticationRequestTypeID, - "getCurrentState": GetCurrentStateRequestTypeID, - "setDatabaseEncryptionKey": SetDatabaseEncryptionKeyRequestTypeID, - "getPasswordState": GetPasswordStateRequestTypeID, - "setPassword": SetPasswordRequestTypeID, - "setLoginEmailAddress": SetLoginEmailAddressRequestTypeID, - "resendLoginEmailAddressCode": ResendLoginEmailAddressCodeRequestTypeID, - "checkLoginEmailAddressCode": CheckLoginEmailAddressCodeRequestTypeID, - "getRecoveryEmailAddress": GetRecoveryEmailAddressRequestTypeID, - "setRecoveryEmailAddress": SetRecoveryEmailAddressRequestTypeID, - "checkRecoveryEmailAddressCode": CheckRecoveryEmailAddressCodeRequestTypeID, - "resendRecoveryEmailAddressCode": ResendRecoveryEmailAddressCodeRequestTypeID, - "requestPasswordRecovery": RequestPasswordRecoveryRequestTypeID, - "checkPasswordRecoveryCode": CheckPasswordRecoveryCodeRequestTypeID, - "recoverPassword": RecoverPasswordRequestTypeID, - "resetPassword": ResetPasswordRequestTypeID, - "cancelPasswordReset": CancelPasswordResetRequestTypeID, - "createTemporaryPassword": CreateTemporaryPasswordRequestTypeID, - "getTemporaryPasswordState": GetTemporaryPasswordStateRequestTypeID, - "getMe": GetMeRequestTypeID, - "getUser": GetUserRequestTypeID, - "getUserFullInfo": GetUserFullInfoRequestTypeID, - "getBasicGroup": GetBasicGroupRequestTypeID, - "getBasicGroupFullInfo": GetBasicGroupFullInfoRequestTypeID, - "getSupergroup": GetSupergroupRequestTypeID, - "getSupergroupFullInfo": GetSupergroupFullInfoRequestTypeID, - "getSecretChat": GetSecretChatRequestTypeID, - "getChat": GetChatRequestTypeID, - "getMessage": GetMessageRequestTypeID, - "getMessageLocally": GetMessageLocallyRequestTypeID, - "getRepliedMessage": GetRepliedMessageRequestTypeID, - "getChatPinnedMessage": GetChatPinnedMessageRequestTypeID, - "getCallbackQueryMessage": GetCallbackQueryMessageRequestTypeID, - "getMessages": GetMessagesRequestTypeID, - "getMessageThread": GetMessageThreadRequestTypeID, - "getMessageViewers": GetMessageViewersRequestTypeID, - "getFile": GetFileRequestTypeID, - "getRemoteFile": GetRemoteFileRequestTypeID, - "loadChats": LoadChatsRequestTypeID, - "getChats": GetChatsRequestTypeID, - "searchPublicChat": SearchPublicChatRequestTypeID, - "searchPublicChats": SearchPublicChatsRequestTypeID, - "searchChats": SearchChatsRequestTypeID, - "searchChatsOnServer": SearchChatsOnServerRequestTypeID, - "searchChatsNearby": SearchChatsNearbyRequestTypeID, - "getChatSimilarChats": GetChatSimilarChatsRequestTypeID, - "getChatSimilarChatCount": GetChatSimilarChatCountRequestTypeID, - "getTopChats": GetTopChatsRequestTypeID, - "removeTopChat": RemoveTopChatRequestTypeID, - "searchRecentlyFoundChats": SearchRecentlyFoundChatsRequestTypeID, - "addRecentlyFoundChat": AddRecentlyFoundChatRequestTypeID, - "removeRecentlyFoundChat": RemoveRecentlyFoundChatRequestTypeID, - "clearRecentlyFoundChats": ClearRecentlyFoundChatsRequestTypeID, - "getRecentlyOpenedChats": GetRecentlyOpenedChatsRequestTypeID, - "checkChatUsername": CheckChatUsernameRequestTypeID, - "getCreatedPublicChats": GetCreatedPublicChatsRequestTypeID, - "checkCreatedPublicChatsLimit": CheckCreatedPublicChatsLimitRequestTypeID, - "getSuitableDiscussionChats": GetSuitableDiscussionChatsRequestTypeID, - "getInactiveSupergroupChats": GetInactiveSupergroupChatsRequestTypeID, - "getGroupsInCommon": GetGroupsInCommonRequestTypeID, - "getChatHistory": GetChatHistoryRequestTypeID, - "getMessageThreadHistory": GetMessageThreadHistoryRequestTypeID, - "deleteChatHistory": DeleteChatHistoryRequestTypeID, - "deleteChat": DeleteChatRequestTypeID, - "searchChatMessages": SearchChatMessagesRequestTypeID, - "searchMessages": SearchMessagesRequestTypeID, - "searchSecretMessages": SearchSecretMessagesRequestTypeID, - "searchCallMessages": SearchCallMessagesRequestTypeID, - "searchOutgoingDocumentMessages": SearchOutgoingDocumentMessagesRequestTypeID, - "deleteAllCallMessages": DeleteAllCallMessagesRequestTypeID, - "searchChatRecentLocationMessages": SearchChatRecentLocationMessagesRequestTypeID, - "getActiveLiveLocationMessages": GetActiveLiveLocationMessagesRequestTypeID, - "getChatMessageByDate": GetChatMessageByDateRequestTypeID, - "getChatSparseMessagePositions": GetChatSparseMessagePositionsRequestTypeID, - "getChatMessageCalendar": GetChatMessageCalendarRequestTypeID, - "getChatMessageCount": GetChatMessageCountRequestTypeID, - "getChatMessagePosition": GetChatMessagePositionRequestTypeID, - "getChatScheduledMessages": GetChatScheduledMessagesRequestTypeID, - "getChatSponsoredMessages": GetChatSponsoredMessagesRequestTypeID, - "clickChatSponsoredMessage": ClickChatSponsoredMessageRequestTypeID, - "removeNotification": RemoveNotificationRequestTypeID, - "removeNotificationGroup": RemoveNotificationGroupRequestTypeID, - "getMessageLink": GetMessageLinkRequestTypeID, - "getMessageEmbeddingCode": GetMessageEmbeddingCodeRequestTypeID, - "getMessageLinkInfo": GetMessageLinkInfoRequestTypeID, - "translateText": TranslateTextRequestTypeID, - "translateMessageText": TranslateMessageTextRequestTypeID, - "recognizeSpeech": RecognizeSpeechRequestTypeID, - "rateSpeechRecognition": RateSpeechRecognitionRequestTypeID, - "getChatAvailableMessageSenders": GetChatAvailableMessageSendersRequestTypeID, - "setChatMessageSender": SetChatMessageSenderRequestTypeID, - "sendMessage": SendMessageRequestTypeID, - "sendMessageAlbum": SendMessageAlbumRequestTypeID, - "sendBotStartMessage": SendBotStartMessageRequestTypeID, - "sendInlineQueryResultMessage": SendInlineQueryResultMessageRequestTypeID, - "forwardMessages": ForwardMessagesRequestTypeID, - "resendMessages": ResendMessagesRequestTypeID, - "addLocalMessage": AddLocalMessageRequestTypeID, - "deleteMessages": DeleteMessagesRequestTypeID, - "deleteChatMessagesBySender": DeleteChatMessagesBySenderRequestTypeID, - "deleteChatMessagesByDate": DeleteChatMessagesByDateRequestTypeID, - "editMessageText": EditMessageTextRequestTypeID, - "editMessageLiveLocation": EditMessageLiveLocationRequestTypeID, - "editMessageMedia": EditMessageMediaRequestTypeID, - "editMessageCaption": EditMessageCaptionRequestTypeID, - "editMessageReplyMarkup": EditMessageReplyMarkupRequestTypeID, - "editInlineMessageText": EditInlineMessageTextRequestTypeID, - "editInlineMessageLiveLocation": EditInlineMessageLiveLocationRequestTypeID, - "editInlineMessageMedia": EditInlineMessageMediaRequestTypeID, - "editInlineMessageCaption": EditInlineMessageCaptionRequestTypeID, - "editInlineMessageReplyMarkup": EditInlineMessageReplyMarkupRequestTypeID, - "editMessageSchedulingState": EditMessageSchedulingStateRequestTypeID, - "getForumTopicDefaultIcons": GetForumTopicDefaultIconsRequestTypeID, - "createForumTopic": CreateForumTopicRequestTypeID, - "editForumTopic": EditForumTopicRequestTypeID, - "getForumTopic": GetForumTopicRequestTypeID, - "getForumTopicLink": GetForumTopicLinkRequestTypeID, - "getForumTopics": GetForumTopicsRequestTypeID, - "setForumTopicNotificationSettings": SetForumTopicNotificationSettingsRequestTypeID, - "toggleForumTopicIsClosed": ToggleForumTopicIsClosedRequestTypeID, - "toggleGeneralForumTopicIsHidden": ToggleGeneralForumTopicIsHiddenRequestTypeID, - "toggleForumTopicIsPinned": ToggleForumTopicIsPinnedRequestTypeID, - "setPinnedForumTopics": SetPinnedForumTopicsRequestTypeID, - "deleteForumTopic": DeleteForumTopicRequestTypeID, - "getEmojiReaction": GetEmojiReactionRequestTypeID, - "getCustomEmojiReactionAnimations": GetCustomEmojiReactionAnimationsRequestTypeID, - "getMessageAvailableReactions": GetMessageAvailableReactionsRequestTypeID, - "clearRecentReactions": ClearRecentReactionsRequestTypeID, - "addMessageReaction": AddMessageReactionRequestTypeID, - "removeMessageReaction": RemoveMessageReactionRequestTypeID, - "getMessageAddedReactions": GetMessageAddedReactionsRequestTypeID, - "setDefaultReactionType": SetDefaultReactionTypeRequestTypeID, - "searchQuote": SearchQuoteRequestTypeID, - "getTextEntities": GetTextEntitiesRequestTypeID, - "parseTextEntities": ParseTextEntitiesRequestTypeID, - "parseMarkdown": ParseMarkdownRequestTypeID, - "getMarkdownText": GetMarkdownTextRequestTypeID, - "getFileMimeType": GetFileMimeTypeRequestTypeID, - "getFileExtension": GetFileExtensionRequestTypeID, - "cleanFileName": CleanFileNameRequestTypeID, - "getLanguagePackString": GetLanguagePackStringRequestTypeID, - "getJsonValue": GetJSONValueRequestTypeID, - "getJsonString": GetJSONStringRequestTypeID, - "getThemeParametersJsonString": GetThemeParametersJSONStringRequestTypeID, - "setPollAnswer": SetPollAnswerRequestTypeID, - "getPollVoters": GetPollVotersRequestTypeID, - "stopPoll": StopPollRequestTypeID, - "hideSuggestedAction": HideSuggestedActionRequestTypeID, - "getLoginUrlInfo": GetLoginURLInfoRequestTypeID, - "getLoginUrl": GetLoginURLRequestTypeID, - "shareUserWithBot": ShareUserWithBotRequestTypeID, - "shareChatWithBot": ShareChatWithBotRequestTypeID, - "getInlineQueryResults": GetInlineQueryResultsRequestTypeID, - "answerInlineQuery": AnswerInlineQueryRequestTypeID, - "searchWebApp": SearchWebAppRequestTypeID, - "getWebAppLinkUrl": GetWebAppLinkURLRequestTypeID, - "getWebAppUrl": GetWebAppURLRequestTypeID, - "sendWebAppData": SendWebAppDataRequestTypeID, - "openWebApp": OpenWebAppRequestTypeID, - "closeWebApp": CloseWebAppRequestTypeID, - "answerWebAppQuery": AnswerWebAppQueryRequestTypeID, - "getCallbackQueryAnswer": GetCallbackQueryAnswerRequestTypeID, - "answerCallbackQuery": AnswerCallbackQueryRequestTypeID, - "answerShippingQuery": AnswerShippingQueryRequestTypeID, - "answerPreCheckoutQuery": AnswerPreCheckoutQueryRequestTypeID, - "setGameScore": SetGameScoreRequestTypeID, - "setInlineGameScore": SetInlineGameScoreRequestTypeID, - "getGameHighScores": GetGameHighScoresRequestTypeID, - "getInlineGameHighScores": GetInlineGameHighScoresRequestTypeID, - "deleteChatReplyMarkup": DeleteChatReplyMarkupRequestTypeID, - "sendChatAction": SendChatActionRequestTypeID, - "openChat": OpenChatRequestTypeID, - "closeChat": CloseChatRequestTypeID, - "viewMessages": ViewMessagesRequestTypeID, - "openMessageContent": OpenMessageContentRequestTypeID, - "clickAnimatedEmojiMessage": ClickAnimatedEmojiMessageRequestTypeID, - "getInternalLink": GetInternalLinkRequestTypeID, - "getInternalLinkType": GetInternalLinkTypeRequestTypeID, - "getExternalLinkInfo": GetExternalLinkInfoRequestTypeID, - "getExternalLink": GetExternalLinkRequestTypeID, - "readAllChatMentions": ReadAllChatMentionsRequestTypeID, - "readAllMessageThreadMentions": ReadAllMessageThreadMentionsRequestTypeID, - "readAllChatReactions": ReadAllChatReactionsRequestTypeID, - "readAllMessageThreadReactions": ReadAllMessageThreadReactionsRequestTypeID, - "createPrivateChat": CreatePrivateChatRequestTypeID, - "createBasicGroupChat": CreateBasicGroupChatRequestTypeID, - "createSupergroupChat": CreateSupergroupChatRequestTypeID, - "createSecretChat": CreateSecretChatRequestTypeID, - "createNewBasicGroupChat": CreateNewBasicGroupChatRequestTypeID, - "createNewSupergroupChat": CreateNewSupergroupChatRequestTypeID, - "createNewSecretChat": CreateNewSecretChatRequestTypeID, - "upgradeBasicGroupChatToSupergroupChat": UpgradeBasicGroupChatToSupergroupChatRequestTypeID, - "getChatListsToAddChat": GetChatListsToAddChatRequestTypeID, - "addChatToList": AddChatToListRequestTypeID, - "getChatFolder": GetChatFolderRequestTypeID, - "createChatFolder": CreateChatFolderRequestTypeID, - "editChatFolder": EditChatFolderRequestTypeID, - "deleteChatFolder": DeleteChatFolderRequestTypeID, - "getChatFolderChatsToLeave": GetChatFolderChatsToLeaveRequestTypeID, - "getChatFolderChatCount": GetChatFolderChatCountRequestTypeID, - "reorderChatFolders": ReorderChatFoldersRequestTypeID, - "getRecommendedChatFolders": GetRecommendedChatFoldersRequestTypeID, - "getChatFolderDefaultIconName": GetChatFolderDefaultIconNameRequestTypeID, - "getChatsForChatFolderInviteLink": GetChatsForChatFolderInviteLinkRequestTypeID, - "createChatFolderInviteLink": CreateChatFolderInviteLinkRequestTypeID, - "getChatFolderInviteLinks": GetChatFolderInviteLinksRequestTypeID, - "editChatFolderInviteLink": EditChatFolderInviteLinkRequestTypeID, - "deleteChatFolderInviteLink": DeleteChatFolderInviteLinkRequestTypeID, - "checkChatFolderInviteLink": CheckChatFolderInviteLinkRequestTypeID, - "addChatFolderByInviteLink": AddChatFolderByInviteLinkRequestTypeID, - "getChatFolderNewChats": GetChatFolderNewChatsRequestTypeID, - "processChatFolderNewChats": ProcessChatFolderNewChatsRequestTypeID, - "getArchiveChatListSettings": GetArchiveChatListSettingsRequestTypeID, - "setArchiveChatListSettings": SetArchiveChatListSettingsRequestTypeID, - "setChatTitle": SetChatTitleRequestTypeID, - "setChatPhoto": SetChatPhotoRequestTypeID, - "setChatAccentColor": SetChatAccentColorRequestTypeID, - "setChatMessageAutoDeleteTime": SetChatMessageAutoDeleteTimeRequestTypeID, - "setChatPermissions": SetChatPermissionsRequestTypeID, - "setChatBackground": SetChatBackgroundRequestTypeID, - "deleteChatBackground": DeleteChatBackgroundRequestTypeID, - "setChatTheme": SetChatThemeRequestTypeID, - "setChatDraftMessage": SetChatDraftMessageRequestTypeID, - "setChatNotificationSettings": SetChatNotificationSettingsRequestTypeID, - "toggleChatHasProtectedContent": ToggleChatHasProtectedContentRequestTypeID, - "toggleChatViewAsTopics": ToggleChatViewAsTopicsRequestTypeID, - "toggleChatIsTranslatable": ToggleChatIsTranslatableRequestTypeID, - "toggleChatIsMarkedAsUnread": ToggleChatIsMarkedAsUnreadRequestTypeID, - "toggleChatDefaultDisableNotification": ToggleChatDefaultDisableNotificationRequestTypeID, - "setChatAvailableReactions": SetChatAvailableReactionsRequestTypeID, - "setChatClientData": SetChatClientDataRequestTypeID, - "setChatDescription": SetChatDescriptionRequestTypeID, - "setChatDiscussionGroup": SetChatDiscussionGroupRequestTypeID, - "setChatLocation": SetChatLocationRequestTypeID, - "setChatSlowModeDelay": SetChatSlowModeDelayRequestTypeID, - "pinChatMessage": PinChatMessageRequestTypeID, - "unpinChatMessage": UnpinChatMessageRequestTypeID, - "unpinAllChatMessages": UnpinAllChatMessagesRequestTypeID, - "unpinAllMessageThreadMessages": UnpinAllMessageThreadMessagesRequestTypeID, - "joinChat": JoinChatRequestTypeID, - "leaveChat": LeaveChatRequestTypeID, - "addChatMember": AddChatMemberRequestTypeID, - "addChatMembers": AddChatMembersRequestTypeID, - "setChatMemberStatus": SetChatMemberStatusRequestTypeID, - "banChatMember": BanChatMemberRequestTypeID, - "canTransferOwnership": CanTransferOwnershipRequestTypeID, - "transferChatOwnership": TransferChatOwnershipRequestTypeID, - "getChatMember": GetChatMemberRequestTypeID, - "searchChatMembers": SearchChatMembersRequestTypeID, - "getChatAdministrators": GetChatAdministratorsRequestTypeID, - "clearAllDraftMessages": ClearAllDraftMessagesRequestTypeID, - "getSavedNotificationSound": GetSavedNotificationSoundRequestTypeID, - "getSavedNotificationSounds": GetSavedNotificationSoundsRequestTypeID, - "addSavedNotificationSound": AddSavedNotificationSoundRequestTypeID, - "removeSavedNotificationSound": RemoveSavedNotificationSoundRequestTypeID, - "getChatNotificationSettingsExceptions": GetChatNotificationSettingsExceptionsRequestTypeID, - "getScopeNotificationSettings": GetScopeNotificationSettingsRequestTypeID, - "setScopeNotificationSettings": SetScopeNotificationSettingsRequestTypeID, - "resetAllNotificationSettings": ResetAllNotificationSettingsRequestTypeID, - "toggleChatIsPinned": ToggleChatIsPinnedRequestTypeID, - "setPinnedChats": SetPinnedChatsRequestTypeID, - "readChatList": ReadChatListRequestTypeID, - "getStory": GetStoryRequestTypeID, - "getChatsToSendStories": GetChatsToSendStoriesRequestTypeID, - "canSendStory": CanSendStoryRequestTypeID, - "sendStory": SendStoryRequestTypeID, - "editStory": EditStoryRequestTypeID, - "setStoryPrivacySettings": SetStoryPrivacySettingsRequestTypeID, - "toggleStoryIsPinned": ToggleStoryIsPinnedRequestTypeID, - "deleteStory": DeleteStoryRequestTypeID, - "getStoryNotificationSettingsExceptions": GetStoryNotificationSettingsExceptionsRequestTypeID, - "loadActiveStories": LoadActiveStoriesRequestTypeID, - "setChatActiveStoriesList": SetChatActiveStoriesListRequestTypeID, - "getChatActiveStories": GetChatActiveStoriesRequestTypeID, - "getChatPinnedStories": GetChatPinnedStoriesRequestTypeID, - "getChatArchivedStories": GetChatArchivedStoriesRequestTypeID, - "openStory": OpenStoryRequestTypeID, - "closeStory": CloseStoryRequestTypeID, - "getStoryAvailableReactions": GetStoryAvailableReactionsRequestTypeID, - "setStoryReaction": SetStoryReactionRequestTypeID, - "getStoryViewers": GetStoryViewersRequestTypeID, - "reportStory": ReportStoryRequestTypeID, - "activateStoryStealthMode": ActivateStoryStealthModeRequestTypeID, - "getStoryPublicForwards": GetStoryPublicForwardsRequestTypeID, - "getAvailableChatBoostSlots": GetAvailableChatBoostSlotsRequestTypeID, - "getChatBoostStatus": GetChatBoostStatusRequestTypeID, - "boostChat": BoostChatRequestTypeID, - "getChatBoostLink": GetChatBoostLinkRequestTypeID, - "getChatBoostLinkInfo": GetChatBoostLinkInfoRequestTypeID, - "getChatBoosts": GetChatBoostsRequestTypeID, - "getUserChatBoosts": GetUserChatBoostsRequestTypeID, - "getAttachmentMenuBot": GetAttachmentMenuBotRequestTypeID, - "toggleBotIsAddedToAttachmentMenu": ToggleBotIsAddedToAttachmentMenuRequestTypeID, - "getThemedEmojiStatuses": GetThemedEmojiStatusesRequestTypeID, - "getRecentEmojiStatuses": GetRecentEmojiStatusesRequestTypeID, - "getDefaultEmojiStatuses": GetDefaultEmojiStatusesRequestTypeID, - "clearRecentEmojiStatuses": ClearRecentEmojiStatusesRequestTypeID, - "downloadFile": DownloadFileRequestTypeID, - "getFileDownloadedPrefixSize": GetFileDownloadedPrefixSizeRequestTypeID, - "cancelDownloadFile": CancelDownloadFileRequestTypeID, - "getSuggestedFileName": GetSuggestedFileNameRequestTypeID, - "preliminaryUploadFile": PreliminaryUploadFileRequestTypeID, - "cancelPreliminaryUploadFile": CancelPreliminaryUploadFileRequestTypeID, - "writeGeneratedFilePart": WriteGeneratedFilePartRequestTypeID, - "setFileGenerationProgress": SetFileGenerationProgressRequestTypeID, - "finishFileGeneration": FinishFileGenerationRequestTypeID, - "readFilePart": ReadFilePartRequestTypeID, - "deleteFile": DeleteFileRequestTypeID, - "addFileToDownloads": AddFileToDownloadsRequestTypeID, - "toggleDownloadIsPaused": ToggleDownloadIsPausedRequestTypeID, - "toggleAllDownloadsArePaused": ToggleAllDownloadsArePausedRequestTypeID, - "removeFileFromDownloads": RemoveFileFromDownloadsRequestTypeID, - "removeAllFilesFromDownloads": RemoveAllFilesFromDownloadsRequestTypeID, - "searchFileDownloads": SearchFileDownloadsRequestTypeID, - "getMessageFileType": GetMessageFileTypeRequestTypeID, - "getMessageImportConfirmationText": GetMessageImportConfirmationTextRequestTypeID, - "importMessages": ImportMessagesRequestTypeID, - "replacePrimaryChatInviteLink": ReplacePrimaryChatInviteLinkRequestTypeID, - "createChatInviteLink": CreateChatInviteLinkRequestTypeID, - "editChatInviteLink": EditChatInviteLinkRequestTypeID, - "getChatInviteLink": GetChatInviteLinkRequestTypeID, - "getChatInviteLinkCounts": GetChatInviteLinkCountsRequestTypeID, - "getChatInviteLinks": GetChatInviteLinksRequestTypeID, - "getChatInviteLinkMembers": GetChatInviteLinkMembersRequestTypeID, - "revokeChatInviteLink": RevokeChatInviteLinkRequestTypeID, - "deleteRevokedChatInviteLink": DeleteRevokedChatInviteLinkRequestTypeID, - "deleteAllRevokedChatInviteLinks": DeleteAllRevokedChatInviteLinksRequestTypeID, - "checkChatInviteLink": CheckChatInviteLinkRequestTypeID, - "joinChatByInviteLink": JoinChatByInviteLinkRequestTypeID, - "getChatJoinRequests": GetChatJoinRequestsRequestTypeID, - "processChatJoinRequest": ProcessChatJoinRequestRequestTypeID, - "processChatJoinRequests": ProcessChatJoinRequestsRequestTypeID, - "createCall": CreateCallRequestTypeID, - "acceptCall": AcceptCallRequestTypeID, - "sendCallSignalingData": SendCallSignalingDataRequestTypeID, - "discardCall": DiscardCallRequestTypeID, - "sendCallRating": SendCallRatingRequestTypeID, - "sendCallDebugInformation": SendCallDebugInformationRequestTypeID, - "sendCallLog": SendCallLogRequestTypeID, - "getVideoChatAvailableParticipants": GetVideoChatAvailableParticipantsRequestTypeID, - "setVideoChatDefaultParticipant": SetVideoChatDefaultParticipantRequestTypeID, - "createVideoChat": CreateVideoChatRequestTypeID, - "getVideoChatRtmpUrl": GetVideoChatRtmpURLRequestTypeID, - "replaceVideoChatRtmpUrl": ReplaceVideoChatRtmpURLRequestTypeID, - "getGroupCall": GetGroupCallRequestTypeID, - "startScheduledGroupCall": StartScheduledGroupCallRequestTypeID, - "toggleGroupCallEnabledStartNotification": ToggleGroupCallEnabledStartNotificationRequestTypeID, - "joinGroupCall": JoinGroupCallRequestTypeID, - "startGroupCallScreenSharing": StartGroupCallScreenSharingRequestTypeID, - "toggleGroupCallScreenSharingIsPaused": ToggleGroupCallScreenSharingIsPausedRequestTypeID, - "endGroupCallScreenSharing": EndGroupCallScreenSharingRequestTypeID, - "setGroupCallTitle": SetGroupCallTitleRequestTypeID, - "toggleGroupCallMuteNewParticipants": ToggleGroupCallMuteNewParticipantsRequestTypeID, - "inviteGroupCallParticipants": InviteGroupCallParticipantsRequestTypeID, - "getGroupCallInviteLink": GetGroupCallInviteLinkRequestTypeID, - "revokeGroupCallInviteLink": RevokeGroupCallInviteLinkRequestTypeID, - "startGroupCallRecording": StartGroupCallRecordingRequestTypeID, - "endGroupCallRecording": EndGroupCallRecordingRequestTypeID, - "toggleGroupCallIsMyVideoPaused": ToggleGroupCallIsMyVideoPausedRequestTypeID, - "toggleGroupCallIsMyVideoEnabled": ToggleGroupCallIsMyVideoEnabledRequestTypeID, - "setGroupCallParticipantIsSpeaking": SetGroupCallParticipantIsSpeakingRequestTypeID, - "toggleGroupCallParticipantIsMuted": ToggleGroupCallParticipantIsMutedRequestTypeID, - "setGroupCallParticipantVolumeLevel": SetGroupCallParticipantVolumeLevelRequestTypeID, - "toggleGroupCallParticipantIsHandRaised": ToggleGroupCallParticipantIsHandRaisedRequestTypeID, - "loadGroupCallParticipants": LoadGroupCallParticipantsRequestTypeID, - "leaveGroupCall": LeaveGroupCallRequestTypeID, - "endGroupCall": EndGroupCallRequestTypeID, - "getGroupCallStreams": GetGroupCallStreamsRequestTypeID, - "getGroupCallStreamSegment": GetGroupCallStreamSegmentRequestTypeID, - "setMessageSenderBlockList": SetMessageSenderBlockListRequestTypeID, - "blockMessageSenderFromReplies": BlockMessageSenderFromRepliesRequestTypeID, - "getBlockedMessageSenders": GetBlockedMessageSendersRequestTypeID, - "addContact": AddContactRequestTypeID, - "importContacts": ImportContactsRequestTypeID, - "getContacts": GetContactsRequestTypeID, - "searchContacts": SearchContactsRequestTypeID, - "removeContacts": RemoveContactsRequestTypeID, - "getImportedContactCount": GetImportedContactCountRequestTypeID, - "changeImportedContacts": ChangeImportedContactsRequestTypeID, - "clearImportedContacts": ClearImportedContactsRequestTypeID, - "setCloseFriends": SetCloseFriendsRequestTypeID, - "getCloseFriends": GetCloseFriendsRequestTypeID, - "setUserPersonalProfilePhoto": SetUserPersonalProfilePhotoRequestTypeID, - "suggestUserProfilePhoto": SuggestUserProfilePhotoRequestTypeID, - "searchUserByPhoneNumber": SearchUserByPhoneNumberRequestTypeID, - "sharePhoneNumber": SharePhoneNumberRequestTypeID, - "getUserProfilePhotos": GetUserProfilePhotosRequestTypeID, - "getStickers": GetStickersRequestTypeID, - "getAllStickerEmojis": GetAllStickerEmojisRequestTypeID, - "searchStickers": SearchStickersRequestTypeID, - "getPremiumStickers": GetPremiumStickersRequestTypeID, - "getInstalledStickerSets": GetInstalledStickerSetsRequestTypeID, - "getArchivedStickerSets": GetArchivedStickerSetsRequestTypeID, - "getTrendingStickerSets": GetTrendingStickerSetsRequestTypeID, - "getAttachedStickerSets": GetAttachedStickerSetsRequestTypeID, - "getStickerSet": GetStickerSetRequestTypeID, - "searchStickerSet": SearchStickerSetRequestTypeID, - "searchInstalledStickerSets": SearchInstalledStickerSetsRequestTypeID, - "searchStickerSets": SearchStickerSetsRequestTypeID, - "changeStickerSet": ChangeStickerSetRequestTypeID, - "viewTrendingStickerSets": ViewTrendingStickerSetsRequestTypeID, - "reorderInstalledStickerSets": ReorderInstalledStickerSetsRequestTypeID, - "getRecentStickers": GetRecentStickersRequestTypeID, - "addRecentSticker": AddRecentStickerRequestTypeID, - "removeRecentSticker": RemoveRecentStickerRequestTypeID, - "clearRecentStickers": ClearRecentStickersRequestTypeID, - "getFavoriteStickers": GetFavoriteStickersRequestTypeID, - "addFavoriteSticker": AddFavoriteStickerRequestTypeID, - "removeFavoriteSticker": RemoveFavoriteStickerRequestTypeID, - "getStickerEmojis": GetStickerEmojisRequestTypeID, - "searchEmojis": SearchEmojisRequestTypeID, - "getEmojiCategories": GetEmojiCategoriesRequestTypeID, - "getAnimatedEmoji": GetAnimatedEmojiRequestTypeID, - "getEmojiSuggestionsUrl": GetEmojiSuggestionsURLRequestTypeID, - "getCustomEmojiStickers": GetCustomEmojiStickersRequestTypeID, - "getDefaultChatPhotoCustomEmojiStickers": GetDefaultChatPhotoCustomEmojiStickersRequestTypeID, - "getDefaultProfilePhotoCustomEmojiStickers": GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID, - "getDefaultBackgroundCustomEmojiStickers": GetDefaultBackgroundCustomEmojiStickersRequestTypeID, - "getSavedAnimations": GetSavedAnimationsRequestTypeID, - "addSavedAnimation": AddSavedAnimationRequestTypeID, - "removeSavedAnimation": RemoveSavedAnimationRequestTypeID, - "getRecentInlineBots": GetRecentInlineBotsRequestTypeID, - "searchHashtags": SearchHashtagsRequestTypeID, - "removeRecentHashtag": RemoveRecentHashtagRequestTypeID, - "getWebPagePreview": GetWebPagePreviewRequestTypeID, - "getWebPageInstantView": GetWebPageInstantViewRequestTypeID, - "setProfilePhoto": SetProfilePhotoRequestTypeID, - "deleteProfilePhoto": DeleteProfilePhotoRequestTypeID, - "setAccentColor": SetAccentColorRequestTypeID, - "setProfileAccentColor": SetProfileAccentColorRequestTypeID, - "setName": SetNameRequestTypeID, - "setBio": SetBioRequestTypeID, - "setUsername": SetUsernameRequestTypeID, - "toggleUsernameIsActive": ToggleUsernameIsActiveRequestTypeID, - "reorderActiveUsernames": ReorderActiveUsernamesRequestTypeID, - "setEmojiStatus": SetEmojiStatusRequestTypeID, - "setLocation": SetLocationRequestTypeID, - "changePhoneNumber": ChangePhoneNumberRequestTypeID, - "resendChangePhoneNumberCode": ResendChangePhoneNumberCodeRequestTypeID, - "checkChangePhoneNumberCode": CheckChangePhoneNumberCodeRequestTypeID, - "getUserLink": GetUserLinkRequestTypeID, - "searchUserByToken": SearchUserByTokenRequestTypeID, - "setCommands": SetCommandsRequestTypeID, - "deleteCommands": DeleteCommandsRequestTypeID, - "getCommands": GetCommandsRequestTypeID, - "setMenuButton": SetMenuButtonRequestTypeID, - "getMenuButton": GetMenuButtonRequestTypeID, - "setDefaultGroupAdministratorRights": SetDefaultGroupAdministratorRightsRequestTypeID, - "setDefaultChannelAdministratorRights": SetDefaultChannelAdministratorRightsRequestTypeID, - "canBotSendMessages": CanBotSendMessagesRequestTypeID, - "allowBotToSendMessages": AllowBotToSendMessagesRequestTypeID, - "sendWebAppCustomRequest": SendWebAppCustomRequestRequestTypeID, - "setBotName": SetBotNameRequestTypeID, - "getBotName": GetBotNameRequestTypeID, - "setBotProfilePhoto": SetBotProfilePhotoRequestTypeID, - "toggleBotUsernameIsActive": ToggleBotUsernameIsActiveRequestTypeID, - "reorderBotActiveUsernames": ReorderBotActiveUsernamesRequestTypeID, - "setBotInfoDescription": SetBotInfoDescriptionRequestTypeID, - "getBotInfoDescription": GetBotInfoDescriptionRequestTypeID, - "setBotInfoShortDescription": SetBotInfoShortDescriptionRequestTypeID, - "getBotInfoShortDescription": GetBotInfoShortDescriptionRequestTypeID, - "getActiveSessions": GetActiveSessionsRequestTypeID, - "terminateSession": TerminateSessionRequestTypeID, - "terminateAllOtherSessions": TerminateAllOtherSessionsRequestTypeID, - "confirmSession": ConfirmSessionRequestTypeID, - "toggleSessionCanAcceptCalls": ToggleSessionCanAcceptCallsRequestTypeID, - "toggleSessionCanAcceptSecretChats": ToggleSessionCanAcceptSecretChatsRequestTypeID, - "setInactiveSessionTtl": SetInactiveSessionTTLRequestTypeID, - "getConnectedWebsites": GetConnectedWebsitesRequestTypeID, - "disconnectWebsite": DisconnectWebsiteRequestTypeID, - "disconnectAllWebsites": DisconnectAllWebsitesRequestTypeID, - "setSupergroupUsername": SetSupergroupUsernameRequestTypeID, - "toggleSupergroupUsernameIsActive": ToggleSupergroupUsernameIsActiveRequestTypeID, - "disableAllSupergroupUsernames": DisableAllSupergroupUsernamesRequestTypeID, - "reorderSupergroupActiveUsernames": ReorderSupergroupActiveUsernamesRequestTypeID, - "setSupergroupStickerSet": SetSupergroupStickerSetRequestTypeID, - "toggleSupergroupSignMessages": ToggleSupergroupSignMessagesRequestTypeID, - "toggleSupergroupJoinToSendMessages": ToggleSupergroupJoinToSendMessagesRequestTypeID, - "toggleSupergroupJoinByRequest": ToggleSupergroupJoinByRequestRequestTypeID, - "toggleSupergroupIsAllHistoryAvailable": ToggleSupergroupIsAllHistoryAvailableRequestTypeID, - "toggleSupergroupHasHiddenMembers": ToggleSupergroupHasHiddenMembersRequestTypeID, - "toggleSupergroupHasAggressiveAntiSpamEnabled": ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID, - "toggleSupergroupIsForum": ToggleSupergroupIsForumRequestTypeID, - "toggleSupergroupIsBroadcastGroup": ToggleSupergroupIsBroadcastGroupRequestTypeID, - "reportSupergroupSpam": ReportSupergroupSpamRequestTypeID, - "reportSupergroupAntiSpamFalsePositive": ReportSupergroupAntiSpamFalsePositiveRequestTypeID, - "getSupergroupMembers": GetSupergroupMembersRequestTypeID, - "closeSecretChat": CloseSecretChatRequestTypeID, - "getChatEventLog": GetChatEventLogRequestTypeID, - "getPaymentForm": GetPaymentFormRequestTypeID, - "validateOrderInfo": ValidateOrderInfoRequestTypeID, - "sendPaymentForm": SendPaymentFormRequestTypeID, - "getPaymentReceipt": GetPaymentReceiptRequestTypeID, - "getSavedOrderInfo": GetSavedOrderInfoRequestTypeID, - "deleteSavedOrderInfo": DeleteSavedOrderInfoRequestTypeID, - "deleteSavedCredentials": DeleteSavedCredentialsRequestTypeID, - "createInvoiceLink": CreateInvoiceLinkRequestTypeID, - "getSupportUser": GetSupportUserRequestTypeID, - "getBackgrounds": GetBackgroundsRequestTypeID, - "getBackgroundUrl": GetBackgroundURLRequestTypeID, - "searchBackground": SearchBackgroundRequestTypeID, - "setBackground": SetBackgroundRequestTypeID, - "removeBackground": RemoveBackgroundRequestTypeID, - "resetBackgrounds": ResetBackgroundsRequestTypeID, - "getLocalizationTargetInfo": GetLocalizationTargetInfoRequestTypeID, - "getLanguagePackInfo": GetLanguagePackInfoRequestTypeID, - "getLanguagePackStrings": GetLanguagePackStringsRequestTypeID, - "synchronizeLanguagePack": SynchronizeLanguagePackRequestTypeID, - "addCustomServerLanguagePack": AddCustomServerLanguagePackRequestTypeID, - "setCustomLanguagePack": SetCustomLanguagePackRequestTypeID, - "editCustomLanguagePackInfo": EditCustomLanguagePackInfoRequestTypeID, - "setCustomLanguagePackString": SetCustomLanguagePackStringRequestTypeID, - "deleteLanguagePack": DeleteLanguagePackRequestTypeID, - "registerDevice": RegisterDeviceRequestTypeID, - "processPushNotification": ProcessPushNotificationRequestTypeID, - "getPushReceiverId": GetPushReceiverIDRequestTypeID, - "getRecentlyVisitedTMeUrls": GetRecentlyVisitedTMeURLsRequestTypeID, - "setUserPrivacySettingRules": SetUserPrivacySettingRulesRequestTypeID, - "getUserPrivacySettingRules": GetUserPrivacySettingRulesRequestTypeID, - "getOption": GetOptionRequestTypeID, - "setOption": SetOptionRequestTypeID, - "setAccountTtl": SetAccountTTLRequestTypeID, - "getAccountTtl": GetAccountTTLRequestTypeID, - "deleteAccount": DeleteAccountRequestTypeID, - "setDefaultMessageAutoDeleteTime": SetDefaultMessageAutoDeleteTimeRequestTypeID, - "getDefaultMessageAutoDeleteTime": GetDefaultMessageAutoDeleteTimeRequestTypeID, - "removeChatActionBar": RemoveChatActionBarRequestTypeID, - "reportChat": ReportChatRequestTypeID, - "reportChatPhoto": ReportChatPhotoRequestTypeID, - "reportMessageReactions": ReportMessageReactionsRequestTypeID, - "getChatStatistics": GetChatStatisticsRequestTypeID, - "getMessageStatistics": GetMessageStatisticsRequestTypeID, - "getMessagePublicForwards": GetMessagePublicForwardsRequestTypeID, - "getStoryStatistics": GetStoryStatisticsRequestTypeID, - "getStatisticalGraph": GetStatisticalGraphRequestTypeID, - "getStorageStatistics": GetStorageStatisticsRequestTypeID, - "getStorageStatisticsFast": GetStorageStatisticsFastRequestTypeID, - "getDatabaseStatistics": GetDatabaseStatisticsRequestTypeID, - "optimizeStorage": OptimizeStorageRequestTypeID, - "setNetworkType": SetNetworkTypeRequestTypeID, - "getNetworkStatistics": GetNetworkStatisticsRequestTypeID, - "addNetworkStatistics": AddNetworkStatisticsRequestTypeID, - "resetNetworkStatistics": ResetNetworkStatisticsRequestTypeID, - "getAutoDownloadSettingsPresets": GetAutoDownloadSettingsPresetsRequestTypeID, - "setAutoDownloadSettings": SetAutoDownloadSettingsRequestTypeID, - "getAutosaveSettings": GetAutosaveSettingsRequestTypeID, - "setAutosaveSettings": SetAutosaveSettingsRequestTypeID, - "clearAutosaveSettingsExceptions": ClearAutosaveSettingsExceptionsRequestTypeID, - "getBankCardInfo": GetBankCardInfoRequestTypeID, - "getPassportElement": GetPassportElementRequestTypeID, - "getAllPassportElements": GetAllPassportElementsRequestTypeID, - "setPassportElement": SetPassportElementRequestTypeID, - "deletePassportElement": DeletePassportElementRequestTypeID, - "setPassportElementErrors": SetPassportElementErrorsRequestTypeID, - "getPreferredCountryLanguage": GetPreferredCountryLanguageRequestTypeID, - "sendPhoneNumberVerificationCode": SendPhoneNumberVerificationCodeRequestTypeID, - "resendPhoneNumberVerificationCode": ResendPhoneNumberVerificationCodeRequestTypeID, - "checkPhoneNumberVerificationCode": CheckPhoneNumberVerificationCodeRequestTypeID, - "sendEmailAddressVerificationCode": SendEmailAddressVerificationCodeRequestTypeID, - "resendEmailAddressVerificationCode": ResendEmailAddressVerificationCodeRequestTypeID, - "checkEmailAddressVerificationCode": CheckEmailAddressVerificationCodeRequestTypeID, - "getPassportAuthorizationForm": GetPassportAuthorizationFormRequestTypeID, - "getPassportAuthorizationFormAvailableElements": GetPassportAuthorizationFormAvailableElementsRequestTypeID, - "sendPassportAuthorizationForm": SendPassportAuthorizationFormRequestTypeID, - "sendPhoneNumberConfirmationCode": SendPhoneNumberConfirmationCodeRequestTypeID, - "resendPhoneNumberConfirmationCode": ResendPhoneNumberConfirmationCodeRequestTypeID, - "checkPhoneNumberConfirmationCode": CheckPhoneNumberConfirmationCodeRequestTypeID, - "setBotUpdatesStatus": SetBotUpdatesStatusRequestTypeID, - "uploadStickerFile": UploadStickerFileRequestTypeID, - "getSuggestedStickerSetName": GetSuggestedStickerSetNameRequestTypeID, - "checkStickerSetName": CheckStickerSetNameRequestTypeID, - "createNewStickerSet": CreateNewStickerSetRequestTypeID, - "addStickerToSet": AddStickerToSetRequestTypeID, - "setStickerSetThumbnail": SetStickerSetThumbnailRequestTypeID, - "setCustomEmojiStickerSetThumbnail": SetCustomEmojiStickerSetThumbnailRequestTypeID, - "setStickerSetTitle": SetStickerSetTitleRequestTypeID, - "deleteStickerSet": DeleteStickerSetRequestTypeID, - "setStickerPositionInSet": SetStickerPositionInSetRequestTypeID, - "removeStickerFromSet": RemoveStickerFromSetRequestTypeID, - "setStickerEmojis": SetStickerEmojisRequestTypeID, - "setStickerKeywords": SetStickerKeywordsRequestTypeID, - "setStickerMaskPosition": SetStickerMaskPositionRequestTypeID, - "getMapThumbnailFile": GetMapThumbnailFileRequestTypeID, - "getPremiumLimit": GetPremiumLimitRequestTypeID, - "getPremiumFeatures": GetPremiumFeaturesRequestTypeID, - "getPremiumStickerExamples": GetPremiumStickerExamplesRequestTypeID, - "viewPremiumFeature": ViewPremiumFeatureRequestTypeID, - "clickPremiumSubscriptionButton": ClickPremiumSubscriptionButtonRequestTypeID, - "getPremiumState": GetPremiumStateRequestTypeID, - "getPremiumGiftCodePaymentOptions": GetPremiumGiftCodePaymentOptionsRequestTypeID, - "checkPremiumGiftCode": CheckPremiumGiftCodeRequestTypeID, - "applyPremiumGiftCode": ApplyPremiumGiftCodeRequestTypeID, - "launchPrepaidPremiumGiveaway": LaunchPrepaidPremiumGiveawayRequestTypeID, - "getPremiumGiveawayInfo": GetPremiumGiveawayInfoRequestTypeID, - "canPurchasePremium": CanPurchasePremiumRequestTypeID, - "assignAppStoreTransaction": AssignAppStoreTransactionRequestTypeID, - "assignGooglePlayTransaction": AssignGooglePlayTransactionRequestTypeID, - "acceptTermsOfService": AcceptTermsOfServiceRequestTypeID, - "searchStringsByPrefix": SearchStringsByPrefixRequestTypeID, - "sendCustomRequest": SendCustomRequestRequestTypeID, - "answerCustomQuery": AnswerCustomQueryRequestTypeID, - "setAlarm": SetAlarmRequestTypeID, - "getCountries": GetCountriesRequestTypeID, - "getCountryCode": GetCountryCodeRequestTypeID, - "getPhoneNumberInfo": GetPhoneNumberInfoRequestTypeID, - "getPhoneNumberInfoSync": GetPhoneNumberInfoSyncRequestTypeID, - "getDeepLinkInfo": GetDeepLinkInfoRequestTypeID, - "getApplicationConfig": GetApplicationConfigRequestTypeID, - "addApplicationChangelog": AddApplicationChangelogRequestTypeID, - "saveApplicationLogEvent": SaveApplicationLogEventRequestTypeID, - "getApplicationDownloadLink": GetApplicationDownloadLinkRequestTypeID, - "addProxy": AddProxyRequestTypeID, - "editProxy": EditProxyRequestTypeID, - "enableProxy": EnableProxyRequestTypeID, - "disableProxy": DisableProxyRequestTypeID, - "removeProxy": RemoveProxyRequestTypeID, - "getProxies": GetProxiesRequestTypeID, - "getProxyLink": GetProxyLinkRequestTypeID, - "pingProxy": PingProxyRequestTypeID, - "setLogStream": SetLogStreamRequestTypeID, - "getLogStream": GetLogStreamRequestTypeID, - "setLogVerbosityLevel": SetLogVerbosityLevelRequestTypeID, - "getLogVerbosityLevel": GetLogVerbosityLevelRequestTypeID, - "getLogTags": GetLogTagsRequestTypeID, - "setLogTagVerbosityLevel": SetLogTagVerbosityLevelRequestTypeID, - "getLogTagVerbosityLevel": GetLogTagVerbosityLevelRequestTypeID, - "addLogMessage": AddLogMessageRequestTypeID, - "getUserSupportInfo": GetUserSupportInfoRequestTypeID, - "setUserSupportInfo": SetUserSupportInfoRequestTypeID, - "getSupportName": GetSupportNameRequestTypeID, - "testCallEmpty": TestCallEmptyRequestTypeID, - "testCallString": TestCallStringRequestTypeID, - "testCallBytes": TestCallBytesRequestTypeID, - "testCallVectorInt": TestCallVectorIntRequestTypeID, - "testCallVectorIntObject": TestCallVectorIntObjectRequestTypeID, - "testCallVectorString": TestCallVectorStringRequestTypeID, - "testCallVectorStringObject": TestCallVectorStringObjectRequestTypeID, - "testSquareInt": TestSquareIntRequestTypeID, - "testNetwork": TestNetworkRequestTypeID, - "testProxy": TestProxyRequestTypeID, - "testGetDifference": TestGetDifferenceRequestTypeID, - "testUseUpdate": TestUseUpdateRequestTypeID, - "testReturnError": TestReturnErrorRequestTypeID, + "suggestedActionGiftPremiumForChristmas": SuggestedActionGiftPremiumForChristmasTypeID, + "count": CountTypeID, + "text": TextTypeID, + "seconds": SecondsTypeID, + "fileDownloadedPrefixSize": FileDownloadedPrefixSizeTypeID, + "deepLinkInfo": DeepLinkInfoTypeID, + "textParseModeMarkdown": TextParseModeMarkdownTypeID, + "textParseModeHTML": TextParseModeHTMLTypeID, + "proxyTypeSocks5": ProxyTypeSocks5TypeID, + "proxyTypeHttp": ProxyTypeHTTPTypeID, + "proxyTypeMtproto": ProxyTypeMtprotoTypeID, + "proxy": ProxyTypeID, + "proxies": ProxiesTypeID, + "inputSticker": InputStickerTypeID, + "dateRange": DateRangeTypeID, + "statisticalValue": StatisticalValueTypeID, + "statisticalGraphData": StatisticalGraphDataTypeID, + "statisticalGraphAsync": StatisticalGraphAsyncTypeID, + "statisticalGraphError": StatisticalGraphErrorTypeID, + "chatStatisticsObjectTypeMessage": ChatStatisticsObjectTypeMessageTypeID, + "chatStatisticsObjectTypeStory": ChatStatisticsObjectTypeStoryTypeID, + "chatStatisticsInteractionInfo": ChatStatisticsInteractionInfoTypeID, + "chatStatisticsMessageSenderInfo": ChatStatisticsMessageSenderInfoTypeID, + "chatStatisticsAdministratorActionsInfo": ChatStatisticsAdministratorActionsInfoTypeID, + "chatStatisticsInviterInfo": ChatStatisticsInviterInfoTypeID, + "chatStatisticsSupergroup": ChatStatisticsSupergroupTypeID, + "chatStatisticsChannel": ChatStatisticsChannelTypeID, + "messageStatistics": MessageStatisticsTypeID, + "storyStatistics": StoryStatisticsTypeID, + "point": PointTypeID, + "vectorPathCommandLine": VectorPathCommandLineTypeID, + "vectorPathCommandCubicBezierCurve": VectorPathCommandCubicBezierCurveTypeID, + "botCommandScopeDefault": BotCommandScopeDefaultTypeID, + "botCommandScopeAllPrivateChats": BotCommandScopeAllPrivateChatsTypeID, + "botCommandScopeAllGroupChats": BotCommandScopeAllGroupChatsTypeID, + "botCommandScopeAllChatAdministrators": BotCommandScopeAllChatAdministratorsTypeID, + "botCommandScopeChat": BotCommandScopeChatTypeID, + "botCommandScopeChatAdministrators": BotCommandScopeChatAdministratorsTypeID, + "botCommandScopeChatMember": BotCommandScopeChatMemberTypeID, + "updateAuthorizationState": UpdateAuthorizationStateTypeID, + "updateNewMessage": UpdateNewMessageTypeID, + "updateMessageSendAcknowledged": UpdateMessageSendAcknowledgedTypeID, + "updateMessageSendSucceeded": UpdateMessageSendSucceededTypeID, + "updateMessageSendFailed": UpdateMessageSendFailedTypeID, + "updateMessageContent": UpdateMessageContentTypeID, + "updateMessageEdited": UpdateMessageEditedTypeID, + "updateMessageIsPinned": UpdateMessageIsPinnedTypeID, + "updateMessageInteractionInfo": UpdateMessageInteractionInfoTypeID, + "updateMessageContentOpened": UpdateMessageContentOpenedTypeID, + "updateMessageMentionRead": UpdateMessageMentionReadTypeID, + "updateMessageUnreadReactions": UpdateMessageUnreadReactionsTypeID, + "updateMessageLiveLocationViewed": UpdateMessageLiveLocationViewedTypeID, + "updateNewChat": UpdateNewChatTypeID, + "updateChatTitle": UpdateChatTitleTypeID, + "updateChatPhoto": UpdateChatPhotoTypeID, + "updateChatAccentColors": UpdateChatAccentColorsTypeID, + "updateChatPermissions": UpdateChatPermissionsTypeID, + "updateChatLastMessage": UpdateChatLastMessageTypeID, + "updateChatPosition": UpdateChatPositionTypeID, + "updateChatReadInbox": UpdateChatReadInboxTypeID, + "updateChatReadOutbox": UpdateChatReadOutboxTypeID, + "updateChatActionBar": UpdateChatActionBarTypeID, + "updateChatAvailableReactions": UpdateChatAvailableReactionsTypeID, + "updateChatDraftMessage": UpdateChatDraftMessageTypeID, + "updateChatEmojiStatus": UpdateChatEmojiStatusTypeID, + "updateChatMessageSender": UpdateChatMessageSenderTypeID, + "updateChatMessageAutoDeleteTime": UpdateChatMessageAutoDeleteTimeTypeID, + "updateChatNotificationSettings": UpdateChatNotificationSettingsTypeID, + "updateChatPendingJoinRequests": UpdateChatPendingJoinRequestsTypeID, + "updateChatReplyMarkup": UpdateChatReplyMarkupTypeID, + "updateChatBackground": UpdateChatBackgroundTypeID, + "updateChatTheme": UpdateChatThemeTypeID, + "updateChatUnreadMentionCount": UpdateChatUnreadMentionCountTypeID, + "updateChatUnreadReactionCount": UpdateChatUnreadReactionCountTypeID, + "updateChatVideoChat": UpdateChatVideoChatTypeID, + "updateChatDefaultDisableNotification": UpdateChatDefaultDisableNotificationTypeID, + "updateChatHasProtectedContent": UpdateChatHasProtectedContentTypeID, + "updateChatIsTranslatable": UpdateChatIsTranslatableTypeID, + "updateChatIsMarkedAsUnread": UpdateChatIsMarkedAsUnreadTypeID, + "updateChatViewAsTopics": UpdateChatViewAsTopicsTypeID, + "updateChatBlockList": UpdateChatBlockListTypeID, + "updateChatHasScheduledMessages": UpdateChatHasScheduledMessagesTypeID, + "updateChatFolders": UpdateChatFoldersTypeID, + "updateChatOnlineMemberCount": UpdateChatOnlineMemberCountTypeID, + "updateForumTopicInfo": UpdateForumTopicInfoTypeID, + "updateScopeNotificationSettings": UpdateScopeNotificationSettingsTypeID, + "updateNotification": UpdateNotificationTypeID, + "updateNotificationGroup": UpdateNotificationGroupTypeID, + "updateActiveNotifications": UpdateActiveNotificationsTypeID, + "updateHavePendingNotifications": UpdateHavePendingNotificationsTypeID, + "updateDeleteMessages": UpdateDeleteMessagesTypeID, + "updateChatAction": UpdateChatActionTypeID, + "updateUserStatus": UpdateUserStatusTypeID, + "updateUser": UpdateUserTypeID, + "updateBasicGroup": UpdateBasicGroupTypeID, + "updateSupergroup": UpdateSupergroupTypeID, + "updateSecretChat": UpdateSecretChatTypeID, + "updateUserFullInfo": UpdateUserFullInfoTypeID, + "updateBasicGroupFullInfo": UpdateBasicGroupFullInfoTypeID, + "updateSupergroupFullInfo": UpdateSupergroupFullInfoTypeID, + "updateServiceNotification": UpdateServiceNotificationTypeID, + "updateFile": UpdateFileTypeID, + "updateFileGenerationStart": UpdateFileGenerationStartTypeID, + "updateFileGenerationStop": UpdateFileGenerationStopTypeID, + "updateFileDownloads": UpdateFileDownloadsTypeID, + "updateFileAddedToDownloads": UpdateFileAddedToDownloadsTypeID, + "updateFileDownload": UpdateFileDownloadTypeID, + "updateFileRemovedFromDownloads": UpdateFileRemovedFromDownloadsTypeID, + "updateCall": UpdateCallTypeID, + "updateGroupCall": UpdateGroupCallTypeID, + "updateGroupCallParticipant": UpdateGroupCallParticipantTypeID, + "updateNewCallSignalingData": UpdateNewCallSignalingDataTypeID, + "updateUserPrivacySettingRules": UpdateUserPrivacySettingRulesTypeID, + "updateUnreadMessageCount": UpdateUnreadMessageCountTypeID, + "updateUnreadChatCount": UpdateUnreadChatCountTypeID, + "updateStory": UpdateStoryTypeID, + "updateStoryDeleted": UpdateStoryDeletedTypeID, + "updateStorySendSucceeded": UpdateStorySendSucceededTypeID, + "updateStorySendFailed": UpdateStorySendFailedTypeID, + "updateChatActiveStories": UpdateChatActiveStoriesTypeID, + "updateStoryListChatCount": UpdateStoryListChatCountTypeID, + "updateStoryStealthMode": UpdateStoryStealthModeTypeID, + "updateOption": UpdateOptionTypeID, + "updateStickerSet": UpdateStickerSetTypeID, + "updateInstalledStickerSets": UpdateInstalledStickerSetsTypeID, + "updateTrendingStickerSets": UpdateTrendingStickerSetsTypeID, + "updateRecentStickers": UpdateRecentStickersTypeID, + "updateFavoriteStickers": UpdateFavoriteStickersTypeID, + "updateSavedAnimations": UpdateSavedAnimationsTypeID, + "updateSavedNotificationSounds": UpdateSavedNotificationSoundsTypeID, + "updateDefaultBackground": UpdateDefaultBackgroundTypeID, + "updateChatThemes": UpdateChatThemesTypeID, + "updateAccentColors": UpdateAccentColorsTypeID, + "updateProfileAccentColors": UpdateProfileAccentColorsTypeID, + "updateLanguagePackStrings": UpdateLanguagePackStringsTypeID, + "updateConnectionState": UpdateConnectionStateTypeID, + "updateTermsOfService": UpdateTermsOfServiceTypeID, + "updateUsersNearby": UpdateUsersNearbyTypeID, + "updateUnconfirmedSession": UpdateUnconfirmedSessionTypeID, + "updateAttachmentMenuBots": UpdateAttachmentMenuBotsTypeID, + "updateWebAppMessageSent": UpdateWebAppMessageSentTypeID, + "updateActiveEmojiReactions": UpdateActiveEmojiReactionsTypeID, + "updateDefaultReactionType": UpdateDefaultReactionTypeTypeID, + "updateSpeechRecognitionTrial": UpdateSpeechRecognitionTrialTypeID, + "updateDiceEmojis": UpdateDiceEmojisTypeID, + "updateAnimatedEmojiMessageClicked": UpdateAnimatedEmojiMessageClickedTypeID, + "updateAnimationSearchParameters": UpdateAnimationSearchParametersTypeID, + "updateSuggestedActions": UpdateSuggestedActionsTypeID, + "updateAddChatMembersPrivacyForbidden": UpdateAddChatMembersPrivacyForbiddenTypeID, + "updateAutosaveSettings": UpdateAutosaveSettingsTypeID, + "updateNewInlineQuery": UpdateNewInlineQueryTypeID, + "updateNewChosenInlineResult": UpdateNewChosenInlineResultTypeID, + "updateNewCallbackQuery": UpdateNewCallbackQueryTypeID, + "updateNewInlineCallbackQuery": UpdateNewInlineCallbackQueryTypeID, + "updateNewShippingQuery": UpdateNewShippingQueryTypeID, + "updateNewPreCheckoutQuery": UpdateNewPreCheckoutQueryTypeID, + "updateNewCustomEvent": UpdateNewCustomEventTypeID, + "updateNewCustomQuery": UpdateNewCustomQueryTypeID, + "updatePoll": UpdatePollTypeID, + "updatePollAnswer": UpdatePollAnswerTypeID, + "updateChatMember": UpdateChatMemberTypeID, + "updateNewChatJoinRequest": UpdateNewChatJoinRequestTypeID, + "updateChatBoost": UpdateChatBoostTypeID, + "updateMessageReaction": UpdateMessageReactionTypeID, + "updateMessageReactions": UpdateMessageReactionsTypeID, + "updates": UpdatesTypeID, + "logStreamDefault": LogStreamDefaultTypeID, + "logStreamFile": LogStreamFileTypeID, + "logStreamEmpty": LogStreamEmptyTypeID, + "logVerbosityLevel": LogVerbosityLevelTypeID, + "logTags": LogTagsTypeID, + "userSupportInfo": UserSupportInfoTypeID, + "testInt": TestIntTypeID, + "testString": TestStringTypeID, + "testBytes": TestBytesTypeID, + "testVectorInt": TestVectorIntTypeID, + "testVectorIntObject": TestVectorIntObjectTypeID, + "testVectorString": TestVectorStringTypeID, + "testVectorStringObject": TestVectorStringObjectTypeID, + "getAuthorizationState": GetAuthorizationStateRequestTypeID, + "setTdlibParameters": SetTdlibParametersRequestTypeID, + "setAuthenticationPhoneNumber": SetAuthenticationPhoneNumberRequestTypeID, + "setAuthenticationEmailAddress": SetAuthenticationEmailAddressRequestTypeID, + "resendAuthenticationCode": ResendAuthenticationCodeRequestTypeID, + "checkAuthenticationEmailCode": CheckAuthenticationEmailCodeRequestTypeID, + "checkAuthenticationCode": CheckAuthenticationCodeRequestTypeID, + "requestQrCodeAuthentication": RequestQrCodeAuthenticationRequestTypeID, + "registerUser": RegisterUserRequestTypeID, + "resetAuthenticationEmailAddress": ResetAuthenticationEmailAddressRequestTypeID, + "checkAuthenticationPassword": CheckAuthenticationPasswordRequestTypeID, + "requestAuthenticationPasswordRecovery": RequestAuthenticationPasswordRecoveryRequestTypeID, + "checkAuthenticationPasswordRecoveryCode": CheckAuthenticationPasswordRecoveryCodeRequestTypeID, + "recoverAuthenticationPassword": RecoverAuthenticationPasswordRequestTypeID, + "sendAuthenticationFirebaseSms": SendAuthenticationFirebaseSMSRequestTypeID, + "checkAuthenticationBotToken": CheckAuthenticationBotTokenRequestTypeID, + "logOut": LogOutRequestTypeID, + "close": CloseRequestTypeID, + "destroy": DestroyRequestTypeID, + "confirmQrCodeAuthentication": ConfirmQrCodeAuthenticationRequestTypeID, + "getCurrentState": GetCurrentStateRequestTypeID, + "setDatabaseEncryptionKey": SetDatabaseEncryptionKeyRequestTypeID, + "getPasswordState": GetPasswordStateRequestTypeID, + "setPassword": SetPasswordRequestTypeID, + "setLoginEmailAddress": SetLoginEmailAddressRequestTypeID, + "resendLoginEmailAddressCode": ResendLoginEmailAddressCodeRequestTypeID, + "checkLoginEmailAddressCode": CheckLoginEmailAddressCodeRequestTypeID, + "getRecoveryEmailAddress": GetRecoveryEmailAddressRequestTypeID, + "setRecoveryEmailAddress": SetRecoveryEmailAddressRequestTypeID, + "checkRecoveryEmailAddressCode": CheckRecoveryEmailAddressCodeRequestTypeID, + "resendRecoveryEmailAddressCode": ResendRecoveryEmailAddressCodeRequestTypeID, + "requestPasswordRecovery": RequestPasswordRecoveryRequestTypeID, + "checkPasswordRecoveryCode": CheckPasswordRecoveryCodeRequestTypeID, + "recoverPassword": RecoverPasswordRequestTypeID, + "resetPassword": ResetPasswordRequestTypeID, + "cancelPasswordReset": CancelPasswordResetRequestTypeID, + "createTemporaryPassword": CreateTemporaryPasswordRequestTypeID, + "getTemporaryPasswordState": GetTemporaryPasswordStateRequestTypeID, + "getMe": GetMeRequestTypeID, + "getUser": GetUserRequestTypeID, + "getUserFullInfo": GetUserFullInfoRequestTypeID, + "getBasicGroup": GetBasicGroupRequestTypeID, + "getBasicGroupFullInfo": GetBasicGroupFullInfoRequestTypeID, + "getSupergroup": GetSupergroupRequestTypeID, + "getSupergroupFullInfo": GetSupergroupFullInfoRequestTypeID, + "getSecretChat": GetSecretChatRequestTypeID, + "getChat": GetChatRequestTypeID, + "getMessage": GetMessageRequestTypeID, + "getMessageLocally": GetMessageLocallyRequestTypeID, + "getRepliedMessage": GetRepliedMessageRequestTypeID, + "getChatPinnedMessage": GetChatPinnedMessageRequestTypeID, + "getCallbackQueryMessage": GetCallbackQueryMessageRequestTypeID, + "getMessages": GetMessagesRequestTypeID, + "getMessageThread": GetMessageThreadRequestTypeID, + "getMessageViewers": GetMessageViewersRequestTypeID, + "getFile": GetFileRequestTypeID, + "getRemoteFile": GetRemoteFileRequestTypeID, + "loadChats": LoadChatsRequestTypeID, + "getChats": GetChatsRequestTypeID, + "searchPublicChat": SearchPublicChatRequestTypeID, + "searchPublicChats": SearchPublicChatsRequestTypeID, + "searchChats": SearchChatsRequestTypeID, + "searchChatsOnServer": SearchChatsOnServerRequestTypeID, + "searchChatsNearby": SearchChatsNearbyRequestTypeID, + "getChatSimilarChats": GetChatSimilarChatsRequestTypeID, + "getChatSimilarChatCount": GetChatSimilarChatCountRequestTypeID, + "openChatSimilarChat": OpenChatSimilarChatRequestTypeID, + "getTopChats": GetTopChatsRequestTypeID, + "removeTopChat": RemoveTopChatRequestTypeID, + "searchRecentlyFoundChats": SearchRecentlyFoundChatsRequestTypeID, + "addRecentlyFoundChat": AddRecentlyFoundChatRequestTypeID, + "removeRecentlyFoundChat": RemoveRecentlyFoundChatRequestTypeID, + "clearRecentlyFoundChats": ClearRecentlyFoundChatsRequestTypeID, + "getRecentlyOpenedChats": GetRecentlyOpenedChatsRequestTypeID, + "checkChatUsername": CheckChatUsernameRequestTypeID, + "getCreatedPublicChats": GetCreatedPublicChatsRequestTypeID, + "checkCreatedPublicChatsLimit": CheckCreatedPublicChatsLimitRequestTypeID, + "getSuitableDiscussionChats": GetSuitableDiscussionChatsRequestTypeID, + "getInactiveSupergroupChats": GetInactiveSupergroupChatsRequestTypeID, + "getGroupsInCommon": GetGroupsInCommonRequestTypeID, + "getChatHistory": GetChatHistoryRequestTypeID, + "getMessageThreadHistory": GetMessageThreadHistoryRequestTypeID, + "deleteChatHistory": DeleteChatHistoryRequestTypeID, + "deleteChat": DeleteChatRequestTypeID, + "searchChatMessages": SearchChatMessagesRequestTypeID, + "searchMessages": SearchMessagesRequestTypeID, + "searchSecretMessages": SearchSecretMessagesRequestTypeID, + "searchCallMessages": SearchCallMessagesRequestTypeID, + "searchOutgoingDocumentMessages": SearchOutgoingDocumentMessagesRequestTypeID, + "deleteAllCallMessages": DeleteAllCallMessagesRequestTypeID, + "searchChatRecentLocationMessages": SearchChatRecentLocationMessagesRequestTypeID, + "getActiveLiveLocationMessages": GetActiveLiveLocationMessagesRequestTypeID, + "getChatMessageByDate": GetChatMessageByDateRequestTypeID, + "getChatSparseMessagePositions": GetChatSparseMessagePositionsRequestTypeID, + "getChatMessageCalendar": GetChatMessageCalendarRequestTypeID, + "getChatMessageCount": GetChatMessageCountRequestTypeID, + "getChatMessagePosition": GetChatMessagePositionRequestTypeID, + "getChatScheduledMessages": GetChatScheduledMessagesRequestTypeID, + "getChatSponsoredMessages": GetChatSponsoredMessagesRequestTypeID, + "clickChatSponsoredMessage": ClickChatSponsoredMessageRequestTypeID, + "removeNotification": RemoveNotificationRequestTypeID, + "removeNotificationGroup": RemoveNotificationGroupRequestTypeID, + "getMessageLink": GetMessageLinkRequestTypeID, + "getMessageEmbeddingCode": GetMessageEmbeddingCodeRequestTypeID, + "getMessageLinkInfo": GetMessageLinkInfoRequestTypeID, + "translateText": TranslateTextRequestTypeID, + "translateMessageText": TranslateMessageTextRequestTypeID, + "recognizeSpeech": RecognizeSpeechRequestTypeID, + "rateSpeechRecognition": RateSpeechRecognitionRequestTypeID, + "getChatAvailableMessageSenders": GetChatAvailableMessageSendersRequestTypeID, + "setChatMessageSender": SetChatMessageSenderRequestTypeID, + "sendMessage": SendMessageRequestTypeID, + "sendMessageAlbum": SendMessageAlbumRequestTypeID, + "sendBotStartMessage": SendBotStartMessageRequestTypeID, + "sendInlineQueryResultMessage": SendInlineQueryResultMessageRequestTypeID, + "forwardMessages": ForwardMessagesRequestTypeID, + "resendMessages": ResendMessagesRequestTypeID, + "addLocalMessage": AddLocalMessageRequestTypeID, + "deleteMessages": DeleteMessagesRequestTypeID, + "deleteChatMessagesBySender": DeleteChatMessagesBySenderRequestTypeID, + "deleteChatMessagesByDate": DeleteChatMessagesByDateRequestTypeID, + "editMessageText": EditMessageTextRequestTypeID, + "editMessageLiveLocation": EditMessageLiveLocationRequestTypeID, + "editMessageMedia": EditMessageMediaRequestTypeID, + "editMessageCaption": EditMessageCaptionRequestTypeID, + "editMessageReplyMarkup": EditMessageReplyMarkupRequestTypeID, + "editInlineMessageText": EditInlineMessageTextRequestTypeID, + "editInlineMessageLiveLocation": EditInlineMessageLiveLocationRequestTypeID, + "editInlineMessageMedia": EditInlineMessageMediaRequestTypeID, + "editInlineMessageCaption": EditInlineMessageCaptionRequestTypeID, + "editInlineMessageReplyMarkup": EditInlineMessageReplyMarkupRequestTypeID, + "editMessageSchedulingState": EditMessageSchedulingStateRequestTypeID, + "getForumTopicDefaultIcons": GetForumTopicDefaultIconsRequestTypeID, + "createForumTopic": CreateForumTopicRequestTypeID, + "editForumTopic": EditForumTopicRequestTypeID, + "getForumTopic": GetForumTopicRequestTypeID, + "getForumTopicLink": GetForumTopicLinkRequestTypeID, + "getForumTopics": GetForumTopicsRequestTypeID, + "setForumTopicNotificationSettings": SetForumTopicNotificationSettingsRequestTypeID, + "toggleForumTopicIsClosed": ToggleForumTopicIsClosedRequestTypeID, + "toggleGeneralForumTopicIsHidden": ToggleGeneralForumTopicIsHiddenRequestTypeID, + "toggleForumTopicIsPinned": ToggleForumTopicIsPinnedRequestTypeID, + "setPinnedForumTopics": SetPinnedForumTopicsRequestTypeID, + "deleteForumTopic": DeleteForumTopicRequestTypeID, + "getEmojiReaction": GetEmojiReactionRequestTypeID, + "getCustomEmojiReactionAnimations": GetCustomEmojiReactionAnimationsRequestTypeID, + "getMessageAvailableReactions": GetMessageAvailableReactionsRequestTypeID, + "clearRecentReactions": ClearRecentReactionsRequestTypeID, + "addMessageReaction": AddMessageReactionRequestTypeID, + "removeMessageReaction": RemoveMessageReactionRequestTypeID, + "setMessageReactions": SetMessageReactionsRequestTypeID, + "getMessageAddedReactions": GetMessageAddedReactionsRequestTypeID, + "setDefaultReactionType": SetDefaultReactionTypeRequestTypeID, + "searchQuote": SearchQuoteRequestTypeID, + "getTextEntities": GetTextEntitiesRequestTypeID, + "parseTextEntities": ParseTextEntitiesRequestTypeID, + "parseMarkdown": ParseMarkdownRequestTypeID, + "getMarkdownText": GetMarkdownTextRequestTypeID, + "getFileMimeType": GetFileMimeTypeRequestTypeID, + "getFileExtension": GetFileExtensionRequestTypeID, + "cleanFileName": CleanFileNameRequestTypeID, + "getLanguagePackString": GetLanguagePackStringRequestTypeID, + "getJsonValue": GetJSONValueRequestTypeID, + "getJsonString": GetJSONStringRequestTypeID, + "getThemeParametersJsonString": GetThemeParametersJSONStringRequestTypeID, + "setPollAnswer": SetPollAnswerRequestTypeID, + "getPollVoters": GetPollVotersRequestTypeID, + "stopPoll": StopPollRequestTypeID, + "hideSuggestedAction": HideSuggestedActionRequestTypeID, + "getLoginUrlInfo": GetLoginURLInfoRequestTypeID, + "getLoginUrl": GetLoginURLRequestTypeID, + "shareUsersWithBot": ShareUsersWithBotRequestTypeID, + "shareChatWithBot": ShareChatWithBotRequestTypeID, + "getInlineQueryResults": GetInlineQueryResultsRequestTypeID, + "answerInlineQuery": AnswerInlineQueryRequestTypeID, + "searchWebApp": SearchWebAppRequestTypeID, + "getWebAppLinkUrl": GetWebAppLinkURLRequestTypeID, + "getWebAppUrl": GetWebAppURLRequestTypeID, + "sendWebAppData": SendWebAppDataRequestTypeID, + "openWebApp": OpenWebAppRequestTypeID, + "closeWebApp": CloseWebAppRequestTypeID, + "answerWebAppQuery": AnswerWebAppQueryRequestTypeID, + "getCallbackQueryAnswer": GetCallbackQueryAnswerRequestTypeID, + "answerCallbackQuery": AnswerCallbackQueryRequestTypeID, + "answerShippingQuery": AnswerShippingQueryRequestTypeID, + "answerPreCheckoutQuery": AnswerPreCheckoutQueryRequestTypeID, + "setGameScore": SetGameScoreRequestTypeID, + "setInlineGameScore": SetInlineGameScoreRequestTypeID, + "getGameHighScores": GetGameHighScoresRequestTypeID, + "getInlineGameHighScores": GetInlineGameHighScoresRequestTypeID, + "deleteChatReplyMarkup": DeleteChatReplyMarkupRequestTypeID, + "sendChatAction": SendChatActionRequestTypeID, + "openChat": OpenChatRequestTypeID, + "closeChat": CloseChatRequestTypeID, + "viewMessages": ViewMessagesRequestTypeID, + "openMessageContent": OpenMessageContentRequestTypeID, + "clickAnimatedEmojiMessage": ClickAnimatedEmojiMessageRequestTypeID, + "getInternalLink": GetInternalLinkRequestTypeID, + "getInternalLinkType": GetInternalLinkTypeRequestTypeID, + "getExternalLinkInfo": GetExternalLinkInfoRequestTypeID, + "getExternalLink": GetExternalLinkRequestTypeID, + "readAllChatMentions": ReadAllChatMentionsRequestTypeID, + "readAllMessageThreadMentions": ReadAllMessageThreadMentionsRequestTypeID, + "readAllChatReactions": ReadAllChatReactionsRequestTypeID, + "readAllMessageThreadReactions": ReadAllMessageThreadReactionsRequestTypeID, + "createPrivateChat": CreatePrivateChatRequestTypeID, + "createBasicGroupChat": CreateBasicGroupChatRequestTypeID, + "createSupergroupChat": CreateSupergroupChatRequestTypeID, + "createSecretChat": CreateSecretChatRequestTypeID, + "createNewBasicGroupChat": CreateNewBasicGroupChatRequestTypeID, + "createNewSupergroupChat": CreateNewSupergroupChatRequestTypeID, + "createNewSecretChat": CreateNewSecretChatRequestTypeID, + "upgradeBasicGroupChatToSupergroupChat": UpgradeBasicGroupChatToSupergroupChatRequestTypeID, + "getChatListsToAddChat": GetChatListsToAddChatRequestTypeID, + "addChatToList": AddChatToListRequestTypeID, + "getChatFolder": GetChatFolderRequestTypeID, + "createChatFolder": CreateChatFolderRequestTypeID, + "editChatFolder": EditChatFolderRequestTypeID, + "deleteChatFolder": DeleteChatFolderRequestTypeID, + "getChatFolderChatsToLeave": GetChatFolderChatsToLeaveRequestTypeID, + "getChatFolderChatCount": GetChatFolderChatCountRequestTypeID, + "reorderChatFolders": ReorderChatFoldersRequestTypeID, + "getRecommendedChatFolders": GetRecommendedChatFoldersRequestTypeID, + "getChatFolderDefaultIconName": GetChatFolderDefaultIconNameRequestTypeID, + "getChatsForChatFolderInviteLink": GetChatsForChatFolderInviteLinkRequestTypeID, + "createChatFolderInviteLink": CreateChatFolderInviteLinkRequestTypeID, + "getChatFolderInviteLinks": GetChatFolderInviteLinksRequestTypeID, + "editChatFolderInviteLink": EditChatFolderInviteLinkRequestTypeID, + "deleteChatFolderInviteLink": DeleteChatFolderInviteLinkRequestTypeID, + "checkChatFolderInviteLink": CheckChatFolderInviteLinkRequestTypeID, + "addChatFolderByInviteLink": AddChatFolderByInviteLinkRequestTypeID, + "getChatFolderNewChats": GetChatFolderNewChatsRequestTypeID, + "processChatFolderNewChats": ProcessChatFolderNewChatsRequestTypeID, + "getArchiveChatListSettings": GetArchiveChatListSettingsRequestTypeID, + "setArchiveChatListSettings": SetArchiveChatListSettingsRequestTypeID, + "setChatTitle": SetChatTitleRequestTypeID, + "setChatPhoto": SetChatPhotoRequestTypeID, + "setChatAccentColor": SetChatAccentColorRequestTypeID, + "setChatProfileAccentColor": SetChatProfileAccentColorRequestTypeID, + "setChatMessageAutoDeleteTime": SetChatMessageAutoDeleteTimeRequestTypeID, + "setChatEmojiStatus": SetChatEmojiStatusRequestTypeID, + "setChatPermissions": SetChatPermissionsRequestTypeID, + "setChatBackground": SetChatBackgroundRequestTypeID, + "deleteChatBackground": DeleteChatBackgroundRequestTypeID, + "setChatTheme": SetChatThemeRequestTypeID, + "setChatDraftMessage": SetChatDraftMessageRequestTypeID, + "setChatNotificationSettings": SetChatNotificationSettingsRequestTypeID, + "toggleChatHasProtectedContent": ToggleChatHasProtectedContentRequestTypeID, + "toggleChatViewAsTopics": ToggleChatViewAsTopicsRequestTypeID, + "toggleChatIsTranslatable": ToggleChatIsTranslatableRequestTypeID, + "toggleChatIsMarkedAsUnread": ToggleChatIsMarkedAsUnreadRequestTypeID, + "toggleChatDefaultDisableNotification": ToggleChatDefaultDisableNotificationRequestTypeID, + "setChatAvailableReactions": SetChatAvailableReactionsRequestTypeID, + "setChatClientData": SetChatClientDataRequestTypeID, + "setChatDescription": SetChatDescriptionRequestTypeID, + "setChatDiscussionGroup": SetChatDiscussionGroupRequestTypeID, + "setChatLocation": SetChatLocationRequestTypeID, + "setChatSlowModeDelay": SetChatSlowModeDelayRequestTypeID, + "pinChatMessage": PinChatMessageRequestTypeID, + "unpinChatMessage": UnpinChatMessageRequestTypeID, + "unpinAllChatMessages": UnpinAllChatMessagesRequestTypeID, + "unpinAllMessageThreadMessages": UnpinAllMessageThreadMessagesRequestTypeID, + "joinChat": JoinChatRequestTypeID, + "leaveChat": LeaveChatRequestTypeID, + "addChatMember": AddChatMemberRequestTypeID, + "addChatMembers": AddChatMembersRequestTypeID, + "setChatMemberStatus": SetChatMemberStatusRequestTypeID, + "banChatMember": BanChatMemberRequestTypeID, + "canTransferOwnership": CanTransferOwnershipRequestTypeID, + "transferChatOwnership": TransferChatOwnershipRequestTypeID, + "getChatMember": GetChatMemberRequestTypeID, + "searchChatMembers": SearchChatMembersRequestTypeID, + "getChatAdministrators": GetChatAdministratorsRequestTypeID, + "clearAllDraftMessages": ClearAllDraftMessagesRequestTypeID, + "getSavedNotificationSound": GetSavedNotificationSoundRequestTypeID, + "getSavedNotificationSounds": GetSavedNotificationSoundsRequestTypeID, + "addSavedNotificationSound": AddSavedNotificationSoundRequestTypeID, + "removeSavedNotificationSound": RemoveSavedNotificationSoundRequestTypeID, + "getChatNotificationSettingsExceptions": GetChatNotificationSettingsExceptionsRequestTypeID, + "getScopeNotificationSettings": GetScopeNotificationSettingsRequestTypeID, + "setScopeNotificationSettings": SetScopeNotificationSettingsRequestTypeID, + "resetAllNotificationSettings": ResetAllNotificationSettingsRequestTypeID, + "toggleChatIsPinned": ToggleChatIsPinnedRequestTypeID, + "setPinnedChats": SetPinnedChatsRequestTypeID, + "readChatList": ReadChatListRequestTypeID, + "getStory": GetStoryRequestTypeID, + "getChatsToSendStories": GetChatsToSendStoriesRequestTypeID, + "canSendStory": CanSendStoryRequestTypeID, + "sendStory": SendStoryRequestTypeID, + "editStory": EditStoryRequestTypeID, + "setStoryPrivacySettings": SetStoryPrivacySettingsRequestTypeID, + "toggleStoryIsPinned": ToggleStoryIsPinnedRequestTypeID, + "deleteStory": DeleteStoryRequestTypeID, + "getStoryNotificationSettingsExceptions": GetStoryNotificationSettingsExceptionsRequestTypeID, + "loadActiveStories": LoadActiveStoriesRequestTypeID, + "setChatActiveStoriesList": SetChatActiveStoriesListRequestTypeID, + "getChatActiveStories": GetChatActiveStoriesRequestTypeID, + "getChatPinnedStories": GetChatPinnedStoriesRequestTypeID, + "getChatArchivedStories": GetChatArchivedStoriesRequestTypeID, + "openStory": OpenStoryRequestTypeID, + "closeStory": CloseStoryRequestTypeID, + "getStoryAvailableReactions": GetStoryAvailableReactionsRequestTypeID, + "setStoryReaction": SetStoryReactionRequestTypeID, + "getStoryInteractions": GetStoryInteractionsRequestTypeID, + "getChatStoryInteractions": GetChatStoryInteractionsRequestTypeID, + "reportStory": ReportStoryRequestTypeID, + "activateStoryStealthMode": ActivateStoryStealthModeRequestTypeID, + "getStoryPublicForwards": GetStoryPublicForwardsRequestTypeID, + "getChatBoostLevelFeatures": GetChatBoostLevelFeaturesRequestTypeID, + "getChatBoostFeatures": GetChatBoostFeaturesRequestTypeID, + "getAvailableChatBoostSlots": GetAvailableChatBoostSlotsRequestTypeID, + "getChatBoostStatus": GetChatBoostStatusRequestTypeID, + "boostChat": BoostChatRequestTypeID, + "getChatBoostLink": GetChatBoostLinkRequestTypeID, + "getChatBoostLinkInfo": GetChatBoostLinkInfoRequestTypeID, + "getChatBoosts": GetChatBoostsRequestTypeID, + "getUserChatBoosts": GetUserChatBoostsRequestTypeID, + "getAttachmentMenuBot": GetAttachmentMenuBotRequestTypeID, + "toggleBotIsAddedToAttachmentMenu": ToggleBotIsAddedToAttachmentMenuRequestTypeID, + "getThemedEmojiStatuses": GetThemedEmojiStatusesRequestTypeID, + "getRecentEmojiStatuses": GetRecentEmojiStatusesRequestTypeID, + "getDefaultEmojiStatuses": GetDefaultEmojiStatusesRequestTypeID, + "clearRecentEmojiStatuses": ClearRecentEmojiStatusesRequestTypeID, + "getThemedChatEmojiStatuses": GetThemedChatEmojiStatusesRequestTypeID, + "getDefaultChatEmojiStatuses": GetDefaultChatEmojiStatusesRequestTypeID, + "getDisallowedChatEmojiStatuses": GetDisallowedChatEmojiStatusesRequestTypeID, + "downloadFile": DownloadFileRequestTypeID, + "getFileDownloadedPrefixSize": GetFileDownloadedPrefixSizeRequestTypeID, + "cancelDownloadFile": CancelDownloadFileRequestTypeID, + "getSuggestedFileName": GetSuggestedFileNameRequestTypeID, + "preliminaryUploadFile": PreliminaryUploadFileRequestTypeID, + "cancelPreliminaryUploadFile": CancelPreliminaryUploadFileRequestTypeID, + "writeGeneratedFilePart": WriteGeneratedFilePartRequestTypeID, + "setFileGenerationProgress": SetFileGenerationProgressRequestTypeID, + "finishFileGeneration": FinishFileGenerationRequestTypeID, + "readFilePart": ReadFilePartRequestTypeID, + "deleteFile": DeleteFileRequestTypeID, + "addFileToDownloads": AddFileToDownloadsRequestTypeID, + "toggleDownloadIsPaused": ToggleDownloadIsPausedRequestTypeID, + "toggleAllDownloadsArePaused": ToggleAllDownloadsArePausedRequestTypeID, + "removeFileFromDownloads": RemoveFileFromDownloadsRequestTypeID, + "removeAllFilesFromDownloads": RemoveAllFilesFromDownloadsRequestTypeID, + "searchFileDownloads": SearchFileDownloadsRequestTypeID, + "getMessageFileType": GetMessageFileTypeRequestTypeID, + "getMessageImportConfirmationText": GetMessageImportConfirmationTextRequestTypeID, + "importMessages": ImportMessagesRequestTypeID, + "replacePrimaryChatInviteLink": ReplacePrimaryChatInviteLinkRequestTypeID, + "createChatInviteLink": CreateChatInviteLinkRequestTypeID, + "editChatInviteLink": EditChatInviteLinkRequestTypeID, + "getChatInviteLink": GetChatInviteLinkRequestTypeID, + "getChatInviteLinkCounts": GetChatInviteLinkCountsRequestTypeID, + "getChatInviteLinks": GetChatInviteLinksRequestTypeID, + "getChatInviteLinkMembers": GetChatInviteLinkMembersRequestTypeID, + "revokeChatInviteLink": RevokeChatInviteLinkRequestTypeID, + "deleteRevokedChatInviteLink": DeleteRevokedChatInviteLinkRequestTypeID, + "deleteAllRevokedChatInviteLinks": DeleteAllRevokedChatInviteLinksRequestTypeID, + "checkChatInviteLink": CheckChatInviteLinkRequestTypeID, + "joinChatByInviteLink": JoinChatByInviteLinkRequestTypeID, + "getChatJoinRequests": GetChatJoinRequestsRequestTypeID, + "processChatJoinRequest": ProcessChatJoinRequestRequestTypeID, + "processChatJoinRequests": ProcessChatJoinRequestsRequestTypeID, + "createCall": CreateCallRequestTypeID, + "acceptCall": AcceptCallRequestTypeID, + "sendCallSignalingData": SendCallSignalingDataRequestTypeID, + "discardCall": DiscardCallRequestTypeID, + "sendCallRating": SendCallRatingRequestTypeID, + "sendCallDebugInformation": SendCallDebugInformationRequestTypeID, + "sendCallLog": SendCallLogRequestTypeID, + "getVideoChatAvailableParticipants": GetVideoChatAvailableParticipantsRequestTypeID, + "setVideoChatDefaultParticipant": SetVideoChatDefaultParticipantRequestTypeID, + "createVideoChat": CreateVideoChatRequestTypeID, + "getVideoChatRtmpUrl": GetVideoChatRtmpURLRequestTypeID, + "replaceVideoChatRtmpUrl": ReplaceVideoChatRtmpURLRequestTypeID, + "getGroupCall": GetGroupCallRequestTypeID, + "startScheduledGroupCall": StartScheduledGroupCallRequestTypeID, + "toggleGroupCallEnabledStartNotification": ToggleGroupCallEnabledStartNotificationRequestTypeID, + "joinGroupCall": JoinGroupCallRequestTypeID, + "startGroupCallScreenSharing": StartGroupCallScreenSharingRequestTypeID, + "toggleGroupCallScreenSharingIsPaused": ToggleGroupCallScreenSharingIsPausedRequestTypeID, + "endGroupCallScreenSharing": EndGroupCallScreenSharingRequestTypeID, + "setGroupCallTitle": SetGroupCallTitleRequestTypeID, + "toggleGroupCallMuteNewParticipants": ToggleGroupCallMuteNewParticipantsRequestTypeID, + "inviteGroupCallParticipants": InviteGroupCallParticipantsRequestTypeID, + "getGroupCallInviteLink": GetGroupCallInviteLinkRequestTypeID, + "revokeGroupCallInviteLink": RevokeGroupCallInviteLinkRequestTypeID, + "startGroupCallRecording": StartGroupCallRecordingRequestTypeID, + "endGroupCallRecording": EndGroupCallRecordingRequestTypeID, + "toggleGroupCallIsMyVideoPaused": ToggleGroupCallIsMyVideoPausedRequestTypeID, + "toggleGroupCallIsMyVideoEnabled": ToggleGroupCallIsMyVideoEnabledRequestTypeID, + "setGroupCallParticipantIsSpeaking": SetGroupCallParticipantIsSpeakingRequestTypeID, + "toggleGroupCallParticipantIsMuted": ToggleGroupCallParticipantIsMutedRequestTypeID, + "setGroupCallParticipantVolumeLevel": SetGroupCallParticipantVolumeLevelRequestTypeID, + "toggleGroupCallParticipantIsHandRaised": ToggleGroupCallParticipantIsHandRaisedRequestTypeID, + "loadGroupCallParticipants": LoadGroupCallParticipantsRequestTypeID, + "leaveGroupCall": LeaveGroupCallRequestTypeID, + "endGroupCall": EndGroupCallRequestTypeID, + "getGroupCallStreams": GetGroupCallStreamsRequestTypeID, + "getGroupCallStreamSegment": GetGroupCallStreamSegmentRequestTypeID, + "setMessageSenderBlockList": SetMessageSenderBlockListRequestTypeID, + "blockMessageSenderFromReplies": BlockMessageSenderFromRepliesRequestTypeID, + "getBlockedMessageSenders": GetBlockedMessageSendersRequestTypeID, + "addContact": AddContactRequestTypeID, + "importContacts": ImportContactsRequestTypeID, + "getContacts": GetContactsRequestTypeID, + "searchContacts": SearchContactsRequestTypeID, + "removeContacts": RemoveContactsRequestTypeID, + "getImportedContactCount": GetImportedContactCountRequestTypeID, + "changeImportedContacts": ChangeImportedContactsRequestTypeID, + "clearImportedContacts": ClearImportedContactsRequestTypeID, + "setCloseFriends": SetCloseFriendsRequestTypeID, + "getCloseFriends": GetCloseFriendsRequestTypeID, + "setUserPersonalProfilePhoto": SetUserPersonalProfilePhotoRequestTypeID, + "suggestUserProfilePhoto": SuggestUserProfilePhotoRequestTypeID, + "searchUserByPhoneNumber": SearchUserByPhoneNumberRequestTypeID, + "sharePhoneNumber": SharePhoneNumberRequestTypeID, + "getUserProfilePhotos": GetUserProfilePhotosRequestTypeID, + "getStickers": GetStickersRequestTypeID, + "getAllStickerEmojis": GetAllStickerEmojisRequestTypeID, + "searchStickers": SearchStickersRequestTypeID, + "getPremiumStickers": GetPremiumStickersRequestTypeID, + "getInstalledStickerSets": GetInstalledStickerSetsRequestTypeID, + "getArchivedStickerSets": GetArchivedStickerSetsRequestTypeID, + "getTrendingStickerSets": GetTrendingStickerSetsRequestTypeID, + "getAttachedStickerSets": GetAttachedStickerSetsRequestTypeID, + "getStickerSet": GetStickerSetRequestTypeID, + "searchStickerSet": SearchStickerSetRequestTypeID, + "searchInstalledStickerSets": SearchInstalledStickerSetsRequestTypeID, + "searchStickerSets": SearchStickerSetsRequestTypeID, + "changeStickerSet": ChangeStickerSetRequestTypeID, + "viewTrendingStickerSets": ViewTrendingStickerSetsRequestTypeID, + "reorderInstalledStickerSets": ReorderInstalledStickerSetsRequestTypeID, + "getRecentStickers": GetRecentStickersRequestTypeID, + "addRecentSticker": AddRecentStickerRequestTypeID, + "removeRecentSticker": RemoveRecentStickerRequestTypeID, + "clearRecentStickers": ClearRecentStickersRequestTypeID, + "getFavoriteStickers": GetFavoriteStickersRequestTypeID, + "addFavoriteSticker": AddFavoriteStickerRequestTypeID, + "removeFavoriteSticker": RemoveFavoriteStickerRequestTypeID, + "getStickerEmojis": GetStickerEmojisRequestTypeID, + "searchEmojis": SearchEmojisRequestTypeID, + "getEmojiCategories": GetEmojiCategoriesRequestTypeID, + "getAnimatedEmoji": GetAnimatedEmojiRequestTypeID, + "getEmojiSuggestionsUrl": GetEmojiSuggestionsURLRequestTypeID, + "getCustomEmojiStickers": GetCustomEmojiStickersRequestTypeID, + "getDefaultChatPhotoCustomEmojiStickers": GetDefaultChatPhotoCustomEmojiStickersRequestTypeID, + "getDefaultProfilePhotoCustomEmojiStickers": GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID, + "getDefaultBackgroundCustomEmojiStickers": GetDefaultBackgroundCustomEmojiStickersRequestTypeID, + "getSavedAnimations": GetSavedAnimationsRequestTypeID, + "addSavedAnimation": AddSavedAnimationRequestTypeID, + "removeSavedAnimation": RemoveSavedAnimationRequestTypeID, + "getRecentInlineBots": GetRecentInlineBotsRequestTypeID, + "searchHashtags": SearchHashtagsRequestTypeID, + "removeRecentHashtag": RemoveRecentHashtagRequestTypeID, + "getWebPagePreview": GetWebPagePreviewRequestTypeID, + "getWebPageInstantView": GetWebPageInstantViewRequestTypeID, + "setProfilePhoto": SetProfilePhotoRequestTypeID, + "deleteProfilePhoto": DeleteProfilePhotoRequestTypeID, + "setAccentColor": SetAccentColorRequestTypeID, + "setProfileAccentColor": SetProfileAccentColorRequestTypeID, + "setName": SetNameRequestTypeID, + "setBio": SetBioRequestTypeID, + "setUsername": SetUsernameRequestTypeID, + "toggleUsernameIsActive": ToggleUsernameIsActiveRequestTypeID, + "reorderActiveUsernames": ReorderActiveUsernamesRequestTypeID, + "setEmojiStatus": SetEmojiStatusRequestTypeID, + "setLocation": SetLocationRequestTypeID, + "changePhoneNumber": ChangePhoneNumberRequestTypeID, + "resendChangePhoneNumberCode": ResendChangePhoneNumberCodeRequestTypeID, + "checkChangePhoneNumberCode": CheckChangePhoneNumberCodeRequestTypeID, + "getUserLink": GetUserLinkRequestTypeID, + "searchUserByToken": SearchUserByTokenRequestTypeID, + "setCommands": SetCommandsRequestTypeID, + "deleteCommands": DeleteCommandsRequestTypeID, + "getCommands": GetCommandsRequestTypeID, + "setMenuButton": SetMenuButtonRequestTypeID, + "getMenuButton": GetMenuButtonRequestTypeID, + "setDefaultGroupAdministratorRights": SetDefaultGroupAdministratorRightsRequestTypeID, + "setDefaultChannelAdministratorRights": SetDefaultChannelAdministratorRightsRequestTypeID, + "canBotSendMessages": CanBotSendMessagesRequestTypeID, + "allowBotToSendMessages": AllowBotToSendMessagesRequestTypeID, + "sendWebAppCustomRequest": SendWebAppCustomRequestRequestTypeID, + "setBotName": SetBotNameRequestTypeID, + "getBotName": GetBotNameRequestTypeID, + "setBotProfilePhoto": SetBotProfilePhotoRequestTypeID, + "toggleBotUsernameIsActive": ToggleBotUsernameIsActiveRequestTypeID, + "reorderBotActiveUsernames": ReorderBotActiveUsernamesRequestTypeID, + "setBotInfoDescription": SetBotInfoDescriptionRequestTypeID, + "getBotInfoDescription": GetBotInfoDescriptionRequestTypeID, + "setBotInfoShortDescription": SetBotInfoShortDescriptionRequestTypeID, + "getBotInfoShortDescription": GetBotInfoShortDescriptionRequestTypeID, + "getActiveSessions": GetActiveSessionsRequestTypeID, + "terminateSession": TerminateSessionRequestTypeID, + "terminateAllOtherSessions": TerminateAllOtherSessionsRequestTypeID, + "confirmSession": ConfirmSessionRequestTypeID, + "toggleSessionCanAcceptCalls": ToggleSessionCanAcceptCallsRequestTypeID, + "toggleSessionCanAcceptSecretChats": ToggleSessionCanAcceptSecretChatsRequestTypeID, + "setInactiveSessionTtl": SetInactiveSessionTTLRequestTypeID, + "getConnectedWebsites": GetConnectedWebsitesRequestTypeID, + "disconnectWebsite": DisconnectWebsiteRequestTypeID, + "disconnectAllWebsites": DisconnectAllWebsitesRequestTypeID, + "setSupergroupUsername": SetSupergroupUsernameRequestTypeID, + "toggleSupergroupUsernameIsActive": ToggleSupergroupUsernameIsActiveRequestTypeID, + "disableAllSupergroupUsernames": DisableAllSupergroupUsernamesRequestTypeID, + "reorderSupergroupActiveUsernames": ReorderSupergroupActiveUsernamesRequestTypeID, + "setSupergroupStickerSet": SetSupergroupStickerSetRequestTypeID, + "toggleSupergroupSignMessages": ToggleSupergroupSignMessagesRequestTypeID, + "toggleSupergroupJoinToSendMessages": ToggleSupergroupJoinToSendMessagesRequestTypeID, + "toggleSupergroupJoinByRequest": ToggleSupergroupJoinByRequestRequestTypeID, + "toggleSupergroupIsAllHistoryAvailable": ToggleSupergroupIsAllHistoryAvailableRequestTypeID, + "toggleSupergroupHasHiddenMembers": ToggleSupergroupHasHiddenMembersRequestTypeID, + "toggleSupergroupHasAggressiveAntiSpamEnabled": ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID, + "toggleSupergroupIsForum": ToggleSupergroupIsForumRequestTypeID, + "toggleSupergroupIsBroadcastGroup": ToggleSupergroupIsBroadcastGroupRequestTypeID, + "reportSupergroupSpam": ReportSupergroupSpamRequestTypeID, + "reportSupergroupAntiSpamFalsePositive": ReportSupergroupAntiSpamFalsePositiveRequestTypeID, + "getSupergroupMembers": GetSupergroupMembersRequestTypeID, + "closeSecretChat": CloseSecretChatRequestTypeID, + "getChatEventLog": GetChatEventLogRequestTypeID, + "getPaymentForm": GetPaymentFormRequestTypeID, + "validateOrderInfo": ValidateOrderInfoRequestTypeID, + "sendPaymentForm": SendPaymentFormRequestTypeID, + "getPaymentReceipt": GetPaymentReceiptRequestTypeID, + "getSavedOrderInfo": GetSavedOrderInfoRequestTypeID, + "deleteSavedOrderInfo": DeleteSavedOrderInfoRequestTypeID, + "deleteSavedCredentials": DeleteSavedCredentialsRequestTypeID, + "createInvoiceLink": CreateInvoiceLinkRequestTypeID, + "getSupportUser": GetSupportUserRequestTypeID, + "getBackgroundUrl": GetBackgroundURLRequestTypeID, + "searchBackground": SearchBackgroundRequestTypeID, + "setDefaultBackground": SetDefaultBackgroundRequestTypeID, + "deleteDefaultBackground": DeleteDefaultBackgroundRequestTypeID, + "getInstalledBackgrounds": GetInstalledBackgroundsRequestTypeID, + "removeInstalledBackground": RemoveInstalledBackgroundRequestTypeID, + "resetInstalledBackgrounds": ResetInstalledBackgroundsRequestTypeID, + "getLocalizationTargetInfo": GetLocalizationTargetInfoRequestTypeID, + "getLanguagePackInfo": GetLanguagePackInfoRequestTypeID, + "getLanguagePackStrings": GetLanguagePackStringsRequestTypeID, + "synchronizeLanguagePack": SynchronizeLanguagePackRequestTypeID, + "addCustomServerLanguagePack": AddCustomServerLanguagePackRequestTypeID, + "setCustomLanguagePack": SetCustomLanguagePackRequestTypeID, + "editCustomLanguagePackInfo": EditCustomLanguagePackInfoRequestTypeID, + "setCustomLanguagePackString": SetCustomLanguagePackStringRequestTypeID, + "deleteLanguagePack": DeleteLanguagePackRequestTypeID, + "registerDevice": RegisterDeviceRequestTypeID, + "processPushNotification": ProcessPushNotificationRequestTypeID, + "getPushReceiverId": GetPushReceiverIDRequestTypeID, + "getRecentlyVisitedTMeUrls": GetRecentlyVisitedTMeURLsRequestTypeID, + "setUserPrivacySettingRules": SetUserPrivacySettingRulesRequestTypeID, + "getUserPrivacySettingRules": GetUserPrivacySettingRulesRequestTypeID, + "getOption": GetOptionRequestTypeID, + "setOption": SetOptionRequestTypeID, + "setAccountTtl": SetAccountTTLRequestTypeID, + "getAccountTtl": GetAccountTTLRequestTypeID, + "deleteAccount": DeleteAccountRequestTypeID, + "setDefaultMessageAutoDeleteTime": SetDefaultMessageAutoDeleteTimeRequestTypeID, + "getDefaultMessageAutoDeleteTime": GetDefaultMessageAutoDeleteTimeRequestTypeID, + "removeChatActionBar": RemoveChatActionBarRequestTypeID, + "reportChat": ReportChatRequestTypeID, + "reportChatPhoto": ReportChatPhotoRequestTypeID, + "reportMessageReactions": ReportMessageReactionsRequestTypeID, + "getChatStatistics": GetChatStatisticsRequestTypeID, + "getMessageStatistics": GetMessageStatisticsRequestTypeID, + "getMessagePublicForwards": GetMessagePublicForwardsRequestTypeID, + "getStoryStatistics": GetStoryStatisticsRequestTypeID, + "getStatisticalGraph": GetStatisticalGraphRequestTypeID, + "getStorageStatistics": GetStorageStatisticsRequestTypeID, + "getStorageStatisticsFast": GetStorageStatisticsFastRequestTypeID, + "getDatabaseStatistics": GetDatabaseStatisticsRequestTypeID, + "optimizeStorage": OptimizeStorageRequestTypeID, + "setNetworkType": SetNetworkTypeRequestTypeID, + "getNetworkStatistics": GetNetworkStatisticsRequestTypeID, + "addNetworkStatistics": AddNetworkStatisticsRequestTypeID, + "resetNetworkStatistics": ResetNetworkStatisticsRequestTypeID, + "getAutoDownloadSettingsPresets": GetAutoDownloadSettingsPresetsRequestTypeID, + "setAutoDownloadSettings": SetAutoDownloadSettingsRequestTypeID, + "getAutosaveSettings": GetAutosaveSettingsRequestTypeID, + "setAutosaveSettings": SetAutosaveSettingsRequestTypeID, + "clearAutosaveSettingsExceptions": ClearAutosaveSettingsExceptionsRequestTypeID, + "getBankCardInfo": GetBankCardInfoRequestTypeID, + "getPassportElement": GetPassportElementRequestTypeID, + "getAllPassportElements": GetAllPassportElementsRequestTypeID, + "setPassportElement": SetPassportElementRequestTypeID, + "deletePassportElement": DeletePassportElementRequestTypeID, + "setPassportElementErrors": SetPassportElementErrorsRequestTypeID, + "getPreferredCountryLanguage": GetPreferredCountryLanguageRequestTypeID, + "sendPhoneNumberVerificationCode": SendPhoneNumberVerificationCodeRequestTypeID, + "resendPhoneNumberVerificationCode": ResendPhoneNumberVerificationCodeRequestTypeID, + "checkPhoneNumberVerificationCode": CheckPhoneNumberVerificationCodeRequestTypeID, + "sendEmailAddressVerificationCode": SendEmailAddressVerificationCodeRequestTypeID, + "resendEmailAddressVerificationCode": ResendEmailAddressVerificationCodeRequestTypeID, + "checkEmailAddressVerificationCode": CheckEmailAddressVerificationCodeRequestTypeID, + "getPassportAuthorizationForm": GetPassportAuthorizationFormRequestTypeID, + "getPassportAuthorizationFormAvailableElements": GetPassportAuthorizationFormAvailableElementsRequestTypeID, + "sendPassportAuthorizationForm": SendPassportAuthorizationFormRequestTypeID, + "sendPhoneNumberConfirmationCode": SendPhoneNumberConfirmationCodeRequestTypeID, + "resendPhoneNumberConfirmationCode": ResendPhoneNumberConfirmationCodeRequestTypeID, + "checkPhoneNumberConfirmationCode": CheckPhoneNumberConfirmationCodeRequestTypeID, + "setBotUpdatesStatus": SetBotUpdatesStatusRequestTypeID, + "uploadStickerFile": UploadStickerFileRequestTypeID, + "getSuggestedStickerSetName": GetSuggestedStickerSetNameRequestTypeID, + "checkStickerSetName": CheckStickerSetNameRequestTypeID, + "createNewStickerSet": CreateNewStickerSetRequestTypeID, + "addStickerToSet": AddStickerToSetRequestTypeID, + "setStickerSetThumbnail": SetStickerSetThumbnailRequestTypeID, + "setCustomEmojiStickerSetThumbnail": SetCustomEmojiStickerSetThumbnailRequestTypeID, + "setStickerSetTitle": SetStickerSetTitleRequestTypeID, + "deleteStickerSet": DeleteStickerSetRequestTypeID, + "setStickerPositionInSet": SetStickerPositionInSetRequestTypeID, + "removeStickerFromSet": RemoveStickerFromSetRequestTypeID, + "setStickerEmojis": SetStickerEmojisRequestTypeID, + "setStickerKeywords": SetStickerKeywordsRequestTypeID, + "setStickerMaskPosition": SetStickerMaskPositionRequestTypeID, + "getMapThumbnailFile": GetMapThumbnailFileRequestTypeID, + "getPremiumLimit": GetPremiumLimitRequestTypeID, + "getPremiumFeatures": GetPremiumFeaturesRequestTypeID, + "getPremiumStickerExamples": GetPremiumStickerExamplesRequestTypeID, + "viewPremiumFeature": ViewPremiumFeatureRequestTypeID, + "clickPremiumSubscriptionButton": ClickPremiumSubscriptionButtonRequestTypeID, + "getPremiumState": GetPremiumStateRequestTypeID, + "getPremiumGiftCodePaymentOptions": GetPremiumGiftCodePaymentOptionsRequestTypeID, + "checkPremiumGiftCode": CheckPremiumGiftCodeRequestTypeID, + "applyPremiumGiftCode": ApplyPremiumGiftCodeRequestTypeID, + "launchPrepaidPremiumGiveaway": LaunchPrepaidPremiumGiveawayRequestTypeID, + "getPremiumGiveawayInfo": GetPremiumGiveawayInfoRequestTypeID, + "canPurchasePremium": CanPurchasePremiumRequestTypeID, + "assignAppStoreTransaction": AssignAppStoreTransactionRequestTypeID, + "assignGooglePlayTransaction": AssignGooglePlayTransactionRequestTypeID, + "acceptTermsOfService": AcceptTermsOfServiceRequestTypeID, + "searchStringsByPrefix": SearchStringsByPrefixRequestTypeID, + "sendCustomRequest": SendCustomRequestRequestTypeID, + "answerCustomQuery": AnswerCustomQueryRequestTypeID, + "setAlarm": SetAlarmRequestTypeID, + "getCountries": GetCountriesRequestTypeID, + "getCountryCode": GetCountryCodeRequestTypeID, + "getPhoneNumberInfo": GetPhoneNumberInfoRequestTypeID, + "getPhoneNumberInfoSync": GetPhoneNumberInfoSyncRequestTypeID, + "getDeepLinkInfo": GetDeepLinkInfoRequestTypeID, + "getApplicationConfig": GetApplicationConfigRequestTypeID, + "saveApplicationLogEvent": SaveApplicationLogEventRequestTypeID, + "getApplicationDownloadLink": GetApplicationDownloadLinkRequestTypeID, + "addProxy": AddProxyRequestTypeID, + "editProxy": EditProxyRequestTypeID, + "enableProxy": EnableProxyRequestTypeID, + "disableProxy": DisableProxyRequestTypeID, + "removeProxy": RemoveProxyRequestTypeID, + "getProxies": GetProxiesRequestTypeID, + "getProxyLink": GetProxyLinkRequestTypeID, + "pingProxy": PingProxyRequestTypeID, + "setLogStream": SetLogStreamRequestTypeID, + "getLogStream": GetLogStreamRequestTypeID, + "setLogVerbosityLevel": SetLogVerbosityLevelRequestTypeID, + "getLogVerbosityLevel": GetLogVerbosityLevelRequestTypeID, + "getLogTags": GetLogTagsRequestTypeID, + "setLogTagVerbosityLevel": SetLogTagVerbosityLevelRequestTypeID, + "getLogTagVerbosityLevel": GetLogTagVerbosityLevelRequestTypeID, + "addLogMessage": AddLogMessageRequestTypeID, + "getUserSupportInfo": GetUserSupportInfoRequestTypeID, + "setUserSupportInfo": SetUserSupportInfoRequestTypeID, + "getSupportName": GetSupportNameRequestTypeID, + "testCallEmpty": TestCallEmptyRequestTypeID, + "testCallString": TestCallStringRequestTypeID, + "testCallBytes": TestCallBytesRequestTypeID, + "testCallVectorInt": TestCallVectorIntRequestTypeID, + "testCallVectorIntObject": TestCallVectorIntObjectRequestTypeID, + "testCallVectorString": TestCallVectorStringRequestTypeID, + "testCallVectorStringObject": TestCallVectorStringObjectRequestTypeID, + "testSquareInt": TestSquareIntRequestTypeID, + "testNetwork": TestNetworkRequestTypeID, + "testProxy": TestProxyRequestTypeID, + "testGetDifference": TestGetDifferenceRequestTypeID, + "testUseUpdate": TestUseUpdateRequestTypeID, + "testReturnError": TestReturnErrorRequestTypeID, } } @@ -4369,7 +4419,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { KeyboardButtonTypeRequestPhoneNumberTypeID: func() bin.Object { return &KeyboardButtonTypeRequestPhoneNumber{} }, KeyboardButtonTypeRequestLocationTypeID: func() bin.Object { return &KeyboardButtonTypeRequestLocation{} }, KeyboardButtonTypeRequestPollTypeID: func() bin.Object { return &KeyboardButtonTypeRequestPoll{} }, - KeyboardButtonTypeRequestUserTypeID: func() bin.Object { return &KeyboardButtonTypeRequestUser{} }, + KeyboardButtonTypeRequestUsersTypeID: func() bin.Object { return &KeyboardButtonTypeRequestUsers{} }, KeyboardButtonTypeRequestChatTypeID: func() bin.Object { return &KeyboardButtonTypeRequestChat{} }, KeyboardButtonTypeWebAppTypeID: func() bin.Object { return &KeyboardButtonTypeWebApp{} }, KeyboardButtonTypeID: func() bin.Object { return &KeyboardButton{} }, @@ -4615,8 +4665,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessagePremiumGiveawayCreatedTypeID: func() bin.Object { return &MessagePremiumGiveawayCreated{} }, MessagePremiumGiveawayTypeID: func() bin.Object { return &MessagePremiumGiveaway{} }, MessagePremiumGiveawayCompletedTypeID: func() bin.Object { return &MessagePremiumGiveawayCompleted{} }, + MessagePremiumGiveawayWinnersTypeID: func() bin.Object { return &MessagePremiumGiveawayWinners{} }, MessageContactRegisteredTypeID: func() bin.Object { return &MessageContactRegistered{} }, - MessageUserSharedTypeID: func() bin.Object { return &MessageUserShared{} }, + MessageUsersSharedTypeID: func() bin.Object { return &MessageUsersShared{} }, MessageChatSharedTypeID: func() bin.Object { return &MessageChatShared{} }, MessageBotWriteAccessAllowedTypeID: func() bin.Object { return &MessageBotWriteAccessAllowed{} }, MessageWebAppDataSentTypeID: func() bin.Object { return &MessageWebAppDataSent{} }, @@ -4720,17 +4771,17 @@ func TypesConstructorMap() map[uint32]func() bin.Object { EmojiCategoryTypeDefaultTypeID: func() bin.Object { return &EmojiCategoryTypeDefault{} }, EmojiCategoryTypeEmojiStatusTypeID: func() bin.Object { return &EmojiCategoryTypeEmojiStatus{} }, EmojiCategoryTypeChatPhotoTypeID: func() bin.Object { return &EmojiCategoryTypeChatPhoto{} }, - StoryViewerTypeID: func() bin.Object { return &StoryViewer{} }, - StoryViewersTypeID: func() bin.Object { return &StoryViewers{} }, StoryAreaPositionTypeID: func() bin.Object { return &StoryAreaPosition{} }, StoryAreaTypeLocationTypeID: func() bin.Object { return &StoryAreaTypeLocation{} }, StoryAreaTypeVenueTypeID: func() bin.Object { return &StoryAreaTypeVenue{} }, StoryAreaTypeSuggestedReactionTypeID: func() bin.Object { return &StoryAreaTypeSuggestedReaction{} }, + StoryAreaTypeMessageTypeID: func() bin.Object { return &StoryAreaTypeMessage{} }, StoryAreaTypeID: func() bin.Object { return &StoryArea{} }, InputStoryAreaTypeLocationTypeID: func() bin.Object { return &InputStoryAreaTypeLocation{} }, InputStoryAreaTypeFoundVenueTypeID: func() bin.Object { return &InputStoryAreaTypeFoundVenue{} }, InputStoryAreaTypePreviousVenueTypeID: func() bin.Object { return &InputStoryAreaTypePreviousVenue{} }, InputStoryAreaTypeSuggestedReactionTypeID: func() bin.Object { return &InputStoryAreaTypeSuggestedReaction{} }, + InputStoryAreaTypeMessageTypeID: func() bin.Object { return &InputStoryAreaTypeMessage{} }, InputStoryAreaTypeID: func() bin.Object { return &InputStoryArea{} }, InputStoryAreasTypeID: func() bin.Object { return &InputStoryAreas{} }, StoryVideoTypeID: func() bin.Object { return &StoryVideo{} }, @@ -4750,9 +4801,16 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StoryFullIDTypeID: func() bin.Object { return &StoryFullID{} }, StoryInfoTypeID: func() bin.Object { return &StoryInfo{} }, ChatActiveStoriesTypeID: func() bin.Object { return &ChatActiveStories{} }, - StoryPublicForwardMessageTypeID: func() bin.Object { return &StoryPublicForwardMessage{} }, - StoryPublicForwardStoryTypeID: func() bin.Object { return &StoryPublicForwardStory{} }, - StoryPublicForwardsTypeID: func() bin.Object { return &StoryPublicForwards{} }, + StoryInteractionTypeViewTypeID: func() bin.Object { return &StoryInteractionTypeView{} }, + StoryInteractionTypeForwardTypeID: func() bin.Object { return &StoryInteractionTypeForward{} }, + StoryInteractionTypeRepostTypeID: func() bin.Object { return &StoryInteractionTypeRepost{} }, + StoryInteractionTypeID: func() bin.Object { return &StoryInteraction{} }, + StoryInteractionsTypeID: func() bin.Object { return &StoryInteractions{} }, + PublicForwardMessageTypeID: func() bin.Object { return &PublicForwardMessage{} }, + PublicForwardStoryTypeID: func() bin.Object { return &PublicForwardStory{} }, + PublicForwardsTypeID: func() bin.Object { return &PublicForwards{} }, + ChatBoostLevelFeaturesTypeID: func() bin.Object { return &ChatBoostLevelFeatures{} }, + ChatBoostFeaturesTypeID: func() bin.Object { return &ChatBoostFeatures{} }, ChatBoostSourceGiftCodeTypeID: func() bin.Object { return &ChatBoostSourceGiftCode{} }, ChatBoostSourceGiveawayTypeID: func() bin.Object { return &ChatBoostSourceGiveaway{} }, ChatBoostSourcePremiumTypeID: func() bin.Object { return &ChatBoostSourcePremium{} }, @@ -4872,7 +4930,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatEventMemberPromotedTypeID: func() bin.Object { return &ChatEventMemberPromoted{} }, ChatEventMemberRestrictedTypeID: func() bin.Object { return &ChatEventMemberRestricted{} }, ChatEventAvailableReactionsChangedTypeID: func() bin.Object { return &ChatEventAvailableReactionsChanged{} }, + ChatEventBackgroundChangedTypeID: func() bin.Object { return &ChatEventBackgroundChanged{} }, ChatEventDescriptionChangedTypeID: func() bin.Object { return &ChatEventDescriptionChanged{} }, + ChatEventEmojiStatusChangedTypeID: func() bin.Object { return &ChatEventEmojiStatusChanged{} }, ChatEventLinkedChatChangedTypeID: func() bin.Object { return &ChatEventLinkedChatChanged{} }, ChatEventLocationChangedTypeID: func() bin.Object { return &ChatEventLocationChanged{} }, ChatEventMessageAutoDeleteTimeChangedTypeID: func() bin.Object { return &ChatEventMessageAutoDeleteTimeChanged{} }, @@ -4884,7 +4944,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatEventUsernameChangedTypeID: func() bin.Object { return &ChatEventUsernameChanged{} }, ChatEventActiveUsernamesChangedTypeID: func() bin.Object { return &ChatEventActiveUsernamesChanged{} }, ChatEventAccentColorChangedTypeID: func() bin.Object { return &ChatEventAccentColorChanged{} }, - ChatEventBackgroundCustomEmojiChangedTypeID: func() bin.Object { return &ChatEventBackgroundCustomEmojiChanged{} }, + ChatEventProfileAccentColorChangedTypeID: func() bin.Object { return &ChatEventProfileAccentColorChanged{} }, ChatEventHasProtectedContentToggledTypeID: func() bin.Object { return &ChatEventHasProtectedContentToggled{} }, ChatEventInvitesToggledTypeID: func() bin.Object { return &ChatEventInvitesToggled{} }, ChatEventIsAllHistoryAvailableToggledTypeID: func() bin.Object { return &ChatEventIsAllHistoryAvailableToggled{} }, @@ -4992,6 +5052,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { BackgroundTypeWallpaperTypeID: func() bin.Object { return &BackgroundTypeWallpaper{} }, BackgroundTypePatternTypeID: func() bin.Object { return &BackgroundTypePattern{} }, BackgroundTypeFillTypeID: func() bin.Object { return &BackgroundTypeFill{} }, + BackgroundTypeChatThemeTypeID: func() bin.Object { return &BackgroundTypeChatTheme{} }, InputBackgroundLocalTypeID: func() bin.Object { return &InputBackgroundLocal{} }, InputBackgroundRemoteTypeID: func() bin.Object { return &InputBackgroundRemote{} }, InputBackgroundPreviousTypeID: func() bin.Object { return &InputBackgroundPrevious{} }, @@ -5164,6 +5225,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InternalLinkTypePassportDataRequestTypeID: func() bin.Object { return &InternalLinkTypePassportDataRequest{} }, InternalLinkTypePhoneNumberConfirmationTypeID: func() bin.Object { return &InternalLinkTypePhoneNumberConfirmation{} }, InternalLinkTypePremiumFeaturesTypeID: func() bin.Object { return &InternalLinkTypePremiumFeatures{} }, + InternalLinkTypePremiumGiftTypeID: func() bin.Object { return &InternalLinkTypePremiumGift{} }, InternalLinkTypePremiumGiftCodeTypeID: func() bin.Object { return &InternalLinkTypePremiumGiftCode{} }, InternalLinkTypePrivacyAndSecuritySettingsTypeID: func() bin.Object { return &InternalLinkTypePrivacyAndSecuritySettings{} }, InternalLinkTypeProxyTypeID: func() bin.Object { return &InternalLinkTypeProxy{} }, @@ -5259,6 +5321,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { SuggestedActionUpgradePremiumTypeID: func() bin.Object { return &SuggestedActionUpgradePremium{} }, SuggestedActionRestorePremiumTypeID: func() bin.Object { return &SuggestedActionRestorePremium{} }, SuggestedActionSubscribeToAnnualPremiumTypeID: func() bin.Object { return &SuggestedActionSubscribeToAnnualPremium{} }, + SuggestedActionGiftPremiumForChristmasTypeID: func() bin.Object { return &SuggestedActionGiftPremiumForChristmas{} }, CountTypeID: func() bin.Object { return &Count{} }, TextTypeID: func() bin.Object { return &Text{} }, SecondsTypeID: func() bin.Object { return &Seconds{} }, @@ -5313,8 +5376,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateNewChatTypeID: func() bin.Object { return &UpdateNewChat{} }, UpdateChatTitleTypeID: func() bin.Object { return &UpdateChatTitle{} }, UpdateChatPhotoTypeID: func() bin.Object { return &UpdateChatPhoto{} }, - UpdateChatAccentColorTypeID: func() bin.Object { return &UpdateChatAccentColor{} }, - UpdateChatBackgroundCustomEmojiTypeID: func() bin.Object { return &UpdateChatBackgroundCustomEmoji{} }, + UpdateChatAccentColorsTypeID: func() bin.Object { return &UpdateChatAccentColors{} }, UpdateChatPermissionsTypeID: func() bin.Object { return &UpdateChatPermissions{} }, UpdateChatLastMessageTypeID: func() bin.Object { return &UpdateChatLastMessage{} }, UpdateChatPositionTypeID: func() bin.Object { return &UpdateChatPosition{} }, @@ -5323,6 +5385,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateChatActionBarTypeID: func() bin.Object { return &UpdateChatActionBar{} }, UpdateChatAvailableReactionsTypeID: func() bin.Object { return &UpdateChatAvailableReactions{} }, UpdateChatDraftMessageTypeID: func() bin.Object { return &UpdateChatDraftMessage{} }, + UpdateChatEmojiStatusTypeID: func() bin.Object { return &UpdateChatEmojiStatus{} }, UpdateChatMessageSenderTypeID: func() bin.Object { return &UpdateChatMessageSender{} }, UpdateChatMessageAutoDeleteTimeTypeID: func() bin.Object { return &UpdateChatMessageAutoDeleteTime{} }, UpdateChatNotificationSettingsTypeID: func() bin.Object { return &UpdateChatNotificationSettings{} }, @@ -5388,7 +5451,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateFavoriteStickersTypeID: func() bin.Object { return &UpdateFavoriteStickers{} }, UpdateSavedAnimationsTypeID: func() bin.Object { return &UpdateSavedAnimations{} }, UpdateSavedNotificationSoundsTypeID: func() bin.Object { return &UpdateSavedNotificationSounds{} }, - UpdateSelectedBackgroundTypeID: func() bin.Object { return &UpdateSelectedBackground{} }, + UpdateDefaultBackgroundTypeID: func() bin.Object { return &UpdateDefaultBackground{} }, UpdateChatThemesTypeID: func() bin.Object { return &UpdateChatThemes{} }, UpdateAccentColorsTypeID: func() bin.Object { return &UpdateAccentColors{} }, UpdateProfileAccentColorsTypeID: func() bin.Object { return &UpdateProfileAccentColors{} }, @@ -5421,6 +5484,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateChatMemberTypeID: func() bin.Object { return &UpdateChatMember{} }, UpdateNewChatJoinRequestTypeID: func() bin.Object { return &UpdateNewChatJoinRequest{} }, UpdateChatBoostTypeID: func() bin.Object { return &UpdateChatBoost{} }, + UpdateMessageReactionTypeID: func() bin.Object { return &UpdateMessageReaction{} }, + UpdateMessageReactionsTypeID: func() bin.Object { return &UpdateMessageReactions{} }, UpdatesTypeID: func() bin.Object { return &Updates{} }, LogStreamDefaultTypeID: func() bin.Object { return &LogStreamDefault{} }, LogStreamFileTypeID: func() bin.Object { return &LogStreamFile{} }, @@ -5501,6 +5566,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { SearchChatsNearbyRequestTypeID: func() bin.Object { return &SearchChatsNearbyRequest{} }, GetChatSimilarChatsRequestTypeID: func() bin.Object { return &GetChatSimilarChatsRequest{} }, GetChatSimilarChatCountRequestTypeID: func() bin.Object { return &GetChatSimilarChatCountRequest{} }, + OpenChatSimilarChatRequestTypeID: func() bin.Object { return &OpenChatSimilarChatRequest{} }, GetTopChatsRequestTypeID: func() bin.Object { return &GetTopChatsRequest{} }, RemoveTopChatRequestTypeID: func() bin.Object { return &RemoveTopChatRequest{} }, SearchRecentlyFoundChatsRequestTypeID: func() bin.Object { return &SearchRecentlyFoundChatsRequest{} }, @@ -5584,6 +5650,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ClearRecentReactionsRequestTypeID: func() bin.Object { return &ClearRecentReactionsRequest{} }, AddMessageReactionRequestTypeID: func() bin.Object { return &AddMessageReactionRequest{} }, RemoveMessageReactionRequestTypeID: func() bin.Object { return &RemoveMessageReactionRequest{} }, + SetMessageReactionsRequestTypeID: func() bin.Object { return &SetMessageReactionsRequest{} }, GetMessageAddedReactionsRequestTypeID: func() bin.Object { return &GetMessageAddedReactionsRequest{} }, SetDefaultReactionTypeRequestTypeID: func() bin.Object { return &SetDefaultReactionTypeRequest{} }, SearchQuoteRequestTypeID: func() bin.Object { return &SearchQuoteRequest{} }, @@ -5604,7 +5671,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { HideSuggestedActionRequestTypeID: func() bin.Object { return &HideSuggestedActionRequest{} }, GetLoginURLInfoRequestTypeID: func() bin.Object { return &GetLoginURLInfoRequest{} }, GetLoginURLRequestTypeID: func() bin.Object { return &GetLoginURLRequest{} }, - ShareUserWithBotRequestTypeID: func() bin.Object { return &ShareUserWithBotRequest{} }, + ShareUsersWithBotRequestTypeID: func() bin.Object { return &ShareUsersWithBotRequest{} }, ShareChatWithBotRequestTypeID: func() bin.Object { return &ShareChatWithBotRequest{} }, GetInlineQueryResultsRequestTypeID: func() bin.Object { return &GetInlineQueryResultsRequest{} }, AnswerInlineQueryRequestTypeID: func() bin.Object { return &AnswerInlineQueryRequest{} }, @@ -5671,7 +5738,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { SetChatTitleRequestTypeID: func() bin.Object { return &SetChatTitleRequest{} }, SetChatPhotoRequestTypeID: func() bin.Object { return &SetChatPhotoRequest{} }, SetChatAccentColorRequestTypeID: func() bin.Object { return &SetChatAccentColorRequest{} }, + SetChatProfileAccentColorRequestTypeID: func() bin.Object { return &SetChatProfileAccentColorRequest{} }, SetChatMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &SetChatMessageAutoDeleteTimeRequest{} }, + SetChatEmojiStatusRequestTypeID: func() bin.Object { return &SetChatEmojiStatusRequest{} }, SetChatPermissionsRequestTypeID: func() bin.Object { return &SetChatPermissionsRequest{} }, SetChatBackgroundRequestTypeID: func() bin.Object { return &SetChatBackgroundRequest{} }, DeleteChatBackgroundRequestTypeID: func() bin.Object { return &DeleteChatBackgroundRequest{} }, @@ -5734,10 +5803,13 @@ func TypesConstructorMap() map[uint32]func() bin.Object { CloseStoryRequestTypeID: func() bin.Object { return &CloseStoryRequest{} }, GetStoryAvailableReactionsRequestTypeID: func() bin.Object { return &GetStoryAvailableReactionsRequest{} }, SetStoryReactionRequestTypeID: func() bin.Object { return &SetStoryReactionRequest{} }, - GetStoryViewersRequestTypeID: func() bin.Object { return &GetStoryViewersRequest{} }, + GetStoryInteractionsRequestTypeID: func() bin.Object { return &GetStoryInteractionsRequest{} }, + GetChatStoryInteractionsRequestTypeID: func() bin.Object { return &GetChatStoryInteractionsRequest{} }, ReportStoryRequestTypeID: func() bin.Object { return &ReportStoryRequest{} }, ActivateStoryStealthModeRequestTypeID: func() bin.Object { return &ActivateStoryStealthModeRequest{} }, GetStoryPublicForwardsRequestTypeID: func() bin.Object { return &GetStoryPublicForwardsRequest{} }, + GetChatBoostLevelFeaturesRequestTypeID: func() bin.Object { return &GetChatBoostLevelFeaturesRequest{} }, + GetChatBoostFeaturesRequestTypeID: func() bin.Object { return &GetChatBoostFeaturesRequest{} }, GetAvailableChatBoostSlotsRequestTypeID: func() bin.Object { return &GetAvailableChatBoostSlotsRequest{} }, GetChatBoostStatusRequestTypeID: func() bin.Object { return &GetChatBoostStatusRequest{} }, BoostChatRequestTypeID: func() bin.Object { return &BoostChatRequest{} }, @@ -5751,6 +5823,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetRecentEmojiStatusesRequestTypeID: func() bin.Object { return &GetRecentEmojiStatusesRequest{} }, GetDefaultEmojiStatusesRequestTypeID: func() bin.Object { return &GetDefaultEmojiStatusesRequest{} }, ClearRecentEmojiStatusesRequestTypeID: func() bin.Object { return &ClearRecentEmojiStatusesRequest{} }, + GetThemedChatEmojiStatusesRequestTypeID: func() bin.Object { return &GetThemedChatEmojiStatusesRequest{} }, + GetDefaultChatEmojiStatusesRequestTypeID: func() bin.Object { return &GetDefaultChatEmojiStatusesRequest{} }, + GetDisallowedChatEmojiStatusesRequestTypeID: func() bin.Object { return &GetDisallowedChatEmojiStatusesRequest{} }, DownloadFileRequestTypeID: func() bin.Object { return &DownloadFileRequest{} }, GetFileDownloadedPrefixSizeRequestTypeID: func() bin.Object { return &GetFileDownloadedPrefixSizeRequest{} }, CancelDownloadFileRequestTypeID: func() bin.Object { return &CancelDownloadFileRequest{} }, @@ -5952,12 +6027,13 @@ func TypesConstructorMap() map[uint32]func() bin.Object { DeleteSavedCredentialsRequestTypeID: func() bin.Object { return &DeleteSavedCredentialsRequest{} }, CreateInvoiceLinkRequestTypeID: func() bin.Object { return &CreateInvoiceLinkRequest{} }, GetSupportUserRequestTypeID: func() bin.Object { return &GetSupportUserRequest{} }, - GetBackgroundsRequestTypeID: func() bin.Object { return &GetBackgroundsRequest{} }, GetBackgroundURLRequestTypeID: func() bin.Object { return &GetBackgroundURLRequest{} }, SearchBackgroundRequestTypeID: func() bin.Object { return &SearchBackgroundRequest{} }, - SetBackgroundRequestTypeID: func() bin.Object { return &SetBackgroundRequest{} }, - RemoveBackgroundRequestTypeID: func() bin.Object { return &RemoveBackgroundRequest{} }, - ResetBackgroundsRequestTypeID: func() bin.Object { return &ResetBackgroundsRequest{} }, + SetDefaultBackgroundRequestTypeID: func() bin.Object { return &SetDefaultBackgroundRequest{} }, + DeleteDefaultBackgroundRequestTypeID: func() bin.Object { return &DeleteDefaultBackgroundRequest{} }, + GetInstalledBackgroundsRequestTypeID: func() bin.Object { return &GetInstalledBackgroundsRequest{} }, + RemoveInstalledBackgroundRequestTypeID: func() bin.Object { return &RemoveInstalledBackgroundRequest{} }, + ResetInstalledBackgroundsRequestTypeID: func() bin.Object { return &ResetInstalledBackgroundsRequest{} }, GetLocalizationTargetInfoRequestTypeID: func() bin.Object { return &GetLocalizationTargetInfoRequest{} }, GetLanguagePackInfoRequestTypeID: func() bin.Object { return &GetLanguagePackInfoRequest{} }, GetLanguagePackStringsRequestTypeID: func() bin.Object { return &GetLanguagePackStringsRequest{} }, @@ -6062,7 +6138,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetPhoneNumberInfoSyncRequestTypeID: func() bin.Object { return &GetPhoneNumberInfoSyncRequest{} }, GetDeepLinkInfoRequestTypeID: func() bin.Object { return &GetDeepLinkInfoRequest{} }, GetApplicationConfigRequestTypeID: func() bin.Object { return &GetApplicationConfigRequest{} }, - AddApplicationChangelogRequestTypeID: func() bin.Object { return &AddApplicationChangelogRequest{} }, SaveApplicationLogEventRequestTypeID: func() bin.Object { return &SaveApplicationLogEventRequest{} }, GetApplicationDownloadLinkRequestTypeID: func() bin.Object { return &GetApplicationDownloadLinkRequest{} }, AddProxyRequestTypeID: func() bin.Object { return &AddProxyRequest{} }, @@ -6142,6 +6217,7 @@ func ClassConstructorsMap() map[string][]uint32 { BackgroundTypeWallpaperTypeID, BackgroundTypePatternTypeID, BackgroundTypeFillTypeID, + BackgroundTypeChatThemeTypeID, }, BlockListClassName: { BlockListMainTypeID, @@ -6264,7 +6340,9 @@ func ClassConstructorsMap() map[string][]uint32 { ChatEventMemberPromotedTypeID, ChatEventMemberRestrictedTypeID, ChatEventAvailableReactionsChangedTypeID, + ChatEventBackgroundChangedTypeID, ChatEventDescriptionChangedTypeID, + ChatEventEmojiStatusChangedTypeID, ChatEventLinkedChatChangedTypeID, ChatEventLocationChangedTypeID, ChatEventMessageAutoDeleteTimeChangedTypeID, @@ -6276,7 +6354,7 @@ func ClassConstructorsMap() map[string][]uint32 { ChatEventUsernameChangedTypeID, ChatEventActiveUsernamesChangedTypeID, ChatEventAccentColorChangedTypeID, - ChatEventBackgroundCustomEmojiChangedTypeID, + ChatEventProfileAccentColorChangedTypeID, ChatEventHasProtectedContentToggledTypeID, ChatEventInvitesToggledTypeID, ChatEventIsAllHistoryAvailableToggledTypeID, @@ -6550,6 +6628,7 @@ func ClassConstructorsMap() map[string][]uint32 { InputStoryAreaTypeFoundVenueTypeID, InputStoryAreaTypePreviousVenueTypeID, InputStoryAreaTypeSuggestedReactionTypeID, + InputStoryAreaTypeMessageTypeID, }, InputStoryContentClassName: { InputStoryContentPhotoTypeID, @@ -6580,6 +6659,7 @@ func ClassConstructorsMap() map[string][]uint32 { InternalLinkTypePassportDataRequestTypeID, InternalLinkTypePhoneNumberConfirmationTypeID, InternalLinkTypePremiumFeaturesTypeID, + InternalLinkTypePremiumGiftTypeID, InternalLinkTypePremiumGiftCodeTypeID, InternalLinkTypePrivacyAndSecuritySettingsTypeID, InternalLinkTypeProxyTypeID, @@ -6617,7 +6697,7 @@ func ClassConstructorsMap() map[string][]uint32 { KeyboardButtonTypeRequestPhoneNumberTypeID, KeyboardButtonTypeRequestLocationTypeID, KeyboardButtonTypeRequestPollTypeID, - KeyboardButtonTypeRequestUserTypeID, + KeyboardButtonTypeRequestUsersTypeID, KeyboardButtonTypeRequestChatTypeID, KeyboardButtonTypeWebAppTypeID, }, @@ -6697,8 +6777,9 @@ func ClassConstructorsMap() map[string][]uint32 { MessagePremiumGiveawayCreatedTypeID, MessagePremiumGiveawayTypeID, MessagePremiumGiveawayCompletedTypeID, + MessagePremiumGiveawayWinnersTypeID, MessageContactRegisteredTypeID, - MessageUserSharedTypeID, + MessageUsersSharedTypeID, MessageChatSharedTypeID, MessageBotWriteAccessAllowedTypeID, MessageWebAppDataSentTypeID, @@ -6965,6 +7046,10 @@ func ClassConstructorsMap() map[string][]uint32 { PublicChatTypeHasUsernameTypeID, PublicChatTypeIsLocationBasedTypeID, }, + PublicForwardClassName: { + PublicForwardMessageTypeID, + PublicForwardStoryTypeID, + }, PushMessageContentClassName: { PushMessageContentHiddenTypeID, PushMessageContentAnimationTypeID, @@ -7125,12 +7210,18 @@ func ClassConstructorsMap() map[string][]uint32 { StoryAreaTypeLocationTypeID, StoryAreaTypeVenueTypeID, StoryAreaTypeSuggestedReactionTypeID, + StoryAreaTypeMessageTypeID, }, StoryContentClassName: { StoryContentPhotoTypeID, StoryContentVideoTypeID, StoryContentUnsupportedTypeID, }, + StoryInteractionTypeClassName: { + StoryInteractionTypeViewTypeID, + StoryInteractionTypeForwardTypeID, + StoryInteractionTypeRepostTypeID, + }, StoryListClassName: { StoryListMainTypeID, StoryListArchiveTypeID, @@ -7145,10 +7236,6 @@ func ClassConstructorsMap() map[string][]uint32 { StoryPrivacySettingsCloseFriendsTypeID, StoryPrivacySettingsSelectedUsersTypeID, }, - StoryPublicForwardClassName: { - StoryPublicForwardMessageTypeID, - StoryPublicForwardStoryTypeID, - }, SuggestedActionClassName: { SuggestedActionEnableArchiveAndMuteNewChatsTypeID, SuggestedActionCheckPasswordTypeID, @@ -7159,6 +7246,7 @@ func ClassConstructorsMap() map[string][]uint32 { SuggestedActionUpgradePremiumTypeID, SuggestedActionRestorePremiumTypeID, SuggestedActionSubscribeToAnnualPremiumTypeID, + SuggestedActionGiftPremiumForChristmasTypeID, }, SupergroupMembersFilterClassName: { SupergroupMembersFilterRecentTypeID, @@ -7247,8 +7335,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateNewChatTypeID, UpdateChatTitleTypeID, UpdateChatPhotoTypeID, - UpdateChatAccentColorTypeID, - UpdateChatBackgroundCustomEmojiTypeID, + UpdateChatAccentColorsTypeID, UpdateChatPermissionsTypeID, UpdateChatLastMessageTypeID, UpdateChatPositionTypeID, @@ -7257,6 +7344,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateChatActionBarTypeID, UpdateChatAvailableReactionsTypeID, UpdateChatDraftMessageTypeID, + UpdateChatEmojiStatusTypeID, UpdateChatMessageSenderTypeID, UpdateChatMessageAutoDeleteTimeTypeID, UpdateChatNotificationSettingsTypeID, @@ -7322,7 +7410,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateFavoriteStickersTypeID, UpdateSavedAnimationsTypeID, UpdateSavedNotificationSoundsTypeID, - UpdateSelectedBackgroundTypeID, + UpdateDefaultBackgroundTypeID, UpdateChatThemesTypeID, UpdateAccentColorsTypeID, UpdateProfileAccentColorsTypeID, @@ -7355,6 +7443,8 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateChatMemberTypeID, UpdateNewChatJoinRequestTypeID, UpdateChatBoostTypeID, + UpdateMessageReactionTypeID, + UpdateMessageReactionsTypeID, }, UserPrivacySettingClassName: { UserPrivacySettingShowStatusTypeID, diff --git a/tdapi/tl_remove_background_gen.go b/tdapi/tl_remove_background_gen.go deleted file mode 100644 index ae3ceae8ac..0000000000 --- a/tdapi/tl_remove_background_gen.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// RemoveBackgroundRequest represents TL type `removeBackground#a783a196`. -type RemoveBackgroundRequest struct { - // The background identifier - BackgroundID int64 -} - -// RemoveBackgroundRequestTypeID is TL type id of RemoveBackgroundRequest. -const RemoveBackgroundRequestTypeID = 0xa783a196 - -// Ensuring interfaces in compile-time for RemoveBackgroundRequest. -var ( - _ bin.Encoder = &RemoveBackgroundRequest{} - _ bin.Decoder = &RemoveBackgroundRequest{} - _ bin.BareEncoder = &RemoveBackgroundRequest{} - _ bin.BareDecoder = &RemoveBackgroundRequest{} -) - -func (r *RemoveBackgroundRequest) Zero() bool { - if r == nil { - return true - } - if !(r.BackgroundID == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (r *RemoveBackgroundRequest) String() string { - if r == nil { - return "RemoveBackgroundRequest(nil)" - } - type Alias RemoveBackgroundRequest - return fmt.Sprintf("RemoveBackgroundRequest%+v", Alias(*r)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*RemoveBackgroundRequest) TypeID() uint32 { - return RemoveBackgroundRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*RemoveBackgroundRequest) TypeName() string { - return "removeBackground" -} - -// TypeInfo returns info about TL type. -func (r *RemoveBackgroundRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "removeBackground", - ID: RemoveBackgroundRequestTypeID, - } - if r == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "BackgroundID", - SchemaName: "background_id", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (r *RemoveBackgroundRequest) Encode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode removeBackground#a783a196 as nil") - } - b.PutID(RemoveBackgroundRequestTypeID) - return r.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (r *RemoveBackgroundRequest) EncodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode removeBackground#a783a196 as nil") - } - b.PutLong(r.BackgroundID) - return nil -} - -// Decode implements bin.Decoder. -func (r *RemoveBackgroundRequest) Decode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode removeBackground#a783a196 to nil") - } - if err := b.ConsumeID(RemoveBackgroundRequestTypeID); err != nil { - return fmt.Errorf("unable to decode removeBackground#a783a196: %w", err) - } - return r.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (r *RemoveBackgroundRequest) DecodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode removeBackground#a783a196 to nil") - } - { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode removeBackground#a783a196: field background_id: %w", err) - } - r.BackgroundID = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (r *RemoveBackgroundRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if r == nil { - return fmt.Errorf("can't encode removeBackground#a783a196 as nil") - } - b.ObjStart() - b.PutID("removeBackground") - b.Comma() - b.FieldStart("background_id") - b.PutLong(r.BackgroundID) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (r *RemoveBackgroundRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if r == nil { - return fmt.Errorf("can't decode removeBackground#a783a196 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("removeBackground"); err != nil { - return fmt.Errorf("unable to decode removeBackground#a783a196: %w", err) - } - case "background_id": - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode removeBackground#a783a196: field background_id: %w", err) - } - r.BackgroundID = value - default: - return b.Skip() - } - return nil - }) -} - -// GetBackgroundID returns value of BackgroundID field. -func (r *RemoveBackgroundRequest) GetBackgroundID() (value int64) { - if r == nil { - return - } - return r.BackgroundID -} - -// RemoveBackground invokes method removeBackground#a783a196 returning error if any. -func (c *Client) RemoveBackground(ctx context.Context, backgroundid int64) error { - var ok Ok - - request := &RemoveBackgroundRequest{ - BackgroundID: backgroundid, - } - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err - } - return nil -} diff --git a/tdapi/tl_remove_installed_background_gen.go b/tdapi/tl_remove_installed_background_gen.go new file mode 100644 index 0000000000..cba40662a3 --- /dev/null +++ b/tdapi/tl_remove_installed_background_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{} +) + +// RemoveInstalledBackgroundRequest represents TL type `removeInstalledBackground#5041253c`. +type RemoveInstalledBackgroundRequest struct { + // The background identifier + BackgroundID int64 +} + +// RemoveInstalledBackgroundRequestTypeID is TL type id of RemoveInstalledBackgroundRequest. +const RemoveInstalledBackgroundRequestTypeID = 0x5041253c + +// Ensuring interfaces in compile-time for RemoveInstalledBackgroundRequest. +var ( + _ bin.Encoder = &RemoveInstalledBackgroundRequest{} + _ bin.Decoder = &RemoveInstalledBackgroundRequest{} + _ bin.BareEncoder = &RemoveInstalledBackgroundRequest{} + _ bin.BareDecoder = &RemoveInstalledBackgroundRequest{} +) + +func (r *RemoveInstalledBackgroundRequest) Zero() bool { + if r == nil { + return true + } + if !(r.BackgroundID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *RemoveInstalledBackgroundRequest) String() string { + if r == nil { + return "RemoveInstalledBackgroundRequest(nil)" + } + type Alias RemoveInstalledBackgroundRequest + return fmt.Sprintf("RemoveInstalledBackgroundRequest%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*RemoveInstalledBackgroundRequest) TypeID() uint32 { + return RemoveInstalledBackgroundRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*RemoveInstalledBackgroundRequest) TypeName() string { + return "removeInstalledBackground" +} + +// TypeInfo returns info about TL type. +func (r *RemoveInstalledBackgroundRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "removeInstalledBackground", + ID: RemoveInstalledBackgroundRequestTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BackgroundID", + SchemaName: "background_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *RemoveInstalledBackgroundRequest) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode removeInstalledBackground#5041253c as nil") + } + b.PutID(RemoveInstalledBackgroundRequestTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *RemoveInstalledBackgroundRequest) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode removeInstalledBackground#5041253c as nil") + } + b.PutLong(r.BackgroundID) + return nil +} + +// Decode implements bin.Decoder. +func (r *RemoveInstalledBackgroundRequest) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode removeInstalledBackground#5041253c to nil") + } + if err := b.ConsumeID(RemoveInstalledBackgroundRequestTypeID); err != nil { + return fmt.Errorf("unable to decode removeInstalledBackground#5041253c: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *RemoveInstalledBackgroundRequest) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode removeInstalledBackground#5041253c to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode removeInstalledBackground#5041253c: field background_id: %w", err) + } + r.BackgroundID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *RemoveInstalledBackgroundRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode removeInstalledBackground#5041253c as nil") + } + b.ObjStart() + b.PutID("removeInstalledBackground") + b.Comma() + b.FieldStart("background_id") + b.PutLong(r.BackgroundID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *RemoveInstalledBackgroundRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode removeInstalledBackground#5041253c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("removeInstalledBackground"); err != nil { + return fmt.Errorf("unable to decode removeInstalledBackground#5041253c: %w", err) + } + case "background_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode removeInstalledBackground#5041253c: field background_id: %w", err) + } + r.BackgroundID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBackgroundID returns value of BackgroundID field. +func (r *RemoveInstalledBackgroundRequest) GetBackgroundID() (value int64) { + if r == nil { + return + } + return r.BackgroundID +} + +// RemoveInstalledBackground invokes method removeInstalledBackground#5041253c returning error if any. +func (c *Client) RemoveInstalledBackground(ctx context.Context, backgroundid int64) error { + var ok Ok + + request := &RemoveInstalledBackgroundRequest{ + BackgroundID: backgroundid, + } + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_reset_backgrounds_gen.go b/tdapi/tl_reset_backgrounds_gen.go deleted file mode 100644 index ee5034f256..0000000000 --- a/tdapi/tl_reset_backgrounds_gen.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// ResetBackgroundsRequest represents TL type `resetBackgrounds#c35cb78`. -type ResetBackgroundsRequest struct { -} - -// ResetBackgroundsRequestTypeID is TL type id of ResetBackgroundsRequest. -const ResetBackgroundsRequestTypeID = 0xc35cb78 - -// Ensuring interfaces in compile-time for ResetBackgroundsRequest. -var ( - _ bin.Encoder = &ResetBackgroundsRequest{} - _ bin.Decoder = &ResetBackgroundsRequest{} - _ bin.BareEncoder = &ResetBackgroundsRequest{} - _ bin.BareDecoder = &ResetBackgroundsRequest{} -) - -func (r *ResetBackgroundsRequest) Zero() bool { - if r == nil { - return true - } - - return true -} - -// String implements fmt.Stringer. -func (r *ResetBackgroundsRequest) String() string { - if r == nil { - return "ResetBackgroundsRequest(nil)" - } - type Alias ResetBackgroundsRequest - return fmt.Sprintf("ResetBackgroundsRequest%+v", Alias(*r)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ResetBackgroundsRequest) TypeID() uint32 { - return ResetBackgroundsRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*ResetBackgroundsRequest) TypeName() string { - return "resetBackgrounds" -} - -// TypeInfo returns info about TL type. -func (r *ResetBackgroundsRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "resetBackgrounds", - ID: ResetBackgroundsRequestTypeID, - } - if r == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{} - return typ -} - -// Encode implements bin.Encoder. -func (r *ResetBackgroundsRequest) Encode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode resetBackgrounds#c35cb78 as nil") - } - b.PutID(ResetBackgroundsRequestTypeID) - return r.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (r *ResetBackgroundsRequest) EncodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode resetBackgrounds#c35cb78 as nil") - } - return nil -} - -// Decode implements bin.Decoder. -func (r *ResetBackgroundsRequest) Decode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode resetBackgrounds#c35cb78 to nil") - } - if err := b.ConsumeID(ResetBackgroundsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode resetBackgrounds#c35cb78: %w", err) - } - return r.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (r *ResetBackgroundsRequest) DecodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode resetBackgrounds#c35cb78 to nil") - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (r *ResetBackgroundsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if r == nil { - return fmt.Errorf("can't encode resetBackgrounds#c35cb78 as nil") - } - b.ObjStart() - b.PutID("resetBackgrounds") - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (r *ResetBackgroundsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if r == nil { - return fmt.Errorf("can't decode resetBackgrounds#c35cb78 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("resetBackgrounds"); err != nil { - return fmt.Errorf("unable to decode resetBackgrounds#c35cb78: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// ResetBackgrounds invokes method resetBackgrounds#c35cb78 returning error if any. -func (c *Client) ResetBackgrounds(ctx context.Context) error { - var ok Ok - - request := &ResetBackgroundsRequest{} - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err - } - return nil -} diff --git a/tdapi/tl_reset_installed_backgrounds_gen.go b/tdapi/tl_reset_installed_backgrounds_gen.go new file mode 100644 index 0000000000..9950b366ef --- /dev/null +++ b/tdapi/tl_reset_installed_backgrounds_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ResetInstalledBackgroundsRequest represents TL type `resetInstalledBackgrounds#70540157`. +type ResetInstalledBackgroundsRequest struct { +} + +// ResetInstalledBackgroundsRequestTypeID is TL type id of ResetInstalledBackgroundsRequest. +const ResetInstalledBackgroundsRequestTypeID = 0x70540157 + +// Ensuring interfaces in compile-time for ResetInstalledBackgroundsRequest. +var ( + _ bin.Encoder = &ResetInstalledBackgroundsRequest{} + _ bin.Decoder = &ResetInstalledBackgroundsRequest{} + _ bin.BareEncoder = &ResetInstalledBackgroundsRequest{} + _ bin.BareDecoder = &ResetInstalledBackgroundsRequest{} +) + +func (r *ResetInstalledBackgroundsRequest) Zero() bool { + if r == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (r *ResetInstalledBackgroundsRequest) String() string { + if r == nil { + return "ResetInstalledBackgroundsRequest(nil)" + } + type Alias ResetInstalledBackgroundsRequest + return fmt.Sprintf("ResetInstalledBackgroundsRequest%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ResetInstalledBackgroundsRequest) TypeID() uint32 { + return ResetInstalledBackgroundsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ResetInstalledBackgroundsRequest) TypeName() string { + return "resetInstalledBackgrounds" +} + +// TypeInfo returns info about TL type. +func (r *ResetInstalledBackgroundsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "resetInstalledBackgrounds", + ID: ResetInstalledBackgroundsRequestTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (r *ResetInstalledBackgroundsRequest) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode resetInstalledBackgrounds#70540157 as nil") + } + b.PutID(ResetInstalledBackgroundsRequestTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ResetInstalledBackgroundsRequest) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode resetInstalledBackgrounds#70540157 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ResetInstalledBackgroundsRequest) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode resetInstalledBackgrounds#70540157 to nil") + } + if err := b.ConsumeID(ResetInstalledBackgroundsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode resetInstalledBackgrounds#70540157: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ResetInstalledBackgroundsRequest) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode resetInstalledBackgrounds#70540157 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ResetInstalledBackgroundsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode resetInstalledBackgrounds#70540157 as nil") + } + b.ObjStart() + b.PutID("resetInstalledBackgrounds") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ResetInstalledBackgroundsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode resetInstalledBackgrounds#70540157 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("resetInstalledBackgrounds"); err != nil { + return fmt.Errorf("unable to decode resetInstalledBackgrounds#70540157: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// ResetInstalledBackgrounds invokes method resetInstalledBackgrounds#70540157 returning error if any. +func (c *Client) ResetInstalledBackgrounds(ctx context.Context) error { + var ok Ok + + request := &ResetInstalledBackgroundsRequest{} + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_set_accent_color_gen.go b/tdapi/tl_set_accent_color_gen.go index 583aac52c0..85e1186ad2 100644 --- a/tdapi/tl_set_accent_color_gen.go +++ b/tdapi/tl_set_accent_color_gen.go @@ -35,7 +35,8 @@ var ( type SetAccentColorRequest struct { // Identifier of the accent color to use AccentColorID int32 - // Identifier of a custom emoji to be shown on the reply header background; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview + // background; 0 if none BackgroundCustomEmojiID int64 } diff --git a/tdapi/tl_set_background_gen.go b/tdapi/tl_set_background_gen.go deleted file mode 100644 index 9daa20f443..0000000000 --- a/tdapi/tl_set_background_gen.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// SetBackgroundRequest represents TL type `setBackground#c2487387`. -type SetBackgroundRequest struct { - // The input background to use; pass null to create a new filled background or to remove - // the current background - Background InputBackgroundClass - // Background type; pass null to use the default type of the remote background or to - // remove the current background - Type BackgroundTypeClass - // Pass true if the background is changed for a dark theme - ForDarkTheme bool -} - -// SetBackgroundRequestTypeID is TL type id of SetBackgroundRequest. -const SetBackgroundRequestTypeID = 0xc2487387 - -// Ensuring interfaces in compile-time for SetBackgroundRequest. -var ( - _ bin.Encoder = &SetBackgroundRequest{} - _ bin.Decoder = &SetBackgroundRequest{} - _ bin.BareEncoder = &SetBackgroundRequest{} - _ bin.BareDecoder = &SetBackgroundRequest{} -) - -func (s *SetBackgroundRequest) Zero() bool { - if s == nil { - return true - } - if !(s.Background == nil) { - return false - } - if !(s.Type == nil) { - return false - } - if !(s.ForDarkTheme == false) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *SetBackgroundRequest) String() string { - if s == nil { - return "SetBackgroundRequest(nil)" - } - type Alias SetBackgroundRequest - return fmt.Sprintf("SetBackgroundRequest%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*SetBackgroundRequest) TypeID() uint32 { - return SetBackgroundRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*SetBackgroundRequest) TypeName() string { - return "setBackground" -} - -// TypeInfo returns info about TL type. -func (s *SetBackgroundRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "setBackground", - ID: SetBackgroundRequestTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Background", - SchemaName: "background", - }, - { - Name: "Type", - SchemaName: "type", - }, - { - Name: "ForDarkTheme", - SchemaName: "for_dark_theme", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *SetBackgroundRequest) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode setBackground#c2487387 as nil") - } - b.PutID(SetBackgroundRequestTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *SetBackgroundRequest) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode setBackground#c2487387 as nil") - } - if s.Background == nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field background is nil") - } - if err := s.Background.Encode(b); err != nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field background: %w", err) - } - if s.Type == nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field type is nil") - } - if err := s.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field type: %w", err) - } - b.PutBool(s.ForDarkTheme) - return nil -} - -// Decode implements bin.Decoder. -func (s *SetBackgroundRequest) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode setBackground#c2487387 to nil") - } - if err := b.ConsumeID(SetBackgroundRequestTypeID); err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *SetBackgroundRequest) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode setBackground#c2487387 to nil") - } - { - value, err := DecodeInputBackground(b) - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field background: %w", err) - } - s.Background = value - } - { - value, err := DecodeBackgroundType(b) - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field type: %w", err) - } - s.Type = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field for_dark_theme: %w", err) - } - s.ForDarkTheme = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *SetBackgroundRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode setBackground#c2487387 as nil") - } - b.ObjStart() - b.PutID("setBackground") - b.Comma() - b.FieldStart("background") - if s.Background == nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field background is nil") - } - if err := s.Background.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field background: %w", err) - } - b.Comma() - b.FieldStart("type") - if s.Type == nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field type is nil") - } - if err := s.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode setBackground#c2487387: field type: %w", err) - } - b.Comma() - b.FieldStart("for_dark_theme") - b.PutBool(s.ForDarkTheme) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *SetBackgroundRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode setBackground#c2487387 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("setBackground"); err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: %w", err) - } - case "background": - value, err := DecodeTDLibJSONInputBackground(b) - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field background: %w", err) - } - s.Background = value - case "type": - value, err := DecodeTDLibJSONBackgroundType(b) - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field type: %w", err) - } - s.Type = value - case "for_dark_theme": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode setBackground#c2487387: field for_dark_theme: %w", err) - } - s.ForDarkTheme = value - default: - return b.Skip() - } - return nil - }) -} - -// GetBackground returns value of Background field. -func (s *SetBackgroundRequest) GetBackground() (value InputBackgroundClass) { - if s == nil { - return - } - return s.Background -} - -// GetType returns value of Type field. -func (s *SetBackgroundRequest) GetType() (value BackgroundTypeClass) { - if s == nil { - return - } - return s.Type -} - -// GetForDarkTheme returns value of ForDarkTheme field. -func (s *SetBackgroundRequest) GetForDarkTheme() (value bool) { - if s == nil { - return - } - return s.ForDarkTheme -} - -// SetBackground invokes method setBackground#c2487387 returning error if any. -func (c *Client) SetBackground(ctx context.Context, request *SetBackgroundRequest) (*Background, error) { - var result Background - - if err := c.rpc.Invoke(ctx, request, &result); err != nil { - return nil, err - } - return &result, nil -} diff --git a/tdapi/tl_set_chat_accent_color_gen.go b/tdapi/tl_set_chat_accent_color_gen.go index fa2d816d1f..c43ed4cd92 100644 --- a/tdapi/tl_set_chat_accent_color_gen.go +++ b/tdapi/tl_set_chat_accent_color_gen.go @@ -35,9 +35,12 @@ var ( type SetChatAccentColorRequest struct { // Chat identifier ChatID int64 - // Identifier of the accent color to use + // Identifier of the accent color to use. The chat must have at least accentColor + // min_chat_boost_level boost level to pass the corresponding color AccentColorID int32 - // Identifier of a custom emoji to be shown on the reply header background; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview + // background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to + // check whether a custom emoji can be set BackgroundCustomEmojiID int64 } diff --git a/tdapi/tl_set_chat_background_gen.go b/tdapi/tl_set_chat_background_gen.go index eab3a594c5..e46b4f64dd 100644 --- a/tdapi/tl_set_chat_background_gen.go +++ b/tdapi/tl_set_chat_background_gen.go @@ -35,15 +35,18 @@ var ( type SetChatBackgroundRequest struct { // Chat identifier ChatID int64 - // The input background to use; pass null to create a new filled background + // The input background to use; pass null to create a new filled or chat theme background Background InputBackgroundClass - // Background type; pass null to use default background type for the chosen background + // Background type; pass null to use default background type for the chosen background; + // backgroundTypeChatTheme isn't supported for private and secret chats. Type BackgroundTypeClass - // Dimming of the background in dark themes, as a percentage; 0-100 + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to + // Wallpaper and Fill types of background DarkThemeDimming int32 - // Pass true to set background only for self; pass false to set background for both chat - // users. Background can be set for both users only by Telegram Premium users and if set - // background isn't of the type inputBackgroundPrevious + // Pass true to set background only for self; pass false to set background for all chat + // users. Always false for backgrounds set in boosted chats. Background can be set for + // both users only by Telegram Premium users and if set background isn't of the type + // inputBackgroundPrevious OnlyForSelf bool } diff --git a/tdapi/tl_set_chat_emoji_status_gen.go b/tdapi/tl_set_chat_emoji_status_gen.go new file mode 100644 index 0000000000..19d05dec34 --- /dev/null +++ b/tdapi/tl_set_chat_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{} +) + +// SetChatEmojiStatusRequest represents TL type `setChatEmojiStatus#55881912`. +type SetChatEmojiStatusRequest struct { + // Chat identifier + ChatID int64 + // New emoji status; pass null to remove emoji status + EmojiStatus EmojiStatus +} + +// SetChatEmojiStatusRequestTypeID is TL type id of SetChatEmojiStatusRequest. +const SetChatEmojiStatusRequestTypeID = 0x55881912 + +// Ensuring interfaces in compile-time for SetChatEmojiStatusRequest. +var ( + _ bin.Encoder = &SetChatEmojiStatusRequest{} + _ bin.Decoder = &SetChatEmojiStatusRequest{} + _ bin.BareEncoder = &SetChatEmojiStatusRequest{} + _ bin.BareDecoder = &SetChatEmojiStatusRequest{} +) + +func (s *SetChatEmojiStatusRequest) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.EmojiStatus.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetChatEmojiStatusRequest) String() string { + if s == nil { + return "SetChatEmojiStatusRequest(nil)" + } + type Alias SetChatEmojiStatusRequest + return fmt.Sprintf("SetChatEmojiStatusRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetChatEmojiStatusRequest) TypeID() uint32 { + return SetChatEmojiStatusRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetChatEmojiStatusRequest) TypeName() string { + return "setChatEmojiStatus" +} + +// TypeInfo returns info about TL type. +func (s *SetChatEmojiStatusRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setChatEmojiStatus", + ID: SetChatEmojiStatusRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "EmojiStatus", + SchemaName: "emoji_status", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetChatEmojiStatusRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatEmojiStatus#55881912 as nil") + } + b.PutID(SetChatEmojiStatusRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetChatEmojiStatusRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatEmojiStatus#55881912 as nil") + } + b.PutInt53(s.ChatID) + if err := s.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode setChatEmojiStatus#55881912: field emoji_status: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SetChatEmojiStatusRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatEmojiStatus#55881912 to nil") + } + if err := b.ConsumeID(SetChatEmojiStatusRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetChatEmojiStatusRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatEmojiStatus#55881912 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: field chat_id: %w", err) + } + s.ChatID = value + } + { + if err := s.EmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: field emoji_status: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetChatEmojiStatusRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setChatEmojiStatus#55881912 as nil") + } + b.ObjStart() + b.PutID("setChatEmojiStatus") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("emoji_status") + if err := s.EmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setChatEmojiStatus#55881912: field emoji_status: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetChatEmojiStatusRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setChatEmojiStatus#55881912 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setChatEmojiStatus"); err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: field chat_id: %w", err) + } + s.ChatID = value + case "emoji_status": + if err := s.EmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode setChatEmojiStatus#55881912: field emoji_status: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *SetChatEmojiStatusRequest) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetEmojiStatus returns value of EmojiStatus field. +func (s *SetChatEmojiStatusRequest) GetEmojiStatus() (value EmojiStatus) { + if s == nil { + return + } + return s.EmojiStatus +} + +// SetChatEmojiStatus invokes method setChatEmojiStatus#55881912 returning error if any. +func (c *Client) SetChatEmojiStatus(ctx context.Context, request *SetChatEmojiStatusRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_set_chat_profile_accent_color_gen.go b/tdapi/tl_set_chat_profile_accent_color_gen.go new file mode 100644 index 0000000000..5dab4a2e6c --- /dev/null +++ b/tdapi/tl_set_chat_profile_accent_color_gen.go @@ -0,0 +1,275 @@ +// 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{} +) + +// SetChatProfileAccentColorRequest represents TL type `setChatProfileAccentColor#4227ae7a`. +type SetChatProfileAccentColorRequest struct { + // Chat identifier + ChatID int64 + // Identifier of the accent color to use for profile; pass -1 if none. The chat must have + // at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding + // color + ProfileAccentColorID int32 + // Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if + // none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check + // whether a custom emoji can be set + ProfileBackgroundCustomEmojiID int64 +} + +// SetChatProfileAccentColorRequestTypeID is TL type id of SetChatProfileAccentColorRequest. +const SetChatProfileAccentColorRequestTypeID = 0x4227ae7a + +// Ensuring interfaces in compile-time for SetChatProfileAccentColorRequest. +var ( + _ bin.Encoder = &SetChatProfileAccentColorRequest{} + _ bin.Decoder = &SetChatProfileAccentColorRequest{} + _ bin.BareEncoder = &SetChatProfileAccentColorRequest{} + _ bin.BareDecoder = &SetChatProfileAccentColorRequest{} +) + +func (s *SetChatProfileAccentColorRequest) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.ProfileAccentColorID == 0) { + return false + } + if !(s.ProfileBackgroundCustomEmojiID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetChatProfileAccentColorRequest) String() string { + if s == nil { + return "SetChatProfileAccentColorRequest(nil)" + } + type Alias SetChatProfileAccentColorRequest + return fmt.Sprintf("SetChatProfileAccentColorRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetChatProfileAccentColorRequest) TypeID() uint32 { + return SetChatProfileAccentColorRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetChatProfileAccentColorRequest) TypeName() string { + return "setChatProfileAccentColor" +} + +// TypeInfo returns info about TL type. +func (s *SetChatProfileAccentColorRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setChatProfileAccentColor", + ID: SetChatProfileAccentColorRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "ProfileAccentColorID", + SchemaName: "profile_accent_color_id", + }, + { + Name: "ProfileBackgroundCustomEmojiID", + SchemaName: "profile_background_custom_emoji_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetChatProfileAccentColorRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatProfileAccentColor#4227ae7a as nil") + } + b.PutID(SetChatProfileAccentColorRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetChatProfileAccentColorRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatProfileAccentColor#4227ae7a as nil") + } + b.PutInt53(s.ChatID) + b.PutInt32(s.ProfileAccentColorID) + b.PutLong(s.ProfileBackgroundCustomEmojiID) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetChatProfileAccentColorRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatProfileAccentColor#4227ae7a to nil") + } + if err := b.ConsumeID(SetChatProfileAccentColorRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetChatProfileAccentColorRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatProfileAccentColor#4227ae7a to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field chat_id: %w", err) + } + s.ChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field profile_accent_color_id: %w", err) + } + s.ProfileAccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field profile_background_custom_emoji_id: %w", err) + } + s.ProfileBackgroundCustomEmojiID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetChatProfileAccentColorRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setChatProfileAccentColor#4227ae7a as nil") + } + b.ObjStart() + b.PutID("setChatProfileAccentColor") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("profile_accent_color_id") + b.PutInt32(s.ProfileAccentColorID) + b.Comma() + b.FieldStart("profile_background_custom_emoji_id") + b.PutLong(s.ProfileBackgroundCustomEmojiID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetChatProfileAccentColorRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setChatProfileAccentColor#4227ae7a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setChatProfileAccentColor"); err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field chat_id: %w", err) + } + s.ChatID = value + case "profile_accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field profile_accent_color_id: %w", err) + } + s.ProfileAccentColorID = value + case "profile_background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setChatProfileAccentColor#4227ae7a: field profile_background_custom_emoji_id: %w", err) + } + s.ProfileBackgroundCustomEmojiID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *SetChatProfileAccentColorRequest) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetProfileAccentColorID returns value of ProfileAccentColorID field. +func (s *SetChatProfileAccentColorRequest) GetProfileAccentColorID() (value int32) { + if s == nil { + return + } + return s.ProfileAccentColorID +} + +// GetProfileBackgroundCustomEmojiID returns value of ProfileBackgroundCustomEmojiID field. +func (s *SetChatProfileAccentColorRequest) GetProfileBackgroundCustomEmojiID() (value int64) { + if s == nil { + return + } + return s.ProfileBackgroundCustomEmojiID +} + +// SetChatProfileAccentColor invokes method setChatProfileAccentColor#4227ae7a returning error if any. +func (c *Client) SetChatProfileAccentColor(ctx context.Context, request *SetChatProfileAccentColorRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_set_default_background_gen.go b/tdapi/tl_set_default_background_gen.go new file mode 100644 index 0000000000..57a485300b --- /dev/null +++ b/tdapi/tl_set_default_background_gen.go @@ -0,0 +1,292 @@ +// 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{} +) + +// SetDefaultBackgroundRequest represents TL type `setDefaultBackground#89d1a8a1`. +type SetDefaultBackgroundRequest struct { + // The input background to use; pass null to create a new filled background + Background InputBackgroundClass + // Background type; pass null to use the default type of the remote background; + // backgroundTypeChatTheme isn't supported + Type BackgroundTypeClass + // Pass true if the background is set for a dark theme + ForDarkTheme bool +} + +// SetDefaultBackgroundRequestTypeID is TL type id of SetDefaultBackgroundRequest. +const SetDefaultBackgroundRequestTypeID = 0x89d1a8a1 + +// Ensuring interfaces in compile-time for SetDefaultBackgroundRequest. +var ( + _ bin.Encoder = &SetDefaultBackgroundRequest{} + _ bin.Decoder = &SetDefaultBackgroundRequest{} + _ bin.BareEncoder = &SetDefaultBackgroundRequest{} + _ bin.BareDecoder = &SetDefaultBackgroundRequest{} +) + +func (s *SetDefaultBackgroundRequest) Zero() bool { + if s == nil { + return true + } + if !(s.Background == nil) { + return false + } + if !(s.Type == nil) { + return false + } + if !(s.ForDarkTheme == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetDefaultBackgroundRequest) String() string { + if s == nil { + return "SetDefaultBackgroundRequest(nil)" + } + type Alias SetDefaultBackgroundRequest + return fmt.Sprintf("SetDefaultBackgroundRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetDefaultBackgroundRequest) TypeID() uint32 { + return SetDefaultBackgroundRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetDefaultBackgroundRequest) TypeName() string { + return "setDefaultBackground" +} + +// TypeInfo returns info about TL type. +func (s *SetDefaultBackgroundRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setDefaultBackground", + ID: SetDefaultBackgroundRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Background", + SchemaName: "background", + }, + { + Name: "Type", + SchemaName: "type", + }, + { + Name: "ForDarkTheme", + SchemaName: "for_dark_theme", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetDefaultBackgroundRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setDefaultBackground#89d1a8a1 as nil") + } + b.PutID(SetDefaultBackgroundRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetDefaultBackgroundRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setDefaultBackground#89d1a8a1 as nil") + } + if s.Background == nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field background is nil") + } + if err := s.Background.Encode(b); err != nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field background: %w", err) + } + if s.Type == nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field type is nil") + } + if err := s.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field type: %w", err) + } + b.PutBool(s.ForDarkTheme) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetDefaultBackgroundRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setDefaultBackground#89d1a8a1 to nil") + } + if err := b.ConsumeID(SetDefaultBackgroundRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetDefaultBackgroundRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setDefaultBackground#89d1a8a1 to nil") + } + { + value, err := DecodeInputBackground(b) + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field background: %w", err) + } + s.Background = value + } + { + value, err := DecodeBackgroundType(b) + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field type: %w", err) + } + s.Type = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field for_dark_theme: %w", err) + } + s.ForDarkTheme = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetDefaultBackgroundRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setDefaultBackground#89d1a8a1 as nil") + } + b.ObjStart() + b.PutID("setDefaultBackground") + b.Comma() + b.FieldStart("background") + if s.Background == nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field background is nil") + } + if err := s.Background.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field background: %w", err) + } + b.Comma() + b.FieldStart("type") + if s.Type == nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field type is nil") + } + if err := s.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setDefaultBackground#89d1a8a1: field type: %w", err) + } + b.Comma() + b.FieldStart("for_dark_theme") + b.PutBool(s.ForDarkTheme) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetDefaultBackgroundRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setDefaultBackground#89d1a8a1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setDefaultBackground"); err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: %w", err) + } + case "background": + value, err := DecodeTDLibJSONInputBackground(b) + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field background: %w", err) + } + s.Background = value + case "type": + value, err := DecodeTDLibJSONBackgroundType(b) + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field type: %w", err) + } + s.Type = value + case "for_dark_theme": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setDefaultBackground#89d1a8a1: field for_dark_theme: %w", err) + } + s.ForDarkTheme = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBackground returns value of Background field. +func (s *SetDefaultBackgroundRequest) GetBackground() (value InputBackgroundClass) { + if s == nil { + return + } + return s.Background +} + +// GetType returns value of Type field. +func (s *SetDefaultBackgroundRequest) GetType() (value BackgroundTypeClass) { + if s == nil { + return + } + return s.Type +} + +// GetForDarkTheme returns value of ForDarkTheme field. +func (s *SetDefaultBackgroundRequest) GetForDarkTheme() (value bool) { + if s == nil { + return + } + return s.ForDarkTheme +} + +// SetDefaultBackground invokes method setDefaultBackground#89d1a8a1 returning error if any. +func (c *Client) SetDefaultBackground(ctx context.Context, request *SetDefaultBackgroundRequest) (*Background, error) { + var result Background + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_set_message_reactions_gen.go b/tdapi/tl_set_message_reactions_gen.go new file mode 100644 index 0000000000..894dbef8a5 --- /dev/null +++ b/tdapi/tl_set_message_reactions_gen.go @@ -0,0 +1,339 @@ +// 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{} +) + +// SetMessageReactionsRequest represents TL type `setMessageReactions#71fa9e8f`. +type SetMessageReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatID int64 + // Identifier of the message + MessageID int64 + // Types of the reaction to set + ReactionTypes []ReactionTypeClass + // Pass true if the reactions are added with a big animation + IsBig bool +} + +// SetMessageReactionsRequestTypeID is TL type id of SetMessageReactionsRequest. +const SetMessageReactionsRequestTypeID = 0x71fa9e8f + +// Ensuring interfaces in compile-time for SetMessageReactionsRequest. +var ( + _ bin.Encoder = &SetMessageReactionsRequest{} + _ bin.Decoder = &SetMessageReactionsRequest{} + _ bin.BareEncoder = &SetMessageReactionsRequest{} + _ bin.BareDecoder = &SetMessageReactionsRequest{} +) + +func (s *SetMessageReactionsRequest) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.MessageID == 0) { + return false + } + if !(s.ReactionTypes == nil) { + return false + } + if !(s.IsBig == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetMessageReactionsRequest) String() string { + if s == nil { + return "SetMessageReactionsRequest(nil)" + } + type Alias SetMessageReactionsRequest + return fmt.Sprintf("SetMessageReactionsRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetMessageReactionsRequest) TypeID() uint32 { + return SetMessageReactionsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetMessageReactionsRequest) TypeName() string { + return "setMessageReactions" +} + +// TypeInfo returns info about TL type. +func (s *SetMessageReactionsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setMessageReactions", + ID: SetMessageReactionsRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "ReactionTypes", + SchemaName: "reaction_types", + }, + { + Name: "IsBig", + SchemaName: "is_big", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetMessageReactionsRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setMessageReactions#71fa9e8f as nil") + } + b.PutID(SetMessageReactionsRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetMessageReactionsRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setMessageReactions#71fa9e8f as nil") + } + b.PutInt53(s.ChatID) + b.PutInt53(s.MessageID) + b.PutInt(len(s.ReactionTypes)) + for idx, v := range s.ReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode setMessageReactions#71fa9e8f: field reaction_types element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare setMessageReactions#71fa9e8f: field reaction_types element with index %d: %w", idx, err) + } + } + b.PutBool(s.IsBig) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetMessageReactionsRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setMessageReactions#71fa9e8f to nil") + } + if err := b.ConsumeID(SetMessageReactionsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetMessageReactionsRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setMessageReactions#71fa9e8f to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field chat_id: %w", err) + } + s.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field message_id: %w", err) + } + s.MessageID = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field reaction_types: %w", err) + } + + if headerLen > 0 { + s.ReactionTypes = make([]ReactionTypeClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field reaction_types: %w", err) + } + s.ReactionTypes = append(s.ReactionTypes, value) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field is_big: %w", err) + } + s.IsBig = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetMessageReactionsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setMessageReactions#71fa9e8f as nil") + } + b.ObjStart() + b.PutID("setMessageReactions") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(s.MessageID) + b.Comma() + b.FieldStart("reaction_types") + b.ArrStart() + for idx, v := range s.ReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode setMessageReactions#71fa9e8f: field reaction_types element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setMessageReactions#71fa9e8f: field reaction_types element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("is_big") + b.PutBool(s.IsBig) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetMessageReactionsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setMessageReactions#71fa9e8f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setMessageReactions"); err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field chat_id: %w", err) + } + s.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field message_id: %w", err) + } + s.MessageID = value + case "reaction_types": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field reaction_types: %w", err) + } + s.ReactionTypes = append(s.ReactionTypes, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field reaction_types: %w", err) + } + case "is_big": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setMessageReactions#71fa9e8f: field is_big: %w", err) + } + s.IsBig = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *SetMessageReactionsRequest) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetMessageID returns value of MessageID field. +func (s *SetMessageReactionsRequest) GetMessageID() (value int64) { + if s == nil { + return + } + return s.MessageID +} + +// GetReactionTypes returns value of ReactionTypes field. +func (s *SetMessageReactionsRequest) GetReactionTypes() (value []ReactionTypeClass) { + if s == nil { + return + } + return s.ReactionTypes +} + +// GetIsBig returns value of IsBig field. +func (s *SetMessageReactionsRequest) GetIsBig() (value bool) { + if s == nil { + return + } + return s.IsBig +} + +// SetMessageReactions invokes method setMessageReactions#71fa9e8f returning error if any. +func (c *Client) SetMessageReactions(ctx context.Context, request *SetMessageReactionsRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_set_profile_accent_color_gen.go b/tdapi/tl_set_profile_accent_color_gen.go index 99bd18a41e..d5cc0217b2 100644 --- a/tdapi/tl_set_profile_accent_color_gen.go +++ b/tdapi/tl_set_profile_accent_color_gen.go @@ -35,8 +35,8 @@ var ( type SetProfileAccentColorRequest struct { // Identifier of the accent color to use for profile; pass -1 if none ProfileAccentColorID int32 - // Identifier of a custom emoji to be shown in the on the user's profile photo - // background; 0 if none + // Identifier of a custom emoji to be shown on the user's profile photo background; 0 if + // none ProfileBackgroundCustomEmojiID int64 } diff --git a/tdapi/tl_share_user_with_bot_gen.go b/tdapi/tl_share_user_with_bot_gen.go deleted file mode 100644 index dda227c977..0000000000 --- a/tdapi/tl_share_user_with_bot_gen.go +++ /dev/null @@ -1,340 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// ShareUserWithBotRequest represents TL type `shareUserWithBot#f132ffdc`. -type ShareUserWithBotRequest struct { - // Identifier of the chat with the bot - ChatID int64 - // Identifier of the message with the button - MessageID int64 - // Identifier of the button - ButtonID int32 - // Identifier of the shared user - SharedUserID int64 - // Pass true to check that the user can be shared by the button instead of actually - // sharing them - OnlyCheck bool -} - -// ShareUserWithBotRequestTypeID is TL type id of ShareUserWithBotRequest. -const ShareUserWithBotRequestTypeID = 0xf132ffdc - -// Ensuring interfaces in compile-time for ShareUserWithBotRequest. -var ( - _ bin.Encoder = &ShareUserWithBotRequest{} - _ bin.Decoder = &ShareUserWithBotRequest{} - _ bin.BareEncoder = &ShareUserWithBotRequest{} - _ bin.BareDecoder = &ShareUserWithBotRequest{} -) - -func (s *ShareUserWithBotRequest) Zero() bool { - if s == nil { - return true - } - if !(s.ChatID == 0) { - return false - } - if !(s.MessageID == 0) { - return false - } - if !(s.ButtonID == 0) { - return false - } - if !(s.SharedUserID == 0) { - return false - } - if !(s.OnlyCheck == false) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *ShareUserWithBotRequest) String() string { - if s == nil { - return "ShareUserWithBotRequest(nil)" - } - type Alias ShareUserWithBotRequest - return fmt.Sprintf("ShareUserWithBotRequest%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ShareUserWithBotRequest) TypeID() uint32 { - return ShareUserWithBotRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*ShareUserWithBotRequest) TypeName() string { - return "shareUserWithBot" -} - -// TypeInfo returns info about TL type. -func (s *ShareUserWithBotRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "shareUserWithBot", - ID: ShareUserWithBotRequestTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ChatID", - SchemaName: "chat_id", - }, - { - Name: "MessageID", - SchemaName: "message_id", - }, - { - Name: "ButtonID", - SchemaName: "button_id", - }, - { - Name: "SharedUserID", - SchemaName: "shared_user_id", - }, - { - Name: "OnlyCheck", - SchemaName: "only_check", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *ShareUserWithBotRequest) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode shareUserWithBot#f132ffdc as nil") - } - b.PutID(ShareUserWithBotRequestTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *ShareUserWithBotRequest) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode shareUserWithBot#f132ffdc as nil") - } - b.PutInt53(s.ChatID) - b.PutInt53(s.MessageID) - b.PutInt32(s.ButtonID) - b.PutInt53(s.SharedUserID) - b.PutBool(s.OnlyCheck) - return nil -} - -// Decode implements bin.Decoder. -func (s *ShareUserWithBotRequest) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode shareUserWithBot#f132ffdc to nil") - } - if err := b.ConsumeID(ShareUserWithBotRequestTypeID); err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *ShareUserWithBotRequest) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode shareUserWithBot#f132ffdc to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field chat_id: %w", err) - } - s.ChatID = value - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field message_id: %w", err) - } - s.MessageID = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field button_id: %w", err) - } - s.ButtonID = value - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field shared_user_id: %w", err) - } - s.SharedUserID = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field only_check: %w", err) - } - s.OnlyCheck = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *ShareUserWithBotRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode shareUserWithBot#f132ffdc as nil") - } - b.ObjStart() - b.PutID("shareUserWithBot") - b.Comma() - b.FieldStart("chat_id") - b.PutInt53(s.ChatID) - b.Comma() - b.FieldStart("message_id") - b.PutInt53(s.MessageID) - b.Comma() - b.FieldStart("button_id") - b.PutInt32(s.ButtonID) - b.Comma() - b.FieldStart("shared_user_id") - b.PutInt53(s.SharedUserID) - b.Comma() - b.FieldStart("only_check") - b.PutBool(s.OnlyCheck) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *ShareUserWithBotRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode shareUserWithBot#f132ffdc to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("shareUserWithBot"); err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: %w", err) - } - case "chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field chat_id: %w", err) - } - s.ChatID = value - case "message_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field message_id: %w", err) - } - s.MessageID = value - case "button_id": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field button_id: %w", err) - } - s.ButtonID = value - case "shared_user_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field shared_user_id: %w", err) - } - s.SharedUserID = value - case "only_check": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode shareUserWithBot#f132ffdc: field only_check: %w", err) - } - s.OnlyCheck = value - default: - return b.Skip() - } - return nil - }) -} - -// GetChatID returns value of ChatID field. -func (s *ShareUserWithBotRequest) GetChatID() (value int64) { - if s == nil { - return - } - return s.ChatID -} - -// GetMessageID returns value of MessageID field. -func (s *ShareUserWithBotRequest) GetMessageID() (value int64) { - if s == nil { - return - } - return s.MessageID -} - -// GetButtonID returns value of ButtonID field. -func (s *ShareUserWithBotRequest) GetButtonID() (value int32) { - if s == nil { - return - } - return s.ButtonID -} - -// GetSharedUserID returns value of SharedUserID field. -func (s *ShareUserWithBotRequest) GetSharedUserID() (value int64) { - if s == nil { - return - } - return s.SharedUserID -} - -// GetOnlyCheck returns value of OnlyCheck field. -func (s *ShareUserWithBotRequest) GetOnlyCheck() (value bool) { - if s == nil { - return - } - return s.OnlyCheck -} - -// ShareUserWithBot invokes method shareUserWithBot#f132ffdc returning error if any. -func (c *Client) ShareUserWithBot(ctx context.Context, request *ShareUserWithBotRequest) error { - var ok Ok - - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err - } - return nil -} diff --git a/tdapi/tl_share_users_with_bot_gen.go b/tdapi/tl_share_users_with_bot_gen.go new file mode 100644 index 0000000000..0d4deafdea --- /dev/null +++ b/tdapi/tl_share_users_with_bot_gen.go @@ -0,0 +1,364 @@ +// 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{} +) + +// ShareUsersWithBotRequest represents TL type `shareUsersWithBot#58448550`. +type ShareUsersWithBotRequest struct { + // Identifier of the chat with the bot + ChatID int64 + // Identifier of the message with the button + MessageID int64 + // Identifier of the button + ButtonID int32 + // Identifiers of the shared users + SharedUserIDs []int64 + // Pass true to check that the users can be shared by the button instead of actually + // sharing them + OnlyCheck bool +} + +// ShareUsersWithBotRequestTypeID is TL type id of ShareUsersWithBotRequest. +const ShareUsersWithBotRequestTypeID = 0x58448550 + +// Ensuring interfaces in compile-time for ShareUsersWithBotRequest. +var ( + _ bin.Encoder = &ShareUsersWithBotRequest{} + _ bin.Decoder = &ShareUsersWithBotRequest{} + _ bin.BareEncoder = &ShareUsersWithBotRequest{} + _ bin.BareDecoder = &ShareUsersWithBotRequest{} +) + +func (s *ShareUsersWithBotRequest) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.MessageID == 0) { + return false + } + if !(s.ButtonID == 0) { + return false + } + if !(s.SharedUserIDs == nil) { + return false + } + if !(s.OnlyCheck == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *ShareUsersWithBotRequest) String() string { + if s == nil { + return "ShareUsersWithBotRequest(nil)" + } + type Alias ShareUsersWithBotRequest + return fmt.Sprintf("ShareUsersWithBotRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ShareUsersWithBotRequest) TypeID() uint32 { + return ShareUsersWithBotRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ShareUsersWithBotRequest) TypeName() string { + return "shareUsersWithBot" +} + +// TypeInfo returns info about TL type. +func (s *ShareUsersWithBotRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "shareUsersWithBot", + ID: ShareUsersWithBotRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "ButtonID", + SchemaName: "button_id", + }, + { + Name: "SharedUserIDs", + SchemaName: "shared_user_ids", + }, + { + Name: "OnlyCheck", + SchemaName: "only_check", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *ShareUsersWithBotRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode shareUsersWithBot#58448550 as nil") + } + b.PutID(ShareUsersWithBotRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *ShareUsersWithBotRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode shareUsersWithBot#58448550 as nil") + } + b.PutInt53(s.ChatID) + b.PutInt53(s.MessageID) + b.PutInt32(s.ButtonID) + b.PutInt(len(s.SharedUserIDs)) + for _, v := range s.SharedUserIDs { + b.PutInt53(v) + } + b.PutBool(s.OnlyCheck) + return nil +} + +// Decode implements bin.Decoder. +func (s *ShareUsersWithBotRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode shareUsersWithBot#58448550 to nil") + } + if err := b.ConsumeID(ShareUsersWithBotRequestTypeID); err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *ShareUsersWithBotRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode shareUsersWithBot#58448550 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field chat_id: %w", err) + } + s.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field message_id: %w", err) + } + s.MessageID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field button_id: %w", err) + } + s.ButtonID = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field shared_user_ids: %w", err) + } + + if headerLen > 0 { + s.SharedUserIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field shared_user_ids: %w", err) + } + s.SharedUserIDs = append(s.SharedUserIDs, value) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field only_check: %w", err) + } + s.OnlyCheck = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *ShareUsersWithBotRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode shareUsersWithBot#58448550 as nil") + } + b.ObjStart() + b.PutID("shareUsersWithBot") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(s.MessageID) + b.Comma() + b.FieldStart("button_id") + b.PutInt32(s.ButtonID) + b.Comma() + b.FieldStart("shared_user_ids") + b.ArrStart() + for _, v := range s.SharedUserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("only_check") + b.PutBool(s.OnlyCheck) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *ShareUsersWithBotRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode shareUsersWithBot#58448550 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("shareUsersWithBot"); err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field chat_id: %w", err) + } + s.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field message_id: %w", err) + } + s.MessageID = value + case "button_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field button_id: %w", err) + } + s.ButtonID = value + case "shared_user_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field shared_user_ids: %w", err) + } + s.SharedUserIDs = append(s.SharedUserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field shared_user_ids: %w", err) + } + case "only_check": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode shareUsersWithBot#58448550: field only_check: %w", err) + } + s.OnlyCheck = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *ShareUsersWithBotRequest) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetMessageID returns value of MessageID field. +func (s *ShareUsersWithBotRequest) GetMessageID() (value int64) { + if s == nil { + return + } + return s.MessageID +} + +// GetButtonID returns value of ButtonID field. +func (s *ShareUsersWithBotRequest) GetButtonID() (value int32) { + if s == nil { + return + } + return s.ButtonID +} + +// GetSharedUserIDs returns value of SharedUserIDs field. +func (s *ShareUsersWithBotRequest) GetSharedUserIDs() (value []int64) { + if s == nil { + return + } + return s.SharedUserIDs +} + +// GetOnlyCheck returns value of OnlyCheck field. +func (s *ShareUsersWithBotRequest) GetOnlyCheck() (value bool) { + if s == nil { + return + } + return s.OnlyCheck +} + +// ShareUsersWithBot invokes method shareUsersWithBot#58448550 returning error if any. +func (c *Client) ShareUsersWithBot(ctx context.Context, request *ShareUsersWithBotRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_sticker_set_gen.go b/tdapi/tl_sticker_set_gen.go index 89797b5957..007f75d8b8 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#ac3cff8b`. +// StickerSet represents TL type `stickerSet#133c3db9`. type StickerSet struct { // Identifier of the sticker set ID int64 @@ -59,6 +59,9 @@ type StickerSet struct { // True, if stickers in the sticker set are custom emoji that must be repainted; for // custom emoji sticker sets only NeedsRepainting bool + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji + // status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool // True for already viewed trending sticker sets IsViewed bool // List of stickers in this set @@ -70,7 +73,7 @@ type StickerSet struct { } // StickerSetTypeID is TL type id of StickerSet. -const StickerSetTypeID = 0xac3cff8b +const StickerSetTypeID = 0x133c3db9 // Ensuring interfaces in compile-time for StickerSet. var ( @@ -117,6 +120,9 @@ func (s *StickerSet) Zero() bool { if !(s.NeedsRepainting == false) { return false } + if !(s.IsAllowedAsChatEmojiStatus == false) { + return false + } if !(s.IsViewed == false) { return false } @@ -206,6 +212,10 @@ func (s *StickerSet) TypeInfo() tdp.Type { Name: "NeedsRepainting", SchemaName: "needs_repainting", }, + { + Name: "IsAllowedAsChatEmojiStatus", + SchemaName: "is_allowed_as_chat_emoji_status", + }, { Name: "IsViewed", SchemaName: "is_viewed", @@ -225,7 +235,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#ac3cff8b as nil") + return fmt.Errorf("can't encode stickerSet#133c3db9 as nil") } b.PutID(StickerSetTypeID) return s.EncodeBare(b) @@ -234,47 +244,48 @@ 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#ac3cff8b as nil") + return fmt.Errorf("can't encode stickerSet#133c3db9 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#ac3cff8b: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: 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#ac3cff8b: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#133c3db9: field thumbnail_outline element with index %d: %w", idx, err) } } b.PutBool(s.IsInstalled) b.PutBool(s.IsArchived) b.PutBool(s.IsOfficial) if s.StickerFormat == nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_format is nil") } if err := s.StickerFormat.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_format: %w", err) } if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_type: %w", err) } b.PutBool(s.NeedsRepainting) + b.PutBool(s.IsAllowedAsChatEmojiStatus) b.PutBool(s.IsViewed) 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#ac3cff8b: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#133c3db9: 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#ac3cff8b: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#133c3db9: field emojis element with index %d: %w", idx, err) } } return nil @@ -283,10 +294,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#ac3cff8b to nil") + return fmt.Errorf("can't decode stickerSet#133c3db9 to nil") } if err := b.ConsumeID(StickerSetTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: %w", err) } return s.DecodeBare(b) } @@ -294,38 +305,38 @@ 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#ac3cff8b to nil") + return fmt.Errorf("can't decode stickerSet#133c3db9 to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field thumbnail: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field thumbnail_outline: %w", err) } if headerLen > 0 { @@ -334,7 +345,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value ClosedVectorPath if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSet#ac3cff8b: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#133c3db9: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) } @@ -342,56 +353,63 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field sticker_format: %w", err) } s.StickerFormat = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field needs_repainting: %w", err) } s.NeedsRepainting = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#133c3db9: field is_viewed: %w", err) } s.IsViewed = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field stickers: %w", err) } if headerLen > 0 { @@ -400,7 +418,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#ac3cff8b: field stickers: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#133c3db9: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) } @@ -408,7 +426,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field emojis: %w", err) } if headerLen > 0 { @@ -417,7 +435,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#ac3cff8b: field emojis: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#133c3db9: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) } @@ -428,7 +446,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#ac3cff8b as nil") + return fmt.Errorf("can't encode stickerSet#133c3db9 as nil") } b.ObjStart() b.PutID("stickerSet") @@ -444,14 +462,14 @@ 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#ac3cff8b: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: 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#ac3cff8b: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field thumbnail_outline element with index %d: %w", idx, err) } b.Comma() } @@ -469,23 +487,26 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sticker_format") if s.StickerFormat == nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_format is nil") } if err := s.StickerFormat.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_format: %w", err) } b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field sticker_type: %w", err) } b.Comma() b.FieldStart("needs_repainting") b.PutBool(s.NeedsRepainting) b.Comma() + b.FieldStart("is_allowed_as_chat_emoji_status") + b.PutBool(s.IsAllowedAsChatEmojiStatus) + b.Comma() b.FieldStart("is_viewed") b.PutBool(s.IsViewed) b.Comma() @@ -493,7 +514,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#ac3cff8b: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field stickers element with index %d: %w", idx, err) } b.Comma() } @@ -504,7 +525,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#ac3cff8b: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#133c3db9: field emojis element with index %d: %w", idx, err) } b.Comma() } @@ -519,111 +540,117 @@ 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#ac3cff8b to nil") + return fmt.Errorf("can't decode stickerSet#133c3db9 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#ac3cff8b: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field thumbnail_outline: %w", err) } case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field is_official: %w", err) } s.IsOfficial = value case "sticker_format": value, err := DecodeTDLibJSONStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field sticker_format: %w", err) } s.StickerFormat = value case "sticker_type": value, err := DecodeTDLibJSONStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#133c3db9: 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#ac3cff8b: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: 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#ac3cff8b: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#133c3db9: field emojis: %w", err) } default: return b.Skip() @@ -720,6 +747,14 @@ func (s *StickerSet) GetNeedsRepainting() (value bool) { return s.NeedsRepainting } +// GetIsAllowedAsChatEmojiStatus returns value of IsAllowedAsChatEmojiStatus field. +func (s *StickerSet) GetIsAllowedAsChatEmojiStatus() (value bool) { + if s == nil { + return + } + return s.IsAllowedAsChatEmojiStatus +} + // GetIsViewed returns value of IsViewed field. func (s *StickerSet) GetIsViewed() (value bool) { if s == nil { diff --git a/tdapi/tl_sticker_set_info_gen.go b/tdapi/tl_sticker_set_info_gen.go index ecbc4b640e..9085368c53 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#cbbbedfd`. +// StickerSetInfo represents TL type `stickerSetInfo#fb991fda`. type StickerSetInfo struct { // Identifier of the sticker set ID int64 @@ -40,7 +40,7 @@ type StickerSetInfo struct { // Name of the sticker set Name string // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be - // null + // 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 @@ -59,6 +59,9 @@ type StickerSetInfo struct { // True, if stickers in the sticker set are custom emoji that must be repainted; for // custom emoji sticker sets only NeedsRepainting bool + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji + // status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool // True for already viewed trending sticker sets IsViewed bool // Total number of stickers in the set @@ -69,7 +72,7 @@ type StickerSetInfo struct { } // StickerSetInfoTypeID is TL type id of StickerSetInfo. -const StickerSetInfoTypeID = 0xcbbbedfd +const StickerSetInfoTypeID = 0xfb991fda // Ensuring interfaces in compile-time for StickerSetInfo. var ( @@ -116,6 +119,9 @@ func (s *StickerSetInfo) Zero() bool { if !(s.NeedsRepainting == false) { return false } + if !(s.IsAllowedAsChatEmojiStatus == false) { + return false + } if !(s.IsViewed == false) { return false } @@ -205,6 +211,10 @@ func (s *StickerSetInfo) TypeInfo() tdp.Type { Name: "NeedsRepainting", SchemaName: "needs_repainting", }, + { + Name: "IsAllowedAsChatEmojiStatus", + SchemaName: "is_allowed_as_chat_emoji_status", + }, { Name: "IsViewed", SchemaName: "is_viewed", @@ -224,7 +234,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#cbbbedfd as nil") + return fmt.Errorf("can't encode stickerSetInfo#fb991fda as nil") } b.PutID(StickerSetInfoTypeID) return s.EncodeBare(b) @@ -233,42 +243,43 @@ 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#cbbbedfd as nil") + return fmt.Errorf("can't encode stickerSetInfo#fb991fda 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#cbbbedfd: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: 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#cbbbedfd: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSetInfo#fb991fda: field thumbnail_outline element with index %d: %w", idx, err) } } b.PutBool(s.IsInstalled) b.PutBool(s.IsArchived) b.PutBool(s.IsOfficial) if s.StickerFormat == nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_format is nil") } if err := s.StickerFormat.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_format: %w", err) } if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_type: %w", err) } b.PutBool(s.NeedsRepainting) + b.PutBool(s.IsAllowedAsChatEmojiStatus) b.PutBool(s.IsViewed) b.PutInt32(s.Size) 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#cbbbedfd: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSetInfo#fb991fda: field covers element with index %d: %w", idx, err) } } return nil @@ -277,10 +288,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#cbbbedfd to nil") + return fmt.Errorf("can't decode stickerSetInfo#fb991fda to nil") } if err := b.ConsumeID(StickerSetInfoTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: %w", err) } return s.DecodeBare(b) } @@ -288,38 +299,38 @@ 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#cbbbedfd to nil") + return fmt.Errorf("can't decode stickerSetInfo#fb991fda to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field thumbnail: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field thumbnail_outline: %w", err) } if headerLen > 0 { @@ -328,7 +339,7 @@ func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value ClosedVectorPath if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode bare stickerSetInfo#fb991fda: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) } @@ -336,63 +347,70 @@ func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field sticker_format: %w", err) } s.StickerFormat = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field needs_repainting: %w", err) } s.NeedsRepainting = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#fb991fda: field is_viewed: %w", err) } s.IsViewed = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field size: %w", err) } s.Size = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field covers: %w", err) } if headerLen > 0 { @@ -401,7 +419,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#cbbbedfd: field covers: %w", err) + return fmt.Errorf("unable to decode bare stickerSetInfo#fb991fda: field covers: %w", err) } s.Covers = append(s.Covers, value) } @@ -412,7 +430,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#cbbbedfd as nil") + return fmt.Errorf("can't encode stickerSetInfo#fb991fda as nil") } b.ObjStart() b.PutID("stickerSetInfo") @@ -428,14 +446,14 @@ 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#cbbbedfd: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: 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#cbbbedfd: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field thumbnail_outline element with index %d: %w", idx, err) } b.Comma() } @@ -453,23 +471,26 @@ func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sticker_format") if s.StickerFormat == nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_format is nil") } if err := s.StickerFormat.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_format: %w", err) } b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field sticker_type: %w", err) } b.Comma() b.FieldStart("needs_repainting") b.PutBool(s.NeedsRepainting) b.Comma() + b.FieldStart("is_allowed_as_chat_emoji_status") + b.PutBool(s.IsAllowedAsChatEmojiStatus) + b.Comma() b.FieldStart("is_viewed") b.PutBool(s.IsViewed) b.Comma() @@ -480,7 +501,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#cbbbedfd: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSetInfo#fb991fda: field covers element with index %d: %w", idx, err) } b.Comma() } @@ -495,106 +516,112 @@ 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#cbbbedfd to nil") + return fmt.Errorf("can't decode stickerSetInfo#fb991fda 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#cbbbedfd: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#cbbbedfd: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field thumbnail_outline: %w", err) } case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#cbbbedfd: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#cbbbedfd: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field is_official: %w", err) } s.IsOfficial = value case "sticker_format": value, err := DecodeTDLibJSONStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field sticker_format: %w", err) } s.StickerFormat = value case "sticker_type": value, err := DecodeTDLibJSONStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#cbbbedfd: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#fb991fda: 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#cbbbedfd: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field is_viewed: %w", err) } s.IsViewed = value case "size": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: 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#cbbbedfd: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field covers: %w", err) } s.Covers = append(s.Covers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#fb991fda: field covers: %w", err) } default: return b.Skip() @@ -691,6 +718,14 @@ func (s *StickerSetInfo) GetNeedsRepainting() (value bool) { return s.NeedsRepainting } +// GetIsAllowedAsChatEmojiStatus returns value of IsAllowedAsChatEmojiStatus field. +func (s *StickerSetInfo) GetIsAllowedAsChatEmojiStatus() (value bool) { + if s == nil { + return + } + return s.IsAllowedAsChatEmojiStatus +} + // GetIsViewed returns value of IsViewed field. func (s *StickerSetInfo) GetIsViewed() (value bool) { if s == nil { diff --git a/tdapi/tl_story_area_type_gen.go b/tdapi/tl_story_area_type_gen.go index 702294c906..ce97cc5158 100644 --- a/tdapi/tl_story_area_type_gen.go +++ b/tdapi/tl_story_area_type_gen.go @@ -641,6 +641,206 @@ func (s *StoryAreaTypeSuggestedReaction) GetIsFlipped() (value bool) { return s.IsFlipped } +// StoryAreaTypeMessage represents TL type `storyAreaTypeMessage#bfef76b4`. +type StoryAreaTypeMessage struct { + // Identifier of the chat with the message + ChatID int64 + // Identifier of the message + MessageID int64 +} + +// StoryAreaTypeMessageTypeID is TL type id of StoryAreaTypeMessage. +const StoryAreaTypeMessageTypeID = 0xbfef76b4 + +// construct implements constructor of StoryAreaTypeClass. +func (s StoryAreaTypeMessage) construct() StoryAreaTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryAreaTypeMessage. +var ( + _ bin.Encoder = &StoryAreaTypeMessage{} + _ bin.Decoder = &StoryAreaTypeMessage{} + _ bin.BareEncoder = &StoryAreaTypeMessage{} + _ bin.BareDecoder = &StoryAreaTypeMessage{} + + _ StoryAreaTypeClass = &StoryAreaTypeMessage{} +) + +func (s *StoryAreaTypeMessage) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.MessageID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryAreaTypeMessage) String() string { + if s == nil { + return "StoryAreaTypeMessage(nil)" + } + type Alias StoryAreaTypeMessage + return fmt.Sprintf("StoryAreaTypeMessage%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryAreaTypeMessage) TypeID() uint32 { + return StoryAreaTypeMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryAreaTypeMessage) TypeName() string { + return "storyAreaTypeMessage" +} + +// TypeInfo returns info about TL type. +func (s *StoryAreaTypeMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyAreaTypeMessage", + ID: StoryAreaTypeMessageTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryAreaTypeMessage) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeMessage#bfef76b4 as nil") + } + b.PutID(StoryAreaTypeMessageTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryAreaTypeMessage) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeMessage#bfef76b4 as nil") + } + b.PutInt53(s.ChatID) + b.PutInt53(s.MessageID) + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryAreaTypeMessage) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeMessage#bfef76b4 to nil") + } + if err := b.ConsumeID(StoryAreaTypeMessageTypeID); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryAreaTypeMessage) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeMessage#bfef76b4 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: field chat_id: %w", err) + } + s.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: field message_id: %w", err) + } + s.MessageID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryAreaTypeMessage) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeMessage#bfef76b4 as nil") + } + b.ObjStart() + b.PutID("storyAreaTypeMessage") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(s.MessageID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryAreaTypeMessage) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeMessage#bfef76b4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyAreaTypeMessage"); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: field chat_id: %w", err) + } + s.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyAreaTypeMessage#bfef76b4: field message_id: %w", err) + } + s.MessageID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *StoryAreaTypeMessage) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetMessageID returns value of MessageID field. +func (s *StoryAreaTypeMessage) GetMessageID() (value int64) { + if s == nil { + return + } + return s.MessageID +} + // StoryAreaTypeClassName is schema name of StoryAreaTypeClass. const StoryAreaTypeClassName = "StoryAreaType" @@ -656,6 +856,7 @@ const StoryAreaTypeClassName = "StoryAreaType" // case *tdapi.StoryAreaTypeLocation: // storyAreaTypeLocation#9ebe1186 // case *tdapi.StoryAreaTypeVenue: // storyAreaTypeVenue#18ae4d06 // case *tdapi.StoryAreaTypeSuggestedReaction: // storyAreaTypeSuggestedReaction#f95f927c +// case *tdapi.StoryAreaTypeMessage: // storyAreaTypeMessage#bfef76b4 // default: panic(v) // } type StoryAreaTypeClass interface { @@ -708,6 +909,13 @@ func DecodeStoryAreaType(buf *bin.Buffer) (StoryAreaTypeClass, error) { return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) } return &v, nil + case StoryAreaTypeMessageTypeID: + // Decoding storyAreaTypeMessage#bfef76b4. + v := StoryAreaTypeMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -741,6 +949,13 @@ func DecodeTDLibJSONStoryAreaType(buf tdjson.Decoder) (StoryAreaTypeClass, error return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) } return &v, nil + case "storyAreaTypeMessage": + // Decoding storyAreaTypeMessage#bfef76b4. + v := StoryAreaTypeMessage{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_story_gen.go b/tdapi/tl_story_gen.go index 51a0fb88b7..54be8467cf 100644 --- a/tdapi/tl_story_gen.go +++ b/tdapi/tl_story_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Story represents TL type `story#29dd2b0d`. +// Story represents TL type `story#8e358ca2`. type Story struct { // Unique story identifier among stories of the given sender ID int32 @@ -63,8 +63,8 @@ type Story struct { CanToggleIsPinned bool // True, if the story statistics are available through getStoryStatistics CanGetStatistics bool - // True, if users viewed the story can be received through getStoryViewers - CanGetViewers bool + // True, if interactions with the story can be received through getStoryInteractions + CanGetInteractions bool // True, if users viewed the story can't be received, because the story has expired more // than getOption("story_viewers_expiration_delay") seconds ago HasExpiredViewers bool @@ -86,7 +86,7 @@ type Story struct { } // StoryTypeID is TL type id of Story. -const StoryTypeID = 0x29dd2b0d +const StoryTypeID = 0x8e358ca2 // Ensuring interfaces in compile-time for Story. var ( @@ -142,7 +142,7 @@ func (s *Story) Zero() bool { if !(s.CanGetStatistics == false) { return false } - if !(s.CanGetViewers == false) { + if !(s.CanGetInteractions == false) { return false } if !(s.HasExpiredViewers == false) { @@ -262,8 +262,8 @@ func (s *Story) TypeInfo() tdp.Type { SchemaName: "can_get_statistics", }, { - Name: "CanGetViewers", - SchemaName: "can_get_viewers", + Name: "CanGetInteractions", + SchemaName: "can_get_interactions", }, { Name: "HasExpiredViewers", @@ -304,7 +304,7 @@ func (s *Story) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *Story) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode story#29dd2b0d as nil") + return fmt.Errorf("can't encode story#8e358ca2 as nil") } b.PutID(StoryTypeID) return s.EncodeBare(b) @@ -313,7 +313,7 @@ func (s *Story) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *Story) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode story#29dd2b0d as nil") + return fmt.Errorf("can't encode story#8e358ca2 as nil") } b.PutInt32(s.ID) b.PutInt53(s.SenderChatID) @@ -329,40 +329,40 @@ func (s *Story) EncodeBare(b *bin.Buffer) error { b.PutBool(s.CanBeReplied) b.PutBool(s.CanToggleIsPinned) b.PutBool(s.CanGetStatistics) - b.PutBool(s.CanGetViewers) + b.PutBool(s.CanGetInteractions) b.PutBool(s.HasExpiredViewers) if err := s.RepostInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field repost_info: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field repost_info: %w", err) } if err := s.InteractionInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field interaction_info: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field interaction_info: %w", err) } if s.ChosenReactionType == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field chosen_reaction_type is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field chosen_reaction_type is nil") } if err := s.ChosenReactionType.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field chosen_reaction_type: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field chosen_reaction_type: %w", err) } if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field privacy_settings is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field privacy_settings is nil") } if err := s.PrivacySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field privacy_settings: %w", err) } if s.Content == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field content is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field content is nil") } if err := s.Content.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field content: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field content: %w", err) } b.PutInt(len(s.Areas)) for idx, v := range s.Areas { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare story#29dd2b0d: field areas element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare story#8e358ca2: field areas element with index %d: %w", idx, err) } } if err := s.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field caption: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field caption: %w", err) } return nil } @@ -370,10 +370,10 @@ func (s *Story) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *Story) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode story#29dd2b0d to nil") + return fmt.Errorf("can't decode story#8e358ca2 to nil") } if err := b.ConsumeID(StoryTypeID); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: %w", err) } return s.DecodeBare(b) } @@ -381,155 +381,155 @@ func (s *Story) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *Story) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode story#29dd2b0d to nil") + return fmt.Errorf("can't decode story#8e358ca2 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field id: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field id: %w", err) } s.ID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field sender_chat_id: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field sender_chat_id: %w", err) } s.SenderChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field date: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field date: %w", err) } s.Date = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_being_sent: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_being_sent: %w", err) } s.IsBeingSent = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_being_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_being_edited: %w", err) } s.IsBeingEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_edited: %w", err) } s.IsEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_pinned: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_pinned: %w", err) } s.IsPinned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_visible_only_for_self: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_visible_only_for_self: %w", err) } s.IsVisibleOnlyForSelf = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_deleted: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_deleted: %w", err) } s.CanBeDeleted = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_edited: %w", err) } s.CanBeEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_forwarded: %w", err) } s.CanBeForwarded = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_replied: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_replied: %w", err) } s.CanBeReplied = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_toggle_is_pinned: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_toggle_is_pinned: %w", err) } s.CanToggleIsPinned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_get_statistics: %w", err) } s.CanGetStatistics = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_get_interactions: %w", err) } - s.CanGetViewers = value + s.CanGetInteractions = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field has_expired_viewers: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field has_expired_viewers: %w", err) } s.HasExpiredViewers = value } { if err := s.RepostInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field repost_info: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field repost_info: %w", err) } } { if err := s.InteractionInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field interaction_info: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field interaction_info: %w", err) } } { value, err := DecodeReactionType(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field chosen_reaction_type: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field chosen_reaction_type: %w", err) } s.ChosenReactionType = value } { value, err := DecodeStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field privacy_settings: %w", err) } s.PrivacySettings = value } { value, err := DecodeStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field content: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field content: %w", err) } s.Content = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field areas: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field areas: %w", err) } if headerLen > 0 { @@ -538,14 +538,14 @@ func (s *Story) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value StoryArea if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare story#29dd2b0d: field areas: %w", err) + return fmt.Errorf("unable to decode bare story#8e358ca2: field areas: %w", err) } s.Areas = append(s.Areas, value) } } { if err := s.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field caption: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field caption: %w", err) } } return nil @@ -554,7 +554,7 @@ func (s *Story) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode story#29dd2b0d as nil") + return fmt.Errorf("can't encode story#8e358ca2 as nil") } b.ObjStart() b.PutID("story") @@ -601,51 +601,51 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("can_get_statistics") b.PutBool(s.CanGetStatistics) b.Comma() - b.FieldStart("can_get_viewers") - b.PutBool(s.CanGetViewers) + b.FieldStart("can_get_interactions") + b.PutBool(s.CanGetInteractions) b.Comma() b.FieldStart("has_expired_viewers") b.PutBool(s.HasExpiredViewers) b.Comma() b.FieldStart("repost_info") if err := s.RepostInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field repost_info: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field repost_info: %w", err) } b.Comma() b.FieldStart("interaction_info") if err := s.InteractionInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field interaction_info: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field interaction_info: %w", err) } b.Comma() b.FieldStart("chosen_reaction_type") if s.ChosenReactionType == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field chosen_reaction_type is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field chosen_reaction_type is nil") } if err := s.ChosenReactionType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field chosen_reaction_type: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field chosen_reaction_type: %w", err) } b.Comma() b.FieldStart("privacy_settings") if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field privacy_settings is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field privacy_settings is nil") } if err := s.PrivacySettings.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field privacy_settings: %w", err) } b.Comma() b.FieldStart("content") if s.Content == nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field content is nil") + return fmt.Errorf("unable to encode story#8e358ca2: field content is nil") } if err := s.Content.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field content: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field content: %w", err) } b.Comma() b.FieldStart("areas") b.ArrStart() for idx, v := range s.Areas { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field areas element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode story#8e358ca2: field areas element with index %d: %w", idx, err) } b.Comma() } @@ -654,7 +654,7 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("caption") if err := s.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#29dd2b0d: field caption: %w", err) + return fmt.Errorf("unable to encode story#8e358ca2: field caption: %w", err) } b.Comma() b.StripComma() @@ -665,151 +665,151 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *Story) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode story#29dd2b0d to nil") + return fmt.Errorf("can't decode story#8e358ca2 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("story"); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: %w", err) } case "id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field id: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field id: %w", err) } s.ID = value case "sender_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field sender_chat_id: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field sender_chat_id: %w", err) } s.SenderChatID = value case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field date: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field date: %w", err) } s.Date = value case "is_being_sent": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_being_sent: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_being_sent: %w", err) } s.IsBeingSent = value case "is_being_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_being_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_being_edited: %w", err) } s.IsBeingEdited = value case "is_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_edited: %w", err) } s.IsEdited = value case "is_pinned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_pinned: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_pinned: %w", err) } s.IsPinned = value case "is_visible_only_for_self": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field is_visible_only_for_self: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field is_visible_only_for_self: %w", err) } s.IsVisibleOnlyForSelf = value case "can_be_deleted": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_deleted: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_deleted: %w", err) } s.CanBeDeleted = value case "can_be_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_edited: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_edited: %w", err) } s.CanBeEdited = value case "can_be_forwarded": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_forwarded: %w", err) } s.CanBeForwarded = value case "can_be_replied": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_be_replied: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_be_replied: %w", err) } s.CanBeReplied = value case "can_toggle_is_pinned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_toggle_is_pinned: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_toggle_is_pinned: %w", err) } s.CanToggleIsPinned = value case "can_get_statistics": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_get_statistics: %w", err) } s.CanGetStatistics = value - case "can_get_viewers": + case "can_get_interactions": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field can_get_interactions: %w", err) } - s.CanGetViewers = value + s.CanGetInteractions = value case "has_expired_viewers": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field has_expired_viewers: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field has_expired_viewers: %w", err) } s.HasExpiredViewers = value case "repost_info": if err := s.RepostInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field repost_info: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field repost_info: %w", err) } case "interaction_info": if err := s.InteractionInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field interaction_info: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field interaction_info: %w", err) } case "chosen_reaction_type": value, err := DecodeTDLibJSONReactionType(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field chosen_reaction_type: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field chosen_reaction_type: %w", err) } s.ChosenReactionType = value case "privacy_settings": value, err := DecodeTDLibJSONStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field privacy_settings: %w", err) } s.PrivacySettings = value case "content": value, err := DecodeTDLibJSONStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field content: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field content: %w", err) } s.Content = value case "areas": if err := b.Arr(func(b tdjson.Decoder) error { var value StoryArea if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field areas: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field areas: %w", err) } s.Areas = append(s.Areas, value) return nil }); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field areas: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field areas: %w", err) } case "caption": if err := s.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#29dd2b0d: field caption: %w", err) + return fmt.Errorf("unable to decode story#8e358ca2: field caption: %w", err) } default: return b.Skip() @@ -930,12 +930,12 @@ func (s *Story) GetCanGetStatistics() (value bool) { return s.CanGetStatistics } -// GetCanGetViewers returns value of CanGetViewers field. -func (s *Story) GetCanGetViewers() (value bool) { +// GetCanGetInteractions returns value of CanGetInteractions field. +func (s *Story) GetCanGetInteractions() (value bool) { if s == nil { return } - return s.CanGetViewers + return s.CanGetInteractions } // GetHasExpiredViewers returns value of HasExpiredViewers field. diff --git a/tdapi/tl_story_interaction_gen.go b/tdapi/tl_story_interaction_gen.go new file mode 100644 index 0000000000..0feb3172bf --- /dev/null +++ b/tdapi/tl_story_interaction_gen.go @@ -0,0 +1,325 @@ +// 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{} +) + +// StoryInteraction represents TL type `storyInteraction#d624d222`. +type StoryInteraction struct { + // Identifier of the user or chat that made the interaction + ActorID MessageSenderClass + // Approximate point in time (Unix timestamp) when the interaction happened + InteractionDate int32 + // Block list to which the actor is added; may be null if none or for chat stories + BlockList BlockListClass + // Type of the interaction + Type StoryInteractionTypeClass +} + +// StoryInteractionTypeID is TL type id of StoryInteraction. +const StoryInteractionTypeID = 0xd624d222 + +// Ensuring interfaces in compile-time for StoryInteraction. +var ( + _ bin.Encoder = &StoryInteraction{} + _ bin.Decoder = &StoryInteraction{} + _ bin.BareEncoder = &StoryInteraction{} + _ bin.BareDecoder = &StoryInteraction{} +) + +func (s *StoryInteraction) Zero() bool { + if s == nil { + return true + } + if !(s.ActorID == nil) { + return false + } + if !(s.InteractionDate == 0) { + return false + } + if !(s.BlockList == nil) { + return false + } + if !(s.Type == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryInteraction) String() string { + if s == nil { + return "StoryInteraction(nil)" + } + type Alias StoryInteraction + return fmt.Sprintf("StoryInteraction%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryInteraction) TypeID() uint32 { + return StoryInteractionTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryInteraction) TypeName() string { + return "storyInteraction" +} + +// TypeInfo returns info about TL type. +func (s *StoryInteraction) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyInteraction", + ID: StoryInteractionTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ActorID", + SchemaName: "actor_id", + }, + { + Name: "InteractionDate", + SchemaName: "interaction_date", + }, + { + Name: "BlockList", + SchemaName: "block_list", + }, + { + Name: "Type", + SchemaName: "type", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryInteraction) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteraction#d624d222 as nil") + } + b.PutID(StoryInteractionTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryInteraction) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteraction#d624d222 as nil") + } + if s.ActorID == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field actor_id is nil") + } + if err := s.ActorID.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field actor_id: %w", err) + } + b.PutInt32(s.InteractionDate) + if s.BlockList == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field block_list is nil") + } + if err := s.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field block_list: %w", err) + } + if s.Type == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field type is nil") + } + if err := s.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field type: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryInteraction) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteraction#d624d222 to nil") + } + if err := b.ConsumeID(StoryInteractionTypeID); err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryInteraction) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteraction#d624d222 to nil") + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field actor_id: %w", err) + } + s.ActorID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field interaction_date: %w", err) + } + s.InteractionDate = value + } + { + value, err := DecodeBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field block_list: %w", err) + } + s.BlockList = value + } + { + value, err := DecodeStoryInteractionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field type: %w", err) + } + s.Type = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryInteraction) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyInteraction#d624d222 as nil") + } + b.ObjStart() + b.PutID("storyInteraction") + b.Comma() + b.FieldStart("actor_id") + if s.ActorID == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field actor_id is nil") + } + if err := s.ActorID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field actor_id: %w", err) + } + b.Comma() + b.FieldStart("interaction_date") + b.PutInt32(s.InteractionDate) + b.Comma() + b.FieldStart("block_list") + if s.BlockList == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field block_list is nil") + } + if err := s.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field block_list: %w", err) + } + b.Comma() + b.FieldStart("type") + if s.Type == nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field type is nil") + } + if err := s.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteraction#d624d222: field type: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryInteraction) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyInteraction#d624d222 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyInteraction"); err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: %w", err) + } + case "actor_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field actor_id: %w", err) + } + s.ActorID = value + case "interaction_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field interaction_date: %w", err) + } + s.InteractionDate = value + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field block_list: %w", err) + } + s.BlockList = value + case "type": + value, err := DecodeTDLibJSONStoryInteractionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteraction#d624d222: field type: %w", err) + } + s.Type = value + default: + return b.Skip() + } + return nil + }) +} + +// GetActorID returns value of ActorID field. +func (s *StoryInteraction) GetActorID() (value MessageSenderClass) { + if s == nil { + return + } + return s.ActorID +} + +// GetInteractionDate returns value of InteractionDate field. +func (s *StoryInteraction) GetInteractionDate() (value int32) { + if s == nil { + return + } + return s.InteractionDate +} + +// GetBlockList returns value of BlockList field. +func (s *StoryInteraction) GetBlockList() (value BlockListClass) { + if s == nil { + return + } + return s.BlockList +} + +// GetType returns value of Type field. +func (s *StoryInteraction) GetType() (value StoryInteractionTypeClass) { + if s == nil { + return + } + return s.Type +} diff --git a/tdapi/tl_story_interaction_type_gen.go b/tdapi/tl_story_interaction_type_gen.go new file mode 100644 index 0000000000..9b2c966eef --- /dev/null +++ b/tdapi/tl_story_interaction_type_gen.go @@ -0,0 +1,692 @@ +// 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{} +) + +// StoryInteractionTypeView represents TL type `storyInteractionTypeView#53e337d0`. +type StoryInteractionTypeView struct { + // Type of the reaction that was chosen by the viewer; may be null if none + ChosenReactionType ReactionTypeClass +} + +// StoryInteractionTypeViewTypeID is TL type id of StoryInteractionTypeView. +const StoryInteractionTypeViewTypeID = 0x53e337d0 + +// construct implements constructor of StoryInteractionTypeClass. +func (s StoryInteractionTypeView) construct() StoryInteractionTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryInteractionTypeView. +var ( + _ bin.Encoder = &StoryInteractionTypeView{} + _ bin.Decoder = &StoryInteractionTypeView{} + _ bin.BareEncoder = &StoryInteractionTypeView{} + _ bin.BareDecoder = &StoryInteractionTypeView{} + + _ StoryInteractionTypeClass = &StoryInteractionTypeView{} +) + +func (s *StoryInteractionTypeView) Zero() bool { + if s == nil { + return true + } + if !(s.ChosenReactionType == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryInteractionTypeView) String() string { + if s == nil { + return "StoryInteractionTypeView(nil)" + } + type Alias StoryInteractionTypeView + return fmt.Sprintf("StoryInteractionTypeView%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryInteractionTypeView) TypeID() uint32 { + return StoryInteractionTypeViewTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryInteractionTypeView) TypeName() string { + return "storyInteractionTypeView" +} + +// TypeInfo returns info about TL type. +func (s *StoryInteractionTypeView) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyInteractionTypeView", + ID: StoryInteractionTypeViewTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChosenReactionType", + SchemaName: "chosen_reaction_type", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryInteractionTypeView) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeView#53e337d0 as nil") + } + b.PutID(StoryInteractionTypeViewTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryInteractionTypeView) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeView#53e337d0 as nil") + } + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode storyInteractionTypeView#53e337d0: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeView#53e337d0: field chosen_reaction_type: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryInteractionTypeView) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeView#53e337d0 to nil") + } + if err := b.ConsumeID(StoryInteractionTypeViewTypeID); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeView#53e337d0: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryInteractionTypeView) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeView#53e337d0 to nil") + } + { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeView#53e337d0: field chosen_reaction_type: %w", err) + } + s.ChosenReactionType = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryInteractionTypeView) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeView#53e337d0 as nil") + } + b.ObjStart() + b.PutID("storyInteractionTypeView") + b.Comma() + b.FieldStart("chosen_reaction_type") + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode storyInteractionTypeView#53e337d0: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeView#53e337d0: field chosen_reaction_type: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryInteractionTypeView) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeView#53e337d0 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyInteractionTypeView"); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeView#53e337d0: %w", err) + } + case "chosen_reaction_type": + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeView#53e337d0: field chosen_reaction_type: %w", err) + } + s.ChosenReactionType = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChosenReactionType returns value of ChosenReactionType field. +func (s *StoryInteractionTypeView) GetChosenReactionType() (value ReactionTypeClass) { + if s == nil { + return + } + return s.ChosenReactionType +} + +// StoryInteractionTypeForward represents TL type `storyInteractionTypeForward#27d23cff`. +type StoryInteractionTypeForward struct { + // The message with story forward + Message Message +} + +// StoryInteractionTypeForwardTypeID is TL type id of StoryInteractionTypeForward. +const StoryInteractionTypeForwardTypeID = 0x27d23cff + +// construct implements constructor of StoryInteractionTypeClass. +func (s StoryInteractionTypeForward) construct() StoryInteractionTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryInteractionTypeForward. +var ( + _ bin.Encoder = &StoryInteractionTypeForward{} + _ bin.Decoder = &StoryInteractionTypeForward{} + _ bin.BareEncoder = &StoryInteractionTypeForward{} + _ bin.BareDecoder = &StoryInteractionTypeForward{} + + _ StoryInteractionTypeClass = &StoryInteractionTypeForward{} +) + +func (s *StoryInteractionTypeForward) Zero() bool { + if s == nil { + return true + } + if !(s.Message.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryInteractionTypeForward) String() string { + if s == nil { + return "StoryInteractionTypeForward(nil)" + } + type Alias StoryInteractionTypeForward + return fmt.Sprintf("StoryInteractionTypeForward%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryInteractionTypeForward) TypeID() uint32 { + return StoryInteractionTypeForwardTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryInteractionTypeForward) TypeName() string { + return "storyInteractionTypeForward" +} + +// TypeInfo returns info about TL type. +func (s *StoryInteractionTypeForward) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyInteractionTypeForward", + ID: StoryInteractionTypeForwardTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Message", + SchemaName: "message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryInteractionTypeForward) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeForward#27d23cff as nil") + } + b.PutID(StoryInteractionTypeForwardTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryInteractionTypeForward) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeForward#27d23cff as nil") + } + if err := s.Message.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeForward#27d23cff: field message: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryInteractionTypeForward) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeForward#27d23cff to nil") + } + if err := b.ConsumeID(StoryInteractionTypeForwardTypeID); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeForward#27d23cff: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryInteractionTypeForward) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeForward#27d23cff to nil") + } + { + if err := s.Message.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeForward#27d23cff: field message: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryInteractionTypeForward) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeForward#27d23cff as nil") + } + b.ObjStart() + b.PutID("storyInteractionTypeForward") + b.Comma() + b.FieldStart("message") + if err := s.Message.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeForward#27d23cff: field message: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryInteractionTypeForward) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeForward#27d23cff to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyInteractionTypeForward"); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeForward#27d23cff: %w", err) + } + case "message": + if err := s.Message.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeForward#27d23cff: field message: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetMessage returns value of Message field. +func (s *StoryInteractionTypeForward) GetMessage() (value Message) { + if s == nil { + return + } + return s.Message +} + +// StoryInteractionTypeRepost represents TL type `storyInteractionTypeRepost#c32279c4`. +type StoryInteractionTypeRepost struct { + // The reposted story + Story Story +} + +// StoryInteractionTypeRepostTypeID is TL type id of StoryInteractionTypeRepost. +const StoryInteractionTypeRepostTypeID = 0xc32279c4 + +// construct implements constructor of StoryInteractionTypeClass. +func (s StoryInteractionTypeRepost) construct() StoryInteractionTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryInteractionTypeRepost. +var ( + _ bin.Encoder = &StoryInteractionTypeRepost{} + _ bin.Decoder = &StoryInteractionTypeRepost{} + _ bin.BareEncoder = &StoryInteractionTypeRepost{} + _ bin.BareDecoder = &StoryInteractionTypeRepost{} + + _ StoryInteractionTypeClass = &StoryInteractionTypeRepost{} +) + +func (s *StoryInteractionTypeRepost) Zero() bool { + if s == nil { + return true + } + if !(s.Story.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryInteractionTypeRepost) String() string { + if s == nil { + return "StoryInteractionTypeRepost(nil)" + } + type Alias StoryInteractionTypeRepost + return fmt.Sprintf("StoryInteractionTypeRepost%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryInteractionTypeRepost) TypeID() uint32 { + return StoryInteractionTypeRepostTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryInteractionTypeRepost) TypeName() string { + return "storyInteractionTypeRepost" +} + +// TypeInfo returns info about TL type. +func (s *StoryInteractionTypeRepost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyInteractionTypeRepost", + ID: StoryInteractionTypeRepostTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Story", + SchemaName: "story", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryInteractionTypeRepost) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeRepost#c32279c4 as nil") + } + b.PutID(StoryInteractionTypeRepostTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryInteractionTypeRepost) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeRepost#c32279c4 as nil") + } + if err := s.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeRepost#c32279c4: field story: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryInteractionTypeRepost) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeRepost#c32279c4 to nil") + } + if err := b.ConsumeID(StoryInteractionTypeRepostTypeID); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeRepost#c32279c4: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryInteractionTypeRepost) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeRepost#c32279c4 to nil") + } + { + if err := s.Story.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeRepost#c32279c4: field story: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryInteractionTypeRepost) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractionTypeRepost#c32279c4 as nil") + } + b.ObjStart() + b.PutID("storyInteractionTypeRepost") + b.Comma() + b.FieldStart("story") + if err := s.Story.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteractionTypeRepost#c32279c4: field story: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryInteractionTypeRepost) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractionTypeRepost#c32279c4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyInteractionTypeRepost"); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeRepost#c32279c4: %w", err) + } + case "story": + if err := s.Story.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyInteractionTypeRepost#c32279c4: field story: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetStory returns value of Story field. +func (s *StoryInteractionTypeRepost) GetStory() (value Story) { + if s == nil { + return + } + return s.Story +} + +// StoryInteractionTypeClassName is schema name of StoryInteractionTypeClass. +const StoryInteractionTypeClassName = "StoryInteractionType" + +// StoryInteractionTypeClass represents StoryInteractionType generic type. +// +// Example: +// +// g, err := tdapi.DecodeStoryInteractionType(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.StoryInteractionTypeView: // storyInteractionTypeView#53e337d0 +// case *tdapi.StoryInteractionTypeForward: // storyInteractionTypeForward#27d23cff +// case *tdapi.StoryInteractionTypeRepost: // storyInteractionTypeRepost#c32279c4 +// default: panic(v) +// } +type StoryInteractionTypeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() StoryInteractionTypeClass + + // 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 +} + +// DecodeStoryInteractionType implements binary de-serialization for StoryInteractionTypeClass. +func DecodeStoryInteractionType(buf *bin.Buffer) (StoryInteractionTypeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case StoryInteractionTypeViewTypeID: + // Decoding storyInteractionTypeView#53e337d0. + v := StoryInteractionTypeView{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + case StoryInteractionTypeForwardTypeID: + // Decoding storyInteractionTypeForward#27d23cff. + v := StoryInteractionTypeForward{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + case StoryInteractionTypeRepostTypeID: + // Decoding storyInteractionTypeRepost#c32279c4. + v := StoryInteractionTypeRepost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONStoryInteractionType implements binary de-serialization for StoryInteractionTypeClass. +func DecodeTDLibJSONStoryInteractionType(buf tdjson.Decoder) (StoryInteractionTypeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "storyInteractionTypeView": + // Decoding storyInteractionTypeView#53e337d0. + v := StoryInteractionTypeView{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + case "storyInteractionTypeForward": + // Decoding storyInteractionTypeForward#27d23cff. + v := StoryInteractionTypeForward{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + case "storyInteractionTypeRepost": + // Decoding storyInteractionTypeRepost#c32279c4. + v := StoryInteractionTypeRepost{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryInteractionTypeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// StoryInteractionType boxes the StoryInteractionTypeClass providing a helper. +type StoryInteractionTypeBox struct { + StoryInteractionType StoryInteractionTypeClass +} + +// Decode implements bin.Decoder for StoryInteractionTypeBox. +func (b *StoryInteractionTypeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode StoryInteractionTypeBox to nil") + } + v, err := DecodeStoryInteractionType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryInteractionType = v + return nil +} + +// Encode implements bin.Encode for StoryInteractionTypeBox. +func (b *StoryInteractionTypeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.StoryInteractionType == nil { + return fmt.Errorf("unable to encode StoryInteractionTypeClass as nil") + } + return b.StoryInteractionType.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for StoryInteractionTypeBox. +func (b *StoryInteractionTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode StoryInteractionTypeBox to nil") + } + v, err := DecodeTDLibJSONStoryInteractionType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryInteractionType = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for StoryInteractionTypeBox. +func (b *StoryInteractionTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.StoryInteractionType == nil { + return fmt.Errorf("unable to encode StoryInteractionTypeClass as nil") + } + return b.StoryInteractionType.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_story_interactions_gen.go b/tdapi/tl_story_interactions_gen.go new file mode 100644 index 0000000000..9944bb73f5 --- /dev/null +++ b/tdapi/tl_story_interactions_gen.go @@ -0,0 +1,357 @@ +// 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{} +) + +// StoryInteractions represents TL type `storyInteractions#f9f5d50f`. +type StoryInteractions struct { + // Approximate total number of interactions found + TotalCount int32 + // Approximate total number of found forwards and reposts; always 0 for chat stories + TotalForwardCount int32 + // Approximate total number of found reactions; always 0 for chat stories + TotalReactionCount int32 + // List of story interactions + Interactions []StoryInteraction + // The offset for the next request. If empty, then there are no more results + NextOffset string +} + +// StoryInteractionsTypeID is TL type id of StoryInteractions. +const StoryInteractionsTypeID = 0xf9f5d50f + +// Ensuring interfaces in compile-time for StoryInteractions. +var ( + _ bin.Encoder = &StoryInteractions{} + _ bin.Decoder = &StoryInteractions{} + _ bin.BareEncoder = &StoryInteractions{} + _ bin.BareDecoder = &StoryInteractions{} +) + +func (s *StoryInteractions) Zero() bool { + if s == nil { + return true + } + if !(s.TotalCount == 0) { + return false + } + if !(s.TotalForwardCount == 0) { + return false + } + if !(s.TotalReactionCount == 0) { + return false + } + if !(s.Interactions == nil) { + return false + } + if !(s.NextOffset == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryInteractions) String() string { + if s == nil { + return "StoryInteractions(nil)" + } + type Alias StoryInteractions + return fmt.Sprintf("StoryInteractions%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryInteractions) TypeID() uint32 { + return StoryInteractionsTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryInteractions) TypeName() string { + return "storyInteractions" +} + +// TypeInfo returns info about TL type. +func (s *StoryInteractions) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyInteractions", + ID: StoryInteractionsTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "TotalCount", + SchemaName: "total_count", + }, + { + Name: "TotalForwardCount", + SchemaName: "total_forward_count", + }, + { + Name: "TotalReactionCount", + SchemaName: "total_reaction_count", + }, + { + Name: "Interactions", + SchemaName: "interactions", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryInteractions) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractions#f9f5d50f as nil") + } + b.PutID(StoryInteractionsTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryInteractions) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractions#f9f5d50f as nil") + } + b.PutInt32(s.TotalCount) + b.PutInt32(s.TotalForwardCount) + b.PutInt32(s.TotalReactionCount) + b.PutInt(len(s.Interactions)) + for idx, v := range s.Interactions { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare storyInteractions#f9f5d50f: field interactions element with index %d: %w", idx, err) + } + } + b.PutString(s.NextOffset) + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryInteractions) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractions#f9f5d50f to nil") + } + if err := b.ConsumeID(StoryInteractionsTypeID); err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryInteractions) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractions#f9f5d50f to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_count: %w", err) + } + s.TotalCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_forward_count: %w", err) + } + s.TotalForwardCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_reaction_count: %w", err) + } + s.TotalReactionCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field interactions: %w", err) + } + + if headerLen > 0 { + s.Interactions = make([]StoryInteraction, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value StoryInteraction + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare storyInteractions#f9f5d50f: field interactions: %w", err) + } + s.Interactions = append(s.Interactions, value) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field next_offset: %w", err) + } + s.NextOffset = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryInteractions) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyInteractions#f9f5d50f as nil") + } + b.ObjStart() + b.PutID("storyInteractions") + b.Comma() + b.FieldStart("total_count") + b.PutInt32(s.TotalCount) + b.Comma() + b.FieldStart("total_forward_count") + b.PutInt32(s.TotalForwardCount) + b.Comma() + b.FieldStart("total_reaction_count") + b.PutInt32(s.TotalReactionCount) + b.Comma() + b.FieldStart("interactions") + b.ArrStart() + for idx, v := range s.Interactions { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyInteractions#f9f5d50f: field interactions element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("next_offset") + b.PutString(s.NextOffset) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryInteractions) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyInteractions#f9f5d50f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyInteractions"); err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: %w", err) + } + case "total_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_count: %w", err) + } + s.TotalCount = value + case "total_forward_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_forward_count: %w", err) + } + s.TotalForwardCount = value + case "total_reaction_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field total_reaction_count: %w", err) + } + s.TotalReactionCount = value + case "interactions": + if err := b.Arr(func(b tdjson.Decoder) error { + var value StoryInteraction + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field interactions: %w", err) + } + s.Interactions = append(s.Interactions, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field interactions: %w", err) + } + case "next_offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storyInteractions#f9f5d50f: field next_offset: %w", err) + } + s.NextOffset = value + default: + return b.Skip() + } + return nil + }) +} + +// GetTotalCount returns value of TotalCount field. +func (s *StoryInteractions) GetTotalCount() (value int32) { + if s == nil { + return + } + return s.TotalCount +} + +// GetTotalForwardCount returns value of TotalForwardCount field. +func (s *StoryInteractions) GetTotalForwardCount() (value int32) { + if s == nil { + return + } + return s.TotalForwardCount +} + +// GetTotalReactionCount returns value of TotalReactionCount field. +func (s *StoryInteractions) GetTotalReactionCount() (value int32) { + if s == nil { + return + } + return s.TotalReactionCount +} + +// GetInteractions returns value of Interactions field. +func (s *StoryInteractions) GetInteractions() (value []StoryInteraction) { + if s == nil { + return + } + return s.Interactions +} + +// GetNextOffset returns value of NextOffset field. +func (s *StoryInteractions) GetNextOffset() (value string) { + if s == nil { + return + } + return s.NextOffset +} diff --git a/tdapi/tl_story_public_forward_gen.go b/tdapi/tl_story_public_forward_gen.go deleted file mode 100644 index fd1ed5e3f3..0000000000 --- a/tdapi/tl_story_public_forward_gen.go +++ /dev/null @@ -1,501 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// StoryPublicForwardMessage represents TL type `storyPublicForwardMessage#fd39c20c`. -type StoryPublicForwardMessage struct { - // Information about the message with the story - Message Message -} - -// StoryPublicForwardMessageTypeID is TL type id of StoryPublicForwardMessage. -const StoryPublicForwardMessageTypeID = 0xfd39c20c - -// construct implements constructor of StoryPublicForwardClass. -func (s StoryPublicForwardMessage) construct() StoryPublicForwardClass { return &s } - -// Ensuring interfaces in compile-time for StoryPublicForwardMessage. -var ( - _ bin.Encoder = &StoryPublicForwardMessage{} - _ bin.Decoder = &StoryPublicForwardMessage{} - _ bin.BareEncoder = &StoryPublicForwardMessage{} - _ bin.BareDecoder = &StoryPublicForwardMessage{} - - _ StoryPublicForwardClass = &StoryPublicForwardMessage{} -) - -func (s *StoryPublicForwardMessage) Zero() bool { - if s == nil { - return true - } - if !(s.Message.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *StoryPublicForwardMessage) String() string { - if s == nil { - return "StoryPublicForwardMessage(nil)" - } - type Alias StoryPublicForwardMessage - return fmt.Sprintf("StoryPublicForwardMessage%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StoryPublicForwardMessage) TypeID() uint32 { - return StoryPublicForwardMessageTypeID -} - -// TypeName returns name of type in TL schema. -func (*StoryPublicForwardMessage) TypeName() string { - return "storyPublicForwardMessage" -} - -// TypeInfo returns info about TL type. -func (s *StoryPublicForwardMessage) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "storyPublicForwardMessage", - ID: StoryPublicForwardMessageTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Message", - SchemaName: "message", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *StoryPublicForwardMessage) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardMessage#fd39c20c as nil") - } - b.PutID(StoryPublicForwardMessageTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *StoryPublicForwardMessage) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardMessage#fd39c20c as nil") - } - if err := s.Message.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyPublicForwardMessage#fd39c20c: field message: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (s *StoryPublicForwardMessage) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardMessage#fd39c20c to nil") - } - if err := b.ConsumeID(StoryPublicForwardMessageTypeID); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardMessage#fd39c20c: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *StoryPublicForwardMessage) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardMessage#fd39c20c to nil") - } - { - if err := s.Message.Decode(b); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardMessage#fd39c20c: field message: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StoryPublicForwardMessage) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardMessage#fd39c20c as nil") - } - b.ObjStart() - b.PutID("storyPublicForwardMessage") - b.Comma() - b.FieldStart("message") - if err := s.Message.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyPublicForwardMessage#fd39c20c: field message: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StoryPublicForwardMessage) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardMessage#fd39c20c to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("storyPublicForwardMessage"); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardMessage#fd39c20c: %w", err) - } - case "message": - if err := s.Message.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardMessage#fd39c20c: field message: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetMessage returns value of Message field. -func (s *StoryPublicForwardMessage) GetMessage() (value Message) { - if s == nil { - return - } - return s.Message -} - -// StoryPublicForwardStory represents TL type `storyPublicForwardStory#f7e6c146`. -type StoryPublicForwardStory struct { - // Information about the reposted story - Story Story -} - -// StoryPublicForwardStoryTypeID is TL type id of StoryPublicForwardStory. -const StoryPublicForwardStoryTypeID = 0xf7e6c146 - -// construct implements constructor of StoryPublicForwardClass. -func (s StoryPublicForwardStory) construct() StoryPublicForwardClass { return &s } - -// Ensuring interfaces in compile-time for StoryPublicForwardStory. -var ( - _ bin.Encoder = &StoryPublicForwardStory{} - _ bin.Decoder = &StoryPublicForwardStory{} - _ bin.BareEncoder = &StoryPublicForwardStory{} - _ bin.BareDecoder = &StoryPublicForwardStory{} - - _ StoryPublicForwardClass = &StoryPublicForwardStory{} -) - -func (s *StoryPublicForwardStory) Zero() bool { - if s == nil { - return true - } - if !(s.Story.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *StoryPublicForwardStory) String() string { - if s == nil { - return "StoryPublicForwardStory(nil)" - } - type Alias StoryPublicForwardStory - return fmt.Sprintf("StoryPublicForwardStory%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StoryPublicForwardStory) TypeID() uint32 { - return StoryPublicForwardStoryTypeID -} - -// TypeName returns name of type in TL schema. -func (*StoryPublicForwardStory) TypeName() string { - return "storyPublicForwardStory" -} - -// TypeInfo returns info about TL type. -func (s *StoryPublicForwardStory) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "storyPublicForwardStory", - ID: StoryPublicForwardStoryTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Story", - SchemaName: "story", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *StoryPublicForwardStory) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardStory#f7e6c146 as nil") - } - b.PutID(StoryPublicForwardStoryTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *StoryPublicForwardStory) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardStory#f7e6c146 as nil") - } - if err := s.Story.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyPublicForwardStory#f7e6c146: field story: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (s *StoryPublicForwardStory) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardStory#f7e6c146 to nil") - } - if err := b.ConsumeID(StoryPublicForwardStoryTypeID); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardStory#f7e6c146: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *StoryPublicForwardStory) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardStory#f7e6c146 to nil") - } - { - if err := s.Story.Decode(b); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardStory#f7e6c146: field story: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StoryPublicForwardStory) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwardStory#f7e6c146 as nil") - } - b.ObjStart() - b.PutID("storyPublicForwardStory") - b.Comma() - b.FieldStart("story") - if err := s.Story.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyPublicForwardStory#f7e6c146: field story: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StoryPublicForwardStory) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwardStory#f7e6c146 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("storyPublicForwardStory"); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardStory#f7e6c146: %w", err) - } - case "story": - if err := s.Story.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode storyPublicForwardStory#f7e6c146: field story: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetStory returns value of Story field. -func (s *StoryPublicForwardStory) GetStory() (value Story) { - if s == nil { - return - } - return s.Story -} - -// StoryPublicForwardClassName is schema name of StoryPublicForwardClass. -const StoryPublicForwardClassName = "StoryPublicForward" - -// StoryPublicForwardClass represents StoryPublicForward generic type. -// -// Example: -// -// g, err := tdapi.DecodeStoryPublicForward(buf) -// if err != nil { -// panic(err) -// } -// switch v := g.(type) { -// case *tdapi.StoryPublicForwardMessage: // storyPublicForwardMessage#fd39c20c -// case *tdapi.StoryPublicForwardStory: // storyPublicForwardStory#f7e6c146 -// default: panic(v) -// } -type StoryPublicForwardClass interface { - bin.Encoder - bin.Decoder - bin.BareEncoder - bin.BareDecoder - construct() StoryPublicForwardClass - - // 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 -} - -// DecodeStoryPublicForward implements binary de-serialization for StoryPublicForwardClass. -func DecodeStoryPublicForward(buf *bin.Buffer) (StoryPublicForwardClass, error) { - id, err := buf.PeekID() - if err != nil { - return nil, err - } - switch id { - case StoryPublicForwardMessageTypeID: - // Decoding storyPublicForwardMessage#fd39c20c. - v := StoryPublicForwardMessage{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", err) - } - return &v, nil - case StoryPublicForwardStoryTypeID: - // Decoding storyPublicForwardStory#f7e6c146. - v := StoryPublicForwardStory{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", bin.NewUnexpectedID(id)) - } -} - -// DecodeTDLibJSONStoryPublicForward implements binary de-serialization for StoryPublicForwardClass. -func DecodeTDLibJSONStoryPublicForward(buf tdjson.Decoder) (StoryPublicForwardClass, error) { - id, err := buf.FindTypeID() - if err != nil { - return nil, err - } - switch id { - case "storyPublicForwardMessage": - // Decoding storyPublicForwardMessage#fd39c20c. - v := StoryPublicForwardMessage{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", err) - } - return &v, nil - case "storyPublicForwardStory": - // Decoding storyPublicForwardStory#f7e6c146. - v := StoryPublicForwardStory{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode StoryPublicForwardClass: %w", tdjson.NewUnexpectedID(id)) - } -} - -// StoryPublicForward boxes the StoryPublicForwardClass providing a helper. -type StoryPublicForwardBox struct { - StoryPublicForward StoryPublicForwardClass -} - -// Decode implements bin.Decoder for StoryPublicForwardBox. -func (b *StoryPublicForwardBox) Decode(buf *bin.Buffer) error { - if b == nil { - return fmt.Errorf("unable to decode StoryPublicForwardBox to nil") - } - v, err := DecodeStoryPublicForward(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.StoryPublicForward = v - return nil -} - -// Encode implements bin.Encode for StoryPublicForwardBox. -func (b *StoryPublicForwardBox) Encode(buf *bin.Buffer) error { - if b == nil || b.StoryPublicForward == nil { - return fmt.Errorf("unable to encode StoryPublicForwardClass as nil") - } - return b.StoryPublicForward.Encode(buf) -} - -// DecodeTDLibJSON implements bin.Decoder for StoryPublicForwardBox. -func (b *StoryPublicForwardBox) DecodeTDLibJSON(buf tdjson.Decoder) error { - if b == nil { - return fmt.Errorf("unable to decode StoryPublicForwardBox to nil") - } - v, err := DecodeTDLibJSONStoryPublicForward(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.StoryPublicForward = v - return nil -} - -// EncodeTDLibJSON implements bin.Encode for StoryPublicForwardBox. -func (b *StoryPublicForwardBox) EncodeTDLibJSON(buf tdjson.Encoder) error { - if b == nil || b.StoryPublicForward == nil { - return fmt.Errorf("unable to encode StoryPublicForwardClass as nil") - } - return b.StoryPublicForward.EncodeTDLibJSON(buf) -} diff --git a/tdapi/tl_story_public_forwards_gen.go b/tdapi/tl_story_public_forwards_gen.go deleted file mode 100644 index 415d34e5d2..0000000000 --- a/tdapi/tl_story_public_forwards_gen.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// StoryPublicForwards represents TL type `storyPublicForwards#fcacb389`. -type StoryPublicForwards struct { - // Approximate total number of messages and stories found - TotalCount int32 - // List of found public forwards and reposts - Forwards []StoryPublicForwardClass - // The offset for the next request. If empty, then there are no more results - NextOffset string -} - -// StoryPublicForwardsTypeID is TL type id of StoryPublicForwards. -const StoryPublicForwardsTypeID = 0xfcacb389 - -// Ensuring interfaces in compile-time for StoryPublicForwards. -var ( - _ bin.Encoder = &StoryPublicForwards{} - _ bin.Decoder = &StoryPublicForwards{} - _ bin.BareEncoder = &StoryPublicForwards{} - _ bin.BareDecoder = &StoryPublicForwards{} -) - -func (s *StoryPublicForwards) Zero() bool { - if s == nil { - return true - } - if !(s.TotalCount == 0) { - return false - } - if !(s.Forwards == nil) { - return false - } - if !(s.NextOffset == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *StoryPublicForwards) String() string { - if s == nil { - return "StoryPublicForwards(nil)" - } - type Alias StoryPublicForwards - return fmt.Sprintf("StoryPublicForwards%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StoryPublicForwards) TypeID() uint32 { - return StoryPublicForwardsTypeID -} - -// TypeName returns name of type in TL schema. -func (*StoryPublicForwards) TypeName() string { - return "storyPublicForwards" -} - -// TypeInfo returns info about TL type. -func (s *StoryPublicForwards) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "storyPublicForwards", - ID: StoryPublicForwardsTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "TotalCount", - SchemaName: "total_count", - }, - { - Name: "Forwards", - SchemaName: "forwards", - }, - { - Name: "NextOffset", - SchemaName: "next_offset", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *StoryPublicForwards) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwards#fcacb389 as nil") - } - b.PutID(StoryPublicForwardsTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *StoryPublicForwards) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwards#fcacb389 as nil") - } - b.PutInt32(s.TotalCount) - b.PutInt(len(s.Forwards)) - for idx, v := range s.Forwards { - if v == nil { - return fmt.Errorf("unable to encode storyPublicForwards#fcacb389: field forwards element with index %d is nil", idx) - } - if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare storyPublicForwards#fcacb389: field forwards element with index %d: %w", idx, err) - } - } - b.PutString(s.NextOffset) - return nil -} - -// Decode implements bin.Decoder. -func (s *StoryPublicForwards) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwards#fcacb389 to nil") - } - if err := b.ConsumeID(StoryPublicForwardsTypeID); err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *StoryPublicForwards) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwards#fcacb389 to nil") - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field total_count: %w", err) - } - s.TotalCount = value - } - { - headerLen, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field forwards: %w", err) - } - - if headerLen > 0 { - s.Forwards = make([]StoryPublicForwardClass, 0, headerLen%bin.PreallocateLimit) - } - for idx := 0; idx < headerLen; idx++ { - value, err := DecodeStoryPublicForward(b) - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field forwards: %w", err) - } - s.Forwards = append(s.Forwards, value) - } - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field next_offset: %w", err) - } - s.NextOffset = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StoryPublicForwards) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode storyPublicForwards#fcacb389 as nil") - } - b.ObjStart() - b.PutID("storyPublicForwards") - b.Comma() - b.FieldStart("total_count") - b.PutInt32(s.TotalCount) - b.Comma() - b.FieldStart("forwards") - b.ArrStart() - for idx, v := range s.Forwards { - if v == nil { - return fmt.Errorf("unable to encode storyPublicForwards#fcacb389: field forwards element with index %d is nil", idx) - } - if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyPublicForwards#fcacb389: field forwards element with index %d: %w", idx, err) - } - b.Comma() - } - b.StripComma() - b.ArrEnd() - b.Comma() - b.FieldStart("next_offset") - b.PutString(s.NextOffset) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StoryPublicForwards) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode storyPublicForwards#fcacb389 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("storyPublicForwards"); err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: %w", err) - } - case "total_count": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field total_count: %w", err) - } - s.TotalCount = value - case "forwards": - if err := b.Arr(func(b tdjson.Decoder) error { - value, err := DecodeTDLibJSONStoryPublicForward(b) - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field forwards: %w", err) - } - s.Forwards = append(s.Forwards, value) - return nil - }); err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field forwards: %w", err) - } - case "next_offset": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode storyPublicForwards#fcacb389: field next_offset: %w", err) - } - s.NextOffset = value - default: - return b.Skip() - } - return nil - }) -} - -// GetTotalCount returns value of TotalCount field. -func (s *StoryPublicForwards) GetTotalCount() (value int32) { - if s == nil { - return - } - return s.TotalCount -} - -// GetForwards returns value of Forwards field. -func (s *StoryPublicForwards) GetForwards() (value []StoryPublicForwardClass) { - if s == nil { - return - } - return s.Forwards -} - -// GetNextOffset returns value of NextOffset field. -func (s *StoryPublicForwards) GetNextOffset() (value string) { - if s == nil { - return - } - return s.NextOffset -} diff --git a/tdapi/tl_story_viewer_gen.go b/tdapi/tl_story_viewer_gen.go deleted file mode 100644 index 499f10cd8a..0000000000 --- a/tdapi/tl_story_viewer_gen.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// StoryViewer represents TL type `storyViewer#cf0fb132`. -type StoryViewer struct { - // User identifier of the viewer - UserID int64 - // Approximate point in time (Unix timestamp) when the story was viewed - ViewDate int32 - // Block list to which the user is added; may be null if none - BlockList BlockListClass - // Type of the reaction that was chosen by the user; may be null if none - ChosenReactionType ReactionTypeClass -} - -// StoryViewerTypeID is TL type id of StoryViewer. -const StoryViewerTypeID = 0xcf0fb132 - -// Ensuring interfaces in compile-time for StoryViewer. -var ( - _ bin.Encoder = &StoryViewer{} - _ bin.Decoder = &StoryViewer{} - _ bin.BareEncoder = &StoryViewer{} - _ bin.BareDecoder = &StoryViewer{} -) - -func (s *StoryViewer) Zero() bool { - if s == nil { - return true - } - if !(s.UserID == 0) { - return false - } - if !(s.ViewDate == 0) { - return false - } - if !(s.BlockList == nil) { - return false - } - if !(s.ChosenReactionType == nil) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *StoryViewer) String() string { - if s == nil { - return "StoryViewer(nil)" - } - type Alias StoryViewer - return fmt.Sprintf("StoryViewer%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StoryViewer) TypeID() uint32 { - return StoryViewerTypeID -} - -// TypeName returns name of type in TL schema. -func (*StoryViewer) TypeName() string { - return "storyViewer" -} - -// TypeInfo returns info about TL type. -func (s *StoryViewer) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "storyViewer", - ID: StoryViewerTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "UserID", - SchemaName: "user_id", - }, - { - Name: "ViewDate", - SchemaName: "view_date", - }, - { - Name: "BlockList", - SchemaName: "block_list", - }, - { - Name: "ChosenReactionType", - SchemaName: "chosen_reaction_type", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *StoryViewer) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") - } - b.PutID(StoryViewerTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *StoryViewer) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") - } - b.PutInt53(s.UserID) - b.PutInt32(s.ViewDate) - if s.BlockList == nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list is nil") - } - if err := s.BlockList.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list: %w", err) - } - if s.ChosenReactionType == nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type is nil") - } - if err := s.ChosenReactionType.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (s *StoryViewer) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") - } - if err := b.ConsumeID(StoryViewerTypeID); err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *StoryViewer) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field user_id: %w", err) - } - s.UserID = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field view_date: %w", err) - } - s.ViewDate = value - } - { - value, err := DecodeBlockList(b) - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field block_list: %w", err) - } - s.BlockList = value - } - { - value, err := DecodeReactionType(b) - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) - } - s.ChosenReactionType = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StoryViewer) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") - } - b.ObjStart() - b.PutID("storyViewer") - b.Comma() - b.FieldStart("user_id") - b.PutInt53(s.UserID) - b.Comma() - b.FieldStart("view_date") - b.PutInt32(s.ViewDate) - b.Comma() - b.FieldStart("block_list") - if s.BlockList == nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list is nil") - } - if err := s.BlockList.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list: %w", err) - } - b.Comma() - b.FieldStart("chosen_reaction_type") - if s.ChosenReactionType == nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type is nil") - } - if err := s.ChosenReactionType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StoryViewer) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("storyViewer"); err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: %w", err) - } - case "user_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field user_id: %w", err) - } - s.UserID = value - case "view_date": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field view_date: %w", err) - } - s.ViewDate = value - case "block_list": - value, err := DecodeTDLibJSONBlockList(b) - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field block_list: %w", err) - } - s.BlockList = value - case "chosen_reaction_type": - value, err := DecodeTDLibJSONReactionType(b) - if err != nil { - return fmt.Errorf("unable to decode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) - } - s.ChosenReactionType = value - default: - return b.Skip() - } - return nil - }) -} - -// GetUserID returns value of UserID field. -func (s *StoryViewer) GetUserID() (value int64) { - if s == nil { - return - } - return s.UserID -} - -// GetViewDate returns value of ViewDate field. -func (s *StoryViewer) GetViewDate() (value int32) { - if s == nil { - return - } - return s.ViewDate -} - -// GetBlockList returns value of BlockList field. -func (s *StoryViewer) GetBlockList() (value BlockListClass) { - if s == nil { - return - } - return s.BlockList -} - -// GetChosenReactionType returns value of ChosenReactionType field. -func (s *StoryViewer) GetChosenReactionType() (value ReactionTypeClass) { - if s == nil { - return - } - return s.ChosenReactionType -} diff --git a/tdapi/tl_story_viewers_gen.go b/tdapi/tl_story_viewers_gen.go deleted file mode 100644 index 21ee3a6c35..0000000000 --- a/tdapi/tl_story_viewers_gen.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// StoryViewers represents TL type `storyViewers#9ae27d98`. -type StoryViewers struct { - // Approximate total number of story viewers found - TotalCount int32 - // Approximate total number of reactions set by found story viewers - TotalReactionCount int32 - // List of story viewers - Viewers []StoryViewer - // The offset for the next request. If empty, then there are no more results - NextOffset string -} - -// StoryViewersTypeID is TL type id of StoryViewers. -const StoryViewersTypeID = 0x9ae27d98 - -// Ensuring interfaces in compile-time for StoryViewers. -var ( - _ bin.Encoder = &StoryViewers{} - _ bin.Decoder = &StoryViewers{} - _ bin.BareEncoder = &StoryViewers{} - _ bin.BareDecoder = &StoryViewers{} -) - -func (s *StoryViewers) Zero() bool { - if s == nil { - return true - } - if !(s.TotalCount == 0) { - return false - } - if !(s.TotalReactionCount == 0) { - return false - } - if !(s.Viewers == nil) { - return false - } - if !(s.NextOffset == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (s *StoryViewers) String() string { - if s == nil { - return "StoryViewers(nil)" - } - type Alias StoryViewers - return fmt.Sprintf("StoryViewers%+v", Alias(*s)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StoryViewers) TypeID() uint32 { - return StoryViewersTypeID -} - -// TypeName returns name of type in TL schema. -func (*StoryViewers) TypeName() string { - return "storyViewers" -} - -// TypeInfo returns info about TL type. -func (s *StoryViewers) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "storyViewers", - ID: StoryViewersTypeID, - } - if s == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "TotalCount", - SchemaName: "total_count", - }, - { - Name: "TotalReactionCount", - SchemaName: "total_reaction_count", - }, - { - Name: "Viewers", - SchemaName: "viewers", - }, - { - Name: "NextOffset", - SchemaName: "next_offset", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (s *StoryViewers) Encode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyViewers#9ae27d98 as nil") - } - b.PutID(StoryViewersTypeID) - return s.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (s *StoryViewers) EncodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't encode storyViewers#9ae27d98 as nil") - } - b.PutInt32(s.TotalCount) - b.PutInt32(s.TotalReactionCount) - b.PutInt(len(s.Viewers)) - for idx, v := range s.Viewers { - if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare storyViewers#9ae27d98: field viewers element with index %d: %w", idx, err) - } - } - b.PutString(s.NextOffset) - return nil -} - -// Decode implements bin.Decoder. -func (s *StoryViewers) Decode(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyViewers#9ae27d98 to nil") - } - if err := b.ConsumeID(StoryViewersTypeID); err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: %w", err) - } - return s.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (s *StoryViewers) DecodeBare(b *bin.Buffer) error { - if s == nil { - return fmt.Errorf("can't decode storyViewers#9ae27d98 to nil") - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field total_count: %w", err) - } - s.TotalCount = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field total_reaction_count: %w", err) - } - s.TotalReactionCount = value - } - { - headerLen, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field viewers: %w", err) - } - - if headerLen > 0 { - s.Viewers = make([]StoryViewer, 0, headerLen%bin.PreallocateLimit) - } - for idx := 0; idx < headerLen; idx++ { - var value StoryViewer - if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare storyViewers#9ae27d98: field viewers: %w", err) - } - s.Viewers = append(s.Viewers, value) - } - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field next_offset: %w", err) - } - s.NextOffset = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StoryViewers) EncodeTDLibJSON(b tdjson.Encoder) error { - if s == nil { - return fmt.Errorf("can't encode storyViewers#9ae27d98 as nil") - } - b.ObjStart() - b.PutID("storyViewers") - b.Comma() - b.FieldStart("total_count") - b.PutInt32(s.TotalCount) - b.Comma() - b.FieldStart("total_reaction_count") - b.PutInt32(s.TotalReactionCount) - b.Comma() - b.FieldStart("viewers") - b.ArrStart() - for idx, v := range s.Viewers { - if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode storyViewers#9ae27d98: field viewers element with index %d: %w", idx, err) - } - b.Comma() - } - b.StripComma() - b.ArrEnd() - b.Comma() - b.FieldStart("next_offset") - b.PutString(s.NextOffset) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StoryViewers) DecodeTDLibJSON(b tdjson.Decoder) error { - if s == nil { - return fmt.Errorf("can't decode storyViewers#9ae27d98 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("storyViewers"); err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: %w", err) - } - case "total_count": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field total_count: %w", err) - } - s.TotalCount = value - case "total_reaction_count": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field total_reaction_count: %w", err) - } - s.TotalReactionCount = value - case "viewers": - if err := b.Arr(func(b tdjson.Decoder) error { - var value StoryViewer - if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field viewers: %w", err) - } - s.Viewers = append(s.Viewers, value) - return nil - }); err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field viewers: %w", err) - } - case "next_offset": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode storyViewers#9ae27d98: field next_offset: %w", err) - } - s.NextOffset = value - default: - return b.Skip() - } - return nil - }) -} - -// GetTotalCount returns value of TotalCount field. -func (s *StoryViewers) GetTotalCount() (value int32) { - if s == nil { - return - } - return s.TotalCount -} - -// GetTotalReactionCount returns value of TotalReactionCount field. -func (s *StoryViewers) GetTotalReactionCount() (value int32) { - if s == nil { - return - } - return s.TotalReactionCount -} - -// GetViewers returns value of Viewers field. -func (s *StoryViewers) GetViewers() (value []StoryViewer) { - if s == nil { - return - } - return s.Viewers -} - -// GetNextOffset returns value of NextOffset field. -func (s *StoryViewers) GetNextOffset() (value string) { - if s == nil { - return - } - return s.NextOffset -} diff --git a/tdapi/tl_suggested_action_gen.go b/tdapi/tl_suggested_action_gen.go index 784ba43dd9..deee9c1e91 100644 --- a/tdapi/tl_suggested_action_gen.go +++ b/tdapi/tl_suggested_action_gen.go @@ -1281,6 +1281,137 @@ func (s *SuggestedActionSubscribeToAnnualPremium) DecodeTDLibJSON(b tdjson.Decod }) } +// SuggestedActionGiftPremiumForChristmas represents TL type `suggestedActionGiftPremiumForChristmas#93b3ee6f`. +type SuggestedActionGiftPremiumForChristmas struct { +} + +// SuggestedActionGiftPremiumForChristmasTypeID is TL type id of SuggestedActionGiftPremiumForChristmas. +const SuggestedActionGiftPremiumForChristmasTypeID = 0x93b3ee6f + +// construct implements constructor of SuggestedActionClass. +func (s SuggestedActionGiftPremiumForChristmas) construct() SuggestedActionClass { return &s } + +// Ensuring interfaces in compile-time for SuggestedActionGiftPremiumForChristmas. +var ( + _ bin.Encoder = &SuggestedActionGiftPremiumForChristmas{} + _ bin.Decoder = &SuggestedActionGiftPremiumForChristmas{} + _ bin.BareEncoder = &SuggestedActionGiftPremiumForChristmas{} + _ bin.BareDecoder = &SuggestedActionGiftPremiumForChristmas{} + + _ SuggestedActionClass = &SuggestedActionGiftPremiumForChristmas{} +) + +func (s *SuggestedActionGiftPremiumForChristmas) Zero() bool { + if s == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (s *SuggestedActionGiftPremiumForChristmas) String() string { + if s == nil { + return "SuggestedActionGiftPremiumForChristmas(nil)" + } + type Alias SuggestedActionGiftPremiumForChristmas + return fmt.Sprintf("SuggestedActionGiftPremiumForChristmas%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SuggestedActionGiftPremiumForChristmas) TypeID() uint32 { + return SuggestedActionGiftPremiumForChristmasTypeID +} + +// TypeName returns name of type in TL schema. +func (*SuggestedActionGiftPremiumForChristmas) TypeName() string { + return "suggestedActionGiftPremiumForChristmas" +} + +// TypeInfo returns info about TL type. +func (s *SuggestedActionGiftPremiumForChristmas) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "suggestedActionGiftPremiumForChristmas", + ID: SuggestedActionGiftPremiumForChristmasTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (s *SuggestedActionGiftPremiumForChristmas) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode suggestedActionGiftPremiumForChristmas#93b3ee6f as nil") + } + b.PutID(SuggestedActionGiftPremiumForChristmasTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SuggestedActionGiftPremiumForChristmas) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode suggestedActionGiftPremiumForChristmas#93b3ee6f as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SuggestedActionGiftPremiumForChristmas) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode suggestedActionGiftPremiumForChristmas#93b3ee6f to nil") + } + if err := b.ConsumeID(SuggestedActionGiftPremiumForChristmasTypeID); err != nil { + return fmt.Errorf("unable to decode suggestedActionGiftPremiumForChristmas#93b3ee6f: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SuggestedActionGiftPremiumForChristmas) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode suggestedActionGiftPremiumForChristmas#93b3ee6f to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SuggestedActionGiftPremiumForChristmas) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode suggestedActionGiftPremiumForChristmas#93b3ee6f as nil") + } + b.ObjStart() + b.PutID("suggestedActionGiftPremiumForChristmas") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SuggestedActionGiftPremiumForChristmas) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode suggestedActionGiftPremiumForChristmas#93b3ee6f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("suggestedActionGiftPremiumForChristmas"); err != nil { + return fmt.Errorf("unable to decode suggestedActionGiftPremiumForChristmas#93b3ee6f: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // SuggestedActionClassName is schema name of SuggestedActionClass. const SuggestedActionClassName = "SuggestedAction" @@ -1302,6 +1433,7 @@ const SuggestedActionClassName = "SuggestedAction" // case *tdapi.SuggestedActionUpgradePremium: // suggestedActionUpgradePremium#70aa79fb // case *tdapi.SuggestedActionRestorePremium: // suggestedActionRestorePremium#e909dd64 // case *tdapi.SuggestedActionSubscribeToAnnualPremium: // suggestedActionSubscribeToAnnualPremium#164978bb +// case *tdapi.SuggestedActionGiftPremiumForChristmas: // suggestedActionGiftPremiumForChristmas#93b3ee6f // default: panic(v) // } type SuggestedActionClass interface { @@ -1396,6 +1528,13 @@ func DecodeSuggestedAction(buf *bin.Buffer) (SuggestedActionClass, error) { return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", err) } return &v, nil + case SuggestedActionGiftPremiumForChristmasTypeID: + // Decoding suggestedActionGiftPremiumForChristmas#93b3ee6f. + v := SuggestedActionGiftPremiumForChristmas{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", bin.NewUnexpectedID(id)) } @@ -1471,6 +1610,13 @@ func DecodeTDLibJSONSuggestedAction(buf tdjson.Decoder) (SuggestedActionClass, e return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", err) } return &v, nil + case "suggestedActionGiftPremiumForChristmas": + // Decoding suggestedActionGiftPremiumForChristmas#93b3ee6f. + v := SuggestedActionGiftPremiumForChristmas{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode SuggestedActionClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_supergroup_gen.go b/tdapi/tl_supergroup_gen.go index 50583bd24d..064796a723 100644 --- a/tdapi/tl_supergroup_gen.go +++ b/tdapi/tl_supergroup_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Supergroup represents TL type `supergroup#8b30b3c5`. +// Supergroup represents TL type `supergroup#39a14289`. type Supergroup struct { // Supergroup or channel identifier ID int64 @@ -46,6 +46,8 @@ type Supergroup struct { // Number of members in the supergroup or channel; 0 if unknown. Currently, it is // guaranteed to be known only if the supergroup or channel was received through MemberCount int32 + // Approximate boost level for the chat + BoostLevel int32 // True, if the channel has a discussion group, or the supergroup is the designated // discussion group for a channel HasLinkedChat bool @@ -87,7 +89,7 @@ type Supergroup struct { } // SupergroupTypeID is TL type id of Supergroup. -const SupergroupTypeID = 0x8b30b3c5 +const SupergroupTypeID = 0x39a14289 // Ensuring interfaces in compile-time for Supergroup. var ( @@ -116,6 +118,9 @@ func (s *Supergroup) Zero() bool { if !(s.MemberCount == 0) { return false } + if !(s.BoostLevel == 0) { + return false + } if !(s.HasLinkedChat == false) { return false } @@ -217,6 +222,10 @@ func (s *Supergroup) TypeInfo() tdp.Type { Name: "MemberCount", SchemaName: "member_count", }, + { + Name: "BoostLevel", + SchemaName: "boost_level", + }, { Name: "HasLinkedChat", SchemaName: "has_linked_chat", @@ -284,7 +293,7 @@ func (s *Supergroup) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *Supergroup) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode supergroup#8b30b3c5 as nil") + return fmt.Errorf("can't encode supergroup#39a14289 as nil") } b.PutID(SupergroupTypeID) return s.EncodeBare(b) @@ -293,20 +302,21 @@ func (s *Supergroup) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *Supergroup) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode supergroup#8b30b3c5 as nil") + return fmt.Errorf("can't encode supergroup#39a14289 as nil") } b.PutInt53(s.ID) if err := s.Usernames.Encode(b); err != nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field usernames: %w", err) + return fmt.Errorf("unable to encode supergroup#39a14289: field usernames: %w", err) } b.PutInt32(s.Date) if s.Status == nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field status is nil") + return fmt.Errorf("unable to encode supergroup#39a14289: field status is nil") } if err := s.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field status: %w", err) + return fmt.Errorf("unable to encode supergroup#39a14289: field status: %w", err) } b.PutInt32(s.MemberCount) + b.PutInt32(s.BoostLevel) b.PutBool(s.HasLinkedChat) b.PutBool(s.HasLocation) b.PutBool(s.SignMessages) @@ -328,10 +338,10 @@ func (s *Supergroup) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *Supergroup) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode supergroup#8b30b3c5 to nil") + return fmt.Errorf("can't decode supergroup#39a14289 to nil") } if err := b.ConsumeID(SupergroupTypeID); err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: %w", err) } return s.DecodeBare(b) } @@ -339,143 +349,150 @@ func (s *Supergroup) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *Supergroup) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode supergroup#8b30b3c5 to nil") + return fmt.Errorf("can't decode supergroup#39a14289 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field id: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field id: %w", err) } s.ID = value } { if err := s.Usernames.Decode(b); err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field usernames: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field usernames: %w", err) } } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field date: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field date: %w", err) } s.Date = value } { value, err := DecodeChatMemberStatus(b) if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field status: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field status: %w", err) } s.Status = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field member_count: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field member_count: %w", err) } s.MemberCount = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode supergroup#39a14289: field boost_level: %w", err) + } + s.BoostLevel = value + } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_linked_chat: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_linked_chat: %w", err) } s.HasLinkedChat = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_location: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_location: %w", err) } s.HasLocation = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field sign_messages: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field sign_messages: %w", err) } s.SignMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field join_to_send_messages: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field join_to_send_messages: %w", err) } s.JoinToSendMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field join_by_request: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field join_by_request: %w", err) } s.JoinByRequest = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_slow_mode_enabled: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_slow_mode_enabled: %w", err) } s.IsSlowModeEnabled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_channel: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_channel: %w", err) } s.IsChannel = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_broadcast_group: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_broadcast_group: %w", err) } s.IsBroadcastGroup = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_forum: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_forum: %w", err) } s.IsForum = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_verified: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_verified: %w", err) } s.IsVerified = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field restriction_reason: %w", err) } s.RestrictionReason = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_scam: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_scam: %w", err) } s.IsScam = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_fake: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_fake: %w", err) } s.IsFake = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_active_stories: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_active_stories: %w", err) } s.HasActiveStories = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_unread_active_stories: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_unread_active_stories: %w", err) } s.HasUnreadActiveStories = value } @@ -485,7 +502,7 @@ func (s *Supergroup) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *Supergroup) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode supergroup#8b30b3c5 as nil") + return fmt.Errorf("can't encode supergroup#39a14289 as nil") } b.ObjStart() b.PutID("supergroup") @@ -495,7 +512,7 @@ func (s *Supergroup) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("usernames") if err := s.Usernames.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field usernames: %w", err) + return fmt.Errorf("unable to encode supergroup#39a14289: field usernames: %w", err) } b.Comma() b.FieldStart("date") @@ -503,15 +520,18 @@ func (s *Supergroup) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("status") if s.Status == nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field status is nil") + return fmt.Errorf("unable to encode supergroup#39a14289: field status is nil") } if err := s.Status.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroup#8b30b3c5: field status: %w", err) + return fmt.Errorf("unable to encode supergroup#39a14289: field status: %w", err) } b.Comma() b.FieldStart("member_count") b.PutInt32(s.MemberCount) b.Comma() + b.FieldStart("boost_level") + b.PutInt32(s.BoostLevel) + b.Comma() b.FieldStart("has_linked_chat") b.PutBool(s.HasLinkedChat) b.Comma() @@ -565,131 +585,137 @@ func (s *Supergroup) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *Supergroup) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode supergroup#8b30b3c5 to nil") + return fmt.Errorf("can't decode supergroup#39a14289 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("supergroup"); err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field id: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field id: %w", err) } s.ID = value case "usernames": if err := s.Usernames.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field usernames: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field usernames: %w", err) } case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field date: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field date: %w", err) } s.Date = value case "status": value, err := DecodeTDLibJSONChatMemberStatus(b) if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field status: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field status: %w", err) } s.Status = value case "member_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field member_count: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field member_count: %w", err) } s.MemberCount = value + case "boost_level": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode supergroup#39a14289: field boost_level: %w", err) + } + s.BoostLevel = value case "has_linked_chat": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_linked_chat: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_linked_chat: %w", err) } s.HasLinkedChat = value case "has_location": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_location: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_location: %w", err) } s.HasLocation = value case "sign_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field sign_messages: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field sign_messages: %w", err) } s.SignMessages = value case "join_to_send_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field join_to_send_messages: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field join_to_send_messages: %w", err) } s.JoinToSendMessages = value case "join_by_request": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field join_by_request: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field join_by_request: %w", err) } s.JoinByRequest = value case "is_slow_mode_enabled": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_slow_mode_enabled: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_slow_mode_enabled: %w", err) } s.IsSlowModeEnabled = value case "is_channel": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_channel: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_channel: %w", err) } s.IsChannel = value case "is_broadcast_group": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_broadcast_group: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_broadcast_group: %w", err) } s.IsBroadcastGroup = value case "is_forum": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_forum: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_forum: %w", err) } s.IsForum = value case "is_verified": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_verified: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_verified: %w", err) } s.IsVerified = value case "restriction_reason": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field restriction_reason: %w", err) } s.RestrictionReason = value case "is_scam": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_scam: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_scam: %w", err) } s.IsScam = value case "is_fake": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field is_fake: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field is_fake: %w", err) } s.IsFake = value case "has_active_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_active_stories: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_active_stories: %w", err) } s.HasActiveStories = value case "has_unread_active_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroup#8b30b3c5: field has_unread_active_stories: %w", err) + return fmt.Errorf("unable to decode supergroup#39a14289: field has_unread_active_stories: %w", err) } s.HasUnreadActiveStories = value default: @@ -739,6 +765,14 @@ func (s *Supergroup) GetMemberCount() (value int32) { return s.MemberCount } +// GetBoostLevel returns value of BoostLevel field. +func (s *Supergroup) GetBoostLevel() (value int32) { + if s == nil { + return + } + return s.BoostLevel +} + // GetHasLinkedChat returns value of HasLinkedChat field. func (s *Supergroup) GetHasLinkedChat() (value bool) { if s == nil { diff --git a/tdapi/tl_telegram_payment_purpose_gen.go b/tdapi/tl_telegram_payment_purpose_gen.go index 8c9406b4fd..c3a8636a7c 100644 --- a/tdapi/tl_telegram_payment_purpose_gen.go +++ b/tdapi/tl_telegram_payment_purpose_gen.go @@ -42,7 +42,7 @@ type TelegramPaymentPurposePremiumGiftCodes struct { Amount int64 // Identifiers of the users which can activate the gift codes UserIDs []int64 - // Number of month the Telegram Premium subscription will be active for the users + // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 } @@ -368,7 +368,7 @@ type TelegramPaymentPurposePremiumGiveaway struct { Amount int64 // Number of users which will be able to activate the gift codes WinnerCount int32 - // Number of month the Telegram Premium subscription will be active for the users + // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 } @@ -701,7 +701,7 @@ type TelegramPaymentPurposeClass interface { GetCurrency() (value string) // Paid amount, in the smallest units of the currency GetAmount() (value int64) - // Number of month the Telegram Premium subscription will be active for the users + // Number of months the Telegram Premium subscription will be active for the users GetMonthCount() (value int32) } diff --git a/tdapi/tl_update_gen.go b/tdapi/tl_update_gen.go index a56f9d6f43..a20b569dd1 100644 --- a/tdapi/tl_update_gen.go +++ b/tdapi/tl_update_gen.go @@ -3494,31 +3494,38 @@ func (u *UpdateChatPhoto) GetPhoto() (value ChatPhotoInfo) { return u.Photo } -// UpdateChatAccentColor represents TL type `updateChatAccentColor#fc111634`. -type UpdateChatAccentColor struct { +// UpdateChatAccentColors represents TL type `updateChatAccentColors#b7b8f8f9`. +type UpdateChatAccentColors struct { // Chat identifier ChatID int64 // The new chat accent color identifier AccentColorID int32 + // The new identifier of a custom emoji to be shown on the reply header and link preview + // background; 0 if none + BackgroundCustomEmojiID int64 + // The new chat profile accent color identifier; -1 if none + ProfileAccentColorID int32 + // The new identifier of a custom emoji to be shown on the profile background; 0 if none + ProfileBackgroundCustomEmojiID int64 } -// UpdateChatAccentColorTypeID is TL type id of UpdateChatAccentColor. -const UpdateChatAccentColorTypeID = 0xfc111634 +// UpdateChatAccentColorsTypeID is TL type id of UpdateChatAccentColors. +const UpdateChatAccentColorsTypeID = 0xb7b8f8f9 // construct implements constructor of UpdateClass. -func (u UpdateChatAccentColor) construct() UpdateClass { return &u } +func (u UpdateChatAccentColors) construct() UpdateClass { return &u } -// Ensuring interfaces in compile-time for UpdateChatAccentColor. +// Ensuring interfaces in compile-time for UpdateChatAccentColors. var ( - _ bin.Encoder = &UpdateChatAccentColor{} - _ bin.Decoder = &UpdateChatAccentColor{} - _ bin.BareEncoder = &UpdateChatAccentColor{} - _ bin.BareDecoder = &UpdateChatAccentColor{} + _ bin.Encoder = &UpdateChatAccentColors{} + _ bin.Decoder = &UpdateChatAccentColors{} + _ bin.BareEncoder = &UpdateChatAccentColors{} + _ bin.BareDecoder = &UpdateChatAccentColors{} - _ UpdateClass = &UpdateChatAccentColor{} + _ UpdateClass = &UpdateChatAccentColors{} ) -func (u *UpdateChatAccentColor) Zero() bool { +func (u *UpdateChatAccentColors) Zero() bool { if u == nil { return true } @@ -3528,36 +3535,45 @@ func (u *UpdateChatAccentColor) Zero() bool { if !(u.AccentColorID == 0) { return false } + if !(u.BackgroundCustomEmojiID == 0) { + return false + } + if !(u.ProfileAccentColorID == 0) { + return false + } + if !(u.ProfileBackgroundCustomEmojiID == 0) { + return false + } return true } // String implements fmt.Stringer. -func (u *UpdateChatAccentColor) String() string { +func (u *UpdateChatAccentColors) String() string { if u == nil { - return "UpdateChatAccentColor(nil)" + return "UpdateChatAccentColors(nil)" } - type Alias UpdateChatAccentColor - return fmt.Sprintf("UpdateChatAccentColor%+v", Alias(*u)) + type Alias UpdateChatAccentColors + return fmt.Sprintf("UpdateChatAccentColors%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatAccentColor) TypeID() uint32 { - return UpdateChatAccentColorTypeID +func (*UpdateChatAccentColors) TypeID() uint32 { + return UpdateChatAccentColorsTypeID } // TypeName returns name of type in TL schema. -func (*UpdateChatAccentColor) TypeName() string { - return "updateChatAccentColor" +func (*UpdateChatAccentColors) TypeName() string { + return "updateChatAccentColors" } // TypeInfo returns info about TL type. -func (u *UpdateChatAccentColor) TypeInfo() tdp.Type { +func (u *UpdateChatAccentColors) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateChatAccentColor", - ID: UpdateChatAccentColorTypeID, + Name: "updateChatAccentColors", + ID: UpdateChatAccentColorsTypeID, } if u == nil { typ.Null = true @@ -3572,69 +3588,105 @@ func (u *UpdateChatAccentColor) TypeInfo() tdp.Type { Name: "AccentColorID", SchemaName: "accent_color_id", }, + { + Name: "BackgroundCustomEmojiID", + SchemaName: "background_custom_emoji_id", + }, + { + Name: "ProfileAccentColorID", + SchemaName: "profile_accent_color_id", + }, + { + Name: "ProfileBackgroundCustomEmojiID", + SchemaName: "profile_background_custom_emoji_id", + }, } return typ } // Encode implements bin.Encoder. -func (u *UpdateChatAccentColor) Encode(b *bin.Buffer) error { +func (u *UpdateChatAccentColors) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + return fmt.Errorf("can't encode updateChatAccentColors#b7b8f8f9 as nil") } - b.PutID(UpdateChatAccentColorTypeID) + b.PutID(UpdateChatAccentColorsTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateChatAccentColor) EncodeBare(b *bin.Buffer) error { +func (u *UpdateChatAccentColors) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + return fmt.Errorf("can't encode updateChatAccentColors#b7b8f8f9 as nil") } b.PutInt53(u.ChatID) b.PutInt32(u.AccentColorID) + b.PutLong(u.BackgroundCustomEmojiID) + b.PutInt32(u.ProfileAccentColorID) + b.PutLong(u.ProfileBackgroundCustomEmojiID) return nil } // Decode implements bin.Decoder. -func (u *UpdateChatAccentColor) Decode(b *bin.Buffer) error { +func (u *UpdateChatAccentColors) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatAccentColor#fc111634 to nil") + return fmt.Errorf("can't decode updateChatAccentColors#b7b8f8f9 to nil") } - if err := b.ConsumeID(UpdateChatAccentColorTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: %w", err) + if err := b.ConsumeID(UpdateChatAccentColorsTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateChatAccentColor) DecodeBare(b *bin.Buffer) error { +func (u *UpdateChatAccentColors) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatAccentColor#fc111634 to nil") + return fmt.Errorf("can't decode updateChatAccentColors#b7b8f8f9 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field chat_id: %w", err) } u.ChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: field accent_color_id: %w", err) + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field accent_color_id: %w", err) } u.AccentColorID = value } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field background_custom_emoji_id: %w", err) + } + u.BackgroundCustomEmojiID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field profile_accent_color_id: %w", err) + } + u.ProfileAccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field profile_background_custom_emoji_id: %w", err) + } + u.ProfileBackgroundCustomEmojiID = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateChatAccentColors) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + return fmt.Errorf("can't encode updateChatAccentColors#b7b8f8f9 as nil") } b.ObjStart() - b.PutID("updateChatAccentColor") + b.PutID("updateChatAccentColors") b.Comma() b.FieldStart("chat_id") b.PutInt53(u.ChatID) @@ -3642,35 +3694,62 @@ func (u *UpdateChatAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("accent_color_id") b.PutInt32(u.AccentColorID) b.Comma() + b.FieldStart("background_custom_emoji_id") + b.PutLong(u.BackgroundCustomEmojiID) + b.Comma() + b.FieldStart("profile_accent_color_id") + b.PutInt32(u.ProfileAccentColorID) + b.Comma() + b.FieldStart("profile_background_custom_emoji_id") + b.PutLong(u.ProfileBackgroundCustomEmojiID) + b.Comma() b.StripComma() b.ObjEnd() return nil } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateChatAccentColors) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateChatAccentColor#fc111634 to nil") + return fmt.Errorf("can't decode updateChatAccentColors#b7b8f8f9 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateChatAccentColor"); err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: %w", err) + if err := b.ConsumeID("updateChatAccentColors"); err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field chat_id: %w", err) } u.ChatID = value case "accent_color_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: field accent_color_id: %w", err) + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field accent_color_id: %w", err) } u.AccentColorID = value + case "background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field background_custom_emoji_id: %w", err) + } + u.BackgroundCustomEmojiID = value + case "profile_accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field profile_accent_color_id: %w", err) + } + u.ProfileAccentColorID = value + case "profile_background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColors#b7b8f8f9: field profile_background_custom_emoji_id: %w", err) + } + u.ProfileBackgroundCustomEmojiID = value default: return b.Skip() } @@ -3679,7 +3758,7 @@ func (u *UpdateChatAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatAccentColor) GetChatID() (value int64) { +func (u *UpdateChatAccentColors) GetChatID() (value int64) { if u == nil { return } @@ -3687,212 +3766,35 @@ func (u *UpdateChatAccentColor) GetChatID() (value int64) { } // GetAccentColorID returns value of AccentColorID field. -func (u *UpdateChatAccentColor) GetAccentColorID() (value int32) { +func (u *UpdateChatAccentColors) GetAccentColorID() (value int32) { if u == nil { return } return u.AccentColorID } -// UpdateChatBackgroundCustomEmoji represents TL type `updateChatBackgroundCustomEmoji#dcbad97a`. -type UpdateChatBackgroundCustomEmoji struct { - // Chat identifier - ChatID int64 - // The new identifier of a custom emoji to be shown on the reply header background; 0 if - // none - BackgroundCustomEmojiID int64 -} - -// UpdateChatBackgroundCustomEmojiTypeID is TL type id of UpdateChatBackgroundCustomEmoji. -const UpdateChatBackgroundCustomEmojiTypeID = 0xdcbad97a - -// construct implements constructor of UpdateClass. -func (u UpdateChatBackgroundCustomEmoji) construct() UpdateClass { return &u } - -// Ensuring interfaces in compile-time for UpdateChatBackgroundCustomEmoji. -var ( - _ bin.Encoder = &UpdateChatBackgroundCustomEmoji{} - _ bin.Decoder = &UpdateChatBackgroundCustomEmoji{} - _ bin.BareEncoder = &UpdateChatBackgroundCustomEmoji{} - _ bin.BareDecoder = &UpdateChatBackgroundCustomEmoji{} - - _ UpdateClass = &UpdateChatBackgroundCustomEmoji{} -) - -func (u *UpdateChatBackgroundCustomEmoji) Zero() bool { - if u == nil { - return true - } - if !(u.ChatID == 0) { - return false - } - if !(u.BackgroundCustomEmojiID == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (u *UpdateChatBackgroundCustomEmoji) String() string { - if u == nil { - return "UpdateChatBackgroundCustomEmoji(nil)" - } - type Alias UpdateChatBackgroundCustomEmoji - return fmt.Sprintf("UpdateChatBackgroundCustomEmoji%+v", Alias(*u)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatBackgroundCustomEmoji) TypeID() uint32 { - return UpdateChatBackgroundCustomEmojiTypeID -} - -// TypeName returns name of type in TL schema. -func (*UpdateChatBackgroundCustomEmoji) TypeName() string { - return "updateChatBackgroundCustomEmoji" -} - -// TypeInfo returns info about TL type. -func (u *UpdateChatBackgroundCustomEmoji) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "updateChatBackgroundCustomEmoji", - ID: UpdateChatBackgroundCustomEmojiTypeID, - } - if u == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ChatID", - SchemaName: "chat_id", - }, - { - Name: "BackgroundCustomEmojiID", - SchemaName: "background_custom_emoji_id", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (u *UpdateChatBackgroundCustomEmoji) Encode(b *bin.Buffer) error { - if u == nil { - return fmt.Errorf("can't encode updateChatBackgroundCustomEmoji#dcbad97a as nil") - } - b.PutID(UpdateChatBackgroundCustomEmojiTypeID) - return u.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (u *UpdateChatBackgroundCustomEmoji) EncodeBare(b *bin.Buffer) error { - if u == nil { - return fmt.Errorf("can't encode updateChatBackgroundCustomEmoji#dcbad97a as nil") - } - b.PutInt53(u.ChatID) - b.PutLong(u.BackgroundCustomEmojiID) - return nil -} - -// Decode implements bin.Decoder. -func (u *UpdateChatBackgroundCustomEmoji) Decode(b *bin.Buffer) error { - if u == nil { - return fmt.Errorf("can't decode updateChatBackgroundCustomEmoji#dcbad97a to nil") - } - if err := b.ConsumeID(UpdateChatBackgroundCustomEmojiTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: %w", err) - } - return u.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (u *UpdateChatBackgroundCustomEmoji) DecodeBare(b *bin.Buffer) error { - if u == nil { - return fmt.Errorf("can't decode updateChatBackgroundCustomEmoji#dcbad97a to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: field chat_id: %w", err) - } - u.ChatID = value - } - { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: field background_custom_emoji_id: %w", err) - } - u.BackgroundCustomEmojiID = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatBackgroundCustomEmoji) EncodeTDLibJSON(b tdjson.Encoder) error { - if u == nil { - return fmt.Errorf("can't encode updateChatBackgroundCustomEmoji#dcbad97a as nil") - } - b.ObjStart() - b.PutID("updateChatBackgroundCustomEmoji") - b.Comma() - b.FieldStart("chat_id") - b.PutInt53(u.ChatID) - b.Comma() - b.FieldStart("background_custom_emoji_id") - b.PutLong(u.BackgroundCustomEmojiID) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatBackgroundCustomEmoji) DecodeTDLibJSON(b tdjson.Decoder) error { +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (u *UpdateChatAccentColors) GetBackgroundCustomEmojiID() (value int64) { if u == nil { - return fmt.Errorf("can't decode updateChatBackgroundCustomEmoji#dcbad97a to nil") + return } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("updateChatBackgroundCustomEmoji"); err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: %w", err) - } - case "chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: field chat_id: %w", err) - } - u.ChatID = value - case "background_custom_emoji_id": - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode updateChatBackgroundCustomEmoji#dcbad97a: field background_custom_emoji_id: %w", err) - } - u.BackgroundCustomEmojiID = value - default: - return b.Skip() - } - return nil - }) + return u.BackgroundCustomEmojiID } -// GetChatID returns value of ChatID field. -func (u *UpdateChatBackgroundCustomEmoji) GetChatID() (value int64) { +// GetProfileAccentColorID returns value of ProfileAccentColorID field. +func (u *UpdateChatAccentColors) GetProfileAccentColorID() (value int32) { if u == nil { return } - return u.ChatID + return u.ProfileAccentColorID } -// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. -func (u *UpdateChatBackgroundCustomEmoji) GetBackgroundCustomEmojiID() (value int64) { +// GetProfileBackgroundCustomEmojiID returns value of ProfileBackgroundCustomEmojiID field. +func (u *UpdateChatAccentColors) GetProfileBackgroundCustomEmojiID() (value int64) { if u == nil { return } - return u.BackgroundCustomEmojiID + return u.ProfileBackgroundCustomEmojiID } // UpdateChatPermissions represents TL type `updateChatPermissions#9f52176d`. @@ -5675,38 +5577,38 @@ func (u *UpdateChatDraftMessage) GetPositions() (value []ChatPosition) { return u.Positions } -// UpdateChatMessageSender represents TL type `updateChatMessageSender#77705241`. -type UpdateChatMessageSender struct { +// UpdateChatEmojiStatus represents TL type `updateChatEmojiStatus#77796510`. +type UpdateChatEmojiStatus struct { // Chat identifier ChatID int64 - // New value of message_sender_id; may be null if the user can't change message sender - MessageSenderID MessageSenderClass + // The new chat emoji status; may be null + EmojiStatus EmojiStatus } -// UpdateChatMessageSenderTypeID is TL type id of UpdateChatMessageSender. -const UpdateChatMessageSenderTypeID = 0x77705241 +// UpdateChatEmojiStatusTypeID is TL type id of UpdateChatEmojiStatus. +const UpdateChatEmojiStatusTypeID = 0x77796510 // construct implements constructor of UpdateClass. -func (u UpdateChatMessageSender) construct() UpdateClass { return &u } +func (u UpdateChatEmojiStatus) construct() UpdateClass { return &u } -// Ensuring interfaces in compile-time for UpdateChatMessageSender. +// Ensuring interfaces in compile-time for UpdateChatEmojiStatus. var ( - _ bin.Encoder = &UpdateChatMessageSender{} - _ bin.Decoder = &UpdateChatMessageSender{} - _ bin.BareEncoder = &UpdateChatMessageSender{} - _ bin.BareDecoder = &UpdateChatMessageSender{} + _ bin.Encoder = &UpdateChatEmojiStatus{} + _ bin.Decoder = &UpdateChatEmojiStatus{} + _ bin.BareEncoder = &UpdateChatEmojiStatus{} + _ bin.BareDecoder = &UpdateChatEmojiStatus{} - _ UpdateClass = &UpdateChatMessageSender{} + _ UpdateClass = &UpdateChatEmojiStatus{} ) -func (u *UpdateChatMessageSender) Zero() bool { +func (u *UpdateChatEmojiStatus) Zero() bool { if u == nil { return true } if !(u.ChatID == 0) { return false } - if !(u.MessageSenderID == nil) { + if !(u.EmojiStatus.Zero()) { return false } @@ -5714,31 +5616,31 @@ func (u *UpdateChatMessageSender) Zero() bool { } // String implements fmt.Stringer. -func (u *UpdateChatMessageSender) String() string { +func (u *UpdateChatEmojiStatus) String() string { if u == nil { - return "UpdateChatMessageSender(nil)" + return "UpdateChatEmojiStatus(nil)" } - type Alias UpdateChatMessageSender - return fmt.Sprintf("UpdateChatMessageSender%+v", Alias(*u)) + type Alias UpdateChatEmojiStatus + return fmt.Sprintf("UpdateChatEmojiStatus%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatMessageSender) TypeID() uint32 { - return UpdateChatMessageSenderTypeID +func (*UpdateChatEmojiStatus) TypeID() uint32 { + return UpdateChatEmojiStatusTypeID } // TypeName returns name of type in TL schema. -func (*UpdateChatMessageSender) TypeName() string { - return "updateChatMessageSender" +func (*UpdateChatEmojiStatus) TypeName() string { + return "updateChatEmojiStatus" } // TypeInfo returns info about TL type. -func (u *UpdateChatMessageSender) TypeInfo() tdp.Type { +func (u *UpdateChatEmojiStatus) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateChatMessageSender", - ID: UpdateChatMessageSenderTypeID, + Name: "updateChatEmojiStatus", + ID: UpdateChatEmojiStatusTypeID, } if u == nil { typ.Null = true @@ -5750,87 +5652,79 @@ func (u *UpdateChatMessageSender) TypeInfo() tdp.Type { SchemaName: "chat_id", }, { - Name: "MessageSenderID", - SchemaName: "message_sender_id", + Name: "EmojiStatus", + SchemaName: "emoji_status", }, } return typ } // Encode implements bin.Encoder. -func (u *UpdateChatMessageSender) Encode(b *bin.Buffer) error { +func (u *UpdateChatEmojiStatus) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + return fmt.Errorf("can't encode updateChatEmojiStatus#77796510 as nil") } - b.PutID(UpdateChatMessageSenderTypeID) + b.PutID(UpdateChatEmojiStatusTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateChatMessageSender) EncodeBare(b *bin.Buffer) error { +func (u *UpdateChatEmojiStatus) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + return fmt.Errorf("can't encode updateChatEmojiStatus#77796510 as nil") } b.PutInt53(u.ChatID) - if u.MessageSenderID == nil { - return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id is nil") - } - if err := u.MessageSenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id: %w", err) + if err := u.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateChatEmojiStatus#77796510: field emoji_status: %w", err) } return nil } // Decode implements bin.Decoder. -func (u *UpdateChatMessageSender) Decode(b *bin.Buffer) error { +func (u *UpdateChatEmojiStatus) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + return fmt.Errorf("can't decode updateChatEmojiStatus#77796510 to nil") } - if err := b.ConsumeID(UpdateChatMessageSenderTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatMessageSender#77705241: %w", err) + if err := b.ConsumeID(UpdateChatEmojiStatusTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateChatMessageSender) DecodeBare(b *bin.Buffer) error { +func (u *UpdateChatEmojiStatus) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + return fmt.Errorf("can't decode updateChatEmojiStatus#77796510 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: field chat_id: %w", err) } u.ChatID = value } { - value, err := DecodeMessageSender(b) - if err != nil { - return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field message_sender_id: %w", err) + if err := u.EmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: field emoji_status: %w", err) } - u.MessageSenderID = value } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatMessageSender) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateChatEmojiStatus) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + return fmt.Errorf("can't encode updateChatEmojiStatus#77796510 as nil") } b.ObjStart() - b.PutID("updateChatMessageSender") + b.PutID("updateChatEmojiStatus") b.Comma() b.FieldStart("chat_id") b.PutInt53(u.ChatID) b.Comma() - b.FieldStart("message_sender_id") - if u.MessageSenderID == nil { - return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id is nil") - } - if err := u.MessageSenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id: %w", err) + b.FieldStart("emoji_status") + if err := u.EmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateChatEmojiStatus#77796510: field emoji_status: %w", err) } b.Comma() b.StripComma() @@ -5839,26 +5733,234 @@ func (u *UpdateChatMessageSender) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatMessageSender) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateChatEmojiStatus) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + return fmt.Errorf("can't decode updateChatEmojiStatus#77796510 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateChatMessageSender"); err != nil { - return fmt.Errorf("unable to decode updateChatMessageSender#77705241: %w", err) + if err := b.ConsumeID("updateChatEmojiStatus"); err != nil { + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: field chat_id: %w", err) } u.ChatID = value - case "message_sender_id": - value, err := DecodeTDLibJSONMessageSender(b) - if err != nil { + case "emoji_status": + if err := u.EmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateChatEmojiStatus#77796510: field emoji_status: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (u *UpdateChatEmojiStatus) GetChatID() (value int64) { + if u == nil { + return + } + return u.ChatID +} + +// GetEmojiStatus returns value of EmojiStatus field. +func (u *UpdateChatEmojiStatus) GetEmojiStatus() (value EmojiStatus) { + if u == nil { + return + } + return u.EmojiStatus +} + +// UpdateChatMessageSender represents TL type `updateChatMessageSender#77705241`. +type UpdateChatMessageSender struct { + // Chat identifier + ChatID int64 + // New value of message_sender_id; may be null if the user can't change message sender + MessageSenderID MessageSenderClass +} + +// UpdateChatMessageSenderTypeID is TL type id of UpdateChatMessageSender. +const UpdateChatMessageSenderTypeID = 0x77705241 + +// construct implements constructor of UpdateClass. +func (u UpdateChatMessageSender) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateChatMessageSender. +var ( + _ bin.Encoder = &UpdateChatMessageSender{} + _ bin.Decoder = &UpdateChatMessageSender{} + _ bin.BareEncoder = &UpdateChatMessageSender{} + _ bin.BareDecoder = &UpdateChatMessageSender{} + + _ UpdateClass = &UpdateChatMessageSender{} +) + +func (u *UpdateChatMessageSender) Zero() bool { + if u == nil { + return true + } + if !(u.ChatID == 0) { + return false + } + if !(u.MessageSenderID == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateChatMessageSender) String() string { + if u == nil { + return "UpdateChatMessageSender(nil)" + } + type Alias UpdateChatMessageSender + return fmt.Sprintf("UpdateChatMessageSender%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateChatMessageSender) TypeID() uint32 { + return UpdateChatMessageSenderTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateChatMessageSender) TypeName() string { + return "updateChatMessageSender" +} + +// TypeInfo returns info about TL type. +func (u *UpdateChatMessageSender) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateChatMessageSender", + ID: UpdateChatMessageSenderTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageSenderID", + SchemaName: "message_sender_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateChatMessageSender) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + } + b.PutID(UpdateChatMessageSenderTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateChatMessageSender) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + } + b.PutInt53(u.ChatID) + if u.MessageSenderID == nil { + return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id is nil") + } + if err := u.MessageSenderID.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateChatMessageSender) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + } + if err := b.ConsumeID(UpdateChatMessageSenderTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatMessageSender#77705241: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateChatMessageSender) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field chat_id: %w", err) + } + u.ChatID = value + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field message_sender_id: %w", err) + } + u.MessageSenderID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateChatMessageSender) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateChatMessageSender#77705241 as nil") + } + b.ObjStart() + b.PutID("updateChatMessageSender") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(u.ChatID) + b.Comma() + b.FieldStart("message_sender_id") + if u.MessageSenderID == nil { + return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id is nil") + } + if err := u.MessageSenderID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateChatMessageSender#77705241: field message_sender_id: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateChatMessageSender) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateChatMessageSender#77705241 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateChatMessageSender"); err != nil { + return fmt.Errorf("unable to decode updateChatMessageSender#77705241: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field chat_id: %w", err) + } + u.ChatID = value + case "message_sender_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { return fmt.Errorf("unable to decode updateChatMessageSender#77705241: field message_sender_id: %w", err) } u.MessageSenderID = value @@ -19304,31 +19406,31 @@ func (u *UpdateSavedNotificationSounds) GetNotificationSoundIDs() (value []int64 return u.NotificationSoundIDs } -// UpdateSelectedBackground represents TL type `updateSelectedBackground#99bd205d`. -type UpdateSelectedBackground struct { - // True, if background for dark theme has changed +// UpdateDefaultBackground represents TL type `updateDefaultBackground#d550952f`. +type UpdateDefaultBackground struct { + // True, if default background for dark theme has changed ForDarkTheme bool - // The new selected background; may be null + // The new default background; may be null Background Background } -// UpdateSelectedBackgroundTypeID is TL type id of UpdateSelectedBackground. -const UpdateSelectedBackgroundTypeID = 0x99bd205d +// UpdateDefaultBackgroundTypeID is TL type id of UpdateDefaultBackground. +const UpdateDefaultBackgroundTypeID = 0xd550952f // construct implements constructor of UpdateClass. -func (u UpdateSelectedBackground) construct() UpdateClass { return &u } +func (u UpdateDefaultBackground) construct() UpdateClass { return &u } -// Ensuring interfaces in compile-time for UpdateSelectedBackground. +// Ensuring interfaces in compile-time for UpdateDefaultBackground. var ( - _ bin.Encoder = &UpdateSelectedBackground{} - _ bin.Decoder = &UpdateSelectedBackground{} - _ bin.BareEncoder = &UpdateSelectedBackground{} - _ bin.BareDecoder = &UpdateSelectedBackground{} + _ bin.Encoder = &UpdateDefaultBackground{} + _ bin.Decoder = &UpdateDefaultBackground{} + _ bin.BareEncoder = &UpdateDefaultBackground{} + _ bin.BareDecoder = &UpdateDefaultBackground{} - _ UpdateClass = &UpdateSelectedBackground{} + _ UpdateClass = &UpdateDefaultBackground{} ) -func (u *UpdateSelectedBackground) Zero() bool { +func (u *UpdateDefaultBackground) Zero() bool { if u == nil { return true } @@ -19343,31 +19445,31 @@ func (u *UpdateSelectedBackground) Zero() bool { } // String implements fmt.Stringer. -func (u *UpdateSelectedBackground) String() string { +func (u *UpdateDefaultBackground) String() string { if u == nil { - return "UpdateSelectedBackground(nil)" + return "UpdateDefaultBackground(nil)" } - type Alias UpdateSelectedBackground - return fmt.Sprintf("UpdateSelectedBackground%+v", Alias(*u)) + type Alias UpdateDefaultBackground + return fmt.Sprintf("UpdateDefaultBackground%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateSelectedBackground) TypeID() uint32 { - return UpdateSelectedBackgroundTypeID +func (*UpdateDefaultBackground) TypeID() uint32 { + return UpdateDefaultBackgroundTypeID } // TypeName returns name of type in TL schema. -func (*UpdateSelectedBackground) TypeName() string { - return "updateSelectedBackground" +func (*UpdateDefaultBackground) TypeName() string { + return "updateDefaultBackground" } // TypeInfo returns info about TL type. -func (u *UpdateSelectedBackground) TypeInfo() tdp.Type { +func (u *UpdateDefaultBackground) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateSelectedBackground", - ID: UpdateSelectedBackgroundTypeID, + Name: "updateDefaultBackground", + ID: UpdateDefaultBackgroundTypeID, } if u == nil { typ.Null = true @@ -19387,71 +19489,71 @@ func (u *UpdateSelectedBackground) TypeInfo() tdp.Type { } // Encode implements bin.Encoder. -func (u *UpdateSelectedBackground) Encode(b *bin.Buffer) error { +func (u *UpdateDefaultBackground) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateSelectedBackground#99bd205d as nil") + return fmt.Errorf("can't encode updateDefaultBackground#d550952f as nil") } - b.PutID(UpdateSelectedBackgroundTypeID) + b.PutID(UpdateDefaultBackgroundTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateSelectedBackground) EncodeBare(b *bin.Buffer) error { +func (u *UpdateDefaultBackground) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateSelectedBackground#99bd205d as nil") + return fmt.Errorf("can't encode updateDefaultBackground#d550952f as nil") } b.PutBool(u.ForDarkTheme) if err := u.Background.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateSelectedBackground#99bd205d: field background: %w", err) + return fmt.Errorf("unable to encode updateDefaultBackground#d550952f: field background: %w", err) } return nil } // Decode implements bin.Decoder. -func (u *UpdateSelectedBackground) Decode(b *bin.Buffer) error { +func (u *UpdateDefaultBackground) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateSelectedBackground#99bd205d to nil") + return fmt.Errorf("can't decode updateDefaultBackground#d550952f to nil") } - if err := b.ConsumeID(UpdateSelectedBackgroundTypeID); err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: %w", err) + if err := b.ConsumeID(UpdateDefaultBackgroundTypeID); err != nil { + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateSelectedBackground) DecodeBare(b *bin.Buffer) error { +func (u *UpdateDefaultBackground) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateSelectedBackground#99bd205d to nil") + return fmt.Errorf("can't decode updateDefaultBackground#d550952f to nil") } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: field for_dark_theme: %w", err) + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: field for_dark_theme: %w", err) } u.ForDarkTheme = value } { if err := u.Background.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: field background: %w", err) + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: field background: %w", err) } } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateSelectedBackground) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateDefaultBackground) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateSelectedBackground#99bd205d as nil") + return fmt.Errorf("can't encode updateDefaultBackground#d550952f as nil") } b.ObjStart() - b.PutID("updateSelectedBackground") + b.PutID("updateDefaultBackground") b.Comma() b.FieldStart("for_dark_theme") b.PutBool(u.ForDarkTheme) b.Comma() b.FieldStart("background") if err := u.Background.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode updateSelectedBackground#99bd205d: field background: %w", err) + return fmt.Errorf("unable to encode updateDefaultBackground#d550952f: field background: %w", err) } b.Comma() b.StripComma() @@ -19460,26 +19562,26 @@ func (u *UpdateSelectedBackground) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateSelectedBackground) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateDefaultBackground) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateSelectedBackground#99bd205d to nil") + return fmt.Errorf("can't decode updateDefaultBackground#d550952f to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateSelectedBackground"); err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: %w", err) + if err := b.ConsumeID("updateDefaultBackground"); err != nil { + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: %w", err) } case "for_dark_theme": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: field for_dark_theme: %w", err) + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: field for_dark_theme: %w", err) } u.ForDarkTheme = value case "background": if err := u.Background.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode updateSelectedBackground#99bd205d: field background: %w", err) + return fmt.Errorf("unable to decode updateDefaultBackground#d550952f: field background: %w", err) } default: return b.Skip() @@ -19489,7 +19591,7 @@ func (u *UpdateSelectedBackground) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetForDarkTheme returns value of ForDarkTheme field. -func (u *UpdateSelectedBackground) GetForDarkTheme() (value bool) { +func (u *UpdateDefaultBackground) GetForDarkTheme() (value bool) { if u == nil { return } @@ -19497,7 +19599,7 @@ func (u *UpdateSelectedBackground) GetForDarkTheme() (value bool) { } // GetBackground returns value of Background field. -func (u *UpdateSelectedBackground) GetBackground() (value Background) { +func (u *UpdateDefaultBackground) GetBackground() (value Background) { if u == nil { return } @@ -19956,8 +20058,8 @@ func (u *UpdateAccentColors) GetAvailableAccentColorIDs() (value []int32) { type UpdateProfileAccentColors struct { // Information about supported colors Colors []ProfileAccentColor - // The list of accent color identifiers, which can be set through setProfileAccentColor. - // The colors must be shown in the specififed order + // The list of accent color identifiers, which can be set through setProfileAccentColor + // and setChatProfileAccentColor. The colors must be shown in the specififed order AvailableAccentColorIDs []int32 } @@ -26881,13 +26983,585 @@ func (u *UpdateNewChatJoinRequest) EncodeTDLibJSON(b tdjson.Encoder) error { return fmt.Errorf("unable to encode updateNewChatJoinRequest#7e48b843: field request: %w", err) } b.Comma() - b.FieldStart("user_chat_id") - b.PutInt53(u.UserChatID) - b.Comma() - b.FieldStart("invite_link") - if err := u.InviteLink.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode updateNewChatJoinRequest#7e48b843: field invite_link: %w", err) + b.FieldStart("user_chat_id") + b.PutInt53(u.UserChatID) + b.Comma() + b.FieldStart("invite_link") + if err := u.InviteLink.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateNewChatJoinRequest#7e48b843: field invite_link: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateNewChatJoinRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateNewChatJoinRequest#7e48b843 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateNewChatJoinRequest"); err != nil { + return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field chat_id: %w", err) + } + u.ChatID = value + case "request": + if err := u.Request.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field request: %w", err) + } + case "user_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field user_chat_id: %w", err) + } + u.UserChatID = value + case "invite_link": + if err := u.InviteLink.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field invite_link: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (u *UpdateNewChatJoinRequest) GetChatID() (value int64) { + if u == nil { + return + } + return u.ChatID +} + +// GetRequest returns value of Request field. +func (u *UpdateNewChatJoinRequest) GetRequest() (value ChatJoinRequest) { + if u == nil { + return + } + return u.Request +} + +// GetUserChatID returns value of UserChatID field. +func (u *UpdateNewChatJoinRequest) GetUserChatID() (value int64) { + if u == nil { + return + } + return u.UserChatID +} + +// GetInviteLink returns value of InviteLink field. +func (u *UpdateNewChatJoinRequest) GetInviteLink() (value ChatInviteLink) { + if u == nil { + return + } + return u.InviteLink +} + +// UpdateChatBoost represents TL type `updateChatBoost#50727e24`. +type UpdateChatBoost struct { + // Chat identifier + ChatID int64 + // New information about the boost + Boost ChatBoost +} + +// UpdateChatBoostTypeID is TL type id of UpdateChatBoost. +const UpdateChatBoostTypeID = 0x50727e24 + +// construct implements constructor of UpdateClass. +func (u UpdateChatBoost) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateChatBoost. +var ( + _ bin.Encoder = &UpdateChatBoost{} + _ bin.Decoder = &UpdateChatBoost{} + _ bin.BareEncoder = &UpdateChatBoost{} + _ bin.BareDecoder = &UpdateChatBoost{} + + _ UpdateClass = &UpdateChatBoost{} +) + +func (u *UpdateChatBoost) Zero() bool { + if u == nil { + return true + } + if !(u.ChatID == 0) { + return false + } + if !(u.Boost.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateChatBoost) String() string { + if u == nil { + return "UpdateChatBoost(nil)" + } + type Alias UpdateChatBoost + return fmt.Sprintf("UpdateChatBoost%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateChatBoost) TypeID() uint32 { + return UpdateChatBoostTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateChatBoost) TypeName() string { + return "updateChatBoost" +} + +// TypeInfo returns info about TL type. +func (u *UpdateChatBoost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateChatBoost", + ID: UpdateChatBoostTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "Boost", + SchemaName: "boost", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateChatBoost) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + } + b.PutID(UpdateChatBoostTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateChatBoost) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + } + b.PutInt53(u.ChatID) + if err := u.Boost.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateChatBoost#50727e24: field boost: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateChatBoost) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + } + if err := b.ConsumeID(UpdateChatBoostTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateChatBoost) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: field chat_id: %w", err) + } + u.ChatID = value + } + { + if err := u.Boost.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: field boost: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + } + b.ObjStart() + b.PutID("updateChatBoost") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(u.ChatID) + b.Comma() + b.FieldStart("boost") + if err := u.Boost.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateChatBoost#50727e24: field boost: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateChatBoost"); err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: field chat_id: %w", err) + } + u.ChatID = value + case "boost": + if err := u.Boost.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateChatBoost#50727e24: field boost: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (u *UpdateChatBoost) GetChatID() (value int64) { + if u == nil { + return + } + return u.ChatID +} + +// GetBoost returns value of Boost field. +func (u *UpdateChatBoost) GetBoost() (value ChatBoost) { + if u == nil { + return + } + return u.Boost +} + +// UpdateMessageReaction represents TL type `updateMessageReaction#f46c854a`. +type UpdateMessageReaction struct { + // Chat identifier + ChatID int64 + // Message identifier + MessageID int64 + // Identifier of the user or chat that changed reactions + ActorID MessageSenderClass + // Point in time (Unix timestamp) when the reactions were changed + Date int32 + // Old list of chosen reactions + OldReactionTypes []ReactionTypeClass + // New list of chosen reactions + NewReactionTypes []ReactionTypeClass +} + +// UpdateMessageReactionTypeID is TL type id of UpdateMessageReaction. +const UpdateMessageReactionTypeID = 0xf46c854a + +// construct implements constructor of UpdateClass. +func (u UpdateMessageReaction) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateMessageReaction. +var ( + _ bin.Encoder = &UpdateMessageReaction{} + _ bin.Decoder = &UpdateMessageReaction{} + _ bin.BareEncoder = &UpdateMessageReaction{} + _ bin.BareDecoder = &UpdateMessageReaction{} + + _ UpdateClass = &UpdateMessageReaction{} +) + +func (u *UpdateMessageReaction) Zero() bool { + if u == nil { + return true + } + if !(u.ChatID == 0) { + return false + } + if !(u.MessageID == 0) { + return false + } + if !(u.ActorID == nil) { + return false + } + if !(u.Date == 0) { + return false + } + if !(u.OldReactionTypes == nil) { + return false + } + if !(u.NewReactionTypes == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateMessageReaction) String() string { + if u == nil { + return "UpdateMessageReaction(nil)" + } + type Alias UpdateMessageReaction + return fmt.Sprintf("UpdateMessageReaction%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateMessageReaction) TypeID() uint32 { + return UpdateMessageReactionTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateMessageReaction) TypeName() string { + return "updateMessageReaction" +} + +// TypeInfo returns info about TL type. +func (u *UpdateMessageReaction) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateMessageReaction", + ID: UpdateMessageReactionTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "ActorID", + SchemaName: "actor_id", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "OldReactionTypes", + SchemaName: "old_reaction_types", + }, + { + Name: "NewReactionTypes", + SchemaName: "new_reaction_types", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateMessageReaction) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateMessageReaction#f46c854a as nil") + } + b.PutID(UpdateMessageReactionTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateMessageReaction) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateMessageReaction#f46c854a as nil") + } + b.PutInt53(u.ChatID) + b.PutInt53(u.MessageID) + if u.ActorID == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field actor_id is nil") + } + if err := u.ActorID.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field actor_id: %w", err) + } + b.PutInt32(u.Date) + b.PutInt(len(u.OldReactionTypes)) + for idx, v := range u.OldReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field old_reaction_types element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare updateMessageReaction#f46c854a: field old_reaction_types element with index %d: %w", idx, err) + } + } + b.PutInt(len(u.NewReactionTypes)) + for idx, v := range u.NewReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field new_reaction_types element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare updateMessageReaction#f46c854a: field new_reaction_types element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateMessageReaction) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateMessageReaction#f46c854a to nil") + } + if err := b.ConsumeID(UpdateMessageReactionTypeID); err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateMessageReaction) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateMessageReaction#f46c854a to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field chat_id: %w", err) + } + u.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field message_id: %w", err) + } + u.MessageID = value + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field actor_id: %w", err) + } + u.ActorID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field date: %w", err) + } + u.Date = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field old_reaction_types: %w", err) + } + + if headerLen > 0 { + u.OldReactionTypes = make([]ReactionTypeClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field old_reaction_types: %w", err) + } + u.OldReactionTypes = append(u.OldReactionTypes, value) + } + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field new_reaction_types: %w", err) + } + + if headerLen > 0 { + u.NewReactionTypes = make([]ReactionTypeClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field new_reaction_types: %w", err) + } + u.NewReactionTypes = append(u.NewReactionTypes, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateMessageReaction) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateMessageReaction#f46c854a as nil") + } + b.ObjStart() + b.PutID("updateMessageReaction") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(u.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(u.MessageID) + b.Comma() + b.FieldStart("actor_id") + if u.ActorID == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field actor_id is nil") + } + if err := u.ActorID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field actor_id: %w", err) + } + b.Comma() + b.FieldStart("date") + b.PutInt32(u.Date) + b.Comma() + b.FieldStart("old_reaction_types") + b.ArrStart() + for idx, v := range u.OldReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field old_reaction_types element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field old_reaction_types element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("new_reaction_types") + b.ArrStart() + for idx, v := range u.NewReactionTypes { + if v == nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field new_reaction_types element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateMessageReaction#f46c854a: field new_reaction_types element with index %d: %w", idx, err) + } + b.Comma() } + b.StripComma() + b.ArrEnd() b.Comma() b.StripComma() b.ObjEnd() @@ -26895,36 +27569,62 @@ func (u *UpdateNewChatJoinRequest) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateNewChatJoinRequest) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateMessageReaction) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateNewChatJoinRequest#7e48b843 to nil") + return fmt.Errorf("can't decode updateMessageReaction#f46c854a to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateNewChatJoinRequest"); err != nil { - return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: %w", err) + if err := b.ConsumeID("updateMessageReaction"); err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field chat_id: %w", err) } u.ChatID = value - case "request": - if err := u.Request.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field request: %w", err) - } - case "user_chat_id": + case "message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field user_chat_id: %w", err) + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field message_id: %w", err) } - u.UserChatID = value - case "invite_link": - if err := u.InviteLink.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode updateNewChatJoinRequest#7e48b843: field invite_link: %w", err) + u.MessageID = value + case "actor_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field actor_id: %w", err) + } + u.ActorID = value + case "date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field date: %w", err) + } + u.Date = value + case "old_reaction_types": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field old_reaction_types: %w", err) + } + u.OldReactionTypes = append(u.OldReactionTypes, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field old_reaction_types: %w", err) + } + case "new_reaction_types": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field new_reaction_types: %w", err) + } + u.NewReactionTypes = append(u.NewReactionTypes, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode updateMessageReaction#f46c854a: field new_reaction_types: %w", err) } default: return b.Skip() @@ -26934,69 +27634,95 @@ func (u *UpdateNewChatJoinRequest) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetChatID returns value of ChatID field. -func (u *UpdateNewChatJoinRequest) GetChatID() (value int64) { +func (u *UpdateMessageReaction) GetChatID() (value int64) { if u == nil { return } return u.ChatID } -// GetRequest returns value of Request field. -func (u *UpdateNewChatJoinRequest) GetRequest() (value ChatJoinRequest) { +// GetMessageID returns value of MessageID field. +func (u *UpdateMessageReaction) GetMessageID() (value int64) { if u == nil { return } - return u.Request + return u.MessageID } -// GetUserChatID returns value of UserChatID field. -func (u *UpdateNewChatJoinRequest) GetUserChatID() (value int64) { +// GetActorID returns value of ActorID field. +func (u *UpdateMessageReaction) GetActorID() (value MessageSenderClass) { if u == nil { return } - return u.UserChatID + return u.ActorID } -// GetInviteLink returns value of InviteLink field. -func (u *UpdateNewChatJoinRequest) GetInviteLink() (value ChatInviteLink) { +// GetDate returns value of Date field. +func (u *UpdateMessageReaction) GetDate() (value int32) { if u == nil { return } - return u.InviteLink + return u.Date } -// UpdateChatBoost represents TL type `updateChatBoost#50727e24`. -type UpdateChatBoost struct { +// GetOldReactionTypes returns value of OldReactionTypes field. +func (u *UpdateMessageReaction) GetOldReactionTypes() (value []ReactionTypeClass) { + if u == nil { + return + } + return u.OldReactionTypes +} + +// GetNewReactionTypes returns value of NewReactionTypes field. +func (u *UpdateMessageReaction) GetNewReactionTypes() (value []ReactionTypeClass) { + if u == nil { + return + } + return u.NewReactionTypes +} + +// UpdateMessageReactions represents TL type `updateMessageReactions#bd5618e9`. +type UpdateMessageReactions struct { // Chat identifier ChatID int64 - // New information about the boost - Boost ChatBoost + // Message identifier + MessageID int64 + // Point in time (Unix timestamp) when the reactions were changed + Date int32 + // The list of reactions added to the message + Reactions []MessageReaction } -// UpdateChatBoostTypeID is TL type id of UpdateChatBoost. -const UpdateChatBoostTypeID = 0x50727e24 +// UpdateMessageReactionsTypeID is TL type id of UpdateMessageReactions. +const UpdateMessageReactionsTypeID = 0xbd5618e9 // construct implements constructor of UpdateClass. -func (u UpdateChatBoost) construct() UpdateClass { return &u } +func (u UpdateMessageReactions) construct() UpdateClass { return &u } -// Ensuring interfaces in compile-time for UpdateChatBoost. +// Ensuring interfaces in compile-time for UpdateMessageReactions. var ( - _ bin.Encoder = &UpdateChatBoost{} - _ bin.Decoder = &UpdateChatBoost{} - _ bin.BareEncoder = &UpdateChatBoost{} - _ bin.BareDecoder = &UpdateChatBoost{} + _ bin.Encoder = &UpdateMessageReactions{} + _ bin.Decoder = &UpdateMessageReactions{} + _ bin.BareEncoder = &UpdateMessageReactions{} + _ bin.BareDecoder = &UpdateMessageReactions{} - _ UpdateClass = &UpdateChatBoost{} + _ UpdateClass = &UpdateMessageReactions{} ) -func (u *UpdateChatBoost) Zero() bool { +func (u *UpdateMessageReactions) Zero() bool { if u == nil { return true } if !(u.ChatID == 0) { return false } - if !(u.Boost.Zero()) { + if !(u.MessageID == 0) { + return false + } + if !(u.Date == 0) { + return false + } + if !(u.Reactions == nil) { return false } @@ -27004,31 +27730,31 @@ func (u *UpdateChatBoost) Zero() bool { } // String implements fmt.Stringer. -func (u *UpdateChatBoost) String() string { +func (u *UpdateMessageReactions) String() string { if u == nil { - return "UpdateChatBoost(nil)" + return "UpdateMessageReactions(nil)" } - type Alias UpdateChatBoost - return fmt.Sprintf("UpdateChatBoost%+v", Alias(*u)) + type Alias UpdateMessageReactions + return fmt.Sprintf("UpdateMessageReactions%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatBoost) TypeID() uint32 { - return UpdateChatBoostTypeID +func (*UpdateMessageReactions) TypeID() uint32 { + return UpdateMessageReactionsTypeID } // TypeName returns name of type in TL schema. -func (*UpdateChatBoost) TypeName() string { - return "updateChatBoost" +func (*UpdateMessageReactions) TypeName() string { + return "updateMessageReactions" } // TypeInfo returns info about TL type. -func (u *UpdateChatBoost) TypeInfo() tdp.Type { +func (u *UpdateMessageReactions) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateChatBoost", - ID: UpdateChatBoostTypeID, + Name: "updateMessageReactions", + ID: UpdateMessageReactionsTypeID, } if u == nil { typ.Null = true @@ -27040,80 +27766,131 @@ func (u *UpdateChatBoost) TypeInfo() tdp.Type { SchemaName: "chat_id", }, { - Name: "Boost", - SchemaName: "boost", + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "Reactions", + SchemaName: "reactions", }, } return typ } // Encode implements bin.Encoder. -func (u *UpdateChatBoost) Encode(b *bin.Buffer) error { +func (u *UpdateMessageReactions) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + return fmt.Errorf("can't encode updateMessageReactions#bd5618e9 as nil") } - b.PutID(UpdateChatBoostTypeID) + b.PutID(UpdateMessageReactionsTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateChatBoost) EncodeBare(b *bin.Buffer) error { +func (u *UpdateMessageReactions) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + return fmt.Errorf("can't encode updateMessageReactions#bd5618e9 as nil") } b.PutInt53(u.ChatID) - if err := u.Boost.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatBoost#50727e24: field boost: %w", err) + b.PutInt53(u.MessageID) + b.PutInt32(u.Date) + b.PutInt(len(u.Reactions)) + for idx, v := range u.Reactions { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare updateMessageReactions#bd5618e9: field reactions element with index %d: %w", idx, err) + } } return nil } // Decode implements bin.Decoder. -func (u *UpdateChatBoost) Decode(b *bin.Buffer) error { +func (u *UpdateMessageReactions) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + return fmt.Errorf("can't decode updateMessageReactions#bd5618e9 to nil") } - if err := b.ConsumeID(UpdateChatBoostTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: %w", err) + if err := b.ConsumeID(UpdateMessageReactionsTypeID); err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateChatBoost) DecodeBare(b *bin.Buffer) error { +func (u *UpdateMessageReactions) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + return fmt.Errorf("can't decode updateMessageReactions#bd5618e9 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field chat_id: %w", err) } u.ChatID = value } { - if err := u.Boost.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: field boost: %w", err) + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field message_id: %w", err) + } + u.MessageID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field date: %w", err) + } + u.Date = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field reactions: %w", err) + } + + if headerLen > 0 { + u.Reactions = make([]MessageReaction, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value MessageReaction + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare updateMessageReactions#bd5618e9: field reactions: %w", err) + } + u.Reactions = append(u.Reactions, value) } } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateMessageReactions) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateChatBoost#50727e24 as nil") + return fmt.Errorf("can't encode updateMessageReactions#bd5618e9 as nil") } b.ObjStart() - b.PutID("updateChatBoost") + b.PutID("updateMessageReactions") b.Comma() b.FieldStart("chat_id") b.PutInt53(u.ChatID) b.Comma() - b.FieldStart("boost") - if err := u.Boost.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode updateChatBoost#50727e24: field boost: %w", err) + b.FieldStart("message_id") + b.PutInt53(u.MessageID) + b.Comma() + b.FieldStart("date") + b.PutInt32(u.Date) + b.Comma() + b.FieldStart("reactions") + b.ArrStart() + for idx, v := range u.Reactions { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateMessageReactions#bd5618e9: field reactions element with index %d: %w", idx, err) + } + b.Comma() } + b.StripComma() + b.ArrEnd() b.Comma() b.StripComma() b.ObjEnd() @@ -27121,26 +27898,45 @@ func (u *UpdateChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateMessageReactions) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateChatBoost#50727e24 to nil") + return fmt.Errorf("can't decode updateMessageReactions#bd5618e9 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateChatBoost"); err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: %w", err) + if err := b.ConsumeID("updateMessageReactions"); err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field chat_id: %w", err) } u.ChatID = value - case "boost": - if err := u.Boost.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode updateChatBoost#50727e24: field boost: %w", err) + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field message_id: %w", err) + } + u.MessageID = value + case "date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field date: %w", err) + } + u.Date = value + case "reactions": + if err := b.Arr(func(b tdjson.Decoder) error { + var value MessageReaction + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field reactions: %w", err) + } + u.Reactions = append(u.Reactions, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode updateMessageReactions#bd5618e9: field reactions: %w", err) } default: return b.Skip() @@ -27150,19 +27946,35 @@ func (u *UpdateChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatBoost) GetChatID() (value int64) { +func (u *UpdateMessageReactions) GetChatID() (value int64) { if u == nil { return } return u.ChatID } -// GetBoost returns value of Boost field. -func (u *UpdateChatBoost) GetBoost() (value ChatBoost) { +// GetMessageID returns value of MessageID field. +func (u *UpdateMessageReactions) GetMessageID() (value int64) { if u == nil { return } - return u.Boost + return u.MessageID +} + +// GetDate returns value of Date field. +func (u *UpdateMessageReactions) GetDate() (value int32) { + if u == nil { + return + } + return u.Date +} + +// GetReactions returns value of Reactions field. +func (u *UpdateMessageReactions) GetReactions() (value []MessageReaction) { + if u == nil { + return + } + return u.Reactions } // UpdateClassName is schema name of UpdateClass. @@ -27193,8 +28005,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateNewChat: // updateNewChat#7bb98ccd // case *tdapi.UpdateChatTitle: // updateChatTitle#f58b85a4 // case *tdapi.UpdateChatPhoto: // updateChatPhoto#eca5423f -// case *tdapi.UpdateChatAccentColor: // updateChatAccentColor#fc111634 -// case *tdapi.UpdateChatBackgroundCustomEmoji: // updateChatBackgroundCustomEmoji#dcbad97a +// case *tdapi.UpdateChatAccentColors: // updateChatAccentColors#b7b8f8f9 // case *tdapi.UpdateChatPermissions: // updateChatPermissions#9f52176d // case *tdapi.UpdateChatLastMessage: // updateChatLastMessage#f10cab1d // case *tdapi.UpdateChatPosition: // updateChatPosition#ff76fa77 @@ -27203,6 +28014,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateChatActionBar: // updateChatActionBar#d9a258c2 // case *tdapi.UpdateChatAvailableReactions: // updateChatAvailableReactions#8ab413f9 // case *tdapi.UpdateChatDraftMessage: // updateChatDraftMessage#2bf257d4 +// case *tdapi.UpdateChatEmojiStatus: // updateChatEmojiStatus#77796510 // case *tdapi.UpdateChatMessageSender: // updateChatMessageSender#77705241 // case *tdapi.UpdateChatMessageAutoDeleteTime: // updateChatMessageAutoDeleteTime#71425de5 // case *tdapi.UpdateChatNotificationSettings: // updateChatNotificationSettings#d020b456 @@ -27268,7 +28080,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateFavoriteStickers: // updateFavoriteStickers#113f2b6a // case *tdapi.UpdateSavedAnimations: // updateSavedAnimations#1084a1c8 // case *tdapi.UpdateSavedNotificationSounds: // updateSavedNotificationSounds#5a6653b4 -// case *tdapi.UpdateSelectedBackground: // updateSelectedBackground#99bd205d +// case *tdapi.UpdateDefaultBackground: // updateDefaultBackground#d550952f // case *tdapi.UpdateChatThemes: // updateChatThemes#98dc58d5 // case *tdapi.UpdateAccentColors: // updateAccentColors#1316555e // case *tdapi.UpdateProfileAccentColors: // updateProfileAccentColors#bf8e7430 @@ -27301,6 +28113,8 @@ const UpdateClassName = "Update" // case *tdapi.UpdateChatMember: // updateChatMember#6000e29c // case *tdapi.UpdateNewChatJoinRequest: // updateNewChatJoinRequest#7e48b843 // case *tdapi.UpdateChatBoost: // updateChatBoost#50727e24 +// case *tdapi.UpdateMessageReaction: // updateMessageReaction#f46c854a +// case *tdapi.UpdateMessageReactions: // updateMessageReactions#bd5618e9 // default: panic(v) // } type UpdateClass interface { @@ -27444,16 +28258,9 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case UpdateChatAccentColorTypeID: - // Decoding updateChatAccentColor#fc111634. - v := UpdateChatAccentColor{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) - } - return &v, nil - case UpdateChatBackgroundCustomEmojiTypeID: - // Decoding updateChatBackgroundCustomEmoji#dcbad97a. - v := UpdateChatBackgroundCustomEmoji{} + case UpdateChatAccentColorsTypeID: + // Decoding updateChatAccentColors#b7b8f8f9. + v := UpdateChatAccentColors{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -27514,6 +28321,13 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateChatEmojiStatusTypeID: + // Decoding updateChatEmojiStatus#77796510. + v := UpdateChatEmojiStatus{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case UpdateChatMessageSenderTypeID: // Decoding updateChatMessageSender#77705241. v := UpdateChatMessageSender{} @@ -27969,9 +28783,9 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case UpdateSelectedBackgroundTypeID: - // Decoding updateSelectedBackground#99bd205d. - v := UpdateSelectedBackground{} + case UpdateDefaultBackgroundTypeID: + // Decoding updateDefaultBackground#d550952f. + v := UpdateDefaultBackground{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -28200,6 +29014,20 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateMessageReactionTypeID: + // Decoding updateMessageReaction#f46c854a. + v := UpdateMessageReaction{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdateMessageReactionsTypeID: + // Decoding updateMessageReactions#bd5618e9. + v := UpdateMessageReactions{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode UpdateClass: %w", bin.NewUnexpectedID(id)) } @@ -28324,16 +29152,9 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case "updateChatAccentColor": - // Decoding updateChatAccentColor#fc111634. - v := UpdateChatAccentColor{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) - } - return &v, nil - case "updateChatBackgroundCustomEmoji": - // Decoding updateChatBackgroundCustomEmoji#dcbad97a. - v := UpdateChatBackgroundCustomEmoji{} + case "updateChatAccentColors": + // Decoding updateChatAccentColors#b7b8f8f9. + v := UpdateChatAccentColors{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -28394,6 +29215,13 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateChatEmojiStatus": + // Decoding updateChatEmojiStatus#77796510. + v := UpdateChatEmojiStatus{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case "updateChatMessageSender": // Decoding updateChatMessageSender#77705241. v := UpdateChatMessageSender{} @@ -28849,9 +29677,9 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case "updateSelectedBackground": - // Decoding updateSelectedBackground#99bd205d. - v := UpdateSelectedBackground{} + case "updateDefaultBackground": + // Decoding updateDefaultBackground#d550952f. + v := UpdateDefaultBackground{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -29080,6 +29908,20 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateMessageReaction": + // Decoding updateMessageReaction#f46c854a. + v := UpdateMessageReaction{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case "updateMessageReactions": + // Decoding updateMessageReactions#bd5618e9. + v := UpdateMessageReactions{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode UpdateClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_user_gen.go b/tdapi/tl_user_gen.go index 7bfa3227a0..7f29c990d2 100644 --- a/tdapi/tl_user_gen.go +++ b/tdapi/tl_user_gen.go @@ -50,8 +50,8 @@ type User struct { // Identifier of the accent color for name, and backgrounds of profile photo, reply // header, and link preview. For Telegram Premium users only AccentColorID int32 - // Identifier of a custom emoji to be shown on the reply header background; 0 if none. - // For Telegram Premium users only + // Identifier of a custom emoji to be shown on the reply header and link preview + // background; 0 if none. For Telegram Premium users only BackgroundCustomEmojiID int64 // Identifier of the accent color for the user's profile; -1 if none. For Telegram // Premium users only