From 23e7d3e0636dc442d389e6d3c0b14330e99f8948 Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 7 Nov 2023 07:46:21 +0000 Subject: [PATCH] feat(schema): update TDLib to the latest layer --- _schema/tdapi.tl | 512 ++- tdapi/tl_accent_color_gen.go | 345 ++ tdapi/tl_add_local_message_gen.go | 76 +- tdapi/tl_apply_premium_gift_code_gen.go | 206 + tdapi/tl_attachment_menu_bot_gen.go | 190 +- tdapi/tl_boost_chat_gen.go | 97 +- tdapi/tl_can_boost_chat_gen.go | 206 - tdapi/tl_can_boost_chat_result_gen.go | 1085 ----- tdapi/tl_chat_boost_gen.go | 175 +- tdapi/tl_chat_boost_slot_gen.go | 329 ++ tdapi/tl_chat_boost_slots_gen.go | 221 + tdapi/tl_chat_boost_source_gen.go | 825 ++++ tdapi/tl_chat_boost_status_gen.go | 209 +- tdapi/tl_chat_event_action_gen.go | 430 ++ tdapi/tl_chat_gen.go | 302 +- tdapi/tl_chat_invite_link_info_gen.go | 122 +- tdapi/tl_chat_permissions_gen.go | 3 +- tdapi/tl_check_premium_gift_code_gen.go | 206 + tdapi/tl_draft_message_gen.go | 83 +- tdapi/tl_forward_messages_gen.go | 95 +- tdapi/tl_found_position_gen.go | 193 + tdapi/tl_found_web_app_gen.go | 70 +- .../tl_get_available_chat_boost_slots_gen.go | 169 + tdapi/tl_get_chat_boosts_gen.go | 69 +- ...lt_background_custom_emoji_stickers_gen.go | 169 + ...t_premium_gift_code_payment_options_gen.go | 207 + tdapi/tl_get_premium_giveaway_info_gen.go | 237 ++ tdapi/tl_get_user_chat_boosts_gen.go | 237 ++ tdapi/tl_get_web_page_preview_gen.go | 70 +- tdapi/tl_input_invoice_gen.go | 191 + tdapi/tl_input_message_content_gen.go | 88 +- tdapi/tl_input_message_reply_to_gen.go | 609 +++ tdapi/tl_internal_link_type_gen.go | 181 + .../tl_launch_prepaid_premium_giveaway_gen.go | 237 ++ tdapi/tl_link_preview_options_gen.go | 333 ++ tdapi/tl_message_content_gen.go | 1073 ++++- tdapi/tl_message_forward_info_gen.go | 58 +- tdapi/tl_message_forward_origin_gen.go | 966 ----- tdapi/tl_message_gen.go | 286 +- tdapi/tl_message_origin_gen.go | 966 +++++ tdapi/tl_message_reply_to_gen.go | 241 +- tdapi/tl_message_send_options_gen.go | 86 +- tdapi/tl_message_sending_state_gen.go | 116 +- tdapi/tl_notification_type_gen.go | 2 +- tdapi/tl_open_web_app_gen.go | 74 +- tdapi/tl_page_block_gen.go | 76 +- tdapi/tl_premium_feature_gen.go | 146 + tdapi/tl_premium_gift_code_info_gen.go | 408 ++ ...tl_premium_gift_code_payment_option_gen.go | 363 ++ ...l_premium_gift_code_payment_options_gen.go | 221 + tdapi/tl_premium_giveaway_info_gen.go | 754 ++++ tdapi/tl_premium_giveaway_parameters_gen.go | 382 ++ ...premium_giveaway_participant_status_gen.go | 984 +++++ tdapi/tl_prepaid_premium_giveaway_gen.go | 295 ++ tdapi/tl_push_message_content_gen.go | 432 ++ tdapi/tl_registry_gen.go | 3782 +++++++++-------- tdapi/tl_resend_messages_gen.go | 70 +- tdapi/tl_search_quote_gen.go | 271 ++ ...tl_send_inline_query_result_message_gen.go | 72 +- tdapi/tl_send_message_album_gen.go | 110 +- tdapi/tl_send_message_gen.go | 84 +- tdapi/tl_set_accent_color_gen.go | 237 ++ tdapi/tl_set_chat_accent_color_gen.go | 271 ++ tdapi/tl_sticker_set_gen.go | 151 +- tdapi/tl_sticker_set_info_gen.go | 143 +- tdapi/tl_store_payment_purpose_gen.go | 559 ++- tdapi/tl_telegram_payment_purpose_gen.go | 805 ++++ tdapi/tl_text_entity_type_gen.go | 146 + tdapi/tl_theme_parameters_gen.go | 252 +- tdapi/tl_update_gen.go | 1018 ++++- tdapi/tl_user_gen.go | 210 +- tdapi/tl_web_page_gen.go | 288 +- 72 files changed, 19454 insertions(+), 5721 deletions(-) create mode 100644 tdapi/tl_accent_color_gen.go create mode 100644 tdapi/tl_apply_premium_gift_code_gen.go delete mode 100644 tdapi/tl_can_boost_chat_gen.go delete mode 100644 tdapi/tl_can_boost_chat_result_gen.go create mode 100644 tdapi/tl_chat_boost_slot_gen.go create mode 100644 tdapi/tl_chat_boost_slots_gen.go create mode 100644 tdapi/tl_chat_boost_source_gen.go create mode 100644 tdapi/tl_check_premium_gift_code_gen.go create mode 100644 tdapi/tl_found_position_gen.go create mode 100644 tdapi/tl_get_available_chat_boost_slots_gen.go create mode 100644 tdapi/tl_get_default_background_custom_emoji_stickers_gen.go create mode 100644 tdapi/tl_get_premium_gift_code_payment_options_gen.go create mode 100644 tdapi/tl_get_premium_giveaway_info_gen.go create mode 100644 tdapi/tl_get_user_chat_boosts_gen.go create mode 100644 tdapi/tl_input_message_reply_to_gen.go create mode 100644 tdapi/tl_launch_prepaid_premium_giveaway_gen.go create mode 100644 tdapi/tl_link_preview_options_gen.go delete mode 100644 tdapi/tl_message_forward_origin_gen.go create mode 100644 tdapi/tl_message_origin_gen.go create mode 100644 tdapi/tl_premium_gift_code_info_gen.go create mode 100644 tdapi/tl_premium_gift_code_payment_option_gen.go create mode 100644 tdapi/tl_premium_gift_code_payment_options_gen.go create mode 100644 tdapi/tl_premium_giveaway_info_gen.go create mode 100644 tdapi/tl_premium_giveaway_parameters_gen.go create mode 100644 tdapi/tl_premium_giveaway_participant_status_gen.go create mode 100644 tdapi/tl_prepaid_premium_giveaway_gen.go create mode 100644 tdapi/tl_search_quote_gen.go create mode 100644 tdapi/tl_set_accent_color_gen.go create mode 100644 tdapi/tl_set_chat_accent_color_gen.go create mode 100644 tdapi/tl_telegram_payment_purpose_gen.go diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index e1e2bce36a..1dbc1d2d93 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: b413309e35ae2391a17f78953b4558a9868aa2a71aec22f665681b1de67e0b3e +// SHA256: b639a2427721a997a334aef967f7bb6408d60f2bd5d9308805cdb62055a415ce double#2210c154 ? = Double; @@ -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, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, 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 @@ -692,6 +692,73 @@ premiumPaymentOption#8c0c5fb2 currency:string amount:int53 discount_percentage:i //@last_transaction_id Identifier of the last in-store transaction for the currently used option premiumStatePaymentOption#7d06b579 payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; +//@description Describes an option for creating Telegram Premium gift codes +//@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 +//@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; + +//@description Contains a list of options for creating Telegram Premium gift codes +//@options The list of options +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 +//@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; 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 +//@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; + +//@class PremiumGiveawayParticipantStatus @description Contains information about status of a user in a Telegram Premium giveaway + +//@description The user is eligible for the giveaway +premiumGiveawayParticipantStatusEligible#7ee281c0 = PremiumGiveawayParticipantStatus; + +//@description The user participates in the giveaway +premiumGiveawayParticipantStatusParticipating#740406d1 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they have already been member of the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 joined_chat_date:int32 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway +//@chat_id Identifier of the chat administered by the user +premiumGiveawayParticipantStatusAdministrator#7244dace chat_id:int53 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they phone number is from a disallowed country +//@user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +premiumGiveawayParticipantStatusDisallowedCountry#89684090 user_country_code:string = PremiumGiveawayParticipantStatus; + +//@class PremiumGiveawayInfo @description Contains information about Telegram Premium giveaway + +//@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@status Status of the current user in the giveaway +//@is_ended True, if the giveaway has ended and results are being prepared +premiumGiveawayInfoOngoing#48d3ce6f creation_date:int32 status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; + +//@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@winner_count Number of winners in the giveaway +//@activation_count Number of winners, which activated their gift codes +//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway +premiumGiveawayInfoCompleted#fc8b501b creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; + +//@description Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +//@id Accent color identifier +//@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; + //@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 @@ -715,6 +782,8 @@ usernames#bf343063 active_usernames:vector disabled_usernames:vector disabled_usernames:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; +chatInviteLinkInfo#829e9f23 chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; //@description Describes a user that sent a join request and waits for administrator approval //@user_id User identifier @@ -1087,26 +1157,26 @@ messageViewer#56f111cd user_id:int53 view_date:int32 = MessageViewer; //@viewers List of message viewers messageViewers#87c73f6c viewers:vector = MessageViewers; -//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message +//@class MessageOrigin @description Contains information about the origin of a message //@description The message was originally sent by a known user //@sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser#ead478d1 sender_user_id:int53 = MessageForwardOrigin; +messageOriginUser#9c009043 sender_user_id:int53 = MessageOrigin; + +//@description The message was originally sent by a user, which is hidden by their privacy settings +//@sender_name Name of the sender +messageOriginHiddenUser#ed0c23da sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message //@author_signature For messages originally sent by an anonymous chat administrator, original message author signature -messageForwardOriginChat#5af51364 sender_chat_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was originally sent by a user, which is hidden by their privacy settings -//@sender_name Name of the sender -messageForwardOriginHiddenUser#efd4eee3 sender_name:string = MessageForwardOrigin; +messageOriginChat#f3bb5eb4 sender_chat_id:int53 author_signature:string = MessageOrigin; //@description The message was originally a post in a channel -//@chat_id Identifier of the chat from which the message was originally forwarded +//@chat_id Identifier of the channel chat to which the message was originally sent //@message_id Message identifier of the original message //@author_signature Original post author signature -messageForwardOriginChannel#58dabee3 chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; +messageOriginChannel#a97b51be chat_id:int53 message_id:int53 author_signature:string = MessageOrigin; //@class ReactionType @description Describes type of message reaction @@ -1119,12 +1189,12 @@ reactionTypeEmoji#8c3e22c8 emoji:string = ReactionType; reactionTypeCustomEmoji#c50b42f3 custom_emoji_id:int64 = ReactionType; //@description Contains information about a forwarded message -//@origin Origin of a forwarded message +//@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent //@public_service_announcement_type The type of a public service announcement for the forwarded message //@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown //@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo#ec7dcac8 origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +messageForwardInfo#f22bdd30 origin:MessageOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; //@description Contains information about a message created with importMessages //@sender_name Name of the original sender @@ -1170,21 +1240,41 @@ messageSendingStatePending#f32b63b4 sending_id:int32 = MessageSendingState; //@error The cause of the message sending failure //@can_retry True, if the message can be re-sent //@need_another_sender True, if the message can be re-sent only on behalf of a different sender +//@need_another_reply_quote True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message +//@need_drop_reply True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed#fb75b2af error:error can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +messageSendingStateFailed#ac81ee5e error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; //@class MessageReplyTo @description Contains information about the message or the story a message is replying to -//@description Describes a replied message -//@chat_id The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats -//@message_id The identifier of the replied message -messageReplyToMessage#deb02f02 chat_id:int53 message_id:int53 = MessageReplyTo; - -//@description Describes a replied story -//@story_sender_chat_id The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat -//@story_id The identifier of the replied story +//@description Describes a message replied by a given message +//@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat +//@message_id The identifier of the message; may be 0 if the replied message is in unknown chat +//@quote Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote +//@is_quote_manual True, if the quote was manually chosen by the message sender +//@origin Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat +//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. +messageReplyToMessage#1bb65082 chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; + +//@description Describes a story replied by a given message +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story messageReplyToStory#708ca939 story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; +//@class InputMessageReplyTo @description Contains information about the message or the story to be replied + +//@description Describes a message to be replied +//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat +//@message_id The identifier of the message to be replied in the same or the specified chat +//@quote Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. +inputMessageReplyToMessage#20b16f06 chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo; + +//@description Describes a story to be replied +//@story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat +//@story_id The identifier of the story +inputMessageReplyToStory#51aece78 story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; + //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message @@ -1195,6 +1285,7 @@ messageReplyToStory#708ca939 story_sender_chat_id:int53 story_id:int32 = Message //@is_pinned True, if the message is pinned //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded +//@can_be_replied_in_another_chat True, if the message can be replied in another chat //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users @@ -1225,7 +1316,7 @@ messageReplyToStory#708ca939 story_sender_chat_id:int53 story_id:int32 = Message //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null if none -message#12947545 id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message#5aa8fa7e id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages //@total_count Approximate total number of messages found @@ -1401,10 +1492,10 @@ chatNotificationSettings#dddc12cf use_default_mute_for:Bool mute_for:int32 use_d scopeNotificationSettings#dc4a615f mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_sender:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText -draftMessage#51d71500 reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; +draftMessage#f67c6a5c reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat @@ -1539,6 +1630,8 @@ videoChat#ae158d28 group_call_id:int32 has_participants:Bool default_participant //@type Type of the chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists @@ -1568,7 +1661,7 @@ videoChat#ae158d28 group_call_id:int32 has_participants:Bool default_participant //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat#3f50a728 id:int53 type:ChatType title:string photo:chatPhotoInfo 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 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#5a9e2993 id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 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 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; //@description Represents a list of chats //@total_count Approximate total number of chats found @@ -1752,10 +1845,9 @@ loginUrlInfoRequestConfirmation#7edb242f url:string domain:string bot_user_id:in //@description Contains information about a Web App found by its short name //@web_app The Web App -//@supports_settings True, if the app supports "settings_button_pressed" event //@request_write_access True, if the user must be asked for the permission to the bot to send them messages //@skip_confirmation True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden -foundWebApp#2b8136d4 web_app:webApp supports_settings:Bool request_write_access:Bool skip_confirmation:Bool = FoundWebApp; +foundWebApp#eea8d01e web_app:webApp request_write_access:Bool skip_confirmation:Bool = FoundWebApp; //@description Contains information about a Web App //@launch_id Unique identifier for the Web App launch @@ -1809,6 +1901,14 @@ forumTopic#1213ace6 info:forumTopicInfo last_message:message is_pinned:Bool unre //@next_offset_message_thread_id Offset message thread identifier for the next getForumTopics request forumTopics#2d99b4ae total_count:int32 topics:vector next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics; +//@description Options to be used for generation of a link preview +//@is_disabled True, if link preview must be disabled +//@url URL to use for link preview. If empty, then the first URL found in the message text will be used +//@force_small_media True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified +//@force_large_media True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified +//@show_above_text True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats +linkPreviewOptions#3e61b3f3 is_disabled:Bool url:string force_small_media:Bool force_large_media:Bool show_above_text:Bool = LinkPreviewOptions; + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @@ -2066,8 +2166,9 @@ pageBlockSlideshow#1107d496 page_blocks:vector caption:pageBlockCapti //@description A link to a chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@username Chat username by which all other information about the chat can be resolved -pageBlockChatLink#f3f4550b title:string photo:chatPhotoInfo username:string = PageBlock; +pageBlockChatLink#621ed8bb title:string photo:chatPhotoInfo accent_color_id:int32 username:string = PageBlock; //@description A table //@caption Table caption @@ -2104,7 +2205,7 @@ pageBlockMap#5a0f7013 location:location zoom:int32 width:int32 height:int32 capt //@feedback_link An internal link to be opened to leave feedback about the instant view webPageInstantView#2c0ec99c page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; -//@description Describes a web page preview +//@description Describes a link preview //@url Original URL of the link //@display_url URL to display //@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else @@ -2118,6 +2219,10 @@ webPageInstantView#2c0ec99c page_blocks:vector view_count:int32 versi //@embed_height Height of the embedded preview //@duration Duration of the content, in seconds //@author Author of the content +//@has_large_media True, if the preview has large media and its appearance can be changed +//@show_large_media True, if large media preview must be shown +//@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear +//@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text //@animation Preview of the content as an animation, if available; may be null //@audio Preview of the content as an audio file, if available; may be null //@document Preview of the content as a document, if available; may be null @@ -2128,7 +2233,7 @@ webPageInstantView#2c0ec99c page_blocks:vector view_count:int32 versi //@story_sender_chat_id The identifier of the sender of the previewed story; 0 if none //@story_id The identifier of the previewed story; 0 if none //@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage#1ab72e80 url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 instant_view_version:int32 = WebPage; +webPage#dafbc3a4 url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string has_large_media:Bool show_large_media:Bool skip_confirmation:Bool show_above_text:Bool animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 instant_view_version:int32 = WebPage; //@description Contains information about a country //@country_code A two-letter ISO 3166-1 alpha-2 country code @@ -2171,12 +2276,18 @@ address#86304f3a country_code:string state:string city:string street_line1:strin //@description Contains parameters of the application theme //@background_color A color of the background in the RGB24 format //@secondary_background_color A secondary color for the background in the RGB24 format +//@header_background_color A color of the header background in the RGB24 format +//@section_background_color A color of the section background in the RGB24 format //@text_color A color of text in the RGB24 format +//@accent_text_color An accent color of the text in the RGB24 format +//@section_header_text_color A color of text on the section headers in the RGB24 format +//@subtitle_text_color A color of the subtitle text in the RGB24 format +//@destructive_text_color A color of the text for destructive actions in the RGB24 format //@hint_color A color of hints in the RGB24 format //@link_color A color of links in the RGB24 format //@button_color A color of the buttons in the RGB24 format //@button_text_color A color of text on the buttons in the RGB24 format -themeParameters#d990fe6e background_color:int32 secondary_background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; +themeParameters#af3f42fc background_color:int32 secondary_background_color:int32 header_background_color:int32 section_background_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") //@label Label for this portion of the product price @@ -2310,6 +2421,10 @@ inputInvoiceMessage#58dcea10 chat_id:int53 message_id:int53 = InputInvoice; //@name Name of the invoice inputInvoiceName#b1ca16f3 name:string = InputInvoice; +//@description An invoice for a payment toward Telegram; must not be used in the in-store apps +//@purpose Transaction purpose +inputInvoiceTelegram#96ecfeed purpose:TelegramPaymentPurpose = InputInvoice; + //@class MessageExtendedMedia @description Describes a media, which is attached to an invoice //@description The media is hidden until the invoice is paid @@ -2334,6 +2449,14 @@ messageExtendedMediaVideo#11acbf3b video:video caption:formattedText = MessageEx //@caption Media caption messageExtendedMediaUnsupported#141f5020 caption:formattedText = MessageExtendedMedia; +//@description Describes parameters of a Telegram Premium giveaway +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription +//@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 subscribers of the chats will be eligible for the giveaway +//@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; + //@description File with the date it was uploaded //@file The file //@date Point in time (Unix timestamp) when the file was uploaded @@ -2666,8 +2789,9 @@ inputPassportElementError#11084de2 type:PassportElementType message:string sourc //@description A text message //@text Text of the message -//@web_page A preview of the web page that's mentioned in the text; may be null -messageText#768e4f93 text:formattedText web_page:webPage = MessageContent; +//@web_page A link preview attached to the message; may be null +//@link_preview_options Options which was used for generation of the link preview; may be null if default options were used +messageText#c13562aa text:formattedText web_page:webPage link_preview_options:linkPreviewOptions = MessageContent; //@description An animation message (GIF-style). //@animation The animation description @@ -2932,6 +3056,25 @@ messagePaymentSuccessfulBot#68e13eb9 currency:string total_amount:int53 is_recur //@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; +//@description A Telegram Premium gift code was created for the user +//@creator_id Identifier of a chat or a user that created the gift code +//@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 +//@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; + +//@description A Telegram Premium giveaway was created for the chat +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 +//@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 contact has registered with Telegram messageContactRegistered#a678fcff = MessageContent; @@ -3027,6 +3170,9 @@ textEntityTypePre#62491c8e = TextEntityType; //@language Programming language of the code; as defined by the sender textEntityTypePreCode#c7a77aab language:string = TextEntityType; +//@description Text that must be formatted as if inside a blockquote HTML tag +textEntityTypeBlockQuote#c42830c8 = TextEntityType; + //@description A text description shown instead of a raw URL //@url HTTP or tg:// URL to be opened when the link is clicked textEntityTypeTextUrl#1a912463 url:string = TextEntityType; @@ -3074,9 +3220,10 @@ messageSelfDestructTypeImmediately#c23c9005 = MessageSelfDestructType; //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates -messageSendOptions#1f60b9e disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 = MessageSendOptions; +//@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 messageInvoice can't be copied +//@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 //@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 @@ -3085,10 +3232,10 @@ messageCopyOptions#48076039 send_copy:Bool replace_caption:Bool new_caption:form //@class InputMessageContent @description The content of a message to send //@description A text message -//@text Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually -//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled +//@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@link_preview_options Options to be used for generation of a link preview; pass null to use default link preview options //@clear_draft True, if a chat message draft must be deleted -inputMessageText#eb9b098 text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; +inputMessageText#f350d894 text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). //@animation Animation file to be sent @@ -3220,7 +3367,7 @@ inputMessageStory#21099d63 story_sender_chat_id:int53 story_id:int32 = InputMess //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from -//@message_id Identifier of the message to forward +//@message_id Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded //@in_game_share True, if a game message is being shared from a launched game; applies only to game messages //@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded#651a73f8 from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; @@ -3372,10 +3519,11 @@ emojis#77274a16 emojis:vector = Emojis; //@is_official True, if the sticker set is official //@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_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#2e5aef95 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 is_viewed:Bool stickers:vector emojis:vector = StickerSet; +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; //@description Represents short information about a sticker set //@id Identifier of the sticker set @@ -3388,10 +3536,11 @@ stickerSet#2e5aef95 id:int64 title:string name:string thumbnail:thumbnail thumbn //@is_official True, if the sticker set is official //@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_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#bdeedde0 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 is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +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; //@description Represents a list of sticker sets //@total_count Approximate total number of sticker sets found @@ -3598,21 +3747,51 @@ 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 ChatBoostSource @description Describes source of a chat boost + +//@description The chat created a Telegram Premium gift code for a user +//@user_id Identifier of a user, for which the gift code was created +//@gift_code The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed +chatBoostSourceGiftCode#fa2412ba user_id:int53 gift_code:string = ChatBoostSource; + +//@description The chat created a Telegram Premium giveaway +//@user_id Identifier of a user that won in the giveaway; 0 if none +//@gift_code The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise +//@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants +chatBoostSourceGiveaway#90d1c70 user_id:int53 gift_code:string giveaway_message_id:int53 is_unclaimed:Bool = ChatBoostSource; + +//@description A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +//@user_id Identifier of the user +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 +//@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; + //@description Describes current boost status of a chat //@boost_url An HTTP URL, which can be used to boost the chat -//@is_boosted True, if the current user has already boosted the chat +//@applied_slot_ids Identifiers of boost slots of the current user applied to the chat //@level Current boost level of the chat -//@boost_count The number of times the chat was boosted +//@gift_code_boost_count The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat +//@boost_count The number of boosts received by the chat //@current_level_boost_count The number of boosts added to reach the current level //@next_level_boost_count The number of boosts needed to reach the next level; 0 if the next level isn't available //@premium_member_count Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat //@premium_member_percentage A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat -chatBoostStatus#dc02a4b2 boost_url:string is_boosted:Bool level:int32 boost_count:int32 current_level_boost_count:int32 next_level_boost_count:int32 premium_member_count:int32 premium_member_percentage:double = ChatBoostStatus; +//@prepaid_giveaways The list of prepaid giveaways available for the chat; only for chat administrators +chatBoostStatus#a5007413 boost_url:string applied_slot_ids:vector level:int32 gift_code_boost_count:int32 boost_count:int32 current_level_boost_count:int32 next_level_boost_count:int32 premium_member_count:int32 premium_member_percentage:double prepaid_giveaways:vector = ChatBoostStatus; -//@description Describes a boost of a chat -//@user_id Identifier of a user that boosted the chat -//@expiration_date Point in time (Unix timestamp) when the boost will automatically expire if the user will not prolongate their Telegram Premium subscription -chatBoost#8d029d82 user_id:int53 expiration_date:int32 = ChatBoost; +//@description Describes a boost applied to a chat +//@id Unique identifier of the boost +//@count The number of identical boosts applied +//@source Source of the boost +//@start_date Point in time (Unix timestamp) when the chat was boosted +//@expiration_date Point in time (Unix timestamp) when the boost will expire +chatBoost#96bfccb2 id:string count:int32 source:ChatBoostSource start_date:int32 expiration_date:int32 = ChatBoost; //@description Contains a list of boosts applied to a chat //@total_count Total number of boosts applied to the chat @@ -3620,6 +3799,18 @@ chatBoost#8d029d82 user_id:int53 expiration_date:int32 = ChatBoost; //@next_offset The offset for the next request. If empty, there are no more results foundChatBoosts#dc80d52e total_count:int32 boosts:vector next_offset:string = FoundChatBoosts; +//@description Describes a slot for chat boost +//@slot_id Unique identifier of the slot +//@currently_boosted_chat_id Identifier of the currently boosted chat; 0 if none +//@start_date Point in time (Unix timestamp) when the chat was boosted; 0 if none +//@expiration_date Point in time (Unix timestamp) when the boost will expire +//@cooldown_until_date Point in time (Unix timestamp) after which the boost can be used for another chat +chatBoostSlot#757fac7 slot_id:int32 currently_boosted_chat_id:int53 start_date:int32 expiration_date:int32 cooldown_until_date:int32 = ChatBoostSlot; + +//@description Contains a list of chat boost slots +//@slots List of boost slots +chatBoostSlots#6859c79 slots:vector = ChatBoostSlots; + //@class CallDiscardReason @description Describes the reason why a call was discarded //@description The call wasn't discarded, or the reason is unknown @@ -3938,7 +4129,6 @@ attachmentMenuBotColor#64235ebc light_color:int32 dark_color:int32 = AttachmentM //@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots //@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats //@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats -//@supports_settings True, if the bot supports "settings_button_pressed" event //@request_write_access True, if the user must be asked for the permission to send messages to the bot //@is_added True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed //@show_in_attachment_menu True, if the bot must be shown in the attachment menu @@ -3956,7 +4146,7 @@ attachmentMenuBotColor#64235ebc light_color:int32 dark_color:int32 = AttachmentM //@macos_side_menu_icon Icon for the bot in PNG format for the official macOS app side menu; may be null //@icon_color Color to highlight selected icon of the bot if appropriate; may be null //@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null -attachmentMenuBot#2176d831 bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; +attachmentMenuBot#b96e1bbf bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; //@description Information about the message sent by answerWebAppQuery //@inline_message_id Identifier of the sent inline message, if known @@ -4374,6 +4564,16 @@ 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 +//@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_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; + //@description The has_protected_content setting of a channel was toggled //@has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled#f5044201 has_protected_content:Bool = ChatEventAction; @@ -4639,6 +4839,9 @@ premiumFeatureUpgradedStories#9008051b = PremiumFeature; //@description The ability to boost chats premiumFeatureChatBoost#5df89f1b = PremiumFeature; +//@description The ability to choose accent color +premiumFeatureAccentColor#361ac59e = PremiumFeature; + //@class PremiumStoryFeature @description Describes a story feature available to Premium users //@description User stories are displayed before stories of non-premium contacts and channels @@ -4705,17 +4908,48 @@ premiumState#fd42d2cd state:formattedText payment_options:vector = StorePaymentPurpose; + +//@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +storePaymentPurposePremiumGiveaway#504790d9 parameters:premiumGiveawayParameters currency:string amount:int53 = StorePaymentPurpose; + +//@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram + +//@description The user creating Telegram Premium gift codes for other users +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none +//@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 +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 +//@parameters Giveaway parameters +//@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 +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. //@description A token for Firebase Cloud Messaging @@ -4865,28 +5099,6 @@ canSendStoryResultWeeklyLimitExceeded#1341a0b8 retry_after:int32 = CanSendStoryR //@retry_after Time left before the user can send the next story canSendStoryResultMonthlyLimitExceeded#dd8242d5 retry_after:int32 = CanSendStoryResult; -//@class CanBoostChatResult @description Represents result of checking whether the current user can boost the specific chat - -//@description The chat can be boosted -//@currently_boosted_chat_id Identifier of the currently boosted chat from which boost will be removed; 0 if none -canBoostChatResultOk#1da13a8b currently_boosted_chat_id:int53 = CanBoostChatResult; - -//@description The chat can't be boosted -canBoostChatResultInvalidChat#3d4c3668 = CanBoostChatResult; - -//@description The chat is already boosted by the user -canBoostChatResultAlreadyBoosted#3e012a69 = CanBoostChatResult; - -//@description The user must subscribe to Telegram Premium to be able to boost chats -canBoostChatResultPremiumNeeded#d4b4e4f = CanBoostChatResult; - -//@description The user must have Telegram Premium subscription instead of a gifted Telegram Premium -canBoostChatResultPremiumSubscriptionNeeded#7550d3cc = CanBoostChatResult; - -//@description The user must wait the specified time before the boost can be moved to another chat -//@retry_after Time left before the user can boost another chat -canBoostChatResultWaitNeeded#343aaeaa retry_after:int32 = CanBoostChatResult; - //@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user //@description The session can be used @@ -5024,6 +5236,16 @@ pushMessageContentPhoto#861dc52 photo:photo caption:string is_secret:Bool is_pin //@is_pinned True, if the message is a pinned message with the specified content 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 +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 +//@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; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken#cc51ff9 = PushMessageContent; @@ -5129,7 +5351,7 @@ notificationTypeNewSecretChat#4771c6b0 = NotificationType; notificationTypeNewCall#66164179 call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to reply +//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat //@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible //@sender_name Name of the sender //@is_outgoing True, if the message is outgoing @@ -5573,6 +5795,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 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; + //@description The link is a link to the privacy and security section of the app settings internalLinkTypePrivacyAndSecuritySettings#ad5f6acf = InternalLinkType; @@ -5899,6 +6125,10 @@ topChatCategoryCalls#153b50dd = TopChatCategory; //@description A category containing frequently used chats used to forward messages topChatCategoryForwardChats#6515b7d5 = TopChatCategory; +//@description Contains 0-based match position +//@position The position of the match +foundPosition#8f8adf88 position:int32 = FoundPosition; + //@description Contains 0-based positions of matched objects //@total_count Total number of matched objects //@positions The positions of the matched objects @@ -6254,14 +6484,24 @@ 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 +//@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 tdentifier of a custom emoji to be shown on the reply header background +updateChatBackgroundCustomEmoji#dcbad97a chat_id:int53 background_custom_emoji_id:int64 = Update; + //@description Chat permissions was changed //@chat_id Chat identifier //@permissions The new chat permissions updateChatPermissions#9f52176d chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +//@description The last message of a chat was changed //@chat_id Chat identifier -//@last_message The new last message in the chat; may be null +//@last_message The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update //@positions The new chat positions in the chat lists updateChatLastMessage#f10cab1d chat_id:int53 last_message:message positions:vector = Update; @@ -6632,6 +6872,11 @@ updateSelectedBackground#99bd205d for_dark_theme:Bool background:background = Up //@chat_themes The new list of chat themes updateChatThemes#98dc58d5 chat_themes:vector = Update; +//@description The list of supported accent colors has changed +//@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported +//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order +updateAccentColors#1316555e colors:vector available_accent_color_ids:vector = Update; + //@description Some language pack strings have been updated //@localization_target Localization target to which the language pack belongs //@language_pack_id Identifier of the updated language pack @@ -6789,6 +7034,11 @@ updateChatMember#6000e29c chat_id:int53 actor_user_id:int53 date:int32 invite_li //@invite_link The invite link, which was used to send join request; may be null updateNewChatJoinRequest#7e48b843 chat_id:int53 request:chatJoinRequest user_chat_id:int53 invite_link:chatInviteLink = Update; +//@description A chat boost has changed; for bots only +//@chat_id Chat identifier +//@boost New information about the boost +updateChatBoost#50727e24 chat_id:int53 boost:chatBoost = Update; + //@description Contains a list of updates //@updates List of updates updates#b9829222 updates:vector = Updates; @@ -7371,20 +7621,19 @@ setChatMessageSender#ab456b7e chat_id:int53 message_sender_id:MessageSender = Ok //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage#171a006f chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage#e02d01e9 chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -//@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum#c765936 chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; +sendMessageAlbum#74bcdacf chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @@ -7395,36 +7644,36 @@ sendBotStartMessage#aa6a3eee bot_user_id:int53 chat_id:int53 parameter:string = //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline query result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage#9d4807e9 chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage#467c5478 chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages //@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only //@from_chat_id Identifier of the chat from which to forward messages -//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously +//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false -//@only_preview Pass true to get fake messages instead of actually forwarding them -forwardMessages#3f49f51e chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; +forwardMessages#34de5b20 chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //@chat_id Identifier of the chat to send messages //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order -resendMessages#60d350b8 chat_id:int53 message_ids:vector = Messages; +//@quote New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false +resendMessages#4a0c68af chat_id:int53 message_ids:vector quote:formattedText = Messages; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added -addLocalMessage#66e011a3 chat_id:int53 sender_id:MessageSender reply_to:MessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; +addLocalMessage#f617b7a1 chat_id:int53 sender_id:MessageSender reply_to:InputMessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; //@description Deletes messages //@chat_id Chat identifier @@ -7628,11 +7877,17 @@ getMessageAddedReactions#7dc6ae52 chat_id:int53 message_id:int53 reaction_type:R //@reaction_type New type of the default reaction setDefaultReactionType#65038a3d reaction_type:ReactionType = Ok; +//@description Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +//@text Text in which to search for the quote +//@quote Quote to search for +//@quote_position Approximate quote position in UTF-16 code units +searchQuote#6864011f text:formattedText quote:formattedText quote_position:int32 = FoundPosition; + //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously //@text The text in which to look for entities getTextEntities#eba543fb text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously //@text The text to parse //@parse_mode Text parse mode parseTextEntities#9a1fc29f text:string parse_mode:TextParseMode = FormattedText; @@ -7781,8 +8036,8 @@ sendWebAppData#ab1fce0c bot_user_id:int53 button_text:string data:string = Ok; //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story for the message sent by the Web App; pass null if none -openWebApp#3a621a chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:MessageReplyTo = WebAppInfo; +//@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none +openWebApp#b02666b0 chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:InputMessageReplyTo = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed //@web_app_launch_id Identifier of Web App launch, received from openWebApp @@ -8069,6 +8324,12 @@ 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 +//@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 +setChatAccentColor#349f57ca chat_id:int53 accent_color_id:int32 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 @@ -8398,17 +8659,17 @@ reportStory#9b5f709b story_sender_chat_id:int53 story_id:int32 reason:ReportReas //@description Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds activateStoryStealthMode#c3db8491 = Ok; +//@description Returns the list of available chat boost slots for the current user +getAvailableChatBoostSlots#7307ebd5 = ChatBoostSlots; + //@description Returns the current boost status for a channel chat //@chat_id Identifier of the channel chat getChatBoostStatus#cfac8acf chat_id:int53 = ChatBoostStatus; -//@description Checks whether the current user can boost a chat +//@description Boosts a chat and returns the list of available chat boost slots for the current user after the boost //@chat_id Identifier of the chat -canBoostChat#836e6e58 chat_id:int53 = CanBoostChatResult; - -//@description Boosts a chat -//@chat_id Identifier of the chat -boostChat#4e314c2d chat_id:int53 = Ok; +//@slot_ids Identifiers of boost slots of the current user from which to apply boosts to the chat +boostChat#890ccd68 chat_id:int53 slot_ids:vector = ChatBoostSlots; //@description Returns an HTTPS link to boost the specified channel chat //@chat_id Identifier of the chat @@ -8418,11 +8679,17 @@ getChatBoostLink#56f16c85 chat_id:int53 = ChatBoostLink; //@url The link to boost a chat getChatBoostLinkInfo#26fc4b5c url:string = ChatBoostLinkInfo; -//@description Returns list of boosts applied to a chat. The user must be an administrator in the channel chat to get the list of boosts +//@description Returns list of boosts applied to a chat; requires administrator rights in the channel chat //@chat_id Identifier of the chat +//@only_gift_codes Pass true to receive only boosts received from gift codes and giveaways created by the chat //@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 boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit -getChatBoosts#d82a288e chat_id:int53 offset:string limit:int32 = FoundChatBoosts; +getChatBoosts#ab5eaa38 chat_id:int53 only_gift_codes:Bool offset:string limit:int32 = FoundChatBoosts; + +//@description Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only +//@chat_id Identifier of the chat +//@user_id Identifier of the user +getUserChatBoosts#b90ee799 chat_id:int53 user_id:int53 = FoundChatBoosts; //@description Returns information about a bot that can be added to attachment or side menu //@bot_user_id Bot's user identifier @@ -9059,6 +9326,9 @@ getDefaultChatPhotoCustomEmojiStickers#e9917765 = Stickers; //@description Returns default list of custom emoji stickers for placing on a profile photo getDefaultProfilePhotoCustomEmojiStickers#4c4be2b7 = Stickers; +//@description Returns default list of custom emoji stickers for reply background +getDefaultBackgroundCustomEmojiStickers#1cf6680e = Stickers; + //@description Returns saved animations getSavedAnimations#6b9718 = Animations; @@ -9082,9 +9352,10 @@ searchHashtags#3e34a571 prefix:string limit:int32 = Hashtags; //@hashtag Hashtag to delete removeRecentHashtag#c393a0a4 hashtag:string = Ok; -//@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview +//@description Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview //@text Message text with formatting -getWebPagePreview#222e062c text:formattedText = WebPage; +//@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options +getWebPagePreview#a850b8d8 text:formattedText link_preview_options:linkPreviewOptions = WebPage; //@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page //@url The web page URL @@ -9100,6 +9371,11 @@ setProfilePhoto#85ea05ed photo:InputChatPhoto is_public:Bool = Ok; //@profile_photo_id Identifier of the profile photo to delete 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 +setAccentColor#6389cb39 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + //@description Changes the first and last name of the current user //@first_name The new value of the first name for the current user; 1-64 characters //@last_name The new value of the optional last name for the current user; 0-64 characters @@ -9835,6 +10111,28 @@ clickPremiumSubscriptionButton#e9fca306 = Ok; //@description Returns state of Telegram Premium subscription and promotion videos for Premium features getPremiumState#278e3ae2 = PremiumState; +//@description Returns available options for Telegram Premium gift code or giveaway creation +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none +getPremiumGiftCodePaymentOptions#89523a2c boosted_chat_id:int53 = PremiumGiftCodePaymentOptions; + +//@description Return information about a Telegram Premium gift code +//@code The code to check +checkPremiumGiftCode#958ad664 code:string = PremiumGiftCodeInfo; + +//@description Applies a Telegram Premium gift code +//@code The code to apply +applyPremiumGiftCode#afb44c1e code:string = Ok; + +//@description Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@giveaway_id Unique identifier of the prepaid giveaway +//@parameters Giveaway parameters +launchPrepaidPremiumGiveaway#5328fea1 giveaway_id:int64 parameters:premiumGiveawayParameters = Ok; + +//@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 +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 //@purpose Transaction purpose canPurchasePremium#e9de1cc0 purpose:StorePaymentPurpose = Ok; diff --git a/tdapi/tl_accent_color_gen.go b/tdapi/tl_accent_color_gen.go new file mode 100644 index 0000000000..40016c1126 --- /dev/null +++ b/tdapi/tl_accent_color_gen.go @@ -0,0 +1,345 @@ +// 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{} +) + +// AccentColor represents TL type `accentColor#83d57cd6`. +type AccentColor struct { + // Accent color identifier + ID int32 + // Identifier of a built-in color to use in places, where only one color is needed; 0-6 + BuiltInAccentColorID int32 + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be + // shown in light themes + LightThemeColors []int32 + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be + // shown in dark themes + DarkThemeColors []int32 +} + +// AccentColorTypeID is TL type id of AccentColor. +const AccentColorTypeID = 0x83d57cd6 + +// Ensuring interfaces in compile-time for AccentColor. +var ( + _ bin.Encoder = &AccentColor{} + _ bin.Decoder = &AccentColor{} + _ bin.BareEncoder = &AccentColor{} + _ bin.BareDecoder = &AccentColor{} +) + +func (a *AccentColor) Zero() bool { + if a == nil { + return true + } + if !(a.ID == 0) { + return false + } + if !(a.BuiltInAccentColorID == 0) { + return false + } + if !(a.LightThemeColors == nil) { + return false + } + if !(a.DarkThemeColors == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (a *AccentColor) String() string { + if a == nil { + return "AccentColor(nil)" + } + type Alias AccentColor + return fmt.Sprintf("AccentColor%+v", Alias(*a)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*AccentColor) TypeID() uint32 { + return AccentColorTypeID +} + +// TypeName returns name of type in TL schema. +func (*AccentColor) TypeName() string { + return "accentColor" +} + +// TypeInfo returns info about TL type. +func (a *AccentColor) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "accentColor", + ID: AccentColorTypeID, + } + if a == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "BuiltInAccentColorID", + SchemaName: "built_in_accent_color_id", + }, + { + Name: "LightThemeColors", + SchemaName: "light_theme_colors", + }, + { + Name: "DarkThemeColors", + SchemaName: "dark_theme_colors", + }, + } + return typ +} + +// 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") + } + b.PutID(AccentColorTypeID) + return a.EncodeBare(b) +} + +// 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") + } + b.PutInt32(a.ID) + b.PutInt32(a.BuiltInAccentColorID) + b.PutInt(len(a.LightThemeColors)) + for _, v := range a.LightThemeColors { + b.PutInt32(v) + } + b.PutInt(len(a.DarkThemeColors)) + for _, v := range a.DarkThemeColors { + b.PutInt32(v) + } + 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") + } + if err := b.ConsumeID(AccentColorTypeID); err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: %w", err) + } + return a.DecodeBare(b) +} + +// 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") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: 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) + } + a.BuiltInAccentColorID = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + } + + if headerLen > 0 { + a.LightThemeColors = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: field light_theme_colors: %w", err) + } + a.LightThemeColors = append(a.LightThemeColors, value) + } + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + } + + if headerLen > 0 { + a.DarkThemeColors = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + } + a.DarkThemeColors = append(a.DarkThemeColors, 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") + } + b.ObjStart() + b.PutID("accentColor") + b.Comma() + b.FieldStart("id") + b.PutInt32(a.ID) + b.Comma() + b.FieldStart("built_in_accent_color_id") + b.PutInt32(a.BuiltInAccentColorID) + b.Comma() + b.FieldStart("light_theme_colors") + b.ArrStart() + for _, v := range a.LightThemeColors { + b.PutInt32(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("dark_theme_colors") + b.ArrStart() + for _, v := range a.DarkThemeColors { + b.PutInt32(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// 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 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) + } + case "id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: 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) + } + 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) + } + a.LightThemeColors = append(a.LightThemeColors, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: 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) + } + a.DarkThemeColors = append(a.DarkThemeColors, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode accentColor#83d57cd6: field dark_theme_colors: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetID returns value of ID field. +func (a *AccentColor) GetID() (value int32) { + if a == nil { + return + } + return a.ID +} + +// GetBuiltInAccentColorID returns value of BuiltInAccentColorID field. +func (a *AccentColor) GetBuiltInAccentColorID() (value int32) { + if a == nil { + return + } + return a.BuiltInAccentColorID +} + +// GetLightThemeColors returns value of LightThemeColors field. +func (a *AccentColor) GetLightThemeColors() (value []int32) { + if a == nil { + return + } + return a.LightThemeColors +} + +// GetDarkThemeColors returns value of DarkThemeColors field. +func (a *AccentColor) GetDarkThemeColors() (value []int32) { + if a == nil { + return + } + return a.DarkThemeColors +} diff --git a/tdapi/tl_add_local_message_gen.go b/tdapi/tl_add_local_message_gen.go index d217fcc8c3..89a6ddb53d 100644 --- a/tdapi/tl_add_local_message_gen.go +++ b/tdapi/tl_add_local_message_gen.go @@ -31,14 +31,14 @@ var ( _ = tdjson.Encoder{} ) -// AddLocalMessageRequest represents TL type `addLocalMessage#66e011a3`. +// AddLocalMessageRequest represents TL type `addLocalMessage#f617b7a1`. type AddLocalMessageRequest struct { // Target chat ChatID int64 // Identifier of the sender of the message SenderID MessageSenderClass - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyToClass + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyToClass // Pass true to disable notification for the message DisableNotification bool // The content of the message to be added @@ -46,7 +46,7 @@ type AddLocalMessageRequest struct { } // AddLocalMessageRequestTypeID is TL type id of AddLocalMessageRequest. -const AddLocalMessageRequestTypeID = 0x66e011a3 +const AddLocalMessageRequestTypeID = 0xf617b7a1 // Ensuring interfaces in compile-time for AddLocalMessageRequest. var ( @@ -138,7 +138,7 @@ func (a *AddLocalMessageRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *AddLocalMessageRequest) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode addLocalMessage#66e011a3 as nil") + return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil") } b.PutID(AddLocalMessageRequestTypeID) return a.EncodeBare(b) @@ -147,27 +147,27 @@ func (a *AddLocalMessageRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *AddLocalMessageRequest) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode addLocalMessage#66e011a3 as nil") + return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil") } b.PutInt53(a.ChatID) if a.SenderID == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field sender_id is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id is nil") } if err := a.SenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field sender_id: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id: %w", err) } if a.ReplyTo == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field reply_to is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to is nil") } if err := a.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field reply_to: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to: %w", err) } b.PutBool(a.DisableNotification) if a.InputMessageContent == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field input_message_content is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content is nil") } if err := a.InputMessageContent.Encode(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field input_message_content: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content: %w", err) } return nil } @@ -175,10 +175,10 @@ func (a *AddLocalMessageRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (a *AddLocalMessageRequest) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode addLocalMessage#66e011a3 to nil") + return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil") } if err := b.ConsumeID(AddLocalMessageRequestTypeID); err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: %w", err) } return a.DecodeBare(b) } @@ -186,40 +186,40 @@ func (a *AddLocalMessageRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *AddLocalMessageRequest) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode addLocalMessage#66e011a3 to nil") + return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field chat_id: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field chat_id: %w", err) } a.ChatID = value } { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field sender_id: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field sender_id: %w", err) } a.SenderID = value } { - value, err := DecodeMessageReplyTo(b) + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field reply_to: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field reply_to: %w", err) } a.ReplyTo = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field disable_notification: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field disable_notification: %w", err) } a.DisableNotification = value } { value, err := DecodeInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field input_message_content: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field input_message_content: %w", err) } a.InputMessageContent = value } @@ -229,7 +229,7 @@ func (a *AddLocalMessageRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (a *AddLocalMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if a == nil { - return fmt.Errorf("can't encode addLocalMessage#66e011a3 as nil") + return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil") } b.ObjStart() b.PutID("addLocalMessage") @@ -239,18 +239,18 @@ func (a *AddLocalMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sender_id") if a.SenderID == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field sender_id is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id is nil") } if err := a.SenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field sender_id: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id: %w", err) } b.Comma() b.FieldStart("reply_to") if a.ReplyTo == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field reply_to is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to is nil") } if err := a.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field reply_to: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to: %w", err) } b.Comma() b.FieldStart("disable_notification") @@ -258,10 +258,10 @@ func (a *AddLocalMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("input_message_content") if a.InputMessageContent == nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field input_message_content is nil") + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content is nil") } if err := a.InputMessageContent.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode addLocalMessage#66e011a3: field input_message_content: %w", err) + return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content: %w", err) } b.Comma() b.StripComma() @@ -272,43 +272,43 @@ func (a *AddLocalMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (a *AddLocalMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if a == nil { - return fmt.Errorf("can't decode addLocalMessage#66e011a3 to nil") + return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("addLocalMessage"); err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field chat_id: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field chat_id: %w", err) } a.ChatID = value case "sender_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field sender_id: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field sender_id: %w", err) } a.SenderID = value case "reply_to": - value, err := DecodeTDLibJSONMessageReplyTo(b) + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field reply_to: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field reply_to: %w", err) } a.ReplyTo = value case "disable_notification": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field disable_notification: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field disable_notification: %w", err) } a.DisableNotification = value case "input_message_content": value, err := DecodeTDLibJSONInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode addLocalMessage#66e011a3: field input_message_content: %w", err) + return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field input_message_content: %w", err) } a.InputMessageContent = value default: @@ -335,7 +335,7 @@ func (a *AddLocalMessageRequest) GetSenderID() (value MessageSenderClass) { } // GetReplyTo returns value of ReplyTo field. -func (a *AddLocalMessageRequest) GetReplyTo() (value MessageReplyToClass) { +func (a *AddLocalMessageRequest) GetReplyTo() (value InputMessageReplyToClass) { if a == nil { return } @@ -358,7 +358,7 @@ func (a *AddLocalMessageRequest) GetInputMessageContent() (value InputMessageCon return a.InputMessageContent } -// AddLocalMessage invokes method addLocalMessage#66e011a3 returning error if any. +// AddLocalMessage invokes method addLocalMessage#f617b7a1 returning error if any. func (c *Client) AddLocalMessage(ctx context.Context, request *AddLocalMessageRequest) (*Message, error) { var result Message diff --git a/tdapi/tl_apply_premium_gift_code_gen.go b/tdapi/tl_apply_premium_gift_code_gen.go new file mode 100644 index 0000000000..7a34b85765 --- /dev/null +++ b/tdapi/tl_apply_premium_gift_code_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{} +) + +// ApplyPremiumGiftCodeRequest represents TL type `applyPremiumGiftCode#afb44c1e`. +type ApplyPremiumGiftCodeRequest struct { + // The code to apply + Code string +} + +// ApplyPremiumGiftCodeRequestTypeID is TL type id of ApplyPremiumGiftCodeRequest. +const ApplyPremiumGiftCodeRequestTypeID = 0xafb44c1e + +// Ensuring interfaces in compile-time for ApplyPremiumGiftCodeRequest. +var ( + _ bin.Encoder = &ApplyPremiumGiftCodeRequest{} + _ bin.Decoder = &ApplyPremiumGiftCodeRequest{} + _ bin.BareEncoder = &ApplyPremiumGiftCodeRequest{} + _ bin.BareDecoder = &ApplyPremiumGiftCodeRequest{} +) + +func (a *ApplyPremiumGiftCodeRequest) Zero() bool { + if a == nil { + return true + } + if !(a.Code == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (a *ApplyPremiumGiftCodeRequest) String() string { + if a == nil { + return "ApplyPremiumGiftCodeRequest(nil)" + } + type Alias ApplyPremiumGiftCodeRequest + return fmt.Sprintf("ApplyPremiumGiftCodeRequest%+v", Alias(*a)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ApplyPremiumGiftCodeRequest) TypeID() uint32 { + return ApplyPremiumGiftCodeRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ApplyPremiumGiftCodeRequest) TypeName() string { + return "applyPremiumGiftCode" +} + +// TypeInfo returns info about TL type. +func (a *ApplyPremiumGiftCodeRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "applyPremiumGiftCode", + ID: ApplyPremiumGiftCodeRequestTypeID, + } + if a == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Code", + SchemaName: "code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (a *ApplyPremiumGiftCodeRequest) Encode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil") + } + b.PutID(ApplyPremiumGiftCodeRequestTypeID) + return a.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (a *ApplyPremiumGiftCodeRequest) EncodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil") + } + b.PutString(a.Code) + return nil +} + +// Decode implements bin.Decoder. +func (a *ApplyPremiumGiftCodeRequest) Decode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil") + } + if err := b.ConsumeID(ApplyPremiumGiftCodeRequestTypeID); err != nil { + return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: %w", err) + } + return a.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (a *ApplyPremiumGiftCodeRequest) DecodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: field code: %w", err) + } + a.Code = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (a *ApplyPremiumGiftCodeRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if a == nil { + return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil") + } + b.ObjStart() + b.PutID("applyPremiumGiftCode") + b.Comma() + b.FieldStart("code") + b.PutString(a.Code) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (a *ApplyPremiumGiftCodeRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if a == nil { + return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("applyPremiumGiftCode"); err != nil { + return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: %w", err) + } + case "code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: field code: %w", err) + } + a.Code = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCode returns value of Code field. +func (a *ApplyPremiumGiftCodeRequest) GetCode() (value string) { + if a == nil { + return + } + return a.Code +} + +// ApplyPremiumGiftCode invokes method applyPremiumGiftCode#afb44c1e returning error if any. +func (c *Client) ApplyPremiumGiftCode(ctx context.Context, code string) error { + var ok Ok + + request := &ApplyPremiumGiftCodeRequest{ + Code: code, + } + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_attachment_menu_bot_gen.go b/tdapi/tl_attachment_menu_bot_gen.go index 9bc8fe2cc3..76736c955e 100644 --- a/tdapi/tl_attachment_menu_bot_gen.go +++ b/tdapi/tl_attachment_menu_bot_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// AttachmentMenuBot represents TL type `attachmentMenuBot#2176d831`. +// AttachmentMenuBot represents TL type `attachmentMenuBot#b96e1bbf`. type AttachmentMenuBot struct { // User identifier of the bot BotUserID int64 @@ -48,8 +48,6 @@ type AttachmentMenuBot struct { SupportsGroupChats bool // True, if the bot supports opening from attachment menu in channel chats SupportsChannelChats bool - // True, if the bot supports "settings_button_pressed" event - SupportsSettings bool // True, if the user must be asked for the permission to send messages to the bot RequestWriteAccess bool // True, if the bot was explicitly added by the user. If the bot isn't added, then on the @@ -89,7 +87,7 @@ type AttachmentMenuBot struct { } // AttachmentMenuBotTypeID is TL type id of AttachmentMenuBot. -const AttachmentMenuBotTypeID = 0x2176d831 +const AttachmentMenuBotTypeID = 0xb96e1bbf // Ensuring interfaces in compile-time for AttachmentMenuBot. var ( @@ -121,9 +119,6 @@ func (a *AttachmentMenuBot) Zero() bool { if !(a.SupportsChannelChats == false) { return false } - if !(a.SupportsSettings == false) { - return false - } if !(a.RequestWriteAccess == false) { return false } @@ -235,10 +230,6 @@ func (a *AttachmentMenuBot) TypeInfo() tdp.Type { Name: "SupportsChannelChats", SchemaName: "supports_channel_chats", }, - { - Name: "SupportsSettings", - SchemaName: "supports_settings", - }, { Name: "RequestWriteAccess", SchemaName: "request_write_access", @@ -314,7 +305,7 @@ func (a *AttachmentMenuBot) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *AttachmentMenuBot) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode attachmentMenuBot#2176d831 as nil") + return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil") } b.PutID(AttachmentMenuBotTypeID) return a.EncodeBare(b) @@ -323,7 +314,7 @@ func (a *AttachmentMenuBot) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *AttachmentMenuBot) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode attachmentMenuBot#2176d831 as nil") + return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil") } b.PutInt53(a.BotUserID) b.PutBool(a.SupportsSelfChat) @@ -331,7 +322,6 @@ func (a *AttachmentMenuBot) EncodeBare(b *bin.Buffer) error { b.PutBool(a.SupportsBotChats) b.PutBool(a.SupportsGroupChats) b.PutBool(a.SupportsChannelChats) - b.PutBool(a.SupportsSettings) b.PutBool(a.RequestWriteAccess) b.PutBool(a.IsAdded) b.PutBool(a.ShowInAttachmentMenu) @@ -339,37 +329,37 @@ func (a *AttachmentMenuBot) EncodeBare(b *bin.Buffer) error { b.PutBool(a.ShowDisclaimerInSideMenu) b.PutString(a.Name) if err := a.NameColor.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field name_color: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field name_color: %w", err) } if err := a.DefaultIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field default_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field default_icon: %w", err) } if err := a.IosStaticIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_static_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err) } if err := a.IosAnimatedIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_animated_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err) } if err := a.IosSideMenuIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err) } if err := a.AndroidIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field android_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_icon: %w", err) } if err := a.AndroidSideMenuIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field android_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err) } if err := a.MacosIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field macos_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err) } if err := a.MacosSideMenuIcon.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field macos_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err) } if err := a.IconColor.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field icon_color: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field icon_color: %w", err) } if err := a.WebAppPlaceholder.Encode(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field web_app_placeholder: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err) } return nil } @@ -377,10 +367,10 @@ func (a *AttachmentMenuBot) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (a *AttachmentMenuBot) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode attachmentMenuBot#2176d831 to nil") + return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil") } if err := b.ConsumeID(AttachmentMenuBotTypeID); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: %w", err) } return a.DecodeBare(b) } @@ -388,152 +378,145 @@ func (a *AttachmentMenuBot) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *AttachmentMenuBot) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode attachmentMenuBot#2176d831 to nil") + return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field bot_user_id: %w", err) } a.BotUserID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_self_chat: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_self_chat: %w", err) } a.SupportsSelfChat = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_user_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_user_chats: %w", err) } a.SupportsUserChats = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_bot_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_bot_chats: %w", err) } a.SupportsBotChats = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_group_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_group_chats: %w", err) } a.SupportsGroupChats = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_channel_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_channel_chats: %w", err) } a.SupportsChannelChats = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_settings: %w", err) - } - a.SupportsSettings = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field request_write_access: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field request_write_access: %w", err) } a.RequestWriteAccess = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field is_added: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field is_added: %w", err) } a.IsAdded = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_in_attachment_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_attachment_menu: %w", err) } a.ShowInAttachmentMenu = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_in_side_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_side_menu: %w", err) } a.ShowInSideMenu = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_disclaimer_in_side_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_disclaimer_in_side_menu: %w", err) } a.ShowDisclaimerInSideMenu = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field name: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name: %w", err) } a.Name = value } { if err := a.NameColor.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field name_color: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name_color: %w", err) } } { if err := a.DefaultIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field default_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field default_icon: %w", err) } } { if err := a.IosStaticIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_static_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err) } } { if err := a.IosAnimatedIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_animated_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err) } } { if err := a.IosSideMenuIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err) } } { if err := a.AndroidIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field android_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_icon: %w", err) } } { if err := a.AndroidSideMenuIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field android_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err) } } { if err := a.MacosIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field macos_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err) } } { if err := a.MacosSideMenuIcon.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field macos_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err) } } { if err := a.IconColor.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field icon_color: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field icon_color: %w", err) } } { if err := a.WebAppPlaceholder.Decode(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field web_app_placeholder: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err) } } return nil @@ -542,7 +525,7 @@ func (a *AttachmentMenuBot) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (a *AttachmentMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { if a == nil { - return fmt.Errorf("can't encode attachmentMenuBot#2176d831 as nil") + return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil") } b.ObjStart() b.PutID("attachmentMenuBot") @@ -565,9 +548,6 @@ func (a *AttachmentMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("supports_channel_chats") b.PutBool(a.SupportsChannelChats) b.Comma() - b.FieldStart("supports_settings") - b.PutBool(a.SupportsSettings) - b.Comma() b.FieldStart("request_write_access") b.PutBool(a.RequestWriteAccess) b.Comma() @@ -588,57 +568,57 @@ func (a *AttachmentMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("name_color") if err := a.NameColor.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field name_color: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field name_color: %w", err) } b.Comma() b.FieldStart("default_icon") if err := a.DefaultIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field default_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field default_icon: %w", err) } b.Comma() b.FieldStart("ios_static_icon") if err := a.IosStaticIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_static_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err) } b.Comma() b.FieldStart("ios_animated_icon") if err := a.IosAnimatedIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_animated_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err) } b.Comma() b.FieldStart("ios_side_menu_icon") if err := a.IosSideMenuIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field ios_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err) } b.Comma() b.FieldStart("android_icon") if err := a.AndroidIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field android_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_icon: %w", err) } b.Comma() b.FieldStart("android_side_menu_icon") if err := a.AndroidSideMenuIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field android_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err) } b.Comma() b.FieldStart("macos_icon") if err := a.MacosIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field macos_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err) } b.Comma() b.FieldStart("macos_side_menu_icon") if err := a.MacosSideMenuIcon.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field macos_side_menu_icon: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err) } b.Comma() b.FieldStart("icon_color") if err := a.IconColor.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field icon_color: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field icon_color: %w", err) } b.Comma() b.FieldStart("web_app_placeholder") if err := a.WebAppPlaceholder.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode attachmentMenuBot#2176d831: field web_app_placeholder: %w", err) + return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err) } b.Comma() b.StripComma() @@ -649,136 +629,130 @@ func (a *AttachmentMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (a *AttachmentMenuBot) DecodeTDLibJSON(b tdjson.Decoder) error { if a == nil { - return fmt.Errorf("can't decode attachmentMenuBot#2176d831 to nil") + return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("attachmentMenuBot"); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: %w", err) } case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field bot_user_id: %w", err) } a.BotUserID = value case "supports_self_chat": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_self_chat: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_self_chat: %w", err) } a.SupportsSelfChat = value case "supports_user_chats": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_user_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_user_chats: %w", err) } a.SupportsUserChats = value case "supports_bot_chats": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_bot_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_bot_chats: %w", err) } a.SupportsBotChats = value case "supports_group_chats": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_group_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_group_chats: %w", err) } a.SupportsGroupChats = value case "supports_channel_chats": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_channel_chats: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_channel_chats: %w", err) } a.SupportsChannelChats = value - case "supports_settings": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field supports_settings: %w", err) - } - a.SupportsSettings = value case "request_write_access": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field request_write_access: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field request_write_access: %w", err) } a.RequestWriteAccess = value case "is_added": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field is_added: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field is_added: %w", err) } a.IsAdded = value case "show_in_attachment_menu": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_in_attachment_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_attachment_menu: %w", err) } a.ShowInAttachmentMenu = value case "show_in_side_menu": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_in_side_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_side_menu: %w", err) } a.ShowInSideMenu = value case "show_disclaimer_in_side_menu": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field show_disclaimer_in_side_menu: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_disclaimer_in_side_menu: %w", err) } a.ShowDisclaimerInSideMenu = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field name: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name: %w", err) } a.Name = value case "name_color": if err := a.NameColor.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field name_color: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name_color: %w", err) } case "default_icon": if err := a.DefaultIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field default_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field default_icon: %w", err) } case "ios_static_icon": if err := a.IosStaticIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_static_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err) } case "ios_animated_icon": if err := a.IosAnimatedIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_animated_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err) } case "ios_side_menu_icon": if err := a.IosSideMenuIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field ios_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err) } case "android_icon": if err := a.AndroidIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field android_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_icon: %w", err) } case "android_side_menu_icon": if err := a.AndroidSideMenuIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field android_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err) } case "macos_icon": if err := a.MacosIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field macos_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err) } case "macos_side_menu_icon": if err := a.MacosSideMenuIcon.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field macos_side_menu_icon: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err) } case "icon_color": if err := a.IconColor.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field icon_color: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field icon_color: %w", err) } case "web_app_placeholder": if err := a.WebAppPlaceholder.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode attachmentMenuBot#2176d831: field web_app_placeholder: %w", err) + return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err) } default: return b.Skip() @@ -835,14 +809,6 @@ func (a *AttachmentMenuBot) GetSupportsChannelChats() (value bool) { return a.SupportsChannelChats } -// GetSupportsSettings returns value of SupportsSettings field. -func (a *AttachmentMenuBot) GetSupportsSettings() (value bool) { - if a == nil { - return - } - return a.SupportsSettings -} - // GetRequestWriteAccess returns value of RequestWriteAccess field. func (a *AttachmentMenuBot) GetRequestWriteAccess() (value bool) { if a == nil { diff --git a/tdapi/tl_boost_chat_gen.go b/tdapi/tl_boost_chat_gen.go index 6eb6801727..9f866a9399 100644 --- a/tdapi/tl_boost_chat_gen.go +++ b/tdapi/tl_boost_chat_gen.go @@ -31,14 +31,16 @@ var ( _ = tdjson.Encoder{} ) -// BoostChatRequest represents TL type `boostChat#4e314c2d`. +// BoostChatRequest represents TL type `boostChat#890ccd68`. type BoostChatRequest struct { // Identifier of the chat ChatID int64 + // Identifiers of boost slots of the current user from which to apply boosts to the chat + SlotIDs []int32 } // BoostChatRequestTypeID is TL type id of BoostChatRequest. -const BoostChatRequestTypeID = 0x4e314c2d +const BoostChatRequestTypeID = 0x890ccd68 // Ensuring interfaces in compile-time for BoostChatRequest. var ( @@ -55,6 +57,9 @@ func (b *BoostChatRequest) Zero() bool { if !(b.ChatID == 0) { return false } + if !(b.SlotIDs == nil) { + return false + } return true } @@ -95,6 +100,10 @@ func (b *BoostChatRequest) TypeInfo() tdp.Type { Name: "ChatID", SchemaName: "chat_id", }, + { + Name: "SlotIDs", + SchemaName: "slot_ids", + }, } return typ } @@ -102,7 +111,7 @@ func (b *BoostChatRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (b *BoostChatRequest) Encode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode boostChat#4e314c2d as nil") + return fmt.Errorf("can't encode boostChat#890ccd68 as nil") } buf.PutID(BoostChatRequestTypeID) return b.EncodeBare(buf) @@ -111,19 +120,23 @@ func (b *BoostChatRequest) Encode(buf *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (b *BoostChatRequest) EncodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode boostChat#4e314c2d as nil") + return fmt.Errorf("can't encode boostChat#890ccd68 as nil") } buf.PutInt53(b.ChatID) + buf.PutInt(len(b.SlotIDs)) + for _, v := range b.SlotIDs { + buf.PutInt32(v) + } return nil } // Decode implements bin.Decoder. func (b *BoostChatRequest) Decode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode boostChat#4e314c2d to nil") + return fmt.Errorf("can't decode boostChat#890ccd68 to nil") } if err := buf.ConsumeID(BoostChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode boostChat#4e314c2d: %w", err) + return fmt.Errorf("unable to decode boostChat#890ccd68: %w", err) } return b.DecodeBare(buf) } @@ -131,22 +144,39 @@ func (b *BoostChatRequest) Decode(buf *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (b *BoostChatRequest) DecodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode boostChat#4e314c2d to nil") + return fmt.Errorf("can't decode boostChat#890ccd68 to nil") } { value, err := buf.Int53() if err != nil { - return fmt.Errorf("unable to decode boostChat#4e314c2d: field chat_id: %w", err) + return fmt.Errorf("unable to decode boostChat#890ccd68: field chat_id: %w", err) } b.ChatID = value } + { + headerLen, err := buf.Int() + if err != nil { + return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err) + } + + if headerLen > 0 { + b.SlotIDs = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err) + } + b.SlotIDs = append(b.SlotIDs, value) + } + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (b *BoostChatRequest) EncodeTDLibJSON(buf tdjson.Encoder) error { if b == nil { - return fmt.Errorf("can't encode boostChat#4e314c2d as nil") + return fmt.Errorf("can't encode boostChat#890ccd68 as nil") } buf.ObjStart() buf.PutID("boostChat") @@ -154,6 +184,15 @@ func (b *BoostChatRequest) EncodeTDLibJSON(buf tdjson.Encoder) error { buf.FieldStart("chat_id") buf.PutInt53(b.ChatID) buf.Comma() + buf.FieldStart("slot_ids") + buf.ArrStart() + for _, v := range b.SlotIDs { + buf.PutInt32(v) + buf.Comma() + } + buf.StripComma() + buf.ArrEnd() + buf.Comma() buf.StripComma() buf.ObjEnd() return nil @@ -162,21 +201,32 @@ func (b *BoostChatRequest) EncodeTDLibJSON(buf tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (b *BoostChatRequest) DecodeTDLibJSON(buf tdjson.Decoder) error { if b == nil { - return fmt.Errorf("can't decode boostChat#4e314c2d to nil") + return fmt.Errorf("can't decode boostChat#890ccd68 to nil") } return buf.Obj(func(buf tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := buf.ConsumeID("boostChat"); err != nil { - return fmt.Errorf("unable to decode boostChat#4e314c2d: %w", err) + return fmt.Errorf("unable to decode boostChat#890ccd68: %w", err) } case "chat_id": value, err := buf.Int53() if err != nil { - return fmt.Errorf("unable to decode boostChat#4e314c2d: field chat_id: %w", err) + return fmt.Errorf("unable to decode boostChat#890ccd68: field chat_id: %w", err) } b.ChatID = value + case "slot_ids": + if err := buf.Arr(func(buf tdjson.Decoder) error { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err) + } + b.SlotIDs = append(b.SlotIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err) + } default: return buf.Skip() } @@ -192,15 +242,20 @@ func (b *BoostChatRequest) GetChatID() (value int64) { return b.ChatID } -// BoostChat invokes method boostChat#4e314c2d returning error if any. -func (c *Client) BoostChat(ctx context.Context, chatid int64) error { - var ok Ok - - request := &BoostChatRequest{ - ChatID: chatid, +// GetSlotIDs returns value of SlotIDs field. +func (b *BoostChatRequest) GetSlotIDs() (value []int32) { + if b == nil { + return } - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err + return b.SlotIDs +} + +// BoostChat invokes method boostChat#890ccd68 returning error if any. +func (c *Client) BoostChat(ctx context.Context, request *BoostChatRequest) (*ChatBoostSlots, error) { + var result ChatBoostSlots + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err } - return nil + return &result, nil } diff --git a/tdapi/tl_can_boost_chat_gen.go b/tdapi/tl_can_boost_chat_gen.go deleted file mode 100644 index 59899d8fd5..0000000000 --- a/tdapi/tl_can_boost_chat_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{} -) - -// CanBoostChatRequest represents TL type `canBoostChat#836e6e58`. -type CanBoostChatRequest struct { - // Identifier of the chat - ChatID int64 -} - -// CanBoostChatRequestTypeID is TL type id of CanBoostChatRequest. -const CanBoostChatRequestTypeID = 0x836e6e58 - -// Ensuring interfaces in compile-time for CanBoostChatRequest. -var ( - _ bin.Encoder = &CanBoostChatRequest{} - _ bin.Decoder = &CanBoostChatRequest{} - _ bin.BareEncoder = &CanBoostChatRequest{} - _ bin.BareDecoder = &CanBoostChatRequest{} -) - -func (c *CanBoostChatRequest) Zero() bool { - if c == nil { - return true - } - if !(c.ChatID == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatRequest) String() string { - if c == nil { - return "CanBoostChatRequest(nil)" - } - type Alias CanBoostChatRequest - return fmt.Sprintf("CanBoostChatRequest%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatRequest) TypeID() uint32 { - return CanBoostChatRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatRequest) TypeName() string { - return "canBoostChat" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChat", - ID: CanBoostChatRequestTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ChatID", - SchemaName: "chat_id", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatRequest) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChat#836e6e58 as nil") - } - b.PutID(CanBoostChatRequestTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatRequest) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChat#836e6e58 as nil") - } - b.PutInt53(c.ChatID) - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatRequest) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChat#836e6e58 to nil") - } - if err := b.ConsumeID(CanBoostChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChat#836e6e58: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatRequest) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChat#836e6e58 to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode canBoostChat#836e6e58: field chat_id: %w", err) - } - c.ChatID = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChat#836e6e58 as nil") - } - b.ObjStart() - b.PutID("canBoostChat") - b.Comma() - b.FieldStart("chat_id") - b.PutInt53(c.ChatID) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChat#836e6e58 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChat"); err != nil { - return fmt.Errorf("unable to decode canBoostChat#836e6e58: %w", err) - } - case "chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode canBoostChat#836e6e58: field chat_id: %w", err) - } - c.ChatID = value - default: - return b.Skip() - } - return nil - }) -} - -// GetChatID returns value of ChatID field. -func (c *CanBoostChatRequest) GetChatID() (value int64) { - if c == nil { - return - } - return c.ChatID -} - -// CanBoostChat invokes method canBoostChat#836e6e58 returning error if any. -func (c *Client) CanBoostChat(ctx context.Context, chatid int64) (CanBoostChatResultClass, error) { - var result CanBoostChatResultBox - - request := &CanBoostChatRequest{ - ChatID: chatid, - } - if err := c.rpc.Invoke(ctx, request, &result); err != nil { - return nil, err - } - return result.CanBoostChatResult, nil -} diff --git a/tdapi/tl_can_boost_chat_result_gen.go b/tdapi/tl_can_boost_chat_result_gen.go deleted file mode 100644 index 92679c2eef..0000000000 --- a/tdapi/tl_can_boost_chat_result_gen.go +++ /dev/null @@ -1,1085 +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{} -) - -// CanBoostChatResultOk represents TL type `canBoostChatResultOk#1da13a8b`. -type CanBoostChatResultOk struct { - // Identifier of the currently boosted chat from which boost will be removed; 0 if none - CurrentlyBoostedChatID int64 -} - -// CanBoostChatResultOkTypeID is TL type id of CanBoostChatResultOk. -const CanBoostChatResultOkTypeID = 0x1da13a8b - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultOk) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultOk. -var ( - _ bin.Encoder = &CanBoostChatResultOk{} - _ bin.Decoder = &CanBoostChatResultOk{} - _ bin.BareEncoder = &CanBoostChatResultOk{} - _ bin.BareDecoder = &CanBoostChatResultOk{} - - _ CanBoostChatResultClass = &CanBoostChatResultOk{} -) - -func (c *CanBoostChatResultOk) Zero() bool { - if c == nil { - return true - } - if !(c.CurrentlyBoostedChatID == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultOk) String() string { - if c == nil { - return "CanBoostChatResultOk(nil)" - } - type Alias CanBoostChatResultOk - return fmt.Sprintf("CanBoostChatResultOk%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultOk) TypeID() uint32 { - return CanBoostChatResultOkTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultOk) TypeName() string { - return "canBoostChatResultOk" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultOk) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultOk", - ID: CanBoostChatResultOkTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "CurrentlyBoostedChatID", - SchemaName: "currently_boosted_chat_id", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultOk) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultOk#1da13a8b as nil") - } - b.PutID(CanBoostChatResultOkTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultOk) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultOk#1da13a8b as nil") - } - b.PutInt53(c.CurrentlyBoostedChatID) - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultOk) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultOk#1da13a8b to nil") - } - if err := b.ConsumeID(CanBoostChatResultOkTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultOk#1da13a8b: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultOk) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultOk#1da13a8b to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode canBoostChatResultOk#1da13a8b: field currently_boosted_chat_id: %w", err) - } - c.CurrentlyBoostedChatID = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultOk) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultOk#1da13a8b as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultOk") - b.Comma() - b.FieldStart("currently_boosted_chat_id") - b.PutInt53(c.CurrentlyBoostedChatID) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultOk) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultOk#1da13a8b to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultOk"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultOk#1da13a8b: %w", err) - } - case "currently_boosted_chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode canBoostChatResultOk#1da13a8b: field currently_boosted_chat_id: %w", err) - } - c.CurrentlyBoostedChatID = value - default: - return b.Skip() - } - return nil - }) -} - -// GetCurrentlyBoostedChatID returns value of CurrentlyBoostedChatID field. -func (c *CanBoostChatResultOk) GetCurrentlyBoostedChatID() (value int64) { - if c == nil { - return - } - return c.CurrentlyBoostedChatID -} - -// CanBoostChatResultInvalidChat represents TL type `canBoostChatResultInvalidChat#3d4c3668`. -type CanBoostChatResultInvalidChat struct { -} - -// CanBoostChatResultInvalidChatTypeID is TL type id of CanBoostChatResultInvalidChat. -const CanBoostChatResultInvalidChatTypeID = 0x3d4c3668 - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultInvalidChat) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultInvalidChat. -var ( - _ bin.Encoder = &CanBoostChatResultInvalidChat{} - _ bin.Decoder = &CanBoostChatResultInvalidChat{} - _ bin.BareEncoder = &CanBoostChatResultInvalidChat{} - _ bin.BareDecoder = &CanBoostChatResultInvalidChat{} - - _ CanBoostChatResultClass = &CanBoostChatResultInvalidChat{} -) - -func (c *CanBoostChatResultInvalidChat) Zero() bool { - if c == nil { - return true - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultInvalidChat) String() string { - if c == nil { - return "CanBoostChatResultInvalidChat(nil)" - } - type Alias CanBoostChatResultInvalidChat - return fmt.Sprintf("CanBoostChatResultInvalidChat%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultInvalidChat) TypeID() uint32 { - return CanBoostChatResultInvalidChatTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultInvalidChat) TypeName() string { - return "canBoostChatResultInvalidChat" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultInvalidChat) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultInvalidChat", - ID: CanBoostChatResultInvalidChatTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{} - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultInvalidChat) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultInvalidChat#3d4c3668 as nil") - } - b.PutID(CanBoostChatResultInvalidChatTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultInvalidChat) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultInvalidChat#3d4c3668 as nil") - } - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultInvalidChat) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultInvalidChat#3d4c3668 to nil") - } - if err := b.ConsumeID(CanBoostChatResultInvalidChatTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultInvalidChat#3d4c3668: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultInvalidChat) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultInvalidChat#3d4c3668 to nil") - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultInvalidChat) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultInvalidChat#3d4c3668 as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultInvalidChat") - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultInvalidChat) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultInvalidChat#3d4c3668 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultInvalidChat"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultInvalidChat#3d4c3668: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// CanBoostChatResultAlreadyBoosted represents TL type `canBoostChatResultAlreadyBoosted#3e012a69`. -type CanBoostChatResultAlreadyBoosted struct { -} - -// CanBoostChatResultAlreadyBoostedTypeID is TL type id of CanBoostChatResultAlreadyBoosted. -const CanBoostChatResultAlreadyBoostedTypeID = 0x3e012a69 - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultAlreadyBoosted) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultAlreadyBoosted. -var ( - _ bin.Encoder = &CanBoostChatResultAlreadyBoosted{} - _ bin.Decoder = &CanBoostChatResultAlreadyBoosted{} - _ bin.BareEncoder = &CanBoostChatResultAlreadyBoosted{} - _ bin.BareDecoder = &CanBoostChatResultAlreadyBoosted{} - - _ CanBoostChatResultClass = &CanBoostChatResultAlreadyBoosted{} -) - -func (c *CanBoostChatResultAlreadyBoosted) Zero() bool { - if c == nil { - return true - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultAlreadyBoosted) String() string { - if c == nil { - return "CanBoostChatResultAlreadyBoosted(nil)" - } - type Alias CanBoostChatResultAlreadyBoosted - return fmt.Sprintf("CanBoostChatResultAlreadyBoosted%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultAlreadyBoosted) TypeID() uint32 { - return CanBoostChatResultAlreadyBoostedTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultAlreadyBoosted) TypeName() string { - return "canBoostChatResultAlreadyBoosted" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultAlreadyBoosted) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultAlreadyBoosted", - ID: CanBoostChatResultAlreadyBoostedTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{} - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultAlreadyBoosted) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultAlreadyBoosted#3e012a69 as nil") - } - b.PutID(CanBoostChatResultAlreadyBoostedTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultAlreadyBoosted) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultAlreadyBoosted#3e012a69 as nil") - } - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultAlreadyBoosted) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultAlreadyBoosted#3e012a69 to nil") - } - if err := b.ConsumeID(CanBoostChatResultAlreadyBoostedTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultAlreadyBoosted#3e012a69: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultAlreadyBoosted) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultAlreadyBoosted#3e012a69 to nil") - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultAlreadyBoosted) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultAlreadyBoosted#3e012a69 as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultAlreadyBoosted") - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultAlreadyBoosted) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultAlreadyBoosted#3e012a69 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultAlreadyBoosted"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultAlreadyBoosted#3e012a69: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// CanBoostChatResultPremiumNeeded represents TL type `canBoostChatResultPremiumNeeded#d4b4e4f`. -type CanBoostChatResultPremiumNeeded struct { -} - -// CanBoostChatResultPremiumNeededTypeID is TL type id of CanBoostChatResultPremiumNeeded. -const CanBoostChatResultPremiumNeededTypeID = 0xd4b4e4f - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultPremiumNeeded) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultPremiumNeeded. -var ( - _ bin.Encoder = &CanBoostChatResultPremiumNeeded{} - _ bin.Decoder = &CanBoostChatResultPremiumNeeded{} - _ bin.BareEncoder = &CanBoostChatResultPremiumNeeded{} - _ bin.BareDecoder = &CanBoostChatResultPremiumNeeded{} - - _ CanBoostChatResultClass = &CanBoostChatResultPremiumNeeded{} -) - -func (c *CanBoostChatResultPremiumNeeded) Zero() bool { - if c == nil { - return true - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultPremiumNeeded) String() string { - if c == nil { - return "CanBoostChatResultPremiumNeeded(nil)" - } - type Alias CanBoostChatResultPremiumNeeded - return fmt.Sprintf("CanBoostChatResultPremiumNeeded%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultPremiumNeeded) TypeID() uint32 { - return CanBoostChatResultPremiumNeededTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultPremiumNeeded) TypeName() string { - return "canBoostChatResultPremiumNeeded" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultPremiumNeeded) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultPremiumNeeded", - ID: CanBoostChatResultPremiumNeededTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{} - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultPremiumNeeded) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumNeeded#d4b4e4f as nil") - } - b.PutID(CanBoostChatResultPremiumNeededTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultPremiumNeeded) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumNeeded#d4b4e4f as nil") - } - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultPremiumNeeded) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumNeeded#d4b4e4f to nil") - } - if err := b.ConsumeID(CanBoostChatResultPremiumNeededTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultPremiumNeeded#d4b4e4f: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultPremiumNeeded) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumNeeded#d4b4e4f to nil") - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultPremiumNeeded) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumNeeded#d4b4e4f as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultPremiumNeeded") - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultPremiumNeeded) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumNeeded#d4b4e4f to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultPremiumNeeded"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultPremiumNeeded#d4b4e4f: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// CanBoostChatResultPremiumSubscriptionNeeded represents TL type `canBoostChatResultPremiumSubscriptionNeeded#7550d3cc`. -type CanBoostChatResultPremiumSubscriptionNeeded struct { -} - -// CanBoostChatResultPremiumSubscriptionNeededTypeID is TL type id of CanBoostChatResultPremiumSubscriptionNeeded. -const CanBoostChatResultPremiumSubscriptionNeededTypeID = 0x7550d3cc - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultPremiumSubscriptionNeeded) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultPremiumSubscriptionNeeded. -var ( - _ bin.Encoder = &CanBoostChatResultPremiumSubscriptionNeeded{} - _ bin.Decoder = &CanBoostChatResultPremiumSubscriptionNeeded{} - _ bin.BareEncoder = &CanBoostChatResultPremiumSubscriptionNeeded{} - _ bin.BareDecoder = &CanBoostChatResultPremiumSubscriptionNeeded{} - - _ CanBoostChatResultClass = &CanBoostChatResultPremiumSubscriptionNeeded{} -) - -func (c *CanBoostChatResultPremiumSubscriptionNeeded) Zero() bool { - if c == nil { - return true - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) String() string { - if c == nil { - return "CanBoostChatResultPremiumSubscriptionNeeded(nil)" - } - type Alias CanBoostChatResultPremiumSubscriptionNeeded - return fmt.Sprintf("CanBoostChatResultPremiumSubscriptionNeeded%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultPremiumSubscriptionNeeded) TypeID() uint32 { - return CanBoostChatResultPremiumSubscriptionNeededTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultPremiumSubscriptionNeeded) TypeName() string { - return "canBoostChatResultPremiumSubscriptionNeeded" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultPremiumSubscriptionNeeded", - ID: CanBoostChatResultPremiumSubscriptionNeededTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{} - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc as nil") - } - b.PutID(CanBoostChatResultPremiumSubscriptionNeededTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc as nil") - } - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc to nil") - } - if err := b.ConsumeID(CanBoostChatResultPremiumSubscriptionNeededTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc to nil") - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultPremiumSubscriptionNeeded") - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultPremiumSubscriptionNeeded) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultPremiumSubscriptionNeeded"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultPremiumSubscriptionNeeded#7550d3cc: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// CanBoostChatResultWaitNeeded represents TL type `canBoostChatResultWaitNeeded#343aaeaa`. -type CanBoostChatResultWaitNeeded struct { - // Time left before the user can boost another chat - RetryAfter int32 -} - -// CanBoostChatResultWaitNeededTypeID is TL type id of CanBoostChatResultWaitNeeded. -const CanBoostChatResultWaitNeededTypeID = 0x343aaeaa - -// construct implements constructor of CanBoostChatResultClass. -func (c CanBoostChatResultWaitNeeded) construct() CanBoostChatResultClass { return &c } - -// Ensuring interfaces in compile-time for CanBoostChatResultWaitNeeded. -var ( - _ bin.Encoder = &CanBoostChatResultWaitNeeded{} - _ bin.Decoder = &CanBoostChatResultWaitNeeded{} - _ bin.BareEncoder = &CanBoostChatResultWaitNeeded{} - _ bin.BareDecoder = &CanBoostChatResultWaitNeeded{} - - _ CanBoostChatResultClass = &CanBoostChatResultWaitNeeded{} -) - -func (c *CanBoostChatResultWaitNeeded) Zero() bool { - if c == nil { - return true - } - if !(c.RetryAfter == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (c *CanBoostChatResultWaitNeeded) String() string { - if c == nil { - return "CanBoostChatResultWaitNeeded(nil)" - } - type Alias CanBoostChatResultWaitNeeded - return fmt.Sprintf("CanBoostChatResultWaitNeeded%+v", Alias(*c)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*CanBoostChatResultWaitNeeded) TypeID() uint32 { - return CanBoostChatResultWaitNeededTypeID -} - -// TypeName returns name of type in TL schema. -func (*CanBoostChatResultWaitNeeded) TypeName() string { - return "canBoostChatResultWaitNeeded" -} - -// TypeInfo returns info about TL type. -func (c *CanBoostChatResultWaitNeeded) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "canBoostChatResultWaitNeeded", - ID: CanBoostChatResultWaitNeededTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "RetryAfter", - SchemaName: "retry_after", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (c *CanBoostChatResultWaitNeeded) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultWaitNeeded#343aaeaa as nil") - } - b.PutID(CanBoostChatResultWaitNeededTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *CanBoostChatResultWaitNeeded) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultWaitNeeded#343aaeaa as nil") - } - b.PutInt32(c.RetryAfter) - return nil -} - -// Decode implements bin.Decoder. -func (c *CanBoostChatResultWaitNeeded) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultWaitNeeded#343aaeaa to nil") - } - if err := b.ConsumeID(CanBoostChatResultWaitNeededTypeID); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultWaitNeeded#343aaeaa: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *CanBoostChatResultWaitNeeded) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultWaitNeeded#343aaeaa to nil") - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode canBoostChatResultWaitNeeded#343aaeaa: field retry_after: %w", err) - } - c.RetryAfter = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (c *CanBoostChatResultWaitNeeded) EncodeTDLibJSON(b tdjson.Encoder) error { - if c == nil { - return fmt.Errorf("can't encode canBoostChatResultWaitNeeded#343aaeaa as nil") - } - b.ObjStart() - b.PutID("canBoostChatResultWaitNeeded") - b.Comma() - b.FieldStart("retry_after") - b.PutInt32(c.RetryAfter) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (c *CanBoostChatResultWaitNeeded) DecodeTDLibJSON(b tdjson.Decoder) error { - if c == nil { - return fmt.Errorf("can't decode canBoostChatResultWaitNeeded#343aaeaa to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("canBoostChatResultWaitNeeded"); err != nil { - return fmt.Errorf("unable to decode canBoostChatResultWaitNeeded#343aaeaa: %w", err) - } - case "retry_after": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode canBoostChatResultWaitNeeded#343aaeaa: field retry_after: %w", err) - } - c.RetryAfter = value - default: - return b.Skip() - } - return nil - }) -} - -// GetRetryAfter returns value of RetryAfter field. -func (c *CanBoostChatResultWaitNeeded) GetRetryAfter() (value int32) { - if c == nil { - return - } - return c.RetryAfter -} - -// CanBoostChatResultClassName is schema name of CanBoostChatResultClass. -const CanBoostChatResultClassName = "CanBoostChatResult" - -// CanBoostChatResultClass represents CanBoostChatResult generic type. -// -// Example: -// -// g, err := tdapi.DecodeCanBoostChatResult(buf) -// if err != nil { -// panic(err) -// } -// switch v := g.(type) { -// case *tdapi.CanBoostChatResultOk: // canBoostChatResultOk#1da13a8b -// case *tdapi.CanBoostChatResultInvalidChat: // canBoostChatResultInvalidChat#3d4c3668 -// case *tdapi.CanBoostChatResultAlreadyBoosted: // canBoostChatResultAlreadyBoosted#3e012a69 -// case *tdapi.CanBoostChatResultPremiumNeeded: // canBoostChatResultPremiumNeeded#d4b4e4f -// case *tdapi.CanBoostChatResultPremiumSubscriptionNeeded: // canBoostChatResultPremiumSubscriptionNeeded#7550d3cc -// case *tdapi.CanBoostChatResultWaitNeeded: // canBoostChatResultWaitNeeded#343aaeaa -// default: panic(v) -// } -type CanBoostChatResultClass interface { - bin.Encoder - bin.Decoder - bin.BareEncoder - bin.BareDecoder - construct() CanBoostChatResultClass - - // 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 -} - -// DecodeCanBoostChatResult implements binary de-serialization for CanBoostChatResultClass. -func DecodeCanBoostChatResult(buf *bin.Buffer) (CanBoostChatResultClass, error) { - id, err := buf.PeekID() - if err != nil { - return nil, err - } - switch id { - case CanBoostChatResultOkTypeID: - // Decoding canBoostChatResultOk#1da13a8b. - v := CanBoostChatResultOk{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case CanBoostChatResultInvalidChatTypeID: - // Decoding canBoostChatResultInvalidChat#3d4c3668. - v := CanBoostChatResultInvalidChat{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case CanBoostChatResultAlreadyBoostedTypeID: - // Decoding canBoostChatResultAlreadyBoosted#3e012a69. - v := CanBoostChatResultAlreadyBoosted{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case CanBoostChatResultPremiumNeededTypeID: - // Decoding canBoostChatResultPremiumNeeded#d4b4e4f. - v := CanBoostChatResultPremiumNeeded{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case CanBoostChatResultPremiumSubscriptionNeededTypeID: - // Decoding canBoostChatResultPremiumSubscriptionNeeded#7550d3cc. - v := CanBoostChatResultPremiumSubscriptionNeeded{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case CanBoostChatResultWaitNeededTypeID: - // Decoding canBoostChatResultWaitNeeded#343aaeaa. - v := CanBoostChatResultWaitNeeded{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", bin.NewUnexpectedID(id)) - } -} - -// DecodeTDLibJSONCanBoostChatResult implements binary de-serialization for CanBoostChatResultClass. -func DecodeTDLibJSONCanBoostChatResult(buf tdjson.Decoder) (CanBoostChatResultClass, error) { - id, err := buf.FindTypeID() - if err != nil { - return nil, err - } - switch id { - case "canBoostChatResultOk": - // Decoding canBoostChatResultOk#1da13a8b. - v := CanBoostChatResultOk{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case "canBoostChatResultInvalidChat": - // Decoding canBoostChatResultInvalidChat#3d4c3668. - v := CanBoostChatResultInvalidChat{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case "canBoostChatResultAlreadyBoosted": - // Decoding canBoostChatResultAlreadyBoosted#3e012a69. - v := CanBoostChatResultAlreadyBoosted{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case "canBoostChatResultPremiumNeeded": - // Decoding canBoostChatResultPremiumNeeded#d4b4e4f. - v := CanBoostChatResultPremiumNeeded{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case "canBoostChatResultPremiumSubscriptionNeeded": - // Decoding canBoostChatResultPremiumSubscriptionNeeded#7550d3cc. - v := CanBoostChatResultPremiumSubscriptionNeeded{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - case "canBoostChatResultWaitNeeded": - // Decoding canBoostChatResultWaitNeeded#343aaeaa. - v := CanBoostChatResultWaitNeeded{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode CanBoostChatResultClass: %w", tdjson.NewUnexpectedID(id)) - } -} - -// CanBoostChatResult boxes the CanBoostChatResultClass providing a helper. -type CanBoostChatResultBox struct { - CanBoostChatResult CanBoostChatResultClass -} - -// Decode implements bin.Decoder for CanBoostChatResultBox. -func (b *CanBoostChatResultBox) Decode(buf *bin.Buffer) error { - if b == nil { - return fmt.Errorf("unable to decode CanBoostChatResultBox to nil") - } - v, err := DecodeCanBoostChatResult(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.CanBoostChatResult = v - return nil -} - -// Encode implements bin.Encode for CanBoostChatResultBox. -func (b *CanBoostChatResultBox) Encode(buf *bin.Buffer) error { - if b == nil || b.CanBoostChatResult == nil { - return fmt.Errorf("unable to encode CanBoostChatResultClass as nil") - } - return b.CanBoostChatResult.Encode(buf) -} - -// DecodeTDLibJSON implements bin.Decoder for CanBoostChatResultBox. -func (b *CanBoostChatResultBox) DecodeTDLibJSON(buf tdjson.Decoder) error { - if b == nil { - return fmt.Errorf("unable to decode CanBoostChatResultBox to nil") - } - v, err := DecodeTDLibJSONCanBoostChatResult(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.CanBoostChatResult = v - return nil -} - -// EncodeTDLibJSON implements bin.Encode for CanBoostChatResultBox. -func (b *CanBoostChatResultBox) EncodeTDLibJSON(buf tdjson.Encoder) error { - if b == nil || b.CanBoostChatResult == nil { - return fmt.Errorf("unable to encode CanBoostChatResultClass as nil") - } - return b.CanBoostChatResult.EncodeTDLibJSON(buf) -} diff --git a/tdapi/tl_chat_boost_gen.go b/tdapi/tl_chat_boost_gen.go index 9c561ebed4..fe72ea2542 100644 --- a/tdapi/tl_chat_boost_gen.go +++ b/tdapi/tl_chat_boost_gen.go @@ -31,17 +31,22 @@ var ( _ = tdjson.Encoder{} ) -// ChatBoost represents TL type `chatBoost#8d029d82`. +// ChatBoost represents TL type `chatBoost#96bfccb2`. type ChatBoost struct { - // Identifier of a user that boosted the chat - UserID int64 - // Point in time (Unix timestamp) when the boost will automatically expire if the user - // will not prolongate their Telegram Premium subscription + // Unique identifier of the boost + ID string + // The number of identical boosts applied + Count int32 + // Source of the boost + Source ChatBoostSourceClass + // Point in time (Unix timestamp) when the chat was boosted + StartDate int32 + // Point in time (Unix timestamp) when the boost will expire ExpirationDate int32 } // ChatBoostTypeID is TL type id of ChatBoost. -const ChatBoostTypeID = 0x8d029d82 +const ChatBoostTypeID = 0x96bfccb2 // Ensuring interfaces in compile-time for ChatBoost. var ( @@ -55,7 +60,16 @@ func (c *ChatBoost) Zero() bool { if c == nil { return true } - if !(c.UserID == 0) { + if !(c.ID == "") { + return false + } + if !(c.Count == 0) { + return false + } + if !(c.Source == nil) { + return false + } + if !(c.StartDate == 0) { return false } if !(c.ExpirationDate == 0) { @@ -98,8 +112,20 @@ func (c *ChatBoost) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "UserID", - SchemaName: "user_id", + Name: "ID", + SchemaName: "id", + }, + { + Name: "Count", + SchemaName: "count", + }, + { + Name: "Source", + SchemaName: "source", + }, + { + Name: "StartDate", + SchemaName: "start_date", }, { Name: "ExpirationDate", @@ -112,7 +138,7 @@ func (c *ChatBoost) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatBoost) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatBoost#8d029d82 as nil") + return fmt.Errorf("can't encode chatBoost#96bfccb2 as nil") } b.PutID(ChatBoostTypeID) return c.EncodeBare(b) @@ -121,9 +147,17 @@ func (c *ChatBoost) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatBoost) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatBoost#8d029d82 as nil") + return fmt.Errorf("can't encode chatBoost#96bfccb2 as nil") + } + b.PutString(c.ID) + b.PutInt32(c.Count) + if c.Source == nil { + return fmt.Errorf("unable to encode chatBoost#96bfccb2: field source is nil") + } + if err := c.Source.Encode(b); err != nil { + return fmt.Errorf("unable to encode chatBoost#96bfccb2: field source: %w", err) } - b.PutInt53(c.UserID) + b.PutInt32(c.StartDate) b.PutInt32(c.ExpirationDate) return nil } @@ -131,10 +165,10 @@ func (c *ChatBoost) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatBoost) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatBoost#8d029d82 to nil") + return fmt.Errorf("can't decode chatBoost#96bfccb2 to nil") } if err := b.ConsumeID(ChatBoostTypeID); err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: %w", err) } return c.DecodeBare(b) } @@ -142,19 +176,40 @@ func (c *ChatBoost) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatBoost) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatBoost#8d029d82 to nil") + return fmt.Errorf("can't decode chatBoost#96bfccb2 to nil") } { - value, err := b.Int53() + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field id: %w", err) + } + c.ID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field count: %w", err) + } + c.Count = value + } + { + value, err := DecodeChatBoostSource(b) + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field source: %w", err) + } + c.Source = value + } + { + value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: field user_id: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field start_date: %w", err) } - c.UserID = value + c.StartDate = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: field expiration_date: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field expiration_date: %w", err) } c.ExpirationDate = value } @@ -164,13 +219,27 @@ func (c *ChatBoost) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *ChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chatBoost#8d029d82 as nil") + return fmt.Errorf("can't encode chatBoost#96bfccb2 as nil") } b.ObjStart() b.PutID("chatBoost") b.Comma() - b.FieldStart("user_id") - b.PutInt53(c.UserID) + b.FieldStart("id") + b.PutString(c.ID) + b.Comma() + b.FieldStart("count") + b.PutInt32(c.Count) + b.Comma() + b.FieldStart("source") + if c.Source == nil { + return fmt.Errorf("unable to encode chatBoost#96bfccb2: field source is nil") + } + if err := c.Source.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatBoost#96bfccb2: field source: %w", err) + } + b.Comma() + b.FieldStart("start_date") + b.PutInt32(c.StartDate) b.Comma() b.FieldStart("expiration_date") b.PutInt32(c.ExpirationDate) @@ -183,25 +252,43 @@ func (c *ChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *ChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chatBoost#8d029d82 to nil") + return fmt.Errorf("can't decode chatBoost#96bfccb2 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("chatBoost"); err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: %w", err) + } + case "id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field id: %w", err) } - case "user_id": - value, err := b.Int53() + c.ID = value + case "count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field count: %w", err) + } + c.Count = value + case "source": + value, err := DecodeTDLibJSONChatBoostSource(b) if err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: field user_id: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field source: %w", err) } - c.UserID = value + c.Source = value + case "start_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field start_date: %w", err) + } + c.StartDate = value case "expiration_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoost#8d029d82: field expiration_date: %w", err) + return fmt.Errorf("unable to decode chatBoost#96bfccb2: field expiration_date: %w", err) } c.ExpirationDate = value default: @@ -211,12 +298,36 @@ func (c *ChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetUserID returns value of UserID field. -func (c *ChatBoost) GetUserID() (value int64) { +// GetID returns value of ID field. +func (c *ChatBoost) GetID() (value string) { + if c == nil { + return + } + return c.ID +} + +// GetCount returns value of Count field. +func (c *ChatBoost) GetCount() (value int32) { + if c == nil { + return + } + return c.Count +} + +// GetSource returns value of Source field. +func (c *ChatBoost) GetSource() (value ChatBoostSourceClass) { + if c == nil { + return + } + return c.Source +} + +// GetStartDate returns value of StartDate field. +func (c *ChatBoost) GetStartDate() (value int32) { if c == nil { return } - return c.UserID + return c.StartDate } // GetExpirationDate returns value of ExpirationDate field. diff --git a/tdapi/tl_chat_boost_slot_gen.go b/tdapi/tl_chat_boost_slot_gen.go new file mode 100644 index 0000000000..67a2b2c504 --- /dev/null +++ b/tdapi/tl_chat_boost_slot_gen.go @@ -0,0 +1,329 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ChatBoostSlot represents TL type `chatBoostSlot#757fac7`. +type ChatBoostSlot struct { + // Unique identifier of the slot + SlotID int32 + // Identifier of the currently boosted chat; 0 if none + CurrentlyBoostedChatID int64 + // Point in time (Unix timestamp) when the chat was boosted; 0 if none + StartDate int32 + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 + // Point in time (Unix timestamp) after which the boost can be used for another chat + CooldownUntilDate int32 +} + +// ChatBoostSlotTypeID is TL type id of ChatBoostSlot. +const ChatBoostSlotTypeID = 0x757fac7 + +// Ensuring interfaces in compile-time for ChatBoostSlot. +var ( + _ bin.Encoder = &ChatBoostSlot{} + _ bin.Decoder = &ChatBoostSlot{} + _ bin.BareEncoder = &ChatBoostSlot{} + _ bin.BareDecoder = &ChatBoostSlot{} +) + +func (c *ChatBoostSlot) Zero() bool { + if c == nil { + return true + } + if !(c.SlotID == 0) { + return false + } + if !(c.CurrentlyBoostedChatID == 0) { + return false + } + if !(c.StartDate == 0) { + return false + } + if !(c.ExpirationDate == 0) { + return false + } + if !(c.CooldownUntilDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostSlot) String() string { + if c == nil { + return "ChatBoostSlot(nil)" + } + type Alias ChatBoostSlot + return fmt.Sprintf("ChatBoostSlot%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostSlot) TypeID() uint32 { + return ChatBoostSlotTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostSlot) TypeName() string { + return "chatBoostSlot" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostSlot) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostSlot", + ID: ChatBoostSlotTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SlotID", + SchemaName: "slot_id", + }, + { + Name: "CurrentlyBoostedChatID", + SchemaName: "currently_boosted_chat_id", + }, + { + Name: "StartDate", + SchemaName: "start_date", + }, + { + Name: "ExpirationDate", + SchemaName: "expiration_date", + }, + { + Name: "CooldownUntilDate", + SchemaName: "cooldown_until_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostSlot) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlot#757fac7 as nil") + } + b.PutID(ChatBoostSlotTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostSlot) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlot#757fac7 as nil") + } + b.PutInt32(c.SlotID) + b.PutInt53(c.CurrentlyBoostedChatID) + b.PutInt32(c.StartDate) + b.PutInt32(c.ExpirationDate) + b.PutInt32(c.CooldownUntilDate) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostSlot) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlot#757fac7 to nil") + } + if err := b.ConsumeID(ChatBoostSlotTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostSlot) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlot#757fac7 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field slot_id: %w", err) + } + c.SlotID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field currently_boosted_chat_id: %w", err) + } + c.CurrentlyBoostedChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field start_date: %w", err) + } + c.StartDate = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field expiration_date: %w", err) + } + c.ExpirationDate = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field cooldown_until_date: %w", err) + } + c.CooldownUntilDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostSlot) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlot#757fac7 as nil") + } + b.ObjStart() + b.PutID("chatBoostSlot") + b.Comma() + b.FieldStart("slot_id") + b.PutInt32(c.SlotID) + b.Comma() + b.FieldStart("currently_boosted_chat_id") + b.PutInt53(c.CurrentlyBoostedChatID) + b.Comma() + b.FieldStart("start_date") + b.PutInt32(c.StartDate) + b.Comma() + b.FieldStart("expiration_date") + b.PutInt32(c.ExpirationDate) + b.Comma() + b.FieldStart("cooldown_until_date") + b.PutInt32(c.CooldownUntilDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatBoostSlot) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlot#757fac7 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostSlot"); err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: %w", err) + } + case "slot_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field slot_id: %w", err) + } + c.SlotID = value + case "currently_boosted_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field currently_boosted_chat_id: %w", err) + } + c.CurrentlyBoostedChatID = value + case "start_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field start_date: %w", err) + } + c.StartDate = value + case "expiration_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field expiration_date: %w", err) + } + c.ExpirationDate = value + case "cooldown_until_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlot#757fac7: field cooldown_until_date: %w", err) + } + c.CooldownUntilDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSlotID returns value of SlotID field. +func (c *ChatBoostSlot) GetSlotID() (value int32) { + if c == nil { + return + } + return c.SlotID +} + +// GetCurrentlyBoostedChatID returns value of CurrentlyBoostedChatID field. +func (c *ChatBoostSlot) GetCurrentlyBoostedChatID() (value int64) { + if c == nil { + return + } + return c.CurrentlyBoostedChatID +} + +// GetStartDate returns value of StartDate field. +func (c *ChatBoostSlot) GetStartDate() (value int32) { + if c == nil { + return + } + return c.StartDate +} + +// GetExpirationDate returns value of ExpirationDate field. +func (c *ChatBoostSlot) GetExpirationDate() (value int32) { + if c == nil { + return + } + return c.ExpirationDate +} + +// GetCooldownUntilDate returns value of CooldownUntilDate field. +func (c *ChatBoostSlot) GetCooldownUntilDate() (value int32) { + if c == nil { + return + } + return c.CooldownUntilDate +} diff --git a/tdapi/tl_chat_boost_slots_gen.go b/tdapi/tl_chat_boost_slots_gen.go new file mode 100644 index 0000000000..295160308c --- /dev/null +++ b/tdapi/tl_chat_boost_slots_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{} +) + +// ChatBoostSlots represents TL type `chatBoostSlots#6859c79`. +type ChatBoostSlots struct { + // List of boost slots + Slots []ChatBoostSlot +} + +// ChatBoostSlotsTypeID is TL type id of ChatBoostSlots. +const ChatBoostSlotsTypeID = 0x6859c79 + +// Ensuring interfaces in compile-time for ChatBoostSlots. +var ( + _ bin.Encoder = &ChatBoostSlots{} + _ bin.Decoder = &ChatBoostSlots{} + _ bin.BareEncoder = &ChatBoostSlots{} + _ bin.BareDecoder = &ChatBoostSlots{} +) + +func (c *ChatBoostSlots) Zero() bool { + if c == nil { + return true + } + if !(c.Slots == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostSlots) String() string { + if c == nil { + return "ChatBoostSlots(nil)" + } + type Alias ChatBoostSlots + return fmt.Sprintf("ChatBoostSlots%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostSlots) TypeID() uint32 { + return ChatBoostSlotsTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostSlots) TypeName() string { + return "chatBoostSlots" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostSlots) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostSlots", + ID: ChatBoostSlotsTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Slots", + SchemaName: "slots", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostSlots) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlots#6859c79 as nil") + } + b.PutID(ChatBoostSlotsTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostSlots) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlots#6859c79 as nil") + } + b.PutInt(len(c.Slots)) + for idx, v := range c.Slots { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare chatBoostSlots#6859c79: field slots element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostSlots) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlots#6859c79 to nil") + } + if err := b.ConsumeID(ChatBoostSlotsTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostSlots#6859c79: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostSlots) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlots#6859c79 to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSlots#6859c79: field slots: %w", err) + } + + if headerLen > 0 { + c.Slots = make([]ChatBoostSlot, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ChatBoostSlot + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare chatBoostSlots#6859c79: field slots: %w", err) + } + c.Slots = append(c.Slots, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostSlots) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSlots#6859c79 as nil") + } + b.ObjStart() + b.PutID("chatBoostSlots") + b.Comma() + b.FieldStart("slots") + b.ArrStart() + for idx, v := range c.Slots { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatBoostSlots#6859c79: field slots 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 *ChatBoostSlots) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSlots#6859c79 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostSlots"); err != nil { + return fmt.Errorf("unable to decode chatBoostSlots#6859c79: %w", err) + } + case "slots": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ChatBoostSlot + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatBoostSlots#6859c79: field slots: %w", err) + } + c.Slots = append(c.Slots, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode chatBoostSlots#6859c79: field slots: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetSlots returns value of Slots field. +func (c *ChatBoostSlots) GetSlots() (value []ChatBoostSlot) { + if c == nil { + return + } + return c.Slots +} diff --git a/tdapi/tl_chat_boost_source_gen.go b/tdapi/tl_chat_boost_source_gen.go new file mode 100644 index 0000000000..d115948218 --- /dev/null +++ b/tdapi/tl_chat_boost_source_gen.go @@ -0,0 +1,825 @@ +// 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{} +) + +// ChatBoostSourceGiftCode represents TL type `chatBoostSourceGiftCode#fa2412ba`. +type ChatBoostSourceGiftCode struct { + // Identifier of a user, for which the gift code was created + UserID int64 + // The created Telegram Premium gift code, which is known only if this is a gift code for + // the current user, or it has already been claimed + GiftCode string +} + +// ChatBoostSourceGiftCodeTypeID is TL type id of ChatBoostSourceGiftCode. +const ChatBoostSourceGiftCodeTypeID = 0xfa2412ba + +// construct implements constructor of ChatBoostSourceClass. +func (c ChatBoostSourceGiftCode) construct() ChatBoostSourceClass { return &c } + +// Ensuring interfaces in compile-time for ChatBoostSourceGiftCode. +var ( + _ bin.Encoder = &ChatBoostSourceGiftCode{} + _ bin.Decoder = &ChatBoostSourceGiftCode{} + _ bin.BareEncoder = &ChatBoostSourceGiftCode{} + _ bin.BareDecoder = &ChatBoostSourceGiftCode{} + + _ ChatBoostSourceClass = &ChatBoostSourceGiftCode{} +) + +func (c *ChatBoostSourceGiftCode) Zero() bool { + if c == nil { + return true + } + if !(c.UserID == 0) { + return false + } + if !(c.GiftCode == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostSourceGiftCode) String() string { + if c == nil { + return "ChatBoostSourceGiftCode(nil)" + } + type Alias ChatBoostSourceGiftCode + return fmt.Sprintf("ChatBoostSourceGiftCode%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostSourceGiftCode) TypeID() uint32 { + return ChatBoostSourceGiftCodeTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostSourceGiftCode) TypeName() string { + return "chatBoostSourceGiftCode" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostSourceGiftCode) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostSourceGiftCode", + ID: ChatBoostSourceGiftCodeTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "GiftCode", + SchemaName: "gift_code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostSourceGiftCode) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiftCode#fa2412ba as nil") + } + b.PutID(ChatBoostSourceGiftCodeTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostSourceGiftCode) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiftCode#fa2412ba as nil") + } + b.PutInt53(c.UserID) + b.PutString(c.GiftCode) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostSourceGiftCode) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiftCode#fa2412ba to nil") + } + if err := b.ConsumeID(ChatBoostSourceGiftCodeTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostSourceGiftCode) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiftCode#fa2412ba to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: field user_id: %w", err) + } + c.UserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: field gift_code: %w", err) + } + c.GiftCode = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostSourceGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiftCode#fa2412ba as nil") + } + b.ObjStart() + b.PutID("chatBoostSourceGiftCode") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(c.UserID) + b.Comma() + b.FieldStart("gift_code") + b.PutString(c.GiftCode) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatBoostSourceGiftCode) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiftCode#fa2412ba to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostSourceGiftCode"); err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: field user_id: %w", err) + } + c.UserID = value + case "gift_code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiftCode#fa2412ba: field gift_code: %w", err) + } + c.GiftCode = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (c *ChatBoostSourceGiftCode) GetUserID() (value int64) { + if c == nil { + return + } + return c.UserID +} + +// GetGiftCode returns value of GiftCode field. +func (c *ChatBoostSourceGiftCode) GetGiftCode() (value string) { + if c == nil { + return + } + return c.GiftCode +} + +// ChatBoostSourceGiveaway represents TL type `chatBoostSourceGiveaway#90d1c70`. +type ChatBoostSourceGiveaway struct { + // Identifier of a user that won in the giveaway; 0 if none + UserID int64 + // The created Telegram Premium gift code if it was used by the user or can be claimed by + // the current user; an empty string otherwise + GiftCode string + // Identifier of the corresponding giveaway message; can be an identifier of a deleted + // message + GiveawayMessageID int64 + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, + // because there were not enough participants + IsUnclaimed bool +} + +// ChatBoostSourceGiveawayTypeID is TL type id of ChatBoostSourceGiveaway. +const ChatBoostSourceGiveawayTypeID = 0x90d1c70 + +// construct implements constructor of ChatBoostSourceClass. +func (c ChatBoostSourceGiveaway) construct() ChatBoostSourceClass { return &c } + +// Ensuring interfaces in compile-time for ChatBoostSourceGiveaway. +var ( + _ bin.Encoder = &ChatBoostSourceGiveaway{} + _ bin.Decoder = &ChatBoostSourceGiveaway{} + _ bin.BareEncoder = &ChatBoostSourceGiveaway{} + _ bin.BareDecoder = &ChatBoostSourceGiveaway{} + + _ ChatBoostSourceClass = &ChatBoostSourceGiveaway{} +) + +func (c *ChatBoostSourceGiveaway) Zero() bool { + if c == nil { + return true + } + if !(c.UserID == 0) { + return false + } + if !(c.GiftCode == "") { + return false + } + if !(c.GiveawayMessageID == 0) { + return false + } + if !(c.IsUnclaimed == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostSourceGiveaway) String() string { + if c == nil { + return "ChatBoostSourceGiveaway(nil)" + } + type Alias ChatBoostSourceGiveaway + return fmt.Sprintf("ChatBoostSourceGiveaway%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostSourceGiveaway) TypeID() uint32 { + return ChatBoostSourceGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostSourceGiveaway) TypeName() string { + return "chatBoostSourceGiveaway" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostSourceGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostSourceGiveaway", + ID: ChatBoostSourceGiveawayTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "GiftCode", + SchemaName: "gift_code", + }, + { + Name: "GiveawayMessageID", + SchemaName: "giveaway_message_id", + }, + { + Name: "IsUnclaimed", + SchemaName: "is_unclaimed", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostSourceGiveaway) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiveaway#90d1c70 as nil") + } + b.PutID(ChatBoostSourceGiveawayTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostSourceGiveaway) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiveaway#90d1c70 as nil") + } + b.PutInt53(c.UserID) + b.PutString(c.GiftCode) + b.PutInt53(c.GiveawayMessageID) + b.PutBool(c.IsUnclaimed) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostSourceGiveaway) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiveaway#90d1c70 to nil") + } + if err := b.ConsumeID(ChatBoostSourceGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostSourceGiveaway) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiveaway#90d1c70 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field user_id: %w", err) + } + c.UserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field gift_code: %w", err) + } + c.GiftCode = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field giveaway_message_id: %w", err) + } + c.GiveawayMessageID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field is_unclaimed: %w", err) + } + c.IsUnclaimed = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostSourceGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourceGiveaway#90d1c70 as nil") + } + b.ObjStart() + b.PutID("chatBoostSourceGiveaway") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(c.UserID) + b.Comma() + b.FieldStart("gift_code") + b.PutString(c.GiftCode) + b.Comma() + b.FieldStart("giveaway_message_id") + b.PutInt53(c.GiveawayMessageID) + b.Comma() + b.FieldStart("is_unclaimed") + b.PutBool(c.IsUnclaimed) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatBoostSourceGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourceGiveaway#90d1c70 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostSourceGiveaway"); err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field user_id: %w", err) + } + c.UserID = value + case "gift_code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field gift_code: %w", err) + } + c.GiftCode = value + case "giveaway_message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field giveaway_message_id: %w", err) + } + c.GiveawayMessageID = value + case "is_unclaimed": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourceGiveaway#90d1c70: field is_unclaimed: %w", err) + } + c.IsUnclaimed = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (c *ChatBoostSourceGiveaway) GetUserID() (value int64) { + if c == nil { + return + } + return c.UserID +} + +// GetGiftCode returns value of GiftCode field. +func (c *ChatBoostSourceGiveaway) GetGiftCode() (value string) { + if c == nil { + return + } + return c.GiftCode +} + +// GetGiveawayMessageID returns value of GiveawayMessageID field. +func (c *ChatBoostSourceGiveaway) GetGiveawayMessageID() (value int64) { + if c == nil { + return + } + return c.GiveawayMessageID +} + +// GetIsUnclaimed returns value of IsUnclaimed field. +func (c *ChatBoostSourceGiveaway) GetIsUnclaimed() (value bool) { + if c == nil { + return + } + return c.IsUnclaimed +} + +// ChatBoostSourcePremium represents TL type `chatBoostSourcePremium#ed4eb`. +type ChatBoostSourcePremium struct { + // Identifier of the user + UserID int64 +} + +// ChatBoostSourcePremiumTypeID is TL type id of ChatBoostSourcePremium. +const ChatBoostSourcePremiumTypeID = 0xed4eb + +// construct implements constructor of ChatBoostSourceClass. +func (c ChatBoostSourcePremium) construct() ChatBoostSourceClass { return &c } + +// Ensuring interfaces in compile-time for ChatBoostSourcePremium. +var ( + _ bin.Encoder = &ChatBoostSourcePremium{} + _ bin.Decoder = &ChatBoostSourcePremium{} + _ bin.BareEncoder = &ChatBoostSourcePremium{} + _ bin.BareDecoder = &ChatBoostSourcePremium{} + + _ ChatBoostSourceClass = &ChatBoostSourcePremium{} +) + +func (c *ChatBoostSourcePremium) Zero() bool { + if c == nil { + return true + } + if !(c.UserID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatBoostSourcePremium) String() string { + if c == nil { + return "ChatBoostSourcePremium(nil)" + } + type Alias ChatBoostSourcePremium + return fmt.Sprintf("ChatBoostSourcePremium%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatBoostSourcePremium) TypeID() uint32 { + return ChatBoostSourcePremiumTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatBoostSourcePremium) TypeName() string { + return "chatBoostSourcePremium" +} + +// TypeInfo returns info about TL type. +func (c *ChatBoostSourcePremium) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatBoostSourcePremium", + ID: ChatBoostSourcePremiumTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatBoostSourcePremium) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourcePremium#ed4eb as nil") + } + b.PutID(ChatBoostSourcePremiumTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatBoostSourcePremium) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourcePremium#ed4eb as nil") + } + b.PutInt53(c.UserID) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatBoostSourcePremium) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourcePremium#ed4eb to nil") + } + if err := b.ConsumeID(ChatBoostSourcePremiumTypeID); err != nil { + return fmt.Errorf("unable to decode chatBoostSourcePremium#ed4eb: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatBoostSourcePremium) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourcePremium#ed4eb to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourcePremium#ed4eb: field user_id: %w", err) + } + c.UserID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatBoostSourcePremium) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatBoostSourcePremium#ed4eb as nil") + } + b.ObjStart() + b.PutID("chatBoostSourcePremium") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(c.UserID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatBoostSourcePremium) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatBoostSourcePremium#ed4eb to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("chatBoostSourcePremium"); err != nil { + return fmt.Errorf("unable to decode chatBoostSourcePremium#ed4eb: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode chatBoostSourcePremium#ed4eb: field user_id: %w", err) + } + c.UserID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (c *ChatBoostSourcePremium) GetUserID() (value int64) { + if c == nil { + return + } + return c.UserID +} + +// ChatBoostSourceClassName is schema name of ChatBoostSourceClass. +const ChatBoostSourceClassName = "ChatBoostSource" + +// ChatBoostSourceClass represents ChatBoostSource generic type. +// +// Example: +// +// g, err := tdapi.DecodeChatBoostSource(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.ChatBoostSourceGiftCode: // chatBoostSourceGiftCode#fa2412ba +// case *tdapi.ChatBoostSourceGiveaway: // chatBoostSourceGiveaway#90d1c70 +// case *tdapi.ChatBoostSourcePremium: // chatBoostSourcePremium#ed4eb +// default: panic(v) +// } +type ChatBoostSourceClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() ChatBoostSourceClass + + // 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 + + // Identifier of a user, for which the gift code was created + GetUserID() (value int64) +} + +// DecodeChatBoostSource implements binary de-serialization for ChatBoostSourceClass. +func DecodeChatBoostSource(buf *bin.Buffer) (ChatBoostSourceClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case ChatBoostSourceGiftCodeTypeID: + // Decoding chatBoostSourceGiftCode#fa2412ba. + v := ChatBoostSourceGiftCode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + case ChatBoostSourceGiveawayTypeID: + // Decoding chatBoostSourceGiveaway#90d1c70. + v := ChatBoostSourceGiveaway{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + case ChatBoostSourcePremiumTypeID: + // Decoding chatBoostSourcePremium#ed4eb. + v := ChatBoostSourcePremium{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONChatBoostSource implements binary de-serialization for ChatBoostSourceClass. +func DecodeTDLibJSONChatBoostSource(buf tdjson.Decoder) (ChatBoostSourceClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "chatBoostSourceGiftCode": + // Decoding chatBoostSourceGiftCode#fa2412ba. + v := ChatBoostSourceGiftCode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + case "chatBoostSourceGiveaway": + // Decoding chatBoostSourceGiveaway#90d1c70. + v := ChatBoostSourceGiveaway{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + case "chatBoostSourcePremium": + // Decoding chatBoostSourcePremium#ed4eb. + v := ChatBoostSourcePremium{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ChatBoostSourceClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// ChatBoostSource boxes the ChatBoostSourceClass providing a helper. +type ChatBoostSourceBox struct { + ChatBoostSource ChatBoostSourceClass +} + +// Decode implements bin.Decoder for ChatBoostSourceBox. +func (b *ChatBoostSourceBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode ChatBoostSourceBox to nil") + } + v, err := DecodeChatBoostSource(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ChatBoostSource = v + return nil +} + +// Encode implements bin.Encode for ChatBoostSourceBox. +func (b *ChatBoostSourceBox) Encode(buf *bin.Buffer) error { + if b == nil || b.ChatBoostSource == nil { + return fmt.Errorf("unable to encode ChatBoostSourceClass as nil") + } + return b.ChatBoostSource.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for ChatBoostSourceBox. +func (b *ChatBoostSourceBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode ChatBoostSourceBox to nil") + } + v, err := DecodeTDLibJSONChatBoostSource(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ChatBoostSource = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for ChatBoostSourceBox. +func (b *ChatBoostSourceBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.ChatBoostSource == nil { + return fmt.Errorf("unable to encode ChatBoostSourceClass as nil") + } + return b.ChatBoostSource.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_chat_boost_status_gen.go b/tdapi/tl_chat_boost_status_gen.go index 6fba3672b8..0a8666ccd6 100644 --- a/tdapi/tl_chat_boost_status_gen.go +++ b/tdapi/tl_chat_boost_status_gen.go @@ -31,15 +31,18 @@ var ( _ = tdjson.Encoder{} ) -// ChatBoostStatus represents TL type `chatBoostStatus#dc02a4b2`. +// ChatBoostStatus represents TL type `chatBoostStatus#a5007413`. type ChatBoostStatus struct { // An HTTP URL, which can be used to boost the chat BoostURL string - // True, if the current user has already boosted the chat - IsBoosted bool + // Identifiers of boost slots of the current user applied to the chat + AppliedSlotIDs []int32 // Current boost level of the chat Level int32 - // The number of times the chat was boosted + // The number of boosts received by the chat from created Telegram Premium gift codes and + // giveaways; always 0 if the current user isn't an administrator in the chat + GiftCodeBoostCount int32 + // The number of boosts received by the chat BoostCount int32 // The number of boosts added to reach the current level CurrentLevelBoostCount int32 @@ -52,10 +55,12 @@ type ChatBoostStatus struct { // A percentage of Telegram Premium subscribers joined the chat; always 0 if the current // user isn't an administrator in the chat PremiumMemberPercentage float64 + // The list of prepaid giveaways available for the chat; only for chat administrators + PrepaidGiveaways []PrepaidPremiumGiveaway } // ChatBoostStatusTypeID is TL type id of ChatBoostStatus. -const ChatBoostStatusTypeID = 0xdc02a4b2 +const ChatBoostStatusTypeID = 0xa5007413 // Ensuring interfaces in compile-time for ChatBoostStatus. var ( @@ -72,12 +77,15 @@ func (c *ChatBoostStatus) Zero() bool { if !(c.BoostURL == "") { return false } - if !(c.IsBoosted == false) { + if !(c.AppliedSlotIDs == nil) { return false } if !(c.Level == 0) { return false } + if !(c.GiftCodeBoostCount == 0) { + return false + } if !(c.BoostCount == 0) { return false } @@ -93,6 +101,9 @@ func (c *ChatBoostStatus) Zero() bool { if !(c.PremiumMemberPercentage == 0) { return false } + if !(c.PrepaidGiveaways == nil) { + return false + } return true } @@ -134,13 +145,17 @@ func (c *ChatBoostStatus) TypeInfo() tdp.Type { SchemaName: "boost_url", }, { - Name: "IsBoosted", - SchemaName: "is_boosted", + Name: "AppliedSlotIDs", + SchemaName: "applied_slot_ids", }, { Name: "Level", SchemaName: "level", }, + { + Name: "GiftCodeBoostCount", + SchemaName: "gift_code_boost_count", + }, { Name: "BoostCount", SchemaName: "boost_count", @@ -161,6 +176,10 @@ func (c *ChatBoostStatus) TypeInfo() tdp.Type { Name: "PremiumMemberPercentage", SchemaName: "premium_member_percentage", }, + { + Name: "PrepaidGiveaways", + SchemaName: "prepaid_giveaways", + }, } return typ } @@ -168,7 +187,7 @@ func (c *ChatBoostStatus) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatBoostStatus) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatBoostStatus#dc02a4b2 as nil") + return fmt.Errorf("can't encode chatBoostStatus#a5007413 as nil") } b.PutID(ChatBoostStatusTypeID) return c.EncodeBare(b) @@ -177,26 +196,36 @@ func (c *ChatBoostStatus) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatBoostStatus) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatBoostStatus#dc02a4b2 as nil") + return fmt.Errorf("can't encode chatBoostStatus#a5007413 as nil") } b.PutString(c.BoostURL) - b.PutBool(c.IsBoosted) + b.PutInt(len(c.AppliedSlotIDs)) + for _, v := range c.AppliedSlotIDs { + b.PutInt32(v) + } b.PutInt32(c.Level) + b.PutInt32(c.GiftCodeBoostCount) b.PutInt32(c.BoostCount) b.PutInt32(c.CurrentLevelBoostCount) b.PutInt32(c.NextLevelBoostCount) b.PutInt32(c.PremiumMemberCount) b.PutDouble(c.PremiumMemberPercentage) + b.PutInt(len(c.PrepaidGiveaways)) + for idx, v := range c.PrepaidGiveaways { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare chatBoostStatus#a5007413: field prepaid_giveaways element with index %d: %w", idx, err) + } + } return nil } // Decode implements bin.Decoder. func (c *ChatBoostStatus) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatBoostStatus#dc02a4b2 to nil") + return fmt.Errorf("can't decode chatBoostStatus#a5007413 to nil") } if err := b.ConsumeID(ChatBoostStatusTypeID); err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: %w", err) } return c.DecodeBare(b) } @@ -204,71 +233,105 @@ func (c *ChatBoostStatus) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatBoostStatus) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatBoostStatus#dc02a4b2 to nil") + return fmt.Errorf("can't decode chatBoostStatus#a5007413 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field boost_url: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field boost_url: %w", err) } c.BoostURL = value } { - value, err := b.Bool() + headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field is_boosted: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field applied_slot_ids: %w", err) + } + + if headerLen > 0 { + c.AppliedSlotIDs = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field applied_slot_ids: %w", err) + } + c.AppliedSlotIDs = append(c.AppliedSlotIDs, value) } - c.IsBoosted = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field level: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field level: %w", err) } c.Level = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field gift_code_boost_count: %w", err) + } + c.GiftCodeBoostCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field boost_count: %w", err) } c.BoostCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field current_level_boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field current_level_boost_count: %w", err) } c.CurrentLevelBoostCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field next_level_boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field next_level_boost_count: %w", err) } c.NextLevelBoostCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field premium_member_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field premium_member_count: %w", err) } c.PremiumMemberCount = value } { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field premium_member_percentage: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field premium_member_percentage: %w", err) } c.PremiumMemberPercentage = value } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field prepaid_giveaways: %w", err) + } + + if headerLen > 0 { + c.PrepaidGiveaways = make([]PrepaidPremiumGiveaway, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value PrepaidPremiumGiveaway + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare chatBoostStatus#a5007413: field prepaid_giveaways: %w", err) + } + c.PrepaidGiveaways = append(c.PrepaidGiveaways, value) + } + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *ChatBoostStatus) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chatBoostStatus#dc02a4b2 as nil") + return fmt.Errorf("can't encode chatBoostStatus#a5007413 as nil") } b.ObjStart() b.PutID("chatBoostStatus") @@ -276,12 +339,21 @@ func (c *ChatBoostStatus) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("boost_url") b.PutString(c.BoostURL) b.Comma() - b.FieldStart("is_boosted") - b.PutBool(c.IsBoosted) + b.FieldStart("applied_slot_ids") + b.ArrStart() + for _, v := range c.AppliedSlotIDs { + b.PutInt32(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() b.Comma() b.FieldStart("level") b.PutInt32(c.Level) b.Comma() + b.FieldStart("gift_code_boost_count") + b.PutInt32(c.GiftCodeBoostCount) + b.Comma() b.FieldStart("boost_count") b.PutInt32(c.BoostCount) b.Comma() @@ -297,6 +369,17 @@ func (c *ChatBoostStatus) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("premium_member_percentage") b.PutDouble(c.PremiumMemberPercentage) b.Comma() + b.FieldStart("prepaid_giveaways") + b.ArrStart() + for idx, v := range c.PrepaidGiveaways { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chatBoostStatus#a5007413: field prepaid_giveaways element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -305,63 +388,85 @@ func (c *ChatBoostStatus) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *ChatBoostStatus) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chatBoostStatus#dc02a4b2 to nil") + return fmt.Errorf("can't decode chatBoostStatus#a5007413 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("chatBoostStatus"); err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: %w", err) } case "boost_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field boost_url: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field boost_url: %w", err) } c.BoostURL = value - case "is_boosted": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field is_boosted: %w", err) + case "applied_slot_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field applied_slot_ids: %w", err) + } + c.AppliedSlotIDs = append(c.AppliedSlotIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field applied_slot_ids: %w", err) } - c.IsBoosted = value case "level": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field level: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field level: %w", err) } c.Level = value + case "gift_code_boost_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field gift_code_boost_count: %w", err) + } + c.GiftCodeBoostCount = value case "boost_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field boost_count: %w", err) } c.BoostCount = value case "current_level_boost_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field current_level_boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field current_level_boost_count: %w", err) } c.CurrentLevelBoostCount = value case "next_level_boost_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field next_level_boost_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field next_level_boost_count: %w", err) } c.NextLevelBoostCount = value case "premium_member_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field premium_member_count: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field premium_member_count: %w", err) } c.PremiumMemberCount = value case "premium_member_percentage": value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode chatBoostStatus#dc02a4b2: field premium_member_percentage: %w", err) + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field premium_member_percentage: %w", err) } c.PremiumMemberPercentage = value + case "prepaid_giveaways": + if err := b.Arr(func(b tdjson.Decoder) error { + var value PrepaidPremiumGiveaway + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field prepaid_giveaways: %w", err) + } + c.PrepaidGiveaways = append(c.PrepaidGiveaways, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode chatBoostStatus#a5007413: field prepaid_giveaways: %w", err) + } default: return b.Skip() } @@ -377,12 +482,12 @@ func (c *ChatBoostStatus) GetBoostURL() (value string) { return c.BoostURL } -// GetIsBoosted returns value of IsBoosted field. -func (c *ChatBoostStatus) GetIsBoosted() (value bool) { +// GetAppliedSlotIDs returns value of AppliedSlotIDs field. +func (c *ChatBoostStatus) GetAppliedSlotIDs() (value []int32) { if c == nil { return } - return c.IsBoosted + return c.AppliedSlotIDs } // GetLevel returns value of Level field. @@ -393,6 +498,14 @@ func (c *ChatBoostStatus) GetLevel() (value int32) { return c.Level } +// GetGiftCodeBoostCount returns value of GiftCodeBoostCount field. +func (c *ChatBoostStatus) GetGiftCodeBoostCount() (value int32) { + if c == nil { + return + } + return c.GiftCodeBoostCount +} + // GetBoostCount returns value of BoostCount field. func (c *ChatBoostStatus) GetBoostCount() (value int32) { if c == nil { @@ -432,3 +545,11 @@ func (c *ChatBoostStatus) GetPremiumMemberPercentage() (value float64) { } return c.PremiumMemberPercentage } + +// GetPrepaidGiveaways returns value of PrepaidGiveaways field. +func (c *ChatBoostStatus) GetPrepaidGiveaways() (value []PrepaidPremiumGiveaway) { + if c == nil { + return + } + return c.PrepaidGiveaways +} diff --git a/tdapi/tl_chat_event_action_gen.go b/tdapi/tl_chat_event_action_gen.go index f8a596cf69..434149ee2a 100644 --- a/tdapi/tl_chat_event_action_gen.go +++ b/tdapi/tl_chat_event_action_gen.go @@ -4788,6 +4788,406 @@ func (c *ChatEventActiveUsernamesChanged) GetNewUsernames() (value []string) { return c.NewUsernames } +// ChatEventAccentColorChanged represents TL type `chatEventAccentColorChanged#2a327e32`. +type ChatEventAccentColorChanged struct { + // Previous identifier of chat accent color + OldAccentColorID int32 + // New identifier of chat accent color + NewAccentColorID int32 +} + +// ChatEventAccentColorChangedTypeID is TL type id of ChatEventAccentColorChanged. +const ChatEventAccentColorChangedTypeID = 0x2a327e32 + +// construct implements constructor of ChatEventActionClass. +func (c ChatEventAccentColorChanged) construct() ChatEventActionClass { return &c } + +// Ensuring interfaces in compile-time for ChatEventAccentColorChanged. +var ( + _ bin.Encoder = &ChatEventAccentColorChanged{} + _ bin.Decoder = &ChatEventAccentColorChanged{} + _ bin.BareEncoder = &ChatEventAccentColorChanged{} + _ bin.BareDecoder = &ChatEventAccentColorChanged{} + + _ ChatEventActionClass = &ChatEventAccentColorChanged{} +) + +func (c *ChatEventAccentColorChanged) Zero() bool { + if c == nil { + return true + } + if !(c.OldAccentColorID == 0) { + return false + } + if !(c.NewAccentColorID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatEventAccentColorChanged) String() string { + if c == nil { + return "ChatEventAccentColorChanged(nil)" + } + type Alias ChatEventAccentColorChanged + return fmt.Sprintf("ChatEventAccentColorChanged%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChatEventAccentColorChanged) TypeID() uint32 { + return ChatEventAccentColorChangedTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChatEventAccentColorChanged) TypeName() string { + return "chatEventAccentColorChanged" +} + +// TypeInfo returns info about TL type. +func (c *ChatEventAccentColorChanged) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatEventAccentColorChanged", + ID: ChatEventAccentColorChangedTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OldAccentColorID", + SchemaName: "old_accent_color_id", + }, + { + Name: "NewAccentColorID", + SchemaName: "new_accent_color_id", + }, + } + return typ +} + +// 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") + } + b.PutID(ChatEventAccentColorChangedTypeID) + return c.EncodeBare(b) +} + +// 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") + } + b.PutInt32(c.OldAccentColorID) + b.PutInt32(c.NewAccentColorID) + 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") + } + if err := b.ConsumeID(ChatEventAccentColorChangedTypeID); err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: %w", err) + } + return c.DecodeBare(b) +} + +// 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") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field old_accent_color_id: %w", err) + } + c.OldAccentColorID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatEventAccentColorChanged#2a327e32: field new_accent_color_id: %w", err) + } + c.NewAccentColorID = 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") + } + b.ObjStart() + b.PutID("chatEventAccentColorChanged") + b.Comma() + b.FieldStart("old_accent_color_id") + b.PutInt32(c.OldAccentColorID) + b.Comma() + b.FieldStart("new_accent_color_id") + b.PutInt32(c.NewAccentColorID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// 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 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) + } + 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) + } + c.OldAccentColorID = 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) + } + c.NewAccentColorID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetOldAccentColorID returns value of OldAccentColorID field. +func (c *ChatEventAccentColorChanged) GetOldAccentColorID() (value int32) { + if c == nil { + return + } + return c.OldAccentColorID +} + +// GetNewAccentColorID returns value of NewAccentColorID field. +func (c *ChatEventAccentColorChanged) GetNewAccentColorID() (value int32) { + if c == nil { + return + } + return c.NewAccentColorID +} + +// ChatEventBackgroundCustomEmojiChanged represents TL type `chatEventBackgroundCustomEmojiChanged#d2671e9a`. +type ChatEventBackgroundCustomEmojiChanged struct { + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiID int64 + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiID int64 +} + +// ChatEventBackgroundCustomEmojiChangedTypeID is TL type id of ChatEventBackgroundCustomEmojiChanged. +const ChatEventBackgroundCustomEmojiChangedTypeID = 0xd2671e9a + +// construct implements constructor of ChatEventActionClass. +func (c ChatEventBackgroundCustomEmojiChanged) construct() ChatEventActionClass { return &c } + +// Ensuring interfaces in compile-time for ChatEventBackgroundCustomEmojiChanged. +var ( + _ bin.Encoder = &ChatEventBackgroundCustomEmojiChanged{} + _ bin.Decoder = &ChatEventBackgroundCustomEmojiChanged{} + _ bin.BareEncoder = &ChatEventBackgroundCustomEmojiChanged{} + _ bin.BareDecoder = &ChatEventBackgroundCustomEmojiChanged{} + + _ ChatEventActionClass = &ChatEventBackgroundCustomEmojiChanged{} +) + +func (c *ChatEventBackgroundCustomEmojiChanged) Zero() bool { + if c == nil { + return true + } + if !(c.OldBackgroundCustomEmojiID == 0) { + return false + } + if !(c.NewBackgroundCustomEmojiID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChatEventBackgroundCustomEmojiChanged) String() string { + if c == nil { + return "ChatEventBackgroundCustomEmojiChanged(nil)" + } + type Alias ChatEventBackgroundCustomEmojiChanged + return fmt.Sprintf("ChatEventBackgroundCustomEmojiChanged%+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 +} + +// TypeName returns name of type in TL schema. +func (*ChatEventBackgroundCustomEmojiChanged) TypeName() string { + return "chatEventBackgroundCustomEmojiChanged" +} + +// TypeInfo returns info about TL type. +func (c *ChatEventBackgroundCustomEmojiChanged) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "chatEventBackgroundCustomEmojiChanged", + ID: ChatEventBackgroundCustomEmojiChangedTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OldBackgroundCustomEmojiID", + SchemaName: "old_background_custom_emoji_id", + }, + { + Name: "NewBackgroundCustomEmojiID", + SchemaName: "new_background_custom_emoji_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChatEventBackgroundCustomEmojiChanged) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + } + b.PutID(ChatEventBackgroundCustomEmojiChangedTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChatEventBackgroundCustomEmojiChanged) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + } + b.PutLong(c.OldBackgroundCustomEmojiID) + b.PutLong(c.NewBackgroundCustomEmojiID) + return nil +} + +// Decode implements bin.Decoder. +func (c *ChatEventBackgroundCustomEmojiChanged) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a to nil") + } + if err := b.ConsumeID(ChatEventBackgroundCustomEmojiChangedTypeID); err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChatEventBackgroundCustomEmojiChanged) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field old_background_custom_emoji_id: %w", err) + } + c.OldBackgroundCustomEmojiID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chatEventBackgroundCustomEmojiChanged#d2671e9a: field new_background_custom_emoji_id: %w", err) + } + c.NewBackgroundCustomEmojiID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *ChatEventBackgroundCustomEmojiChanged) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode chatEventBackgroundCustomEmojiChanged#d2671e9a as nil") + } + b.ObjStart() + b.PutID("chatEventBackgroundCustomEmojiChanged") + b.Comma() + b.FieldStart("old_background_custom_emoji_id") + b.PutLong(c.OldBackgroundCustomEmojiID) + b.Comma() + b.FieldStart("new_background_custom_emoji_id") + b.PutLong(c.NewBackgroundCustomEmojiID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *ChatEventBackgroundCustomEmojiChanged) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode chatEventBackgroundCustomEmojiChanged#d2671e9a 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) + } + case "old_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) + } + c.OldBackgroundCustomEmojiID = value + case "new_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) + } + c.NewBackgroundCustomEmojiID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetOldBackgroundCustomEmojiID returns value of OldBackgroundCustomEmojiID field. +func (c *ChatEventBackgroundCustomEmojiChanged) GetOldBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.OldBackgroundCustomEmojiID +} + +// GetNewBackgroundCustomEmojiID returns value of NewBackgroundCustomEmojiID field. +func (c *ChatEventBackgroundCustomEmojiChanged) GetNewBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.NewBackgroundCustomEmojiID +} + // ChatEventHasProtectedContentToggled represents TL type `chatEventHasProtectedContentToggled#f5044201`. type ChatEventHasProtectedContentToggled struct { // New value of has_protected_content @@ -8336,6 +8736,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.ChatEventHasProtectedContentToggled: // chatEventHasProtectedContentToggled#f5044201 // case *tdapi.ChatEventInvitesToggled: // chatEventInvitesToggled#fc45966b // case *tdapi.ChatEventIsAllHistoryAvailableToggled: // chatEventIsAllHistoryAvailableToggled#a0b03c15 @@ -8555,6 +8957,20 @@ func DecodeChatEventAction(buf *bin.Buffer) (ChatEventActionClass, error) { return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case ChatEventAccentColorChangedTypeID: + // Decoding chatEventAccentColorChanged#2a327e32. + 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{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case ChatEventHasProtectedContentToggledTypeID: // Decoding chatEventHasProtectedContentToggled#f5044201. v := ChatEventHasProtectedContentToggled{} @@ -8875,6 +9291,20 @@ func DecodeTDLibJSONChatEventAction(buf tdjson.Decoder) (ChatEventActionClass, e return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) } return &v, nil + case "chatEventAccentColorChanged": + // Decoding chatEventAccentColorChanged#2a327e32. + 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{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChatEventActionClass: %w", err) + } + return &v, nil case "chatEventHasProtectedContentToggled": // Decoding chatEventHasProtectedContentToggled#f5044201. v := ChatEventHasProtectedContentToggled{} diff --git a/tdapi/tl_chat_gen.go b/tdapi/tl_chat_gen.go index f24008072f..97a2c05a01 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#3f50a728`. +// Chat represents TL type `chat#5a9e2993`. type Chat struct { // Chat unique identifier ID int64 @@ -41,6 +41,12 @@ type Chat struct { Title string // Chat photo; may be null Photo ChatPhotoInfo + // 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 + BackgroundCustomEmojiID 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 @@ -112,7 +118,7 @@ type Chat struct { } // ChatTypeID is TL type id of Chat. -const ChatTypeID = 0x3f50a728 +const ChatTypeID = 0x5a9e2993 // Ensuring interfaces in compile-time for Chat. var ( @@ -138,6 +144,12 @@ func (c *Chat) Zero() bool { if !(c.Photo.Zero()) { return false } + if !(c.AccentColorID == 0) { + return false + } + if !(c.BackgroundCustomEmojiID == 0) { + return false + } if !(c.Permissions.Zero()) { return false } @@ -277,6 +289,14 @@ func (c *Chat) TypeInfo() tdp.Type { Name: "Photo", SchemaName: "photo", }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, + { + Name: "BackgroundCustomEmojiID", + SchemaName: "background_custom_emoji_id", + }, { Name: "Permissions", SchemaName: "permissions", @@ -400,7 +420,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#3f50a728 as nil") + return fmt.Errorf("can't encode chat#5a9e2993 as nil") } b.PutID(ChatTypeID) return c.EncodeBare(b) @@ -409,42 +429,44 @@ 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#3f50a728 as nil") + return fmt.Errorf("can't encode chat#5a9e2993 as nil") } b.PutInt53(c.ID) if c.Type == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field type is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field type is nil") } if err := c.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field type: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field type: %w", err) } b.PutString(c.Title) if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field photo: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field photo: %w", err) } + b.PutInt32(c.AccentColorID) + b.PutLong(c.BackgroundCustomEmojiID) if err := c.Permissions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field permissions: %w", err) } if err := c.LastMessage.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare chat#5a9e2993: field positions element with index %d: %w", idx, err) } } if c.MessageSenderID == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field message_sender_id is nil") } if err := c.MessageSenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field message_sender_id: %w", err) } if c.BlockList == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field block_list is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field block_list is nil") } if err := c.BlockList.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field block_list: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field block_list: %w", err) } b.PutBool(c.HasProtectedContent) b.PutBool(c.IsTranslatable) @@ -460,34 +482,34 @@ 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#3f50a728: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field notification_settings: %w", err) } if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field available_reactions is nil") } if err := c.AvailableReactions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field available_reactions: %w", err) } b.PutInt32(c.MessageAutoDeleteTime) if err := c.Background.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field background: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field background: %w", err) } b.PutString(c.ThemeName) if c.ActionBar == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field action_bar is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field action_bar is nil") } if err := c.ActionBar.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field action_bar: %w", err) } if err := c.VideoChat.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field video_chat: %w", err) } if err := c.PendingJoinRequests.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field draft_message: %w", err) } b.PutString(c.ClientData) return nil @@ -496,10 +518,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#3f50a728 to nil") + return fmt.Errorf("can't decode chat#5a9e2993 to nil") } if err := b.ConsumeID(ChatTypeID); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: %w", err) } return c.DecodeBare(b) } @@ -507,48 +529,62 @@ 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#3f50a728 to nil") + return fmt.Errorf("can't decode chat#5a9e2993 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field id: %w", err) } c.ID = value } { value, err := DecodeChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field type: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field type: %w", err) } c.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field title: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field title: %w", err) } c.Title = value } { if err := c.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field photo: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field photo: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chat#5a9e2993: field accent_color_id: %w", err) + } + c.AccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode chat#5a9e2993: field background_custom_emoji_id: %w", err) } + c.BackgroundCustomEmojiID = value } { if err := c.Permissions.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field permissions: %w", err) } } { if err := c.LastMessage.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field last_message: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field positions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field positions: %w", err) } if headerLen > 0 { @@ -557,7 +593,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#3f50a728: field positions: %w", err) + return fmt.Errorf("unable to decode bare chat#5a9e2993: field positions: %w", err) } c.Positions = append(c.Positions, value) } @@ -565,172 +601,172 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field message_sender_id: %w", err) } c.MessageSenderID = value } { value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field block_list: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field block_list: %w", err) } c.BlockList = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field has_protected_content: %w", err) } c.HasProtectedContent = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field is_translatable: %w", err) } c.IsTranslatable = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field is_marked_as_unread: %w", err) } c.IsMarkedAsUnread = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field has_scheduled_messages: %w", err) } c.HasScheduledMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field can_be_reported: %w", err) } c.CanBeReported = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field default_disable_notification: %w", err) } c.DefaultDisableNotification = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field unread_count: %w", err) } c.UnreadCount = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field unread_mention_count: %w", err) } c.UnreadMentionCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field unread_reaction_count: %w", err) } c.UnreadReactionCount = value } { if err := c.NotificationSettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field notification_settings: %w", err) } } { value, err := DecodeChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field available_reactions: %w", err) } c.AvailableReactions = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field message_auto_delete_time: %w", err) } c.MessageAutoDeleteTime = value } { if err := c.Background.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field background: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field background: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field theme_name: %w", err) } c.ThemeName = value } { value, err := DecodeChatActionBar(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field action_bar: %w", err) } c.ActionBar = value } { if err := c.VideoChat.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field video_chat: %w", err) } } { if err := c.PendingJoinRequests.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field pending_join_requests: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field draft_message: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field client_data: %w", err) } c.ClientData = value } @@ -740,7 +776,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#3f50a728 as nil") + return fmt.Errorf("can't encode chat#5a9e2993 as nil") } b.ObjStart() b.PutID("chat") @@ -750,10 +786,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#3f50a728: field type is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field type is nil") } if err := c.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field type: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field type: %w", err) } b.Comma() b.FieldStart("title") @@ -761,24 +797,30 @@ 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#3f50a728: field photo: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field photo: %w", err) } b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(c.AccentColorID) + b.Comma() + b.FieldStart("background_custom_emoji_id") + b.PutLong(c.BackgroundCustomEmojiID) + b.Comma() b.FieldStart("permissions") if err := c.Permissions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode chat#5a9e2993: field positions element with index %d: %w", idx, err) } b.Comma() } @@ -787,18 +829,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#3f50a728: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field message_sender_id is nil") } if err := c.MessageSenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field message_sender_id: %w", err) } b.Comma() b.FieldStart("block_list") if c.BlockList == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field block_list is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field block_list is nil") } if err := c.BlockList.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field block_list: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field block_list: %w", err) } b.Comma() b.FieldStart("has_protected_content") @@ -842,15 +884,15 @@ 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#3f50a728: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field notification_settings: %w", err) } b.Comma() b.FieldStart("available_reactions") if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field available_reactions is nil") } if err := c.AvailableReactions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field available_reactions: %w", err) } b.Comma() b.FieldStart("message_auto_delete_time") @@ -858,7 +900,7 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("background") if err := c.Background.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field background: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field background: %w", err) } b.Comma() b.FieldStart("theme_name") @@ -866,20 +908,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#3f50a728: field action_bar is nil") + return fmt.Errorf("unable to encode chat#5a9e2993: field action_bar is nil") } if err := c.ActionBar.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#3f50a728: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: 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#3f50a728: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field pending_join_requests: %w", err) } b.Comma() b.FieldStart("reply_markup_message_id") @@ -887,7 +929,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#3f50a728: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#5a9e2993: field draft_message: %w", err) } b.Comma() b.FieldStart("client_data") @@ -901,200 +943,212 @@ 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#3f50a728 to nil") + return fmt.Errorf("can't decode chat#5a9e2993 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#3f50a728: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field id: %w", err) } c.ID = value case "type": value, err := DecodeTDLibJSONChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field type: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field type: %w", err) } c.Type = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field title: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field title: %w", err) } c.Title = value case "photo": if err := c.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field photo: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field photo: %w", err) + } + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chat#5a9e2993: 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#5a9e2993: field background_custom_emoji_id: %w", err) + } + c.BackgroundCustomEmojiID = value case "permissions": if err := c.Permissions.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field permissions: %w", err) } case "last_message": if err := c.LastMessage.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field positions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field positions: %w", err) } c.Positions = append(c.Positions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field positions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field positions: %w", err) } case "message_sender_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field block_list: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field is_marked_as_unread: %w", err) } c.IsMarkedAsUnread = value case "has_scheduled_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field notification_settings: %w", err) } case "available_reactions": value, err := DecodeTDLibJSONChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field message_auto_delete_time: %w", err) } c.MessageAutoDeleteTime = value case "background": if err := c.Background.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field background: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field background: %w", err) } case "theme_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field video_chat: %w", err) } case "pending_join_requests": if err := c.PendingJoinRequests.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: 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#3f50a728: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field draft_message: %w", err) } case "client_data": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3f50a728: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#5a9e2993: field client_data: %w", err) } c.ClientData = value default: @@ -1136,6 +1190,22 @@ func (c *Chat) GetPhoto() (value ChatPhotoInfo) { return c.Photo } +// GetAccentColorID returns value of AccentColorID field. +func (c *Chat) GetAccentColorID() (value int32) { + if c == nil { + return + } + return c.AccentColorID +} + +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (c *Chat) GetBackgroundCustomEmojiID() (value int64) { + if c == nil { + return + } + return c.BackgroundCustomEmojiID +} + // GetPermissions returns value of Permissions field. func (c *Chat) GetPermissions() (value ChatPermissions) { if c == nil { diff --git a/tdapi/tl_chat_invite_link_info_gen.go b/tdapi/tl_chat_invite_link_info_gen.go index 663b08521a..b696c74512 100644 --- a/tdapi/tl_chat_invite_link_info_gen.go +++ b/tdapi/tl_chat_invite_link_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// ChatInviteLinkInfo represents TL type `chatInviteLinkInfo#c8c16a57`. +// ChatInviteLinkInfo represents TL type `chatInviteLinkInfo#829e9f23`. type ChatInviteLinkInfo struct { // Chat identifier of the invite link; 0 if the user has no access to the chat before // joining @@ -45,6 +45,8 @@ type ChatInviteLinkInfo struct { Title string // Chat photo; may be null Photo ChatPhotoInfo + // Identifier of the accent color for chat title and background of chat photo + AccentColorID int32 // Contains information about a chat invite link Description string // Number of members in the chat @@ -65,7 +67,7 @@ type ChatInviteLinkInfo struct { } // ChatInviteLinkInfoTypeID is TL type id of ChatInviteLinkInfo. -const ChatInviteLinkInfoTypeID = 0xc8c16a57 +const ChatInviteLinkInfoTypeID = 0x829e9f23 // Ensuring interfaces in compile-time for ChatInviteLinkInfo. var ( @@ -94,6 +96,9 @@ func (c *ChatInviteLinkInfo) Zero() bool { if !(c.Photo.Zero()) { return false } + if !(c.AccentColorID == 0) { + return false + } if !(c.Description == "") { return false } @@ -174,6 +179,10 @@ func (c *ChatInviteLinkInfo) TypeInfo() tdp.Type { Name: "Photo", SchemaName: "photo", }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, { Name: "Description", SchemaName: "description", @@ -213,7 +222,7 @@ func (c *ChatInviteLinkInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatInviteLinkInfo) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteLinkInfo#c8c16a57 as nil") + return fmt.Errorf("can't encode chatInviteLinkInfo#829e9f23 as nil") } b.PutID(ChatInviteLinkInfoTypeID) return c.EncodeBare(b) @@ -222,20 +231,21 @@ func (c *ChatInviteLinkInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatInviteLinkInfo) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteLinkInfo#c8c16a57 as nil") + return fmt.Errorf("can't encode chatInviteLinkInfo#829e9f23 as nil") } b.PutInt53(c.ChatID) b.PutInt32(c.AccessibleFor) if c.Type == nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field type is nil") + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field type is nil") } if err := c.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field type: %w", err) + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field type: %w", err) } b.PutString(c.Title) if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field photo: %w", err) + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field photo: %w", err) } + b.PutInt32(c.AccentColorID) b.PutString(c.Description) b.PutInt32(c.MemberCount) b.PutInt(len(c.MemberUserIDs)) @@ -253,10 +263,10 @@ func (c *ChatInviteLinkInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatInviteLinkInfo) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteLinkInfo#c8c16a57 to nil") + return fmt.Errorf("can't decode chatInviteLinkInfo#829e9f23 to nil") } if err := b.ConsumeID(ChatInviteLinkInfoTypeID); err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: %w", err) } return c.DecodeBare(b) } @@ -264,59 +274,66 @@ func (c *ChatInviteLinkInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatInviteLinkInfo) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteLinkInfo#c8c16a57 to nil") + return fmt.Errorf("can't decode chatInviteLinkInfo#829e9f23 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field chat_id: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field chat_id: %w", err) } c.ChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field accessible_for: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field accessible_for: %w", err) } c.AccessibleFor = value } { value, err := DecodeInviteLinkChatType(b) if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field type: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field type: %w", err) } c.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field title: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field title: %w", err) } c.Title = value } { if err := c.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field photo: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field photo: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field accent_color_id: %w", err) } + c.AccentColorID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field description: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field description: %w", err) } c.Description = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_count: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_count: %w", err) } c.MemberCount = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_user_ids: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_user_ids: %w", err) } if headerLen > 0 { @@ -325,7 +342,7 @@ func (c *ChatInviteLinkInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_user_ids: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_user_ids: %w", err) } c.MemberUserIDs = append(c.MemberUserIDs, value) } @@ -333,35 +350,35 @@ func (c *ChatInviteLinkInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field creates_join_request: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field creates_join_request: %w", err) } c.CreatesJoinRequest = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_public: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_public: %w", err) } c.IsPublic = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_verified: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_verified: %w", err) } c.IsVerified = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_scam: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_scam: %w", err) } c.IsScam = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_fake: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_fake: %w", err) } c.IsFake = value } @@ -371,7 +388,7 @@ func (c *ChatInviteLinkInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *ChatInviteLinkInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode chatInviteLinkInfo#c8c16a57 as nil") + return fmt.Errorf("can't encode chatInviteLinkInfo#829e9f23 as nil") } b.ObjStart() b.PutID("chatInviteLinkInfo") @@ -384,10 +401,10 @@ func (c *ChatInviteLinkInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("type") if c.Type == nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field type is nil") + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field type is nil") } if err := c.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field type: %w", err) + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field type: %w", err) } b.Comma() b.FieldStart("title") @@ -395,9 +412,12 @@ func (c *ChatInviteLinkInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("photo") if err := c.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chatInviteLinkInfo#c8c16a57: field photo: %w", err) + return fmt.Errorf("unable to encode chatInviteLinkInfo#829e9f23: field photo: %w", err) } b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(c.AccentColorID) + b.Comma() b.FieldStart("description") b.PutString(c.Description) b.Comma() @@ -436,94 +456,100 @@ func (c *ChatInviteLinkInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *ChatInviteLinkInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode chatInviteLinkInfo#c8c16a57 to nil") + return fmt.Errorf("can't decode chatInviteLinkInfo#829e9f23 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("chatInviteLinkInfo"); err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field chat_id: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field chat_id: %w", err) } c.ChatID = value case "accessible_for": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field accessible_for: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field accessible_for: %w", err) } c.AccessibleFor = value case "type": value, err := DecodeTDLibJSONInviteLinkChatType(b) if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field type: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field type: %w", err) } c.Type = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field title: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field title: %w", err) } c.Title = value case "photo": if err := c.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field photo: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field photo: %w", err) } + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field accent_color_id: %w", err) + } + c.AccentColorID = value case "description": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field description: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field description: %w", err) } c.Description = value case "member_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_count: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_count: %w", err) } c.MemberCount = value case "member_user_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_user_ids: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_user_ids: %w", err) } c.MemberUserIDs = append(c.MemberUserIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field member_user_ids: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field member_user_ids: %w", err) } case "creates_join_request": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field creates_join_request: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field creates_join_request: %w", err) } c.CreatesJoinRequest = value case "is_public": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_public: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_public: %w", err) } c.IsPublic = value case "is_verified": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_verified: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_verified: %w", err) } c.IsVerified = value case "is_scam": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_scam: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_scam: %w", err) } c.IsScam = value case "is_fake": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chatInviteLinkInfo#c8c16a57: field is_fake: %w", err) + return fmt.Errorf("unable to decode chatInviteLinkInfo#829e9f23: field is_fake: %w", err) } c.IsFake = value default: @@ -573,6 +599,14 @@ func (c *ChatInviteLinkInfo) GetPhoto() (value ChatPhotoInfo) { return c.Photo } +// GetAccentColorID returns value of AccentColorID field. +func (c *ChatInviteLinkInfo) GetAccentColorID() (value int32) { + if c == nil { + return + } + return c.AccentColorID +} + // GetDescription returns value of Description field. func (c *ChatInviteLinkInfo) GetDescription() (value string) { if c == nil { diff --git a/tdapi/tl_chat_permissions_gen.go b/tdapi/tl_chat_permissions_gen.go index 98b4a1e886..6effc04a7d 100644 --- a/tdapi/tl_chat_permissions_gen.go +++ b/tdapi/tl_chat_permissions_gen.go @@ -33,7 +33,8 @@ var ( // ChatPermissions represents TL type `chatPermissions#af3b61cb`. type ChatPermissions struct { - // True, if the user can send text messages, contacts, invoices, locations, and venues + // True, if the user can send text messages, contacts, giveaways, invoices, locations, + // and venues CanSendBasicMessages bool // True, if the user can send music files CanSendAudios bool diff --git a/tdapi/tl_check_premium_gift_code_gen.go b/tdapi/tl_check_premium_gift_code_gen.go new file mode 100644 index 0000000000..c11bf3cb57 --- /dev/null +++ b/tdapi/tl_check_premium_gift_code_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{} +) + +// CheckPremiumGiftCodeRequest represents TL type `checkPremiumGiftCode#958ad664`. +type CheckPremiumGiftCodeRequest struct { + // The code to check + Code string +} + +// CheckPremiumGiftCodeRequestTypeID is TL type id of CheckPremiumGiftCodeRequest. +const CheckPremiumGiftCodeRequestTypeID = 0x958ad664 + +// Ensuring interfaces in compile-time for CheckPremiumGiftCodeRequest. +var ( + _ bin.Encoder = &CheckPremiumGiftCodeRequest{} + _ bin.Decoder = &CheckPremiumGiftCodeRequest{} + _ bin.BareEncoder = &CheckPremiumGiftCodeRequest{} + _ bin.BareDecoder = &CheckPremiumGiftCodeRequest{} +) + +func (c *CheckPremiumGiftCodeRequest) Zero() bool { + if c == nil { + return true + } + if !(c.Code == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *CheckPremiumGiftCodeRequest) String() string { + if c == nil { + return "CheckPremiumGiftCodeRequest(nil)" + } + type Alias CheckPremiumGiftCodeRequest + return fmt.Sprintf("CheckPremiumGiftCodeRequest%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CheckPremiumGiftCodeRequest) TypeID() uint32 { + return CheckPremiumGiftCodeRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*CheckPremiumGiftCodeRequest) TypeName() string { + return "checkPremiumGiftCode" +} + +// TypeInfo returns info about TL type. +func (c *CheckPremiumGiftCodeRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "checkPremiumGiftCode", + ID: CheckPremiumGiftCodeRequestTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Code", + SchemaName: "code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *CheckPremiumGiftCodeRequest) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode checkPremiumGiftCode#958ad664 as nil") + } + b.PutID(CheckPremiumGiftCodeRequestTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CheckPremiumGiftCodeRequest) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode checkPremiumGiftCode#958ad664 as nil") + } + b.PutString(c.Code) + return nil +} + +// Decode implements bin.Decoder. +func (c *CheckPremiumGiftCodeRequest) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode checkPremiumGiftCode#958ad664 to nil") + } + if err := b.ConsumeID(CheckPremiumGiftCodeRequestTypeID); err != nil { + return fmt.Errorf("unable to decode checkPremiumGiftCode#958ad664: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CheckPremiumGiftCodeRequest) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode checkPremiumGiftCode#958ad664 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkPremiumGiftCode#958ad664: field code: %w", err) + } + c.Code = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CheckPremiumGiftCodeRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode checkPremiumGiftCode#958ad664 as nil") + } + b.ObjStart() + b.PutID("checkPremiumGiftCode") + b.Comma() + b.FieldStart("code") + b.PutString(c.Code) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CheckPremiumGiftCodeRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode checkPremiumGiftCode#958ad664 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("checkPremiumGiftCode"); err != nil { + return fmt.Errorf("unable to decode checkPremiumGiftCode#958ad664: %w", err) + } + case "code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkPremiumGiftCode#958ad664: field code: %w", err) + } + c.Code = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCode returns value of Code field. +func (c *CheckPremiumGiftCodeRequest) GetCode() (value string) { + if c == nil { + return + } + return c.Code +} + +// CheckPremiumGiftCode invokes method checkPremiumGiftCode#958ad664 returning error if any. +func (c *Client) CheckPremiumGiftCode(ctx context.Context, code string) (*PremiumGiftCodeInfo, error) { + var result PremiumGiftCodeInfo + + request := &CheckPremiumGiftCodeRequest{ + Code: code, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_draft_message_gen.go b/tdapi/tl_draft_message_gen.go index d07ce44b16..91288c8eac 100644 --- a/tdapi/tl_draft_message_gen.go +++ b/tdapi/tl_draft_message_gen.go @@ -31,10 +31,11 @@ var ( _ = tdjson.Encoder{} ) -// DraftMessage represents TL type `draftMessage#51d71500`. +// DraftMessage represents TL type `draftMessage#f67c6a5c`. type DraftMessage struct { - // Identifier of the replied message; 0 if none - ReplyToMessageID int64 + // Information about the message to be replied; must be of the type + // inputMessageReplyToMessage; may be null if none + ReplyTo InputMessageReplyToClass // Point in time (Unix timestamp) when the draft was created Date int32 // Content of the message draft; must be of the type inputMessageText @@ -42,7 +43,7 @@ type DraftMessage struct { } // DraftMessageTypeID is TL type id of DraftMessage. -const DraftMessageTypeID = 0x51d71500 +const DraftMessageTypeID = 0xf67c6a5c // Ensuring interfaces in compile-time for DraftMessage. var ( @@ -56,7 +57,7 @@ func (d *DraftMessage) Zero() bool { if d == nil { return true } - if !(d.ReplyToMessageID == 0) { + if !(d.ReplyTo == nil) { return false } if !(d.Date == 0) { @@ -102,8 +103,8 @@ func (d *DraftMessage) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "ReplyToMessageID", - SchemaName: "reply_to_message_id", + Name: "ReplyTo", + SchemaName: "reply_to", }, { Name: "Date", @@ -120,7 +121,7 @@ func (d *DraftMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (d *DraftMessage) Encode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode draftMessage#51d71500 as nil") + return fmt.Errorf("can't encode draftMessage#f67c6a5c as nil") } b.PutID(DraftMessageTypeID) return d.EncodeBare(b) @@ -129,15 +130,20 @@ func (d *DraftMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (d *DraftMessage) EncodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode draftMessage#51d71500 as nil") + return fmt.Errorf("can't encode draftMessage#f67c6a5c as nil") + } + if d.ReplyTo == nil { + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field reply_to is nil") + } + if err := d.ReplyTo.Encode(b); err != nil { + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field reply_to: %w", err) } - b.PutInt53(d.ReplyToMessageID) b.PutInt32(d.Date) if d.InputMessageText == nil { - return fmt.Errorf("unable to encode draftMessage#51d71500: field input_message_text is nil") + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field input_message_text is nil") } if err := d.InputMessageText.Encode(b); err != nil { - return fmt.Errorf("unable to encode draftMessage#51d71500: field input_message_text: %w", err) + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field input_message_text: %w", err) } return nil } @@ -145,10 +151,10 @@ func (d *DraftMessage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (d *DraftMessage) Decode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode draftMessage#51d71500 to nil") + return fmt.Errorf("can't decode draftMessage#f67c6a5c to nil") } if err := b.ConsumeID(DraftMessageTypeID); err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: %w", err) } return d.DecodeBare(b) } @@ -156,26 +162,26 @@ func (d *DraftMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (d *DraftMessage) DecodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode draftMessage#51d71500 to nil") + return fmt.Errorf("can't decode draftMessage#f67c6a5c to nil") } { - value, err := b.Int53() + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field reply_to_message_id: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field reply_to: %w", err) } - d.ReplyToMessageID = value + d.ReplyTo = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field date: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field date: %w", err) } d.Date = value } { value, err := DecodeInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field input_message_text: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field input_message_text: %w", err) } d.InputMessageText = value } @@ -185,23 +191,28 @@ func (d *DraftMessage) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (d *DraftMessage) EncodeTDLibJSON(b tdjson.Encoder) error { if d == nil { - return fmt.Errorf("can't encode draftMessage#51d71500 as nil") + return fmt.Errorf("can't encode draftMessage#f67c6a5c as nil") } b.ObjStart() b.PutID("draftMessage") b.Comma() - b.FieldStart("reply_to_message_id") - b.PutInt53(d.ReplyToMessageID) + b.FieldStart("reply_to") + if d.ReplyTo == nil { + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field reply_to is nil") + } + if err := d.ReplyTo.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field reply_to: %w", err) + } b.Comma() b.FieldStart("date") b.PutInt32(d.Date) b.Comma() b.FieldStart("input_message_text") if d.InputMessageText == nil { - return fmt.Errorf("unable to encode draftMessage#51d71500: field input_message_text is nil") + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field input_message_text is nil") } if err := d.InputMessageText.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode draftMessage#51d71500: field input_message_text: %w", err) + return fmt.Errorf("unable to encode draftMessage#f67c6a5c: field input_message_text: %w", err) } b.Comma() b.StripComma() @@ -212,31 +223,31 @@ func (d *DraftMessage) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (d *DraftMessage) DecodeTDLibJSON(b tdjson.Decoder) error { if d == nil { - return fmt.Errorf("can't decode draftMessage#51d71500 to nil") + return fmt.Errorf("can't decode draftMessage#f67c6a5c to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("draftMessage"); err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: %w", err) } - case "reply_to_message_id": - value, err := b.Int53() + case "reply_to": + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field reply_to_message_id: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field reply_to: %w", err) } - d.ReplyToMessageID = value + d.ReplyTo = value case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field date: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field date: %w", err) } d.Date = value case "input_message_text": value, err := DecodeTDLibJSONInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode draftMessage#51d71500: field input_message_text: %w", err) + return fmt.Errorf("unable to decode draftMessage#f67c6a5c: field input_message_text: %w", err) } d.InputMessageText = value default: @@ -246,12 +257,12 @@ func (d *DraftMessage) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetReplyToMessageID returns value of ReplyToMessageID field. -func (d *DraftMessage) GetReplyToMessageID() (value int64) { +// GetReplyTo returns value of ReplyTo field. +func (d *DraftMessage) GetReplyTo() (value InputMessageReplyToClass) { if d == nil { return } - return d.ReplyToMessageID + return d.ReplyTo } // GetDate returns value of Date field. diff --git a/tdapi/tl_forward_messages_gen.go b/tdapi/tl_forward_messages_gen.go index 8bd2cc2fd9..96d2895349 100644 --- a/tdapi/tl_forward_messages_gen.go +++ b/tdapi/tl_forward_messages_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// ForwardMessagesRequest represents TL type `forwardMessages#3f49f51e`. +// ForwardMessagesRequest represents TL type `forwardMessages#34de5b20`. type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatID int64 @@ -41,7 +41,8 @@ type ForwardMessagesRequest struct { // Identifier of the chat from which to forward messages FromChatID int64 // Identifiers of the messages to forward. Message identifiers must be in a strictly - // increasing order. At most 100 messages can be forwarded simultaneously + // increasing order. At most 100 messages can be forwarded simultaneously. A message can + // be forwarded only if message.can_be_forwarded MessageIDs []int64 // Options to be used to send the messages; pass null to use default options Options MessageSendOptions @@ -50,12 +51,10 @@ type ForwardMessagesRequest struct { SendCopy bool // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool - // Pass true to get fake messages instead of actually forwarding them - OnlyPreview bool } // ForwardMessagesRequestTypeID is TL type id of ForwardMessagesRequest. -const ForwardMessagesRequestTypeID = 0x3f49f51e +const ForwardMessagesRequestTypeID = 0x34de5b20 // Ensuring interfaces in compile-time for ForwardMessagesRequest. var ( @@ -90,9 +89,6 @@ func (f *ForwardMessagesRequest) Zero() bool { if !(f.RemoveCaption == false) { return false } - if !(f.OnlyPreview == false) { - return false - } return true } @@ -157,10 +153,6 @@ func (f *ForwardMessagesRequest) TypeInfo() tdp.Type { Name: "RemoveCaption", SchemaName: "remove_caption", }, - { - Name: "OnlyPreview", - SchemaName: "only_preview", - }, } return typ } @@ -168,7 +160,7 @@ func (f *ForwardMessagesRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (f *ForwardMessagesRequest) Encode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode forwardMessages#3f49f51e as nil") + return fmt.Errorf("can't encode forwardMessages#34de5b20 as nil") } b.PutID(ForwardMessagesRequestTypeID) return f.EncodeBare(b) @@ -177,7 +169,7 @@ func (f *ForwardMessagesRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (f *ForwardMessagesRequest) EncodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode forwardMessages#3f49f51e as nil") + return fmt.Errorf("can't encode forwardMessages#34de5b20 as nil") } b.PutInt53(f.ChatID) b.PutInt53(f.MessageThreadID) @@ -187,21 +179,20 @@ func (f *ForwardMessagesRequest) EncodeBare(b *bin.Buffer) error { b.PutInt53(v) } if err := f.Options.Encode(b); err != nil { - return fmt.Errorf("unable to encode forwardMessages#3f49f51e: field options: %w", err) + return fmt.Errorf("unable to encode forwardMessages#34de5b20: field options: %w", err) } b.PutBool(f.SendCopy) b.PutBool(f.RemoveCaption) - b.PutBool(f.OnlyPreview) return nil } // Decode implements bin.Decoder. func (f *ForwardMessagesRequest) Decode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode forwardMessages#3f49f51e to nil") + return fmt.Errorf("can't decode forwardMessages#34de5b20 to nil") } if err := b.ConsumeID(ForwardMessagesRequestTypeID); err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: %w", err) } return f.DecodeBare(b) } @@ -209,33 +200,33 @@ func (f *ForwardMessagesRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (f *ForwardMessagesRequest) DecodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode forwardMessages#3f49f51e to nil") + return fmt.Errorf("can't decode forwardMessages#34de5b20 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field chat_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field chat_id: %w", err) } f.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_thread_id: %w", err) } f.MessageThreadID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field from_chat_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field from_chat_id: %w", err) } f.FromChatID = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_ids: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_ids: %w", err) } if headerLen > 0 { @@ -244,44 +235,37 @@ func (f *ForwardMessagesRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_ids: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_ids: %w", err) } f.MessageIDs = append(f.MessageIDs, value) } } { if err := f.Options.Decode(b); err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field options: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field options: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field send_copy: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field send_copy: %w", err) } f.SendCopy = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field remove_caption: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field remove_caption: %w", err) } f.RemoveCaption = value } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field only_preview: %w", err) - } - f.OnlyPreview = value - } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (f *ForwardMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if f == nil { - return fmt.Errorf("can't encode forwardMessages#3f49f51e as nil") + return fmt.Errorf("can't encode forwardMessages#34de5b20 as nil") } b.ObjStart() b.PutID("forwardMessages") @@ -306,7 +290,7 @@ func (f *ForwardMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("options") if err := f.Options.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode forwardMessages#3f49f51e: field options: %w", err) + return fmt.Errorf("unable to encode forwardMessages#34de5b20: field options: %w", err) } b.Comma() b.FieldStart("send_copy") @@ -315,9 +299,6 @@ func (f *ForwardMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("remove_caption") b.PutBool(f.RemoveCaption) b.Comma() - b.FieldStart("only_preview") - b.PutBool(f.OnlyPreview) - b.Comma() b.StripComma() b.ObjEnd() return nil @@ -326,66 +307,60 @@ func (f *ForwardMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (f *ForwardMessagesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if f == nil { - return fmt.Errorf("can't decode forwardMessages#3f49f51e to nil") + return fmt.Errorf("can't decode forwardMessages#34de5b20 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("forwardMessages"); err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field chat_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field chat_id: %w", err) } f.ChatID = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_thread_id: %w", err) } f.MessageThreadID = value case "from_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field from_chat_id: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field from_chat_id: %w", err) } f.FromChatID = value case "message_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_ids: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_ids: %w", err) } f.MessageIDs = append(f.MessageIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field message_ids: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field message_ids: %w", err) } case "options": if err := f.Options.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field options: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field options: %w", err) } case "send_copy": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field send_copy: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field send_copy: %w", err) } f.SendCopy = value case "remove_caption": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field remove_caption: %w", err) + return fmt.Errorf("unable to decode forwardMessages#34de5b20: field remove_caption: %w", err) } f.RemoveCaption = value - case "only_preview": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode forwardMessages#3f49f51e: field only_preview: %w", err) - } - f.OnlyPreview = value default: return b.Skip() } @@ -449,15 +424,7 @@ func (f *ForwardMessagesRequest) GetRemoveCaption() (value bool) { return f.RemoveCaption } -// GetOnlyPreview returns value of OnlyPreview field. -func (f *ForwardMessagesRequest) GetOnlyPreview() (value bool) { - if f == nil { - return - } - return f.OnlyPreview -} - -// ForwardMessages invokes method forwardMessages#3f49f51e returning error if any. +// ForwardMessages invokes method forwardMessages#34de5b20 returning error if any. func (c *Client) ForwardMessages(ctx context.Context, request *ForwardMessagesRequest) (*Messages, error) { var result Messages diff --git a/tdapi/tl_found_position_gen.go b/tdapi/tl_found_position_gen.go new file mode 100644 index 0000000000..e03f305512 --- /dev/null +++ b/tdapi/tl_found_position_gen.go @@ -0,0 +1,193 @@ +// 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{} +) + +// FoundPosition represents TL type `foundPosition#8f8adf88`. +type FoundPosition struct { + // The position of the match + Position int32 +} + +// FoundPositionTypeID is TL type id of FoundPosition. +const FoundPositionTypeID = 0x8f8adf88 + +// Ensuring interfaces in compile-time for FoundPosition. +var ( + _ bin.Encoder = &FoundPosition{} + _ bin.Decoder = &FoundPosition{} + _ bin.BareEncoder = &FoundPosition{} + _ bin.BareDecoder = &FoundPosition{} +) + +func (f *FoundPosition) Zero() bool { + if f == nil { + return true + } + if !(f.Position == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (f *FoundPosition) String() string { + if f == nil { + return "FoundPosition(nil)" + } + type Alias FoundPosition + return fmt.Sprintf("FoundPosition%+v", Alias(*f)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*FoundPosition) TypeID() uint32 { + return FoundPositionTypeID +} + +// TypeName returns name of type in TL schema. +func (*FoundPosition) TypeName() string { + return "foundPosition" +} + +// TypeInfo returns info about TL type. +func (f *FoundPosition) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "foundPosition", + ID: FoundPositionTypeID, + } + if f == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Position", + SchemaName: "position", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (f *FoundPosition) Encode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode foundPosition#8f8adf88 as nil") + } + b.PutID(FoundPositionTypeID) + return f.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (f *FoundPosition) EncodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode foundPosition#8f8adf88 as nil") + } + b.PutInt32(f.Position) + return nil +} + +// Decode implements bin.Decoder. +func (f *FoundPosition) Decode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode foundPosition#8f8adf88 to nil") + } + if err := b.ConsumeID(FoundPositionTypeID); err != nil { + return fmt.Errorf("unable to decode foundPosition#8f8adf88: %w", err) + } + return f.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (f *FoundPosition) DecodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode foundPosition#8f8adf88 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode foundPosition#8f8adf88: field position: %w", err) + } + f.Position = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (f *FoundPosition) EncodeTDLibJSON(b tdjson.Encoder) error { + if f == nil { + return fmt.Errorf("can't encode foundPosition#8f8adf88 as nil") + } + b.ObjStart() + b.PutID("foundPosition") + b.Comma() + b.FieldStart("position") + b.PutInt32(f.Position) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (f *FoundPosition) DecodeTDLibJSON(b tdjson.Decoder) error { + if f == nil { + return fmt.Errorf("can't decode foundPosition#8f8adf88 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("foundPosition"); err != nil { + return fmt.Errorf("unable to decode foundPosition#8f8adf88: %w", err) + } + case "position": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode foundPosition#8f8adf88: field position: %w", err) + } + f.Position = value + default: + return b.Skip() + } + return nil + }) +} + +// GetPosition returns value of Position field. +func (f *FoundPosition) GetPosition() (value int32) { + if f == nil { + return + } + return f.Position +} diff --git a/tdapi/tl_found_web_app_gen.go b/tdapi/tl_found_web_app_gen.go index 49644c2158..e2e5f8dd44 100644 --- a/tdapi/tl_found_web_app_gen.go +++ b/tdapi/tl_found_web_app_gen.go @@ -31,12 +31,10 @@ var ( _ = tdjson.Encoder{} ) -// FoundWebApp represents TL type `foundWebApp#2b8136d4`. +// FoundWebApp represents TL type `foundWebApp#eea8d01e`. type FoundWebApp struct { // The Web App WebApp WebApp - // True, if the app supports "settings_button_pressed" event - SupportsSettings bool // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool // True, if there is no need to show an ordinary open URL confirmation before opening the @@ -46,7 +44,7 @@ type FoundWebApp struct { } // FoundWebAppTypeID is TL type id of FoundWebApp. -const FoundWebAppTypeID = 0x2b8136d4 +const FoundWebAppTypeID = 0xeea8d01e // Ensuring interfaces in compile-time for FoundWebApp. var ( @@ -63,9 +61,6 @@ func (f *FoundWebApp) Zero() bool { if !(f.WebApp.Zero()) { return false } - if !(f.SupportsSettings == false) { - return false - } if !(f.RequestWriteAccess == false) { return false } @@ -112,10 +107,6 @@ func (f *FoundWebApp) TypeInfo() tdp.Type { Name: "WebApp", SchemaName: "web_app", }, - { - Name: "SupportsSettings", - SchemaName: "supports_settings", - }, { Name: "RequestWriteAccess", SchemaName: "request_write_access", @@ -131,7 +122,7 @@ func (f *FoundWebApp) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (f *FoundWebApp) Encode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode foundWebApp#2b8136d4 as nil") + return fmt.Errorf("can't encode foundWebApp#eea8d01e as nil") } b.PutID(FoundWebAppTypeID) return f.EncodeBare(b) @@ -140,12 +131,11 @@ func (f *FoundWebApp) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (f *FoundWebApp) EncodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode foundWebApp#2b8136d4 as nil") + return fmt.Errorf("can't encode foundWebApp#eea8d01e as nil") } if err := f.WebApp.Encode(b); err != nil { - return fmt.Errorf("unable to encode foundWebApp#2b8136d4: field web_app: %w", err) + return fmt.Errorf("unable to encode foundWebApp#eea8d01e: field web_app: %w", err) } - b.PutBool(f.SupportsSettings) b.PutBool(f.RequestWriteAccess) b.PutBool(f.SkipConfirmation) return nil @@ -154,10 +144,10 @@ func (f *FoundWebApp) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (f *FoundWebApp) Decode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode foundWebApp#2b8136d4 to nil") + return fmt.Errorf("can't decode foundWebApp#eea8d01e to nil") } if err := b.ConsumeID(FoundWebAppTypeID); err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: %w", err) } return f.DecodeBare(b) } @@ -165,31 +155,24 @@ func (f *FoundWebApp) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (f *FoundWebApp) DecodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode foundWebApp#2b8136d4 to nil") + return fmt.Errorf("can't decode foundWebApp#eea8d01e to nil") } { if err := f.WebApp.Decode(b); err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field web_app: %w", err) - } - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field supports_settings: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field web_app: %w", err) } - f.SupportsSettings = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field request_write_access: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field request_write_access: %w", err) } f.RequestWriteAccess = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field skip_confirmation: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field skip_confirmation: %w", err) } f.SkipConfirmation = value } @@ -199,19 +182,16 @@ func (f *FoundWebApp) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (f *FoundWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { if f == nil { - return fmt.Errorf("can't encode foundWebApp#2b8136d4 as nil") + return fmt.Errorf("can't encode foundWebApp#eea8d01e as nil") } b.ObjStart() b.PutID("foundWebApp") b.Comma() b.FieldStart("web_app") if err := f.WebApp.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode foundWebApp#2b8136d4: field web_app: %w", err) + return fmt.Errorf("unable to encode foundWebApp#eea8d01e: field web_app: %w", err) } b.Comma() - b.FieldStart("supports_settings") - b.PutBool(f.SupportsSettings) - b.Comma() b.FieldStart("request_write_access") b.PutBool(f.RequestWriteAccess) b.Comma() @@ -226,35 +206,29 @@ func (f *FoundWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (f *FoundWebApp) DecodeTDLibJSON(b tdjson.Decoder) error { if f == nil { - return fmt.Errorf("can't decode foundWebApp#2b8136d4 to nil") + return fmt.Errorf("can't decode foundWebApp#eea8d01e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("foundWebApp"); err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: %w", err) } case "web_app": if err := f.WebApp.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field web_app: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field web_app: %w", err) } - case "supports_settings": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field supports_settings: %w", err) - } - f.SupportsSettings = value case "request_write_access": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field request_write_access: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field request_write_access: %w", err) } f.RequestWriteAccess = value case "skip_confirmation": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode foundWebApp#2b8136d4: field skip_confirmation: %w", err) + return fmt.Errorf("unable to decode foundWebApp#eea8d01e: field skip_confirmation: %w", err) } f.SkipConfirmation = value default: @@ -272,14 +246,6 @@ func (f *FoundWebApp) GetWebApp() (value WebApp) { return f.WebApp } -// GetSupportsSettings returns value of SupportsSettings field. -func (f *FoundWebApp) GetSupportsSettings() (value bool) { - if f == nil { - return - } - return f.SupportsSettings -} - // GetRequestWriteAccess returns value of RequestWriteAccess field. func (f *FoundWebApp) GetRequestWriteAccess() (value bool) { if f == nil { diff --git a/tdapi/tl_get_available_chat_boost_slots_gen.go b/tdapi/tl_get_available_chat_boost_slots_gen.go new file mode 100644 index 0000000000..e54fd5b9a4 --- /dev/null +++ b/tdapi/tl_get_available_chat_boost_slots_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{} +) + +// GetAvailableChatBoostSlotsRequest represents TL type `getAvailableChatBoostSlots#7307ebd5`. +type GetAvailableChatBoostSlotsRequest struct { +} + +// GetAvailableChatBoostSlotsRequestTypeID is TL type id of GetAvailableChatBoostSlotsRequest. +const GetAvailableChatBoostSlotsRequestTypeID = 0x7307ebd5 + +// Ensuring interfaces in compile-time for GetAvailableChatBoostSlotsRequest. +var ( + _ bin.Encoder = &GetAvailableChatBoostSlotsRequest{} + _ bin.Decoder = &GetAvailableChatBoostSlotsRequest{} + _ bin.BareEncoder = &GetAvailableChatBoostSlotsRequest{} + _ bin.BareDecoder = &GetAvailableChatBoostSlotsRequest{} +) + +func (g *GetAvailableChatBoostSlotsRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetAvailableChatBoostSlotsRequest) String() string { + if g == nil { + return "GetAvailableChatBoostSlotsRequest(nil)" + } + type Alias GetAvailableChatBoostSlotsRequest + return fmt.Sprintf("GetAvailableChatBoostSlotsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetAvailableChatBoostSlotsRequest) TypeID() uint32 { + return GetAvailableChatBoostSlotsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetAvailableChatBoostSlotsRequest) TypeName() string { + return "getAvailableChatBoostSlots" +} + +// TypeInfo returns info about TL type. +func (g *GetAvailableChatBoostSlotsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getAvailableChatBoostSlots", + ID: GetAvailableChatBoostSlotsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetAvailableChatBoostSlotsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableChatBoostSlots#7307ebd5 as nil") + } + b.PutID(GetAvailableChatBoostSlotsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetAvailableChatBoostSlotsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableChatBoostSlots#7307ebd5 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetAvailableChatBoostSlotsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableChatBoostSlots#7307ebd5 to nil") + } + if err := b.ConsumeID(GetAvailableChatBoostSlotsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getAvailableChatBoostSlots#7307ebd5: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetAvailableChatBoostSlotsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableChatBoostSlots#7307ebd5 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetAvailableChatBoostSlotsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableChatBoostSlots#7307ebd5 as nil") + } + b.ObjStart() + b.PutID("getAvailableChatBoostSlots") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetAvailableChatBoostSlotsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableChatBoostSlots#7307ebd5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getAvailableChatBoostSlots"); err != nil { + return fmt.Errorf("unable to decode getAvailableChatBoostSlots#7307ebd5: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetAvailableChatBoostSlots invokes method getAvailableChatBoostSlots#7307ebd5 returning error if any. +func (c *Client) GetAvailableChatBoostSlots(ctx context.Context) (*ChatBoostSlots, error) { + var result ChatBoostSlots + + request := &GetAvailableChatBoostSlotsRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_chat_boosts_gen.go b/tdapi/tl_get_chat_boosts_gen.go index 4493a787d4..58c781e2ce 100644 --- a/tdapi/tl_get_chat_boosts_gen.go +++ b/tdapi/tl_get_chat_boosts_gen.go @@ -31,10 +31,13 @@ var ( _ = tdjson.Encoder{} ) -// GetChatBoostsRequest represents TL type `getChatBoosts#d82a288e`. +// GetChatBoostsRequest represents TL type `getChatBoosts#ab5eaa38`. type GetChatBoostsRequest struct { // Identifier of the chat ChatID int64 + // Pass true to receive only boosts received from gift codes and giveaways created by the + // chat + OnlyGiftCodes 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 @@ -44,7 +47,7 @@ type GetChatBoostsRequest struct { } // GetChatBoostsRequestTypeID is TL type id of GetChatBoostsRequest. -const GetChatBoostsRequestTypeID = 0xd82a288e +const GetChatBoostsRequestTypeID = 0xab5eaa38 // Ensuring interfaces in compile-time for GetChatBoostsRequest. var ( @@ -61,6 +64,9 @@ func (g *GetChatBoostsRequest) Zero() bool { if !(g.ChatID == 0) { return false } + if !(g.OnlyGiftCodes == false) { + return false + } if !(g.Offset == "") { return false } @@ -107,6 +113,10 @@ func (g *GetChatBoostsRequest) TypeInfo() tdp.Type { Name: "ChatID", SchemaName: "chat_id", }, + { + Name: "OnlyGiftCodes", + SchemaName: "only_gift_codes", + }, { Name: "Offset", SchemaName: "offset", @@ -122,7 +132,7 @@ func (g *GetChatBoostsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetChatBoostsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getChatBoosts#d82a288e as nil") + return fmt.Errorf("can't encode getChatBoosts#ab5eaa38 as nil") } b.PutID(GetChatBoostsRequestTypeID) return g.EncodeBare(b) @@ -131,9 +141,10 @@ func (g *GetChatBoostsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetChatBoostsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getChatBoosts#d82a288e as nil") + return fmt.Errorf("can't encode getChatBoosts#ab5eaa38 as nil") } b.PutInt53(g.ChatID) + b.PutBool(g.OnlyGiftCodes) b.PutString(g.Offset) b.PutInt32(g.Limit) return nil @@ -142,10 +153,10 @@ func (g *GetChatBoostsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetChatBoostsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getChatBoosts#d82a288e to nil") + return fmt.Errorf("can't decode getChatBoosts#ab5eaa38 to nil") } if err := b.ConsumeID(GetChatBoostsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: %w", err) } return g.DecodeBare(b) } @@ -153,26 +164,33 @@ func (g *GetChatBoostsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetChatBoostsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getChatBoosts#d82a288e to nil") + return fmt.Errorf("can't decode getChatBoosts#ab5eaa38 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field chat_id: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field chat_id: %w", err) } g.ChatID = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field only_gift_codes: %w", err) + } + g.OnlyGiftCodes = value + } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field offset: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field offset: %w", err) } g.Offset = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field limit: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field limit: %w", err) } g.Limit = value } @@ -182,7 +200,7 @@ func (g *GetChatBoostsRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetChatBoostsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getChatBoosts#d82a288e as nil") + return fmt.Errorf("can't encode getChatBoosts#ab5eaa38 as nil") } b.ObjStart() b.PutID("getChatBoosts") @@ -190,6 +208,9 @@ func (g *GetChatBoostsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("chat_id") b.PutInt53(g.ChatID) b.Comma() + b.FieldStart("only_gift_codes") + b.PutBool(g.OnlyGiftCodes) + b.Comma() b.FieldStart("offset") b.PutString(g.Offset) b.Comma() @@ -204,31 +225,37 @@ func (g *GetChatBoostsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetChatBoostsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getChatBoosts#d82a288e to nil") + return fmt.Errorf("can't decode getChatBoosts#ab5eaa38 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getChatBoosts"); err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field chat_id: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field chat_id: %w", err) } g.ChatID = value + case "only_gift_codes": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field only_gift_codes: %w", err) + } + g.OnlyGiftCodes = value case "offset": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field offset: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field offset: %w", err) } g.Offset = value case "limit": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getChatBoosts#d82a288e: field limit: %w", err) + return fmt.Errorf("unable to decode getChatBoosts#ab5eaa38: field limit: %w", err) } g.Limit = value default: @@ -246,6 +273,14 @@ func (g *GetChatBoostsRequest) GetChatID() (value int64) { return g.ChatID } +// GetOnlyGiftCodes returns value of OnlyGiftCodes field. +func (g *GetChatBoostsRequest) GetOnlyGiftCodes() (value bool) { + if g == nil { + return + } + return g.OnlyGiftCodes +} + // GetOffset returns value of Offset field. func (g *GetChatBoostsRequest) GetOffset() (value string) { if g == nil { @@ -262,7 +297,7 @@ func (g *GetChatBoostsRequest) GetLimit() (value int32) { return g.Limit } -// GetChatBoosts invokes method getChatBoosts#d82a288e returning error if any. +// GetChatBoosts invokes method getChatBoosts#ab5eaa38 returning error if any. func (c *Client) GetChatBoosts(ctx context.Context, request *GetChatBoostsRequest) (*FoundChatBoosts, error) { var result FoundChatBoosts diff --git a/tdapi/tl_get_default_background_custom_emoji_stickers_gen.go b/tdapi/tl_get_default_background_custom_emoji_stickers_gen.go new file mode 100644 index 0000000000..42c4324b6e --- /dev/null +++ b/tdapi/tl_get_default_background_custom_emoji_stickers_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{} +) + +// GetDefaultBackgroundCustomEmojiStickersRequest represents TL type `getDefaultBackgroundCustomEmojiStickers#1cf6680e`. +type GetDefaultBackgroundCustomEmojiStickersRequest struct { +} + +// GetDefaultBackgroundCustomEmojiStickersRequestTypeID is TL type id of GetDefaultBackgroundCustomEmojiStickersRequest. +const GetDefaultBackgroundCustomEmojiStickersRequestTypeID = 0x1cf6680e + +// Ensuring interfaces in compile-time for GetDefaultBackgroundCustomEmojiStickersRequest. +var ( + _ bin.Encoder = &GetDefaultBackgroundCustomEmojiStickersRequest{} + _ bin.Decoder = &GetDefaultBackgroundCustomEmojiStickersRequest{} + _ bin.BareEncoder = &GetDefaultBackgroundCustomEmojiStickersRequest{} + _ bin.BareDecoder = &GetDefaultBackgroundCustomEmojiStickersRequest{} +) + +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) String() string { + if g == nil { + return "GetDefaultBackgroundCustomEmojiStickersRequest(nil)" + } + type Alias GetDefaultBackgroundCustomEmojiStickersRequest + return fmt.Sprintf("GetDefaultBackgroundCustomEmojiStickersRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetDefaultBackgroundCustomEmojiStickersRequest) TypeID() uint32 { + return GetDefaultBackgroundCustomEmojiStickersRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetDefaultBackgroundCustomEmojiStickersRequest) TypeName() string { + return "getDefaultBackgroundCustomEmojiStickers" +} + +// TypeInfo returns info about TL type. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getDefaultBackgroundCustomEmojiStickers", + ID: GetDefaultBackgroundCustomEmojiStickersRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultBackgroundCustomEmojiStickers#1cf6680e as nil") + } + b.PutID(GetDefaultBackgroundCustomEmojiStickersRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultBackgroundCustomEmojiStickers#1cf6680e as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultBackgroundCustomEmojiStickers#1cf6680e to nil") + } + if err := b.ConsumeID(GetDefaultBackgroundCustomEmojiStickersRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getDefaultBackgroundCustomEmojiStickers#1cf6680e: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultBackgroundCustomEmojiStickers#1cf6680e to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getDefaultBackgroundCustomEmojiStickers#1cf6680e as nil") + } + b.ObjStart() + b.PutID("getDefaultBackgroundCustomEmojiStickers") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetDefaultBackgroundCustomEmojiStickersRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getDefaultBackgroundCustomEmojiStickers#1cf6680e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getDefaultBackgroundCustomEmojiStickers"); err != nil { + return fmt.Errorf("unable to decode getDefaultBackgroundCustomEmojiStickers#1cf6680e: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetDefaultBackgroundCustomEmojiStickers invokes method getDefaultBackgroundCustomEmojiStickers#1cf6680e returning error if any. +func (c *Client) GetDefaultBackgroundCustomEmojiStickers(ctx context.Context) (*Stickers, error) { + var result Stickers + + request := &GetDefaultBackgroundCustomEmojiStickersRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_premium_gift_code_payment_options_gen.go b/tdapi/tl_get_premium_gift_code_payment_options_gen.go new file mode 100644 index 0000000000..e1f2324140 --- /dev/null +++ b/tdapi/tl_get_premium_gift_code_payment_options_gen.go @@ -0,0 +1,207 @@ +// 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{} +) + +// GetPremiumGiftCodePaymentOptionsRequest represents TL type `getPremiumGiftCodePaymentOptions#89523a2c`. +type GetPremiumGiftCodePaymentOptionsRequest struct { + // Identifier of the channel chat, which will be automatically boosted by receivers of + // the gift codes and which is administered by the user; 0 if none + BoostedChatID int64 +} + +// GetPremiumGiftCodePaymentOptionsRequestTypeID is TL type id of GetPremiumGiftCodePaymentOptionsRequest. +const GetPremiumGiftCodePaymentOptionsRequestTypeID = 0x89523a2c + +// Ensuring interfaces in compile-time for GetPremiumGiftCodePaymentOptionsRequest. +var ( + _ bin.Encoder = &GetPremiumGiftCodePaymentOptionsRequest{} + _ bin.Decoder = &GetPremiumGiftCodePaymentOptionsRequest{} + _ bin.BareEncoder = &GetPremiumGiftCodePaymentOptionsRequest{} + _ bin.BareDecoder = &GetPremiumGiftCodePaymentOptionsRequest{} +) + +func (g *GetPremiumGiftCodePaymentOptionsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.BoostedChatID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetPremiumGiftCodePaymentOptionsRequest) String() string { + if g == nil { + return "GetPremiumGiftCodePaymentOptionsRequest(nil)" + } + type Alias GetPremiumGiftCodePaymentOptionsRequest + return fmt.Sprintf("GetPremiumGiftCodePaymentOptionsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetPremiumGiftCodePaymentOptionsRequest) TypeID() uint32 { + return GetPremiumGiftCodePaymentOptionsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetPremiumGiftCodePaymentOptionsRequest) TypeName() string { + return "getPremiumGiftCodePaymentOptions" +} + +// TypeInfo returns info about TL type. +func (g *GetPremiumGiftCodePaymentOptionsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getPremiumGiftCodePaymentOptions", + ID: GetPremiumGiftCodePaymentOptionsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BoostedChatID", + SchemaName: "boosted_chat_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiftCodePaymentOptions#89523a2c as nil") + } + b.PutID(GetPremiumGiftCodePaymentOptionsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiftCodePaymentOptions#89523a2c as nil") + } + b.PutInt53(g.BoostedChatID) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiftCodePaymentOptions#89523a2c to nil") + } + if err := b.ConsumeID(GetPremiumGiftCodePaymentOptionsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getPremiumGiftCodePaymentOptions#89523a2c: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiftCodePaymentOptions#89523a2c to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiftCodePaymentOptions#89523a2c: field boosted_chat_id: %w", err) + } + g.BoostedChatID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiftCodePaymentOptions#89523a2c as nil") + } + b.ObjStart() + b.PutID("getPremiumGiftCodePaymentOptions") + b.Comma() + b.FieldStart("boosted_chat_id") + b.PutInt53(g.BoostedChatID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetPremiumGiftCodePaymentOptionsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiftCodePaymentOptions#89523a2c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getPremiumGiftCodePaymentOptions"); err != nil { + return fmt.Errorf("unable to decode getPremiumGiftCodePaymentOptions#89523a2c: %w", err) + } + case "boosted_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiftCodePaymentOptions#89523a2c: field boosted_chat_id: %w", err) + } + g.BoostedChatID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBoostedChatID returns value of BoostedChatID field. +func (g *GetPremiumGiftCodePaymentOptionsRequest) GetBoostedChatID() (value int64) { + if g == nil { + return + } + return g.BoostedChatID +} + +// GetPremiumGiftCodePaymentOptions invokes method getPremiumGiftCodePaymentOptions#89523a2c returning error if any. +func (c *Client) GetPremiumGiftCodePaymentOptions(ctx context.Context, boostedchatid int64) (*PremiumGiftCodePaymentOptions, error) { + var result PremiumGiftCodePaymentOptions + + request := &GetPremiumGiftCodePaymentOptionsRequest{ + BoostedChatID: boostedchatid, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_premium_giveaway_info_gen.go b/tdapi/tl_get_premium_giveaway_info_gen.go new file mode 100644 index 0000000000..014b745c88 --- /dev/null +++ b/tdapi/tl_get_premium_giveaway_info_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{} +) + +// GetPremiumGiveawayInfoRequest represents TL type `getPremiumGiveawayInfo#6adb7b97`. +type GetPremiumGiveawayInfoRequest struct { + // Identifier of the channel chat which started the giveaway + ChatID int64 + // Identifier of the giveaway message in the chat + MessageID int64 +} + +// GetPremiumGiveawayInfoRequestTypeID is TL type id of GetPremiumGiveawayInfoRequest. +const GetPremiumGiveawayInfoRequestTypeID = 0x6adb7b97 + +// Ensuring interfaces in compile-time for GetPremiumGiveawayInfoRequest. +var ( + _ bin.Encoder = &GetPremiumGiveawayInfoRequest{} + _ bin.Decoder = &GetPremiumGiveawayInfoRequest{} + _ bin.BareEncoder = &GetPremiumGiveawayInfoRequest{} + _ bin.BareDecoder = &GetPremiumGiveawayInfoRequest{} +) + +func (g *GetPremiumGiveawayInfoRequest) Zero() bool { + if g == nil { + return true + } + if !(g.ChatID == 0) { + return false + } + if !(g.MessageID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetPremiumGiveawayInfoRequest) String() string { + if g == nil { + return "GetPremiumGiveawayInfoRequest(nil)" + } + type Alias GetPremiumGiveawayInfoRequest + return fmt.Sprintf("GetPremiumGiveawayInfoRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetPremiumGiveawayInfoRequest) TypeID() uint32 { + return GetPremiumGiveawayInfoRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetPremiumGiveawayInfoRequest) TypeName() string { + return "getPremiumGiveawayInfo" +} + +// TypeInfo returns info about TL type. +func (g *GetPremiumGiveawayInfoRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getPremiumGiveawayInfo", + ID: GetPremiumGiveawayInfoRequestTypeID, + } + if g == 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 (g *GetPremiumGiveawayInfoRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiveawayInfo#6adb7b97 as nil") + } + b.PutID(GetPremiumGiveawayInfoRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetPremiumGiveawayInfoRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiveawayInfo#6adb7b97 as nil") + } + b.PutInt53(g.ChatID) + b.PutInt53(g.MessageID) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetPremiumGiveawayInfoRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiveawayInfo#6adb7b97 to nil") + } + if err := b.ConsumeID(GetPremiumGiveawayInfoRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetPremiumGiveawayInfoRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiveawayInfo#6adb7b97 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: field chat_id: %w", err) + } + g.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: field message_id: %w", err) + } + g.MessageID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetPremiumGiveawayInfoRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumGiveawayInfo#6adb7b97 as nil") + } + b.ObjStart() + b.PutID("getPremiumGiveawayInfo") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(g.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(g.MessageID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetPremiumGiveawayInfoRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumGiveawayInfo#6adb7b97 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getPremiumGiveawayInfo"); err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: field chat_id: %w", err) + } + g.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPremiumGiveawayInfo#6adb7b97: field message_id: %w", err) + } + g.MessageID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (g *GetPremiumGiveawayInfoRequest) GetChatID() (value int64) { + if g == nil { + return + } + return g.ChatID +} + +// GetMessageID returns value of MessageID field. +func (g *GetPremiumGiveawayInfoRequest) GetMessageID() (value int64) { + if g == nil { + return + } + return g.MessageID +} + +// GetPremiumGiveawayInfo invokes method getPremiumGiveawayInfo#6adb7b97 returning error if any. +func (c *Client) GetPremiumGiveawayInfo(ctx context.Context, request *GetPremiumGiveawayInfoRequest) (PremiumGiveawayInfoClass, error) { + var result PremiumGiveawayInfoBox + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.PremiumGiveawayInfo, nil +} diff --git a/tdapi/tl_get_user_chat_boosts_gen.go b/tdapi/tl_get_user_chat_boosts_gen.go new file mode 100644 index 0000000000..78bc69f536 --- /dev/null +++ b/tdapi/tl_get_user_chat_boosts_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{} +) + +// GetUserChatBoostsRequest represents TL type `getUserChatBoosts#b90ee799`. +type GetUserChatBoostsRequest struct { + // Identifier of the chat + ChatID int64 + // Identifier of the user + UserID int64 +} + +// GetUserChatBoostsRequestTypeID is TL type id of GetUserChatBoostsRequest. +const GetUserChatBoostsRequestTypeID = 0xb90ee799 + +// Ensuring interfaces in compile-time for GetUserChatBoostsRequest. +var ( + _ bin.Encoder = &GetUserChatBoostsRequest{} + _ bin.Decoder = &GetUserChatBoostsRequest{} + _ bin.BareEncoder = &GetUserChatBoostsRequest{} + _ bin.BareDecoder = &GetUserChatBoostsRequest{} +) + +func (g *GetUserChatBoostsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.ChatID == 0) { + return false + } + if !(g.UserID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetUserChatBoostsRequest) String() string { + if g == nil { + return "GetUserChatBoostsRequest(nil)" + } + type Alias GetUserChatBoostsRequest + return fmt.Sprintf("GetUserChatBoostsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetUserChatBoostsRequest) TypeID() uint32 { + return GetUserChatBoostsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetUserChatBoostsRequest) TypeName() string { + return "getUserChatBoosts" +} + +// TypeInfo returns info about TL type. +func (g *GetUserChatBoostsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getUserChatBoosts", + ID: GetUserChatBoostsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "UserID", + SchemaName: "user_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetUserChatBoostsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getUserChatBoosts#b90ee799 as nil") + } + b.PutID(GetUserChatBoostsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetUserChatBoostsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getUserChatBoosts#b90ee799 as nil") + } + b.PutInt53(g.ChatID) + b.PutInt53(g.UserID) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetUserChatBoostsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getUserChatBoosts#b90ee799 to nil") + } + if err := b.ConsumeID(GetUserChatBoostsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetUserChatBoostsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getUserChatBoosts#b90ee799 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: field chat_id: %w", err) + } + g.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: field user_id: %w", err) + } + g.UserID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetUserChatBoostsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getUserChatBoosts#b90ee799 as nil") + } + b.ObjStart() + b.PutID("getUserChatBoosts") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(g.ChatID) + b.Comma() + b.FieldStart("user_id") + b.PutInt53(g.UserID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetUserChatBoostsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getUserChatBoosts#b90ee799 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getUserChatBoosts"); err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: field chat_id: %w", err) + } + g.ChatID = value + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserChatBoosts#b90ee799: field user_id: %w", err) + } + g.UserID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (g *GetUserChatBoostsRequest) GetChatID() (value int64) { + if g == nil { + return + } + return g.ChatID +} + +// GetUserID returns value of UserID field. +func (g *GetUserChatBoostsRequest) GetUserID() (value int64) { + if g == nil { + return + } + return g.UserID +} + +// GetUserChatBoosts invokes method getUserChatBoosts#b90ee799 returning error if any. +func (c *Client) GetUserChatBoosts(ctx context.Context, request *GetUserChatBoostsRequest) (*FoundChatBoosts, error) { + var result FoundChatBoosts + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_web_page_preview_gen.go b/tdapi/tl_get_web_page_preview_gen.go index 1ddaff66e8..96ad25066f 100644 --- a/tdapi/tl_get_web_page_preview_gen.go +++ b/tdapi/tl_get_web_page_preview_gen.go @@ -31,14 +31,17 @@ var ( _ = tdjson.Encoder{} ) -// GetWebPagePreviewRequest represents TL type `getWebPagePreview#222e062c`. +// GetWebPagePreviewRequest represents TL type `getWebPagePreview#a850b8d8`. type GetWebPagePreviewRequest struct { // Message text with formatting Text FormattedText + // Options to be used for generation of the link preview; pass null to use default link + // preview options + LinkPreviewOptions LinkPreviewOptions } // GetWebPagePreviewRequestTypeID is TL type id of GetWebPagePreviewRequest. -const GetWebPagePreviewRequestTypeID = 0x222e062c +const GetWebPagePreviewRequestTypeID = 0xa850b8d8 // Ensuring interfaces in compile-time for GetWebPagePreviewRequest. var ( @@ -55,6 +58,9 @@ func (g *GetWebPagePreviewRequest) Zero() bool { if !(g.Text.Zero()) { return false } + if !(g.LinkPreviewOptions.Zero()) { + return false + } return true } @@ -95,6 +101,10 @@ func (g *GetWebPagePreviewRequest) TypeInfo() tdp.Type { Name: "Text", SchemaName: "text", }, + { + Name: "LinkPreviewOptions", + SchemaName: "link_preview_options", + }, } return typ } @@ -102,7 +112,7 @@ func (g *GetWebPagePreviewRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetWebPagePreviewRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebPagePreview#222e062c as nil") + return fmt.Errorf("can't encode getWebPagePreview#a850b8d8 as nil") } b.PutID(GetWebPagePreviewRequestTypeID) return g.EncodeBare(b) @@ -111,10 +121,13 @@ func (g *GetWebPagePreviewRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetWebPagePreviewRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebPagePreview#222e062c as nil") + return fmt.Errorf("can't encode getWebPagePreview#a850b8d8 as nil") } if err := g.Text.Encode(b); err != nil { - return fmt.Errorf("unable to encode getWebPagePreview#222e062c: field text: %w", err) + return fmt.Errorf("unable to encode getWebPagePreview#a850b8d8: field text: %w", err) + } + if err := g.LinkPreviewOptions.Encode(b); err != nil { + return fmt.Errorf("unable to encode getWebPagePreview#a850b8d8: field link_preview_options: %w", err) } return nil } @@ -122,10 +135,10 @@ func (g *GetWebPagePreviewRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetWebPagePreviewRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebPagePreview#222e062c to nil") + return fmt.Errorf("can't decode getWebPagePreview#a850b8d8 to nil") } if err := b.ConsumeID(GetWebPagePreviewRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getWebPagePreview#222e062c: %w", err) + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: %w", err) } return g.DecodeBare(b) } @@ -133,11 +146,16 @@ func (g *GetWebPagePreviewRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetWebPagePreviewRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebPagePreview#222e062c to nil") + return fmt.Errorf("can't decode getWebPagePreview#a850b8d8 to nil") } { if err := g.Text.Decode(b); err != nil { - return fmt.Errorf("unable to decode getWebPagePreview#222e062c: field text: %w", err) + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: field text: %w", err) + } + } + { + if err := g.LinkPreviewOptions.Decode(b); err != nil { + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: field link_preview_options: %w", err) } } return nil @@ -146,14 +164,19 @@ func (g *GetWebPagePreviewRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetWebPagePreviewRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getWebPagePreview#222e062c as nil") + return fmt.Errorf("can't encode getWebPagePreview#a850b8d8 as nil") } b.ObjStart() b.PutID("getWebPagePreview") b.Comma() b.FieldStart("text") if err := g.Text.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode getWebPagePreview#222e062c: field text: %w", err) + return fmt.Errorf("unable to encode getWebPagePreview#a850b8d8: field text: %w", err) + } + b.Comma() + b.FieldStart("link_preview_options") + if err := g.LinkPreviewOptions.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getWebPagePreview#a850b8d8: field link_preview_options: %w", err) } b.Comma() b.StripComma() @@ -164,18 +187,22 @@ func (g *GetWebPagePreviewRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetWebPagePreviewRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getWebPagePreview#222e062c to nil") + return fmt.Errorf("can't decode getWebPagePreview#a850b8d8 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getWebPagePreview"); err != nil { - return fmt.Errorf("unable to decode getWebPagePreview#222e062c: %w", err) + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: %w", err) } case "text": if err := g.Text.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode getWebPagePreview#222e062c: field text: %w", err) + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: field text: %w", err) + } + case "link_preview_options": + if err := g.LinkPreviewOptions.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode getWebPagePreview#a850b8d8: field link_preview_options: %w", err) } default: return b.Skip() @@ -192,13 +219,18 @@ func (g *GetWebPagePreviewRequest) GetText() (value FormattedText) { return g.Text } -// GetWebPagePreview invokes method getWebPagePreview#222e062c returning error if any. -func (c *Client) GetWebPagePreview(ctx context.Context, text FormattedText) (*WebPage, error) { +// GetLinkPreviewOptions returns value of LinkPreviewOptions field. +func (g *GetWebPagePreviewRequest) GetLinkPreviewOptions() (value LinkPreviewOptions) { + if g == nil { + return + } + return g.LinkPreviewOptions +} + +// GetWebPagePreview invokes method getWebPagePreview#a850b8d8 returning error if any. +func (c *Client) GetWebPagePreview(ctx context.Context, request *GetWebPagePreviewRequest) (*WebPage, error) { var result WebPage - request := &GetWebPagePreviewRequest{ - Text: text, - } if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err } diff --git a/tdapi/tl_input_invoice_gen.go b/tdapi/tl_input_invoice_gen.go index 05cfc98e75..44d2eb0382 100644 --- a/tdapi/tl_input_invoice_gen.go +++ b/tdapi/tl_input_invoice_gen.go @@ -397,6 +397,182 @@ func (i *InputInvoiceName) GetName() (value string) { return i.Name } +// InputInvoiceTelegram represents TL type `inputInvoiceTelegram#96ecfeed`. +type InputInvoiceTelegram struct { + // Transaction purpose + Purpose TelegramPaymentPurposeClass +} + +// InputInvoiceTelegramTypeID is TL type id of InputInvoiceTelegram. +const InputInvoiceTelegramTypeID = 0x96ecfeed + +// construct implements constructor of InputInvoiceClass. +func (i InputInvoiceTelegram) construct() InputInvoiceClass { return &i } + +// Ensuring interfaces in compile-time for InputInvoiceTelegram. +var ( + _ bin.Encoder = &InputInvoiceTelegram{} + _ bin.Decoder = &InputInvoiceTelegram{} + _ bin.BareEncoder = &InputInvoiceTelegram{} + _ bin.BareDecoder = &InputInvoiceTelegram{} + + _ InputInvoiceClass = &InputInvoiceTelegram{} +) + +func (i *InputInvoiceTelegram) Zero() bool { + if i == nil { + return true + } + if !(i.Purpose == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputInvoiceTelegram) String() string { + if i == nil { + return "InputInvoiceTelegram(nil)" + } + type Alias InputInvoiceTelegram + return fmt.Sprintf("InputInvoiceTelegram%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputInvoiceTelegram) TypeID() uint32 { + return InputInvoiceTelegramTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputInvoiceTelegram) TypeName() string { + return "inputInvoiceTelegram" +} + +// TypeInfo returns info about TL type. +func (i *InputInvoiceTelegram) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputInvoiceTelegram", + ID: InputInvoiceTelegramTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Purpose", + SchemaName: "purpose", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputInvoiceTelegram) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputInvoiceTelegram#96ecfeed as nil") + } + b.PutID(InputInvoiceTelegramTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputInvoiceTelegram) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputInvoiceTelegram#96ecfeed as nil") + } + if i.Purpose == nil { + return fmt.Errorf("unable to encode inputInvoiceTelegram#96ecfeed: field purpose is nil") + } + if err := i.Purpose.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputInvoiceTelegram#96ecfeed: field purpose: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputInvoiceTelegram) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputInvoiceTelegram#96ecfeed to nil") + } + if err := b.ConsumeID(InputInvoiceTelegramTypeID); err != nil { + return fmt.Errorf("unable to decode inputInvoiceTelegram#96ecfeed: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputInvoiceTelegram) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputInvoiceTelegram#96ecfeed to nil") + } + { + value, err := DecodeTelegramPaymentPurpose(b) + if err != nil { + return fmt.Errorf("unable to decode inputInvoiceTelegram#96ecfeed: field purpose: %w", err) + } + i.Purpose = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputInvoiceTelegram) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputInvoiceTelegram#96ecfeed as nil") + } + b.ObjStart() + b.PutID("inputInvoiceTelegram") + b.Comma() + b.FieldStart("purpose") + if i.Purpose == nil { + return fmt.Errorf("unable to encode inputInvoiceTelegram#96ecfeed: field purpose is nil") + } + if err := i.Purpose.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputInvoiceTelegram#96ecfeed: field purpose: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputInvoiceTelegram) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputInvoiceTelegram#96ecfeed to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputInvoiceTelegram"); err != nil { + return fmt.Errorf("unable to decode inputInvoiceTelegram#96ecfeed: %w", err) + } + case "purpose": + value, err := DecodeTDLibJSONTelegramPaymentPurpose(b) + if err != nil { + return fmt.Errorf("unable to decode inputInvoiceTelegram#96ecfeed: field purpose: %w", err) + } + i.Purpose = value + default: + return b.Skip() + } + return nil + }) +} + +// GetPurpose returns value of Purpose field. +func (i *InputInvoiceTelegram) GetPurpose() (value TelegramPaymentPurposeClass) { + if i == nil { + return + } + return i.Purpose +} + // InputInvoiceClassName is schema name of InputInvoiceClass. const InputInvoiceClassName = "InputInvoice" @@ -411,6 +587,7 @@ const InputInvoiceClassName = "InputInvoice" // switch v := g.(type) { // case *tdapi.InputInvoiceMessage: // inputInvoiceMessage#58dcea10 // case *tdapi.InputInvoiceName: // inputInvoiceName#b1ca16f3 +// case *tdapi.InputInvoiceTelegram: // inputInvoiceTelegram#96ecfeed // default: panic(v) // } type InputInvoiceClass interface { @@ -456,6 +633,13 @@ func DecodeInputInvoice(buf *bin.Buffer) (InputInvoiceClass, error) { return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", err) } return &v, nil + case InputInvoiceTelegramTypeID: + // Decoding inputInvoiceTelegram#96ecfeed. + v := InputInvoiceTelegram{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", bin.NewUnexpectedID(id)) } @@ -482,6 +666,13 @@ func DecodeTDLibJSONInputInvoice(buf tdjson.Decoder) (InputInvoiceClass, error) return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", err) } return &v, nil + case "inputInvoiceTelegram": + // Decoding inputInvoiceTelegram#96ecfeed. + v := InputInvoiceTelegram{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputInvoiceClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_input_message_content_gen.go b/tdapi/tl_input_message_content_gen.go index 0f47dd75bb..5d2ce39766 100644 --- a/tdapi/tl_input_message_content_gen.go +++ b/tdapi/tl_input_message_content_gen.go @@ -31,20 +31,21 @@ var ( _ = tdjson.Encoder{} ) -// InputMessageText represents TL type `inputMessageText#eb9b098`. +// InputMessageText represents TL type `inputMessageText#f350d894`. type InputMessageText struct { - // Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only - // Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, - // TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only + // Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, + // PreCode, TextUrl and MentionName entities are allowed to be specified manually Text FormattedText - // True, if rich web page previews for URLs in the message text must be disabled - DisableWebPagePreview bool + // Options to be used for generation of a link preview; pass null to use default link + // preview options + LinkPreviewOptions LinkPreviewOptions // True, if a chat message draft must be deleted ClearDraft bool } // InputMessageTextTypeID is TL type id of InputMessageText. -const InputMessageTextTypeID = 0xeb9b098 +const InputMessageTextTypeID = 0xf350d894 // construct implements constructor of InputMessageContentClass. func (i InputMessageText) construct() InputMessageContentClass { return &i } @@ -66,7 +67,7 @@ func (i *InputMessageText) Zero() bool { if !(i.Text.Zero()) { return false } - if !(i.DisableWebPagePreview == false) { + if !(i.LinkPreviewOptions.Zero()) { return false } if !(i.ClearDraft == false) { @@ -113,8 +114,8 @@ func (i *InputMessageText) TypeInfo() tdp.Type { SchemaName: "text", }, { - Name: "DisableWebPagePreview", - SchemaName: "disable_web_page_preview", + Name: "LinkPreviewOptions", + SchemaName: "link_preview_options", }, { Name: "ClearDraft", @@ -127,7 +128,7 @@ func (i *InputMessageText) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputMessageText) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputMessageText#eb9b098 as nil") + return fmt.Errorf("can't encode inputMessageText#f350d894 as nil") } b.PutID(InputMessageTextTypeID) return i.EncodeBare(b) @@ -136,12 +137,14 @@ func (i *InputMessageText) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputMessageText) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputMessageText#eb9b098 as nil") + return fmt.Errorf("can't encode inputMessageText#f350d894 as nil") } if err := i.Text.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputMessageText#eb9b098: field text: %w", err) + return fmt.Errorf("unable to encode inputMessageText#f350d894: field text: %w", err) + } + if err := i.LinkPreviewOptions.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMessageText#f350d894: field link_preview_options: %w", err) } - b.PutBool(i.DisableWebPagePreview) b.PutBool(i.ClearDraft) return nil } @@ -149,10 +152,10 @@ func (i *InputMessageText) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputMessageText) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputMessageText#eb9b098 to nil") + return fmt.Errorf("can't decode inputMessageText#f350d894 to nil") } if err := b.ConsumeID(InputMessageTextTypeID); err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: %w", err) } return i.DecodeBare(b) } @@ -160,24 +163,22 @@ func (i *InputMessageText) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputMessageText) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputMessageText#eb9b098 to nil") + return fmt.Errorf("can't decode inputMessageText#f350d894 to nil") } { if err := i.Text.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field text: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: field text: %w", err) } } { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field disable_web_page_preview: %w", err) + if err := i.LinkPreviewOptions.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMessageText#f350d894: field link_preview_options: %w", err) } - i.DisableWebPagePreview = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field clear_draft: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: field clear_draft: %w", err) } i.ClearDraft = value } @@ -187,18 +188,20 @@ func (i *InputMessageText) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InputMessageText) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode inputMessageText#eb9b098 as nil") + return fmt.Errorf("can't encode inputMessageText#f350d894 as nil") } b.ObjStart() b.PutID("inputMessageText") b.Comma() b.FieldStart("text") if err := i.Text.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode inputMessageText#eb9b098: field text: %w", err) + return fmt.Errorf("unable to encode inputMessageText#f350d894: field text: %w", err) } b.Comma() - b.FieldStart("disable_web_page_preview") - b.PutBool(i.DisableWebPagePreview) + b.FieldStart("link_preview_options") + if err := i.LinkPreviewOptions.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessageText#f350d894: field link_preview_options: %w", err) + } b.Comma() b.FieldStart("clear_draft") b.PutBool(i.ClearDraft) @@ -211,29 +214,27 @@ func (i *InputMessageText) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InputMessageText) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode inputMessageText#eb9b098 to nil") + return fmt.Errorf("can't decode inputMessageText#f350d894 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("inputMessageText"); err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: %w", err) } case "text": if err := i.Text.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field text: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: field text: %w", err) } - case "disable_web_page_preview": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field disable_web_page_preview: %w", err) + case "link_preview_options": + if err := i.LinkPreviewOptions.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessageText#f350d894: field link_preview_options: %w", err) } - i.DisableWebPagePreview = value case "clear_draft": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode inputMessageText#eb9b098: field clear_draft: %w", err) + return fmt.Errorf("unable to decode inputMessageText#f350d894: field clear_draft: %w", err) } i.ClearDraft = value default: @@ -251,12 +252,12 @@ func (i *InputMessageText) GetText() (value FormattedText) { return i.Text } -// GetDisableWebPagePreview returns value of DisableWebPagePreview field. -func (i *InputMessageText) GetDisableWebPagePreview() (value bool) { +// GetLinkPreviewOptions returns value of LinkPreviewOptions field. +func (i *InputMessageText) GetLinkPreviewOptions() (value LinkPreviewOptions) { if i == nil { return } - return i.DisableWebPagePreview + return i.LinkPreviewOptions } // GetClearDraft returns value of ClearDraft field. @@ -5339,7 +5340,8 @@ func (i *InputMessageStory) GetStoryID() (value int32) { type InputMessageForwarded struct { // Identifier for the chat this forwarded message came from FromChatID int64 - // Identifier of the message to forward + // Identifier of the message to forward. A message can be forwarded only if message + // can_be_forwarded MessageID int64 // True, if a game message is being shared from a launched game; applies only to game // messages @@ -5617,7 +5619,7 @@ const InputMessageContentClassName = "InputMessageContent" // panic(err) // } // switch v := g.(type) { -// case *tdapi.InputMessageText: // inputMessageText#eb9b098 +// case *tdapi.InputMessageText: // inputMessageText#f350d894 // case *tdapi.InputMessageAnimation: // inputMessageAnimation#cd68f5fe // case *tdapi.InputMessageAudio: // inputMessageAudio#daa400b2 // case *tdapi.InputMessageDocument: // inputMessageDocument#615b72b9 @@ -5667,7 +5669,7 @@ func DecodeInputMessageContent(buf *bin.Buffer) (InputMessageContentClass, error } switch id { case InputMessageTextTypeID: - // Decoding inputMessageText#eb9b098. + // Decoding inputMessageText#f350d894. v := InputMessageText{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) @@ -5805,7 +5807,7 @@ func DecodeTDLibJSONInputMessageContent(buf tdjson.Decoder) (InputMessageContent } switch id { case "inputMessageText": - // Decoding inputMessageText#eb9b098. + // Decoding inputMessageText#f350d894. v := InputMessageText{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) diff --git a/tdapi/tl_input_message_reply_to_gen.go b/tdapi/tl_input_message_reply_to_gen.go new file mode 100644 index 0000000000..b6e4a61fa1 --- /dev/null +++ b/tdapi/tl_input_message_reply_to_gen.go @@ -0,0 +1,609 @@ +// 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{} +) + +// InputMessageReplyToMessage represents TL type `inputMessageReplyToMessage#20b16f06`. +type InputMessageReplyToMessage struct { + // The identifier of the chat to which the message to be replied belongs; pass 0 if the + // message to be replied is in the same chat. Must always be 0 for replies in secret + // chats. A message can be replied in another chat only if message + // can_be_replied_in_another_chat + ChatID int64 + // The identifier of the message to be replied in the same or the specified chat + MessageID int64 + // Manually chosen quote from the message to be replied; pass null if none; + // 0-getOption("message_reply_quote_length_max") characters. Must always be null for + // replies in secret chats. + Quote FormattedText +} + +// InputMessageReplyToMessageTypeID is TL type id of InputMessageReplyToMessage. +const InputMessageReplyToMessageTypeID = 0x20b16f06 + +// construct implements constructor of InputMessageReplyToClass. +func (i InputMessageReplyToMessage) construct() InputMessageReplyToClass { return &i } + +// Ensuring interfaces in compile-time for InputMessageReplyToMessage. +var ( + _ bin.Encoder = &InputMessageReplyToMessage{} + _ bin.Decoder = &InputMessageReplyToMessage{} + _ bin.BareEncoder = &InputMessageReplyToMessage{} + _ bin.BareDecoder = &InputMessageReplyToMessage{} + + _ InputMessageReplyToClass = &InputMessageReplyToMessage{} +) + +func (i *InputMessageReplyToMessage) Zero() bool { + if i == nil { + return true + } + if !(i.ChatID == 0) { + return false + } + if !(i.MessageID == 0) { + return false + } + if !(i.Quote.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputMessageReplyToMessage) String() string { + if i == nil { + return "InputMessageReplyToMessage(nil)" + } + type Alias InputMessageReplyToMessage + return fmt.Sprintf("InputMessageReplyToMessage%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputMessageReplyToMessage) TypeID() uint32 { + return InputMessageReplyToMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputMessageReplyToMessage) TypeName() string { + return "inputMessageReplyToMessage" +} + +// TypeInfo returns info about TL type. +func (i *InputMessageReplyToMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputMessageReplyToMessage", + ID: InputMessageReplyToMessageTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "Quote", + SchemaName: "quote", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputMessageReplyToMessage) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToMessage#20b16f06 as nil") + } + b.PutID(InputMessageReplyToMessageTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputMessageReplyToMessage) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToMessage#20b16f06 as nil") + } + b.PutInt53(i.ChatID) + b.PutInt53(i.MessageID) + if err := i.Quote.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMessageReplyToMessage#20b16f06: field quote: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputMessageReplyToMessage) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToMessage#20b16f06 to nil") + } + if err := b.ConsumeID(InputMessageReplyToMessageTypeID); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputMessageReplyToMessage) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToMessage#20b16f06 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field chat_id: %w", err) + } + i.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field message_id: %w", err) + } + i.MessageID = value + } + { + if err := i.Quote.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field quote: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputMessageReplyToMessage) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToMessage#20b16f06 as nil") + } + b.ObjStart() + b.PutID("inputMessageReplyToMessage") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(i.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(i.MessageID) + b.Comma() + b.FieldStart("quote") + if err := i.Quote.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessageReplyToMessage#20b16f06: field quote: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputMessageReplyToMessage) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToMessage#20b16f06 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputMessageReplyToMessage"); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field chat_id: %w", err) + } + i.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field message_id: %w", err) + } + i.MessageID = value + case "quote": + if err := i.Quote.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToMessage#20b16f06: field quote: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (i *InputMessageReplyToMessage) GetChatID() (value int64) { + if i == nil { + return + } + return i.ChatID +} + +// GetMessageID returns value of MessageID field. +func (i *InputMessageReplyToMessage) GetMessageID() (value int64) { + if i == nil { + return + } + return i.MessageID +} + +// GetQuote returns value of Quote field. +func (i *InputMessageReplyToMessage) GetQuote() (value FormattedText) { + if i == nil { + return + } + return i.Quote +} + +// InputMessageReplyToStory represents TL type `inputMessageReplyToStory#51aece78`. +type InputMessageReplyToStory struct { + // The identifier of the sender of the story. Currently, stories can be replied only in + // the sender's chat + StorySenderChatID int64 + // The identifier of the story + StoryID int32 +} + +// InputMessageReplyToStoryTypeID is TL type id of InputMessageReplyToStory. +const InputMessageReplyToStoryTypeID = 0x51aece78 + +// construct implements constructor of InputMessageReplyToClass. +func (i InputMessageReplyToStory) construct() InputMessageReplyToClass { return &i } + +// Ensuring interfaces in compile-time for InputMessageReplyToStory. +var ( + _ bin.Encoder = &InputMessageReplyToStory{} + _ bin.Decoder = &InputMessageReplyToStory{} + _ bin.BareEncoder = &InputMessageReplyToStory{} + _ bin.BareDecoder = &InputMessageReplyToStory{} + + _ InputMessageReplyToClass = &InputMessageReplyToStory{} +) + +func (i *InputMessageReplyToStory) Zero() bool { + if i == nil { + return true + } + if !(i.StorySenderChatID == 0) { + return false + } + if !(i.StoryID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputMessageReplyToStory) String() string { + if i == nil { + return "InputMessageReplyToStory(nil)" + } + type Alias InputMessageReplyToStory + return fmt.Sprintf("InputMessageReplyToStory%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputMessageReplyToStory) TypeID() uint32 { + return InputMessageReplyToStoryTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputMessageReplyToStory) TypeName() string { + return "inputMessageReplyToStory" +} + +// TypeInfo returns info about TL type. +func (i *InputMessageReplyToStory) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputMessageReplyToStory", + ID: InputMessageReplyToStoryTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StorySenderChatID", + SchemaName: "story_sender_chat_id", + }, + { + Name: "StoryID", + SchemaName: "story_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputMessageReplyToStory) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToStory#51aece78 as nil") + } + b.PutID(InputMessageReplyToStoryTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputMessageReplyToStory) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToStory#51aece78 as nil") + } + b.PutInt53(i.StorySenderChatID) + b.PutInt32(i.StoryID) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputMessageReplyToStory) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToStory#51aece78 to nil") + } + if err := b.ConsumeID(InputMessageReplyToStoryTypeID); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputMessageReplyToStory) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToStory#51aece78 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: field story_sender_chat_id: %w", err) + } + i.StorySenderChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: field story_id: %w", err) + } + i.StoryID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputMessageReplyToStory) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputMessageReplyToStory#51aece78 as nil") + } + b.ObjStart() + b.PutID("inputMessageReplyToStory") + b.Comma() + b.FieldStart("story_sender_chat_id") + b.PutInt53(i.StorySenderChatID) + b.Comma() + b.FieldStart("story_id") + b.PutInt32(i.StoryID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputMessageReplyToStory) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputMessageReplyToStory#51aece78 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputMessageReplyToStory"); err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: %w", err) + } + case "story_sender_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: field story_sender_chat_id: %w", err) + } + i.StorySenderChatID = value + case "story_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputMessageReplyToStory#51aece78: field story_id: %w", err) + } + i.StoryID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStorySenderChatID returns value of StorySenderChatID field. +func (i *InputMessageReplyToStory) GetStorySenderChatID() (value int64) { + if i == nil { + return + } + return i.StorySenderChatID +} + +// GetStoryID returns value of StoryID field. +func (i *InputMessageReplyToStory) GetStoryID() (value int32) { + if i == nil { + return + } + return i.StoryID +} + +// InputMessageReplyToClassName is schema name of InputMessageReplyToClass. +const InputMessageReplyToClassName = "InputMessageReplyTo" + +// InputMessageReplyToClass represents InputMessageReplyTo generic type. +// +// Example: +// +// g, err := tdapi.DecodeInputMessageReplyTo(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.InputMessageReplyToMessage: // inputMessageReplyToMessage#20b16f06 +// case *tdapi.InputMessageReplyToStory: // inputMessageReplyToStory#51aece78 +// default: panic(v) +// } +type InputMessageReplyToClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() InputMessageReplyToClass + + // 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 +} + +// DecodeInputMessageReplyTo implements binary de-serialization for InputMessageReplyToClass. +func DecodeInputMessageReplyTo(buf *bin.Buffer) (InputMessageReplyToClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case InputMessageReplyToMessageTypeID: + // Decoding inputMessageReplyToMessage#20b16f06. + v := InputMessageReplyToMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", err) + } + return &v, nil + case InputMessageReplyToStoryTypeID: + // Decoding inputMessageReplyToStory#51aece78. + v := InputMessageReplyToStory{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONInputMessageReplyTo implements binary de-serialization for InputMessageReplyToClass. +func DecodeTDLibJSONInputMessageReplyTo(buf tdjson.Decoder) (InputMessageReplyToClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "inputMessageReplyToMessage": + // Decoding inputMessageReplyToMessage#20b16f06. + v := InputMessageReplyToMessage{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", err) + } + return &v, nil + case "inputMessageReplyToStory": + // Decoding inputMessageReplyToStory#51aece78. + v := InputMessageReplyToStory{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputMessageReplyToClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// InputMessageReplyTo boxes the InputMessageReplyToClass providing a helper. +type InputMessageReplyToBox struct { + InputMessageReplyTo InputMessageReplyToClass +} + +// Decode implements bin.Decoder for InputMessageReplyToBox. +func (b *InputMessageReplyToBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode InputMessageReplyToBox to nil") + } + v, err := DecodeInputMessageReplyTo(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputMessageReplyTo = v + return nil +} + +// Encode implements bin.Encode for InputMessageReplyToBox. +func (b *InputMessageReplyToBox) Encode(buf *bin.Buffer) error { + if b == nil || b.InputMessageReplyTo == nil { + return fmt.Errorf("unable to encode InputMessageReplyToClass as nil") + } + return b.InputMessageReplyTo.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for InputMessageReplyToBox. +func (b *InputMessageReplyToBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode InputMessageReplyToBox to nil") + } + v, err := DecodeTDLibJSONInputMessageReplyTo(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputMessageReplyTo = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for InputMessageReplyToBox. +func (b *InputMessageReplyToBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.InputMessageReplyTo == nil { + return fmt.Errorf("unable to encode InputMessageReplyToClass as nil") + } + return b.InputMessageReplyTo.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index 9667daab95..e1c0afaf00 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 } +// InternalLinkTypePremiumGiftCode represents TL type `internalLinkTypePremiumGiftCode#de5c9892`. +type InternalLinkTypePremiumGiftCode struct { + // The Telegram Premium gift code + Code string +} + +// InternalLinkTypePremiumGiftCodeTypeID is TL type id of InternalLinkTypePremiumGiftCode. +const InternalLinkTypePremiumGiftCodeTypeID = 0xde5c9892 + +// construct implements constructor of InternalLinkTypeClass. +func (i InternalLinkTypePremiumGiftCode) construct() InternalLinkTypeClass { return &i } + +// Ensuring interfaces in compile-time for InternalLinkTypePremiumGiftCode. +var ( + _ bin.Encoder = &InternalLinkTypePremiumGiftCode{} + _ bin.Decoder = &InternalLinkTypePremiumGiftCode{} + _ bin.BareEncoder = &InternalLinkTypePremiumGiftCode{} + _ bin.BareDecoder = &InternalLinkTypePremiumGiftCode{} + + _ InternalLinkTypeClass = &InternalLinkTypePremiumGiftCode{} +) + +func (i *InternalLinkTypePremiumGiftCode) Zero() bool { + if i == nil { + return true + } + if !(i.Code == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InternalLinkTypePremiumGiftCode) String() string { + if i == nil { + return "InternalLinkTypePremiumGiftCode(nil)" + } + type Alias InternalLinkTypePremiumGiftCode + return fmt.Sprintf("InternalLinkTypePremiumGiftCode%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InternalLinkTypePremiumGiftCode) TypeID() uint32 { + return InternalLinkTypePremiumGiftCodeTypeID +} + +// TypeName returns name of type in TL schema. +func (*InternalLinkTypePremiumGiftCode) TypeName() string { + return "internalLinkTypePremiumGiftCode" +} + +// TypeInfo returns info about TL type. +func (i *InternalLinkTypePremiumGiftCode) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "internalLinkTypePremiumGiftCode", + ID: InternalLinkTypePremiumGiftCodeTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Code", + SchemaName: "code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InternalLinkTypePremiumGiftCode) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGiftCode#de5c9892 as nil") + } + b.PutID(InternalLinkTypePremiumGiftCodeTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InternalLinkTypePremiumGiftCode) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGiftCode#de5c9892 as nil") + } + b.PutString(i.Code) + return nil +} + +// Decode implements bin.Decoder. +func (i *InternalLinkTypePremiumGiftCode) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGiftCode#de5c9892 to nil") + } + if err := b.ConsumeID(InternalLinkTypePremiumGiftCodeTypeID); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGiftCode#de5c9892: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InternalLinkTypePremiumGiftCode) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGiftCode#de5c9892 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGiftCode#de5c9892: field code: %w", err) + } + i.Code = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InternalLinkTypePremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePremiumGiftCode#de5c9892 as nil") + } + b.ObjStart() + b.PutID("internalLinkTypePremiumGiftCode") + b.Comma() + b.FieldStart("code") + b.PutString(i.Code) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InternalLinkTypePremiumGiftCode) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePremiumGiftCode#de5c9892 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("internalLinkTypePremiumGiftCode"); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGiftCode#de5c9892: %w", err) + } + case "code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypePremiumGiftCode#de5c9892: field code: %w", err) + } + i.Code = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCode returns value of Code field. +func (i *InternalLinkTypePremiumGiftCode) GetCode() (value string) { + if i == nil { + return + } + return i.Code +} + // InternalLinkTypePrivacyAndSecuritySettings represents TL type `internalLinkTypePrivacyAndSecuritySettings#ad5f6acf`. type InternalLinkTypePrivacyAndSecuritySettings struct { } @@ -7297,6 +7463,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypePassportDataRequest: // internalLinkTypePassportDataRequest#c50fce81 // case *tdapi.InternalLinkTypePhoneNumberConfirmation: // internalLinkTypePhoneNumberConfirmation#68bf6b16 // case *tdapi.InternalLinkTypePremiumFeatures: // internalLinkTypePremiumFeatures#48884f49 +// case *tdapi.InternalLinkTypePremiumGiftCode: // internalLinkTypePremiumGiftCode#de5c9892 // case *tdapi.InternalLinkTypePrivacyAndSecuritySettings: // internalLinkTypePrivacyAndSecuritySettings#ad5f6acf // case *tdapi.InternalLinkTypeProxy: // internalLinkTypeProxy#b1b12cea // case *tdapi.InternalLinkTypePublicChat: // internalLinkTypePublicChat#a774573b @@ -7513,6 +7680,13 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case InternalLinkTypePremiumGiftCodeTypeID: + // Decoding internalLinkTypePremiumGiftCode#de5c9892. + v := InternalLinkTypePremiumGiftCode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case InternalLinkTypePrivacyAndSecuritySettingsTypeID: // Decoding internalLinkTypePrivacyAndSecuritySettings#ad5f6acf. v := InternalLinkTypePrivacyAndSecuritySettings{} @@ -7812,6 +7986,13 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case "internalLinkTypePremiumGiftCode": + // Decoding internalLinkTypePremiumGiftCode#de5c9892. + v := InternalLinkTypePremiumGiftCode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case "internalLinkTypePrivacyAndSecuritySettings": // Decoding internalLinkTypePrivacyAndSecuritySettings#ad5f6acf. v := InternalLinkTypePrivacyAndSecuritySettings{} diff --git a/tdapi/tl_launch_prepaid_premium_giveaway_gen.go b/tdapi/tl_launch_prepaid_premium_giveaway_gen.go new file mode 100644 index 0000000000..aeb8bfa5dc --- /dev/null +++ b/tdapi/tl_launch_prepaid_premium_giveaway_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{} +) + +// LaunchPrepaidPremiumGiveawayRequest represents TL type `launchPrepaidPremiumGiveaway#5328fea1`. +type LaunchPrepaidPremiumGiveawayRequest struct { + // Unique identifier of the prepaid giveaway + GiveawayID int64 + // Giveaway parameters + Parameters PremiumGiveawayParameters +} + +// LaunchPrepaidPremiumGiveawayRequestTypeID is TL type id of LaunchPrepaidPremiumGiveawayRequest. +const LaunchPrepaidPremiumGiveawayRequestTypeID = 0x5328fea1 + +// Ensuring interfaces in compile-time for LaunchPrepaidPremiumGiveawayRequest. +var ( + _ bin.Encoder = &LaunchPrepaidPremiumGiveawayRequest{} + _ bin.Decoder = &LaunchPrepaidPremiumGiveawayRequest{} + _ bin.BareEncoder = &LaunchPrepaidPremiumGiveawayRequest{} + _ bin.BareDecoder = &LaunchPrepaidPremiumGiveawayRequest{} +) + +func (l *LaunchPrepaidPremiumGiveawayRequest) Zero() bool { + if l == nil { + return true + } + if !(l.GiveawayID == 0) { + return false + } + if !(l.Parameters.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (l *LaunchPrepaidPremiumGiveawayRequest) String() string { + if l == nil { + return "LaunchPrepaidPremiumGiveawayRequest(nil)" + } + type Alias LaunchPrepaidPremiumGiveawayRequest + return fmt.Sprintf("LaunchPrepaidPremiumGiveawayRequest%+v", Alias(*l)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*LaunchPrepaidPremiumGiveawayRequest) TypeID() uint32 { + return LaunchPrepaidPremiumGiveawayRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*LaunchPrepaidPremiumGiveawayRequest) TypeName() string { + return "launchPrepaidPremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (l *LaunchPrepaidPremiumGiveawayRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "launchPrepaidPremiumGiveaway", + ID: LaunchPrepaidPremiumGiveawayRequestTypeID, + } + if l == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "GiveawayID", + SchemaName: "giveaway_id", + }, + { + Name: "Parameters", + SchemaName: "parameters", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) Encode(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't encode launchPrepaidPremiumGiveaway#5328fea1 as nil") + } + b.PutID(LaunchPrepaidPremiumGiveawayRequestTypeID) + return l.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) EncodeBare(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't encode launchPrepaidPremiumGiveaway#5328fea1 as nil") + } + b.PutLong(l.GiveawayID) + if err := l.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode launchPrepaidPremiumGiveaway#5328fea1: field parameters: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) Decode(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't decode launchPrepaidPremiumGiveaway#5328fea1 to nil") + } + if err := b.ConsumeID(LaunchPrepaidPremiumGiveawayRequestTypeID); err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: %w", err) + } + return l.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) DecodeBare(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't decode launchPrepaidPremiumGiveaway#5328fea1 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: field giveaway_id: %w", err) + } + l.GiveawayID = value + } + { + if err := l.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: field parameters: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if l == nil { + return fmt.Errorf("can't encode launchPrepaidPremiumGiveaway#5328fea1 as nil") + } + b.ObjStart() + b.PutID("launchPrepaidPremiumGiveaway") + b.Comma() + b.FieldStart("giveaway_id") + b.PutLong(l.GiveawayID) + b.Comma() + b.FieldStart("parameters") + if err := l.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode launchPrepaidPremiumGiveaway#5328fea1: field parameters: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (l *LaunchPrepaidPremiumGiveawayRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if l == nil { + return fmt.Errorf("can't decode launchPrepaidPremiumGiveaway#5328fea1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("launchPrepaidPremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: %w", err) + } + case "giveaway_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: field giveaway_id: %w", err) + } + l.GiveawayID = value + case "parameters": + if err := l.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode launchPrepaidPremiumGiveaway#5328fea1: field parameters: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetGiveawayID returns value of GiveawayID field. +func (l *LaunchPrepaidPremiumGiveawayRequest) GetGiveawayID() (value int64) { + if l == nil { + return + } + return l.GiveawayID +} + +// GetParameters returns value of Parameters field. +func (l *LaunchPrepaidPremiumGiveawayRequest) GetParameters() (value PremiumGiveawayParameters) { + if l == nil { + return + } + return l.Parameters +} + +// LaunchPrepaidPremiumGiveaway invokes method launchPrepaidPremiumGiveaway#5328fea1 returning error if any. +func (c *Client) LaunchPrepaidPremiumGiveaway(ctx context.Context, request *LaunchPrepaidPremiumGiveawayRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_link_preview_options_gen.go b/tdapi/tl_link_preview_options_gen.go new file mode 100644 index 0000000000..205a3211fa --- /dev/null +++ b/tdapi/tl_link_preview_options_gen.go @@ -0,0 +1,333 @@ +// 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{} +) + +// LinkPreviewOptions represents TL type `linkPreviewOptions#3e61b3f3`. +type LinkPreviewOptions struct { + // True, if link preview must be disabled + IsDisabled bool + // URL to use for link preview. If empty, then the first URL found in the message text + // will be used + URL string + // True, if shown media preview must be small; ignored in secret chats or if the URL + // isn't explicitly specified + ForceSmallMedia bool + // True, if shown media preview must be large; ignored in secret chats or if the URL + // isn't explicitly specified + ForceLargeMedia bool + // True, if link preview must be shown above message text; otherwise, the link preview + // will be shown below the message text; ignored in secret chats + ShowAboveText bool +} + +// LinkPreviewOptionsTypeID is TL type id of LinkPreviewOptions. +const LinkPreviewOptionsTypeID = 0x3e61b3f3 + +// Ensuring interfaces in compile-time for LinkPreviewOptions. +var ( + _ bin.Encoder = &LinkPreviewOptions{} + _ bin.Decoder = &LinkPreviewOptions{} + _ bin.BareEncoder = &LinkPreviewOptions{} + _ bin.BareDecoder = &LinkPreviewOptions{} +) + +func (l *LinkPreviewOptions) Zero() bool { + if l == nil { + return true + } + if !(l.IsDisabled == false) { + return false + } + if !(l.URL == "") { + return false + } + if !(l.ForceSmallMedia == false) { + return false + } + if !(l.ForceLargeMedia == false) { + return false + } + if !(l.ShowAboveText == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (l *LinkPreviewOptions) String() string { + if l == nil { + return "LinkPreviewOptions(nil)" + } + type Alias LinkPreviewOptions + return fmt.Sprintf("LinkPreviewOptions%+v", Alias(*l)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*LinkPreviewOptions) TypeID() uint32 { + return LinkPreviewOptionsTypeID +} + +// TypeName returns name of type in TL schema. +func (*LinkPreviewOptions) TypeName() string { + return "linkPreviewOptions" +} + +// TypeInfo returns info about TL type. +func (l *LinkPreviewOptions) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "linkPreviewOptions", + ID: LinkPreviewOptionsTypeID, + } + if l == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "IsDisabled", + SchemaName: "is_disabled", + }, + { + Name: "URL", + SchemaName: "url", + }, + { + Name: "ForceSmallMedia", + SchemaName: "force_small_media", + }, + { + Name: "ForceLargeMedia", + SchemaName: "force_large_media", + }, + { + Name: "ShowAboveText", + SchemaName: "show_above_text", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (l *LinkPreviewOptions) Encode(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't encode linkPreviewOptions#3e61b3f3 as nil") + } + b.PutID(LinkPreviewOptionsTypeID) + return l.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (l *LinkPreviewOptions) EncodeBare(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't encode linkPreviewOptions#3e61b3f3 as nil") + } + b.PutBool(l.IsDisabled) + b.PutString(l.URL) + b.PutBool(l.ForceSmallMedia) + b.PutBool(l.ForceLargeMedia) + b.PutBool(l.ShowAboveText) + return nil +} + +// Decode implements bin.Decoder. +func (l *LinkPreviewOptions) Decode(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't decode linkPreviewOptions#3e61b3f3 to nil") + } + if err := b.ConsumeID(LinkPreviewOptionsTypeID); err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: %w", err) + } + return l.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (l *LinkPreviewOptions) DecodeBare(b *bin.Buffer) error { + if l == nil { + return fmt.Errorf("can't decode linkPreviewOptions#3e61b3f3 to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field is_disabled: %w", err) + } + l.IsDisabled = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field url: %w", err) + } + l.URL = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field force_small_media: %w", err) + } + l.ForceSmallMedia = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field force_large_media: %w", err) + } + l.ForceLargeMedia = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field show_above_text: %w", err) + } + l.ShowAboveText = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (l *LinkPreviewOptions) EncodeTDLibJSON(b tdjson.Encoder) error { + if l == nil { + return fmt.Errorf("can't encode linkPreviewOptions#3e61b3f3 as nil") + } + b.ObjStart() + b.PutID("linkPreviewOptions") + b.Comma() + b.FieldStart("is_disabled") + b.PutBool(l.IsDisabled) + b.Comma() + b.FieldStart("url") + b.PutString(l.URL) + b.Comma() + b.FieldStart("force_small_media") + b.PutBool(l.ForceSmallMedia) + b.Comma() + b.FieldStart("force_large_media") + b.PutBool(l.ForceLargeMedia) + b.Comma() + b.FieldStart("show_above_text") + b.PutBool(l.ShowAboveText) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (l *LinkPreviewOptions) DecodeTDLibJSON(b tdjson.Decoder) error { + if l == nil { + return fmt.Errorf("can't decode linkPreviewOptions#3e61b3f3 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("linkPreviewOptions"); err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: %w", err) + } + case "is_disabled": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field is_disabled: %w", err) + } + l.IsDisabled = value + case "url": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field url: %w", err) + } + l.URL = value + case "force_small_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field force_small_media: %w", err) + } + l.ForceSmallMedia = value + case "force_large_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field force_large_media: %w", err) + } + l.ForceLargeMedia = value + case "show_above_text": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode linkPreviewOptions#3e61b3f3: field show_above_text: %w", err) + } + l.ShowAboveText = value + default: + return b.Skip() + } + return nil + }) +} + +// GetIsDisabled returns value of IsDisabled field. +func (l *LinkPreviewOptions) GetIsDisabled() (value bool) { + if l == nil { + return + } + return l.IsDisabled +} + +// GetURL returns value of URL field. +func (l *LinkPreviewOptions) GetURL() (value string) { + if l == nil { + return + } + return l.URL +} + +// GetForceSmallMedia returns value of ForceSmallMedia field. +func (l *LinkPreviewOptions) GetForceSmallMedia() (value bool) { + if l == nil { + return + } + return l.ForceSmallMedia +} + +// GetForceLargeMedia returns value of ForceLargeMedia field. +func (l *LinkPreviewOptions) GetForceLargeMedia() (value bool) { + if l == nil { + return + } + return l.ForceLargeMedia +} + +// GetShowAboveText returns value of ShowAboveText field. +func (l *LinkPreviewOptions) GetShowAboveText() (value bool) { + if l == nil { + return + } + return l.ShowAboveText +} diff --git a/tdapi/tl_message_content_gen.go b/tdapi/tl_message_content_gen.go index 5f6501dcbd..14102f2b4c 100644 --- a/tdapi/tl_message_content_gen.go +++ b/tdapi/tl_message_content_gen.go @@ -31,16 +31,19 @@ var ( _ = tdjson.Encoder{} ) -// MessageText represents TL type `messageText#768e4f93`. +// MessageText represents TL type `messageText#c13562aa`. type MessageText struct { // Text of the message Text FormattedText - // A preview of the web page that's mentioned in the text; may be null + // A link preview attached to the message; may be null WebPage WebPage + // Options which was used for generation of the link preview; may be null if default + // options were used + LinkPreviewOptions LinkPreviewOptions } // MessageTextTypeID is TL type id of MessageText. -const MessageTextTypeID = 0x768e4f93 +const MessageTextTypeID = 0xc13562aa // construct implements constructor of MessageContentClass. func (m MessageText) construct() MessageContentClass { return &m } @@ -65,6 +68,9 @@ func (m *MessageText) Zero() bool { if !(m.WebPage.Zero()) { return false } + if !(m.LinkPreviewOptions.Zero()) { + return false + } return true } @@ -109,6 +115,10 @@ func (m *MessageText) TypeInfo() tdp.Type { Name: "WebPage", SchemaName: "web_page", }, + { + Name: "LinkPreviewOptions", + SchemaName: "link_preview_options", + }, } return typ } @@ -116,7 +126,7 @@ func (m *MessageText) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageText) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageText#768e4f93 as nil") + return fmt.Errorf("can't encode messageText#c13562aa as nil") } b.PutID(MessageTextTypeID) return m.EncodeBare(b) @@ -125,13 +135,16 @@ func (m *MessageText) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageText) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageText#768e4f93 as nil") + return fmt.Errorf("can't encode messageText#c13562aa as nil") } if err := m.Text.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageText#768e4f93: field text: %w", err) + return fmt.Errorf("unable to encode messageText#c13562aa: field text: %w", err) } if err := m.WebPage.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageText#768e4f93: field web_page: %w", err) + return fmt.Errorf("unable to encode messageText#c13562aa: field web_page: %w", err) + } + if err := m.LinkPreviewOptions.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageText#c13562aa: field link_preview_options: %w", err) } return nil } @@ -139,10 +152,10 @@ func (m *MessageText) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageText) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageText#768e4f93 to nil") + return fmt.Errorf("can't decode messageText#c13562aa to nil") } if err := b.ConsumeID(MessageTextTypeID); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: %w", err) } return m.DecodeBare(b) } @@ -150,16 +163,21 @@ func (m *MessageText) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageText) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageText#768e4f93 to nil") + return fmt.Errorf("can't decode messageText#c13562aa to nil") } { if err := m.Text.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: field text: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: field text: %w", err) } } { if err := m.WebPage.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: field web_page: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: field web_page: %w", err) + } + } + { + if err := m.LinkPreviewOptions.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageText#c13562aa: field link_preview_options: %w", err) } } return nil @@ -168,19 +186,24 @@ func (m *MessageText) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageText) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageText#768e4f93 as nil") + return fmt.Errorf("can't encode messageText#c13562aa as nil") } b.ObjStart() b.PutID("messageText") b.Comma() b.FieldStart("text") if err := m.Text.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageText#768e4f93: field text: %w", err) + return fmt.Errorf("unable to encode messageText#c13562aa: field text: %w", err) } b.Comma() b.FieldStart("web_page") if err := m.WebPage.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageText#768e4f93: field web_page: %w", err) + return fmt.Errorf("unable to encode messageText#c13562aa: field web_page: %w", err) + } + b.Comma() + b.FieldStart("link_preview_options") + if err := m.LinkPreviewOptions.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageText#c13562aa: field link_preview_options: %w", err) } b.Comma() b.StripComma() @@ -191,22 +214,26 @@ func (m *MessageText) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageText) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageText#768e4f93 to nil") + return fmt.Errorf("can't decode messageText#c13562aa to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageText"); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: %w", err) } case "text": if err := m.Text.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: field text: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: field text: %w", err) } case "web_page": if err := m.WebPage.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageText#768e4f93: field web_page: %w", err) + return fmt.Errorf("unable to decode messageText#c13562aa: field web_page: %w", err) + } + case "link_preview_options": + if err := m.LinkPreviewOptions.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageText#c13562aa: field link_preview_options: %w", err) } default: return b.Skip() @@ -231,6 +258,14 @@ func (m *MessageText) GetWebPage() (value WebPage) { return m.WebPage } +// GetLinkPreviewOptions returns value of LinkPreviewOptions field. +func (m *MessageText) GetLinkPreviewOptions() (value LinkPreviewOptions) { + if m == nil { + return + } + return m.LinkPreviewOptions +} + // MessageAnimation represents TL type `messageAnimation#3eb366fc`. type MessageAnimation struct { // The animation description @@ -10801,112 +10836,245 @@ func (m *MessageGiftedPremium) GetSticker() (value Sticker) { return m.Sticker } -// MessageContactRegistered represents TL type `messageContactRegistered#a678fcff`. -type MessageContactRegistered struct { +// MessagePremiumGiftCode represents TL type `messagePremiumGiftCode#7a9c468f`. +type MessagePremiumGiftCode struct { + // Identifier of a chat or a user that created the gift code + CreatorID MessageSenderClass + // True, if the gift code was created for a giveaway + 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 + MonthCount int32 + // A sticker to be shown in the message; may be null if unknown + Sticker Sticker + // The gift code + Code string } -// MessageContactRegisteredTypeID is TL type id of MessageContactRegistered. -const MessageContactRegisteredTypeID = 0xa678fcff +// MessagePremiumGiftCodeTypeID is TL type id of MessagePremiumGiftCode. +const MessagePremiumGiftCodeTypeID = 0x7a9c468f // construct implements constructor of MessageContentClass. -func (m MessageContactRegistered) construct() MessageContentClass { return &m } +func (m MessagePremiumGiftCode) construct() MessageContentClass { return &m } -// Ensuring interfaces in compile-time for MessageContactRegistered. +// Ensuring interfaces in compile-time for MessagePremiumGiftCode. var ( - _ bin.Encoder = &MessageContactRegistered{} - _ bin.Decoder = &MessageContactRegistered{} - _ bin.BareEncoder = &MessageContactRegistered{} - _ bin.BareDecoder = &MessageContactRegistered{} + _ bin.Encoder = &MessagePremiumGiftCode{} + _ bin.Decoder = &MessagePremiumGiftCode{} + _ bin.BareEncoder = &MessagePremiumGiftCode{} + _ bin.BareDecoder = &MessagePremiumGiftCode{} - _ MessageContentClass = &MessageContactRegistered{} + _ MessageContentClass = &MessagePremiumGiftCode{} ) -func (m *MessageContactRegistered) Zero() bool { +func (m *MessagePremiumGiftCode) Zero() bool { if m == nil { return true } + if !(m.CreatorID == nil) { + return false + } + if !(m.IsFromGiveaway == false) { + return false + } + if !(m.IsUnclaimed == false) { + return false + } + if !(m.MonthCount == 0) { + return false + } + if !(m.Sticker.Zero()) { + return false + } + if !(m.Code == "") { + return false + } return true } // String implements fmt.Stringer. -func (m *MessageContactRegistered) String() string { +func (m *MessagePremiumGiftCode) String() string { if m == nil { - return "MessageContactRegistered(nil)" + return "MessagePremiumGiftCode(nil)" } - type Alias MessageContactRegistered - return fmt.Sprintf("MessageContactRegistered%+v", Alias(*m)) + type Alias MessagePremiumGiftCode + return fmt.Sprintf("MessagePremiumGiftCode%+v", Alias(*m)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageContactRegistered) TypeID() uint32 { - return MessageContactRegisteredTypeID +func (*MessagePremiumGiftCode) TypeID() uint32 { + return MessagePremiumGiftCodeTypeID } // TypeName returns name of type in TL schema. -func (*MessageContactRegistered) TypeName() string { - return "messageContactRegistered" +func (*MessagePremiumGiftCode) TypeName() string { + return "messagePremiumGiftCode" } // TypeInfo returns info about TL type. -func (m *MessageContactRegistered) TypeInfo() tdp.Type { +func (m *MessagePremiumGiftCode) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "messageContactRegistered", - ID: MessageContactRegisteredTypeID, + Name: "messagePremiumGiftCode", + ID: MessagePremiumGiftCodeTypeID, } if m == nil { typ.Null = true return typ } - typ.Fields = []tdp.Field{} + typ.Fields = []tdp.Field{ + { + Name: "CreatorID", + SchemaName: "creator_id", + }, + { + Name: "IsFromGiveaway", + SchemaName: "is_from_giveaway", + }, + { + Name: "IsUnclaimed", + SchemaName: "is_unclaimed", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "Sticker", + SchemaName: "sticker", + }, + { + Name: "Code", + SchemaName: "code", + }, + } return typ } // Encode implements bin.Encoder. -func (m *MessageContactRegistered) Encode(b *bin.Buffer) error { +func (m *MessagePremiumGiftCode) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") } - b.PutID(MessageContactRegisteredTypeID) + b.PutID(MessagePremiumGiftCodeTypeID) return m.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (m *MessageContactRegistered) EncodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiftCode) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") } + if m.CreatorID == nil { + return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: 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) + } + b.PutBool(m.IsFromGiveaway) + b.PutBool(m.IsUnclaimed) + b.PutInt32(m.MonthCount) + if err := m.Sticker.Encode(b); err != nil { + return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field sticker: %w", err) + } + b.PutString(m.Code) return nil } // Decode implements bin.Decoder. -func (m *MessageContactRegistered) Decode(b *bin.Buffer) error { +func (m *MessagePremiumGiftCode) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") } - if err := b.ConsumeID(MessageContactRegisteredTypeID); err != nil { - return fmt.Errorf("unable to decode messageContactRegistered#a678fcff: %w", err) + if err := b.ConsumeID(MessagePremiumGiftCodeTypeID); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: %w", err) } return m.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (m *MessageContactRegistered) DecodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiftCode) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: 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) + } + m.IsFromGiveaway = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field is_unclaimed: %w", err) + } + m.IsUnclaimed = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: 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) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field code: %w", err) + } + m.Code = value } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageContactRegistered) EncodeTDLibJSON(b tdjson.Encoder) error { +func (m *MessagePremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + return fmt.Errorf("can't encode messagePremiumGiftCode#7a9c468f as nil") } b.ObjStart() - b.PutID("messageContactRegistered") + 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") + } + if err := m.CreatorID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messagePremiumGiftCode#7a9c468f: field creator_id: %w", err) + } + b.Comma() + b.FieldStart("is_from_giveaway") + b.PutBool(m.IsFromGiveaway) + b.Comma() + b.FieldStart("is_unclaimed") + b.PutBool(m.IsUnclaimed) + 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) + } + b.Comma() + b.FieldStart("code") + b.PutString(m.Code) b.Comma() b.StripComma() b.ObjEnd() @@ -10914,17 +11082,51 @@ func (m *MessageContactRegistered) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageContactRegistered) DecodeTDLibJSON(b tdjson.Decoder) error { +func (m *MessagePremiumGiftCode) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + return fmt.Errorf("can't decode messagePremiumGiftCode#7a9c468f to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("messageContactRegistered"); err != nil { - return fmt.Errorf("unable to decode messageContactRegistered#a678fcff: %w", err) + if err := b.ConsumeID("messagePremiumGiftCode"); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: %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) + } + 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) + } + 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) + } + m.IsUnclaimed = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: 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) + } + case "code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiftCode#7a9c468f: field code: %w", err) } + m.Code = value default: return b.Skip() } @@ -10932,127 +11134,705 @@ func (m *MessageContactRegistered) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// MessageUserShared represents TL type `messageUserShared#d4dcb77c`. -type MessageUserShared struct { - // Identifier of the shared user - UserID int64 - // Identifier of the keyboard button with the request - ButtonID int32 +// GetCreatorID returns value of CreatorID field. +func (m *MessagePremiumGiftCode) GetCreatorID() (value MessageSenderClass) { + if m == nil { + return + } + return m.CreatorID } -// MessageUserSharedTypeID is TL type id of MessageUserShared. -const MessageUserSharedTypeID = 0xd4dcb77c +// GetIsFromGiveaway returns value of IsFromGiveaway field. +func (m *MessagePremiumGiftCode) GetIsFromGiveaway() (value bool) { + if m == nil { + return + } + return m.IsFromGiveaway +} + +// GetIsUnclaimed returns value of IsUnclaimed field. +func (m *MessagePremiumGiftCode) GetIsUnclaimed() (value bool) { + if m == nil { + return + } + return m.IsUnclaimed +} + +// GetMonthCount returns value of MonthCount field. +func (m *MessagePremiumGiftCode) GetMonthCount() (value int32) { + if m == nil { + return + } + return m.MonthCount +} + +// GetSticker returns value of Sticker field. +func (m *MessagePremiumGiftCode) GetSticker() (value Sticker) { + if m == nil { + return + } + return m.Sticker +} + +// GetCode returns value of Code field. +func (m *MessagePremiumGiftCode) GetCode() (value string) { + if m == nil { + return + } + return m.Code +} + +// MessagePremiumGiveawayCreated represents TL type `messagePremiumGiveawayCreated#270f2c44`. +type MessagePremiumGiveawayCreated struct { +} + +// MessagePremiumGiveawayCreatedTypeID is TL type id of MessagePremiumGiveawayCreated. +const MessagePremiumGiveawayCreatedTypeID = 0x270f2c44 // construct implements constructor of MessageContentClass. -func (m MessageUserShared) construct() MessageContentClass { return &m } +func (m MessagePremiumGiveawayCreated) construct() MessageContentClass { return &m } -// Ensuring interfaces in compile-time for MessageUserShared. +// Ensuring interfaces in compile-time for MessagePremiumGiveawayCreated. var ( - _ bin.Encoder = &MessageUserShared{} - _ bin.Decoder = &MessageUserShared{} - _ bin.BareEncoder = &MessageUserShared{} - _ bin.BareDecoder = &MessageUserShared{} + _ bin.Encoder = &MessagePremiumGiveawayCreated{} + _ bin.Decoder = &MessagePremiumGiveawayCreated{} + _ bin.BareEncoder = &MessagePremiumGiveawayCreated{} + _ bin.BareDecoder = &MessagePremiumGiveawayCreated{} - _ MessageContentClass = &MessageUserShared{} + _ MessageContentClass = &MessagePremiumGiveawayCreated{} ) -func (m *MessageUserShared) Zero() bool { +func (m *MessagePremiumGiveawayCreated) Zero() bool { if m == nil { return true } - if !(m.UserID == 0) { - return false - } - if !(m.ButtonID == 0) { - return false - } return true } // String implements fmt.Stringer. -func (m *MessageUserShared) String() string { +func (m *MessagePremiumGiveawayCreated) String() string { if m == nil { - return "MessageUserShared(nil)" + return "MessagePremiumGiveawayCreated(nil)" } - type Alias MessageUserShared - return fmt.Sprintf("MessageUserShared%+v", Alias(*m)) + type Alias MessagePremiumGiveawayCreated + return fmt.Sprintf("MessagePremiumGiveawayCreated%+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 (*MessagePremiumGiveawayCreated) TypeID() uint32 { + return MessagePremiumGiveawayCreatedTypeID } // TypeName returns name of type in TL schema. -func (*MessageUserShared) TypeName() string { - return "messageUserShared" +func (*MessagePremiumGiveawayCreated) TypeName() string { + return "messagePremiumGiveawayCreated" } // TypeInfo returns info about TL type. -func (m *MessageUserShared) TypeInfo() tdp.Type { +func (m *MessagePremiumGiveawayCreated) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "messageUserShared", - ID: MessageUserSharedTypeID, + Name: "messagePremiumGiveawayCreated", + ID: MessagePremiumGiveawayCreatedTypeID, } if m == nil { typ.Null = true return typ } - typ.Fields = []tdp.Field{ - { - Name: "UserID", - SchemaName: "user_id", - }, - { - Name: "ButtonID", - SchemaName: "button_id", - }, - } + typ.Fields = []tdp.Field{} return typ } // Encode implements bin.Encoder. -func (m *MessageUserShared) Encode(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayCreated) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + return fmt.Errorf("can't encode messagePremiumGiveawayCreated#270f2c44 as nil") } - b.PutID(MessageUserSharedTypeID) + b.PutID(MessagePremiumGiveawayCreatedTypeID) return m.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (m *MessageUserShared) EncodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayCreated) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + return fmt.Errorf("can't encode messagePremiumGiveawayCreated#270f2c44 as nil") } - b.PutInt53(m.UserID) - b.PutInt32(m.ButtonID) return nil } // Decode implements bin.Decoder. -func (m *MessageUserShared) Decode(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayCreated) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + return fmt.Errorf("can't decode messagePremiumGiveawayCreated#270f2c44 to nil") } - if err := b.ConsumeID(MessageUserSharedTypeID); err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: %w", err) + if err := b.ConsumeID(MessagePremiumGiveawayCreatedTypeID); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCreated#270f2c44: %w", err) } return m.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (m *MessageUserShared) DecodeBare(b *bin.Buffer) error { +func (m *MessagePremiumGiveawayCreated) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + return fmt.Errorf("can't decode messagePremiumGiveawayCreated#270f2c44 to nil") } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field user_id: %w", err) + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessagePremiumGiveawayCreated) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveawayCreated#270f2c44 as nil") + } + b.ObjStart() + b.PutID("messagePremiumGiveawayCreated") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessagePremiumGiveawayCreated) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveawayCreated#270f2c44 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messagePremiumGiveawayCreated"); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveawayCreated#270f2c44: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// MessagePremiumGiveaway represents TL type `messagePremiumGiveaway#4aa0d0b0`. +type MessagePremiumGiveaway struct { + // Giveaway parameters + 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 + MonthCount int32 + // A sticker to be shown in the message; may be null if unknown + Sticker Sticker +} + +// MessagePremiumGiveawayTypeID is TL type id of MessagePremiumGiveaway. +const MessagePremiumGiveawayTypeID = 0x4aa0d0b0 + +// construct implements constructor of MessageContentClass. +func (m MessagePremiumGiveaway) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessagePremiumGiveaway. +var ( + _ bin.Encoder = &MessagePremiumGiveaway{} + _ bin.Decoder = &MessagePremiumGiveaway{} + _ bin.BareEncoder = &MessagePremiumGiveaway{} + _ bin.BareDecoder = &MessagePremiumGiveaway{} + + _ MessageContentClass = &MessagePremiumGiveaway{} +) + +func (m *MessagePremiumGiveaway) Zero() bool { + if m == nil { + return true + } + if !(m.Parameters.Zero()) { + return false + } + if !(m.WinnerCount == 0) { + return false + } + if !(m.MonthCount == 0) { + return false + } + if !(m.Sticker.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessagePremiumGiveaway) String() string { + if m == nil { + return "MessagePremiumGiveaway(nil)" + } + type Alias MessagePremiumGiveaway + return fmt.Sprintf("MessagePremiumGiveaway%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessagePremiumGiveaway) TypeID() uint32 { + return MessagePremiumGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessagePremiumGiveaway) TypeName() string { + return "messagePremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (m *MessagePremiumGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messagePremiumGiveaway", + ID: MessagePremiumGiveawayTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Parameters", + SchemaName: "parameters", + }, + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "Sticker", + SchemaName: "sticker", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessagePremiumGiveaway) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveaway#4aa0d0b0 as nil") + } + b.PutID(MessagePremiumGiveawayTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessagePremiumGiveaway) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveaway#4aa0d0b0 as nil") + } + if err := m.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode messagePremiumGiveaway#4aa0d0b0: field parameters: %w", err) + } + b.PutInt32(m.WinnerCount) + b.PutInt32(m.MonthCount) + if err := m.Sticker.Encode(b); err != nil { + return fmt.Errorf("unable to encode messagePremiumGiveaway#4aa0d0b0: field sticker: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (m *MessagePremiumGiveaway) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveaway#4aa0d0b0 to nil") + } + if err := b.ConsumeID(MessagePremiumGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessagePremiumGiveaway) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveaway#4aa0d0b0 to nil") + } + { + if err := m.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field parameters: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field winner_count: %w", err) + } + m.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field month_count: %w", err) + } + m.MonthCount = value + } + { + if err := m.Sticker.Decode(b); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field sticker: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessagePremiumGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messagePremiumGiveaway#4aa0d0b0 as nil") + } + b.ObjStart() + b.PutID("messagePremiumGiveaway") + b.Comma() + b.FieldStart("parameters") + if err := m.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messagePremiumGiveaway#4aa0d0b0: field parameters: %w", err) + } + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(m.WinnerCount) + 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 messagePremiumGiveaway#4aa0d0b0: field sticker: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessagePremiumGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messagePremiumGiveaway#4aa0d0b0 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messagePremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: %w", err) + } + case "parameters": + if err := m.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field parameters: %w", err) + } + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field winner_count: %w", err) + } + m.WinnerCount = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field month_count: %w", err) + } + m.MonthCount = value + case "sticker": + if err := m.Sticker.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messagePremiumGiveaway#4aa0d0b0: field sticker: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetParameters returns value of Parameters field. +func (m *MessagePremiumGiveaway) GetParameters() (value PremiumGiveawayParameters) { + if m == nil { + return + } + return m.Parameters +} + +// GetWinnerCount returns value of WinnerCount field. +func (m *MessagePremiumGiveaway) GetWinnerCount() (value int32) { + if m == nil { + return + } + return m.WinnerCount +} + +// GetMonthCount returns value of MonthCount field. +func (m *MessagePremiumGiveaway) GetMonthCount() (value int32) { + if m == nil { + return + } + return m.MonthCount +} + +// GetSticker returns value of Sticker field. +func (m *MessagePremiumGiveaway) GetSticker() (value Sticker) { + if m == nil { + return + } + return m.Sticker +} + +// MessageContactRegistered represents TL type `messageContactRegistered#a678fcff`. +type MessageContactRegistered struct { +} + +// MessageContactRegisteredTypeID is TL type id of MessageContactRegistered. +const MessageContactRegisteredTypeID = 0xa678fcff + +// construct implements constructor of MessageContentClass. +func (m MessageContactRegistered) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessageContactRegistered. +var ( + _ bin.Encoder = &MessageContactRegistered{} + _ bin.Decoder = &MessageContactRegistered{} + _ bin.BareEncoder = &MessageContactRegistered{} + _ bin.BareDecoder = &MessageContactRegistered{} + + _ MessageContentClass = &MessageContactRegistered{} +) + +func (m *MessageContactRegistered) Zero() bool { + if m == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageContactRegistered) String() string { + if m == nil { + return "MessageContactRegistered(nil)" + } + type Alias MessageContactRegistered + return fmt.Sprintf("MessageContactRegistered%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageContactRegistered) TypeID() uint32 { + return MessageContactRegisteredTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageContactRegistered) TypeName() string { + return "messageContactRegistered" +} + +// TypeInfo returns info about TL type. +func (m *MessageContactRegistered) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageContactRegistered", + ID: MessageContactRegisteredTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageContactRegistered) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + } + b.PutID(MessageContactRegisteredTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageContactRegistered) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageContactRegistered) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + } + if err := b.ConsumeID(MessageContactRegisteredTypeID); err != nil { + return fmt.Errorf("unable to decode messageContactRegistered#a678fcff: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageContactRegistered) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageContactRegistered) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageContactRegistered#a678fcff as nil") + } + b.ObjStart() + b.PutID("messageContactRegistered") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageContactRegistered) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageContactRegistered#a678fcff to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageContactRegistered"); err != nil { + return fmt.Errorf("unable to decode messageContactRegistered#a678fcff: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// MessageUserShared represents TL type `messageUserShared#d4dcb77c`. +type MessageUserShared struct { + // Identifier of the shared user + UserID int64 + // Identifier of the keyboard button with the request + ButtonID int32 +} + +// MessageUserSharedTypeID is TL type id of MessageUserShared. +const MessageUserSharedTypeID = 0xd4dcb77c + +// construct implements constructor of MessageContentClass. +func (m MessageUserShared) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessageUserShared. +var ( + _ bin.Encoder = &MessageUserShared{} + _ bin.Decoder = &MessageUserShared{} + _ bin.BareEncoder = &MessageUserShared{} + _ bin.BareDecoder = &MessageUserShared{} + + _ MessageContentClass = &MessageUserShared{} +) + +func (m *MessageUserShared) Zero() bool { + if m == nil { + return true + } + if !(m.UserID == 0) { + return false + } + if !(m.ButtonID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageUserShared) String() string { + if m == nil { + return "MessageUserShared(nil)" + } + type Alias MessageUserShared + return fmt.Sprintf("MessageUserShared%+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 +} + +// TypeName returns name of type in TL schema. +func (*MessageUserShared) TypeName() string { + return "messageUserShared" +} + +// TypeInfo returns info about TL type. +func (m *MessageUserShared) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageUserShared", + ID: MessageUserSharedTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "ButtonID", + SchemaName: "button_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageUserShared) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + } + b.PutID(MessageUserSharedTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageUserShared) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageUserShared#d4dcb77c as nil") + } + b.PutInt53(m.UserID) + b.PutInt32(m.ButtonID) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageUserShared) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + } + if err := b.ConsumeID(MessageUserSharedTypeID); err != nil { + return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageUserShared) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageUserShared#d4dcb77c to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageUserShared#d4dcb77c: field user_id: %w", err) } m.UserID = value } @@ -12699,7 +13479,7 @@ const MessageContentClassName = "MessageContent" // panic(err) // } // switch v := g.(type) { -// case *tdapi.MessageText: // messageText#768e4f93 +// case *tdapi.MessageText: // messageText#c13562aa // case *tdapi.MessageAnimation: // messageAnimation#3eb366fc // case *tdapi.MessageAudio: // messageAudio#107e741c // case *tdapi.MessageDocument: // messageDocument#2394ab77 @@ -12750,6 +13530,9 @@ 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.MessagePremiumGiveawayCreated: // messagePremiumGiveawayCreated#270f2c44 +// case *tdapi.MessagePremiumGiveaway: // messagePremiumGiveaway#4aa0d0b0 // case *tdapi.MessageContactRegistered: // messageContactRegistered#a678fcff // case *tdapi.MessageUserShared: // messageUserShared#d4dcb77c // case *tdapi.MessageChatShared: // messageChatShared#22db7091 @@ -12792,7 +13575,7 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { } switch id { case MessageTextTypeID: - // Decoding messageText#768e4f93. + // Decoding messageText#c13562aa. v := MessageText{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -13148,6 +13931,27 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case MessagePremiumGiftCodeTypeID: + // Decoding messagePremiumGiftCode#7a9c468f. + v := MessagePremiumGiftCode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil + case MessagePremiumGiveawayCreatedTypeID: + // Decoding messagePremiumGiveawayCreated#270f2c44. + v := MessagePremiumGiveawayCreated{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil + case MessagePremiumGiveawayTypeID: + // Decoding messagePremiumGiveaway#4aa0d0b0. + v := MessagePremiumGiveaway{} + 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{} @@ -13231,7 +14035,7 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err } switch id { case "messageText": - // Decoding messageText#768e4f93. + // Decoding messageText#c13562aa. v := MessageText{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -13587,6 +14391,27 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case "messagePremiumGiftCode": + // Decoding messagePremiumGiftCode#7a9c468f. + v := MessagePremiumGiftCode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil + case "messagePremiumGiveawayCreated": + // Decoding messagePremiumGiveawayCreated#270f2c44. + v := MessagePremiumGiveawayCreated{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil + case "messagePremiumGiveaway": + // Decoding messagePremiumGiveaway#4aa0d0b0. + v := MessagePremiumGiveaway{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case "messageContactRegistered": // Decoding messageContactRegistered#a678fcff. v := MessageContactRegistered{} diff --git a/tdapi/tl_message_forward_info_gen.go b/tdapi/tl_message_forward_info_gen.go index ba3f6f31e9..1db8f28c01 100644 --- a/tdapi/tl_message_forward_info_gen.go +++ b/tdapi/tl_message_forward_info_gen.go @@ -31,10 +31,10 @@ var ( _ = tdjson.Encoder{} ) -// MessageForwardInfo represents TL type `messageForwardInfo#ec7dcac8`. +// MessageForwardInfo represents TL type `messageForwardInfo#f22bdd30`. type MessageForwardInfo struct { - // Origin of a forwarded message - Origin MessageForwardOriginClass + // Origin of the forwarded message + Origin MessageOriginClass // Point in time (Unix timestamp) when the message was originally sent Date int32 // The type of a public service announcement for the forwarded message @@ -50,7 +50,7 @@ type MessageForwardInfo struct { } // MessageForwardInfoTypeID is TL type id of MessageForwardInfo. -const MessageForwardInfoTypeID = 0xec7dcac8 +const MessageForwardInfoTypeID = 0xf22bdd30 // Ensuring interfaces in compile-time for MessageForwardInfo. var ( @@ -142,7 +142,7 @@ func (m *MessageForwardInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageForwardInfo) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageForwardInfo#ec7dcac8 as nil") + return fmt.Errorf("can't encode messageForwardInfo#f22bdd30 as nil") } b.PutID(MessageForwardInfoTypeID) return m.EncodeBare(b) @@ -151,13 +151,13 @@ func (m *MessageForwardInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageForwardInfo) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageForwardInfo#ec7dcac8 as nil") + return fmt.Errorf("can't encode messageForwardInfo#f22bdd30 as nil") } if m.Origin == nil { - return fmt.Errorf("unable to encode messageForwardInfo#ec7dcac8: field origin is nil") + return fmt.Errorf("unable to encode messageForwardInfo#f22bdd30: field origin is nil") } if err := m.Origin.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageForwardInfo#ec7dcac8: field origin: %w", err) + return fmt.Errorf("unable to encode messageForwardInfo#f22bdd30: field origin: %w", err) } b.PutInt32(m.Date) b.PutString(m.PublicServiceAnnouncementType) @@ -169,10 +169,10 @@ func (m *MessageForwardInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageForwardInfo) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageForwardInfo#ec7dcac8 to nil") + return fmt.Errorf("can't decode messageForwardInfo#f22bdd30 to nil") } if err := b.ConsumeID(MessageForwardInfoTypeID); err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: %w", err) } return m.DecodeBare(b) } @@ -180,40 +180,40 @@ func (m *MessageForwardInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageForwardInfo) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageForwardInfo#ec7dcac8 to nil") + return fmt.Errorf("can't decode messageForwardInfo#f22bdd30 to nil") } { - value, err := DecodeMessageForwardOrigin(b) + value, err := DecodeMessageOrigin(b) if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field origin: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field origin: %w", err) } m.Origin = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field date: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field date: %w", err) } m.Date = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field public_service_announcement_type: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field public_service_announcement_type: %w", err) } m.PublicServiceAnnouncementType = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field from_chat_id: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field from_chat_id: %w", err) } m.FromChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field from_message_id: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field from_message_id: %w", err) } m.FromMessageID = value } @@ -223,17 +223,17 @@ func (m *MessageForwardInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageForwardInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageForwardInfo#ec7dcac8 as nil") + return fmt.Errorf("can't encode messageForwardInfo#f22bdd30 as nil") } b.ObjStart() b.PutID("messageForwardInfo") b.Comma() b.FieldStart("origin") if m.Origin == nil { - return fmt.Errorf("unable to encode messageForwardInfo#ec7dcac8: field origin is nil") + return fmt.Errorf("unable to encode messageForwardInfo#f22bdd30: field origin is nil") } if err := m.Origin.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageForwardInfo#ec7dcac8: field origin: %w", err) + return fmt.Errorf("unable to encode messageForwardInfo#f22bdd30: field origin: %w", err) } b.Comma() b.FieldStart("date") @@ -256,43 +256,43 @@ func (m *MessageForwardInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageForwardInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageForwardInfo#ec7dcac8 to nil") + return fmt.Errorf("can't decode messageForwardInfo#f22bdd30 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageForwardInfo"); err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: %w", err) } case "origin": - value, err := DecodeTDLibJSONMessageForwardOrigin(b) + value, err := DecodeTDLibJSONMessageOrigin(b) if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field origin: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field origin: %w", err) } m.Origin = value case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field date: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field date: %w", err) } m.Date = value case "public_service_announcement_type": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field public_service_announcement_type: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field public_service_announcement_type: %w", err) } m.PublicServiceAnnouncementType = value case "from_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field from_chat_id: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field from_chat_id: %w", err) } m.FromChatID = value case "from_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageForwardInfo#ec7dcac8: field from_message_id: %w", err) + return fmt.Errorf("unable to decode messageForwardInfo#f22bdd30: field from_message_id: %w", err) } m.FromMessageID = value default: @@ -303,7 +303,7 @@ func (m *MessageForwardInfo) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetOrigin returns value of Origin field. -func (m *MessageForwardInfo) GetOrigin() (value MessageForwardOriginClass) { +func (m *MessageForwardInfo) GetOrigin() (value MessageOriginClass) { if m == nil { return } diff --git a/tdapi/tl_message_forward_origin_gen.go b/tdapi/tl_message_forward_origin_gen.go deleted file mode 100644 index 82d0fe3789..0000000000 --- a/tdapi/tl_message_forward_origin_gen.go +++ /dev/null @@ -1,966 +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{} -) - -// MessageForwardOriginUser represents TL type `messageForwardOriginUser#ead478d1`. -type MessageForwardOriginUser struct { - // Identifier of the user that originally sent the message - SenderUserID int64 -} - -// MessageForwardOriginUserTypeID is TL type id of MessageForwardOriginUser. -const MessageForwardOriginUserTypeID = 0xead478d1 - -// construct implements constructor of MessageForwardOriginClass. -func (m MessageForwardOriginUser) construct() MessageForwardOriginClass { return &m } - -// Ensuring interfaces in compile-time for MessageForwardOriginUser. -var ( - _ bin.Encoder = &MessageForwardOriginUser{} - _ bin.Decoder = &MessageForwardOriginUser{} - _ bin.BareEncoder = &MessageForwardOriginUser{} - _ bin.BareDecoder = &MessageForwardOriginUser{} - - _ MessageForwardOriginClass = &MessageForwardOriginUser{} -) - -func (m *MessageForwardOriginUser) Zero() bool { - if m == nil { - return true - } - if !(m.SenderUserID == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageForwardOriginUser) String() string { - if m == nil { - return "MessageForwardOriginUser(nil)" - } - type Alias MessageForwardOriginUser - return fmt.Sprintf("MessageForwardOriginUser%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageForwardOriginUser) TypeID() uint32 { - return MessageForwardOriginUserTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageForwardOriginUser) TypeName() string { - return "messageForwardOriginUser" -} - -// TypeInfo returns info about TL type. -func (m *MessageForwardOriginUser) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageForwardOriginUser", - ID: MessageForwardOriginUserTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "SenderUserID", - SchemaName: "sender_user_id", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageForwardOriginUser) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginUser#ead478d1 as nil") - } - b.PutID(MessageForwardOriginUserTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageForwardOriginUser) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginUser#ead478d1 as nil") - } - b.PutInt53(m.SenderUserID) - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageForwardOriginUser) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginUser#ead478d1 to nil") - } - if err := b.ConsumeID(MessageForwardOriginUserTypeID); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginUser#ead478d1: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageForwardOriginUser) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginUser#ead478d1 to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginUser#ead478d1: field sender_user_id: %w", err) - } - m.SenderUserID = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageForwardOriginUser) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginUser#ead478d1 as nil") - } - b.ObjStart() - b.PutID("messageForwardOriginUser") - b.Comma() - b.FieldStart("sender_user_id") - b.PutInt53(m.SenderUserID) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageForwardOriginUser) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginUser#ead478d1 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageForwardOriginUser"); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginUser#ead478d1: %w", err) - } - case "sender_user_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginUser#ead478d1: field sender_user_id: %w", err) - } - m.SenderUserID = value - default: - return b.Skip() - } - return nil - }) -} - -// GetSenderUserID returns value of SenderUserID field. -func (m *MessageForwardOriginUser) GetSenderUserID() (value int64) { - if m == nil { - return - } - return m.SenderUserID -} - -// MessageForwardOriginChat represents TL type `messageForwardOriginChat#5af51364`. -type MessageForwardOriginChat struct { - // Identifier of the chat that originally sent the message - SenderChatID int64 - // For messages originally sent by an anonymous chat administrator, original message - // author signature - AuthorSignature string -} - -// MessageForwardOriginChatTypeID is TL type id of MessageForwardOriginChat. -const MessageForwardOriginChatTypeID = 0x5af51364 - -// construct implements constructor of MessageForwardOriginClass. -func (m MessageForwardOriginChat) construct() MessageForwardOriginClass { return &m } - -// Ensuring interfaces in compile-time for MessageForwardOriginChat. -var ( - _ bin.Encoder = &MessageForwardOriginChat{} - _ bin.Decoder = &MessageForwardOriginChat{} - _ bin.BareEncoder = &MessageForwardOriginChat{} - _ bin.BareDecoder = &MessageForwardOriginChat{} - - _ MessageForwardOriginClass = &MessageForwardOriginChat{} -) - -func (m *MessageForwardOriginChat) Zero() bool { - if m == nil { - return true - } - if !(m.SenderChatID == 0) { - return false - } - if !(m.AuthorSignature == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageForwardOriginChat) String() string { - if m == nil { - return "MessageForwardOriginChat(nil)" - } - type Alias MessageForwardOriginChat - return fmt.Sprintf("MessageForwardOriginChat%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageForwardOriginChat) TypeID() uint32 { - return MessageForwardOriginChatTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageForwardOriginChat) TypeName() string { - return "messageForwardOriginChat" -} - -// TypeInfo returns info about TL type. -func (m *MessageForwardOriginChat) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageForwardOriginChat", - ID: MessageForwardOriginChatTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "SenderChatID", - SchemaName: "sender_chat_id", - }, - { - Name: "AuthorSignature", - SchemaName: "author_signature", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageForwardOriginChat) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChat#5af51364 as nil") - } - b.PutID(MessageForwardOriginChatTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageForwardOriginChat) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChat#5af51364 as nil") - } - b.PutInt53(m.SenderChatID) - b.PutString(m.AuthorSignature) - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageForwardOriginChat) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChat#5af51364 to nil") - } - if err := b.ConsumeID(MessageForwardOriginChatTypeID); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageForwardOriginChat) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChat#5af51364 to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: field sender_chat_id: %w", err) - } - m.SenderChatID = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: field author_signature: %w", err) - } - m.AuthorSignature = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageForwardOriginChat) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChat#5af51364 as nil") - } - b.ObjStart() - b.PutID("messageForwardOriginChat") - b.Comma() - b.FieldStart("sender_chat_id") - b.PutInt53(m.SenderChatID) - b.Comma() - b.FieldStart("author_signature") - b.PutString(m.AuthorSignature) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageForwardOriginChat) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChat#5af51364 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageForwardOriginChat"); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: %w", err) - } - case "sender_chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: field sender_chat_id: %w", err) - } - m.SenderChatID = value - case "author_signature": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChat#5af51364: field author_signature: %w", err) - } - m.AuthorSignature = value - default: - return b.Skip() - } - return nil - }) -} - -// GetSenderChatID returns value of SenderChatID field. -func (m *MessageForwardOriginChat) GetSenderChatID() (value int64) { - if m == nil { - return - } - return m.SenderChatID -} - -// GetAuthorSignature returns value of AuthorSignature field. -func (m *MessageForwardOriginChat) GetAuthorSignature() (value string) { - if m == nil { - return - } - return m.AuthorSignature -} - -// MessageForwardOriginHiddenUser represents TL type `messageForwardOriginHiddenUser#efd4eee3`. -type MessageForwardOriginHiddenUser struct { - // Name of the sender - SenderName string -} - -// MessageForwardOriginHiddenUserTypeID is TL type id of MessageForwardOriginHiddenUser. -const MessageForwardOriginHiddenUserTypeID = 0xefd4eee3 - -// construct implements constructor of MessageForwardOriginClass. -func (m MessageForwardOriginHiddenUser) construct() MessageForwardOriginClass { return &m } - -// Ensuring interfaces in compile-time for MessageForwardOriginHiddenUser. -var ( - _ bin.Encoder = &MessageForwardOriginHiddenUser{} - _ bin.Decoder = &MessageForwardOriginHiddenUser{} - _ bin.BareEncoder = &MessageForwardOriginHiddenUser{} - _ bin.BareDecoder = &MessageForwardOriginHiddenUser{} - - _ MessageForwardOriginClass = &MessageForwardOriginHiddenUser{} -) - -func (m *MessageForwardOriginHiddenUser) Zero() bool { - if m == nil { - return true - } - if !(m.SenderName == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageForwardOriginHiddenUser) String() string { - if m == nil { - return "MessageForwardOriginHiddenUser(nil)" - } - type Alias MessageForwardOriginHiddenUser - return fmt.Sprintf("MessageForwardOriginHiddenUser%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageForwardOriginHiddenUser) TypeID() uint32 { - return MessageForwardOriginHiddenUserTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageForwardOriginHiddenUser) TypeName() string { - return "messageForwardOriginHiddenUser" -} - -// TypeInfo returns info about TL type. -func (m *MessageForwardOriginHiddenUser) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageForwardOriginHiddenUser", - ID: MessageForwardOriginHiddenUserTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "SenderName", - SchemaName: "sender_name", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageForwardOriginHiddenUser) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginHiddenUser#efd4eee3 as nil") - } - b.PutID(MessageForwardOriginHiddenUserTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageForwardOriginHiddenUser) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginHiddenUser#efd4eee3 as nil") - } - b.PutString(m.SenderName) - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageForwardOriginHiddenUser) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginHiddenUser#efd4eee3 to nil") - } - if err := b.ConsumeID(MessageForwardOriginHiddenUserTypeID); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginHiddenUser#efd4eee3: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageForwardOriginHiddenUser) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginHiddenUser#efd4eee3 to nil") - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginHiddenUser#efd4eee3: field sender_name: %w", err) - } - m.SenderName = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageForwardOriginHiddenUser) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginHiddenUser#efd4eee3 as nil") - } - b.ObjStart() - b.PutID("messageForwardOriginHiddenUser") - b.Comma() - b.FieldStart("sender_name") - b.PutString(m.SenderName) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageForwardOriginHiddenUser) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginHiddenUser#efd4eee3 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageForwardOriginHiddenUser"); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginHiddenUser#efd4eee3: %w", err) - } - case "sender_name": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginHiddenUser#efd4eee3: field sender_name: %w", err) - } - m.SenderName = value - default: - return b.Skip() - } - return nil - }) -} - -// GetSenderName returns value of SenderName field. -func (m *MessageForwardOriginHiddenUser) GetSenderName() (value string) { - if m == nil { - return - } - return m.SenderName -} - -// MessageForwardOriginChannel represents TL type `messageForwardOriginChannel#58dabee3`. -type MessageForwardOriginChannel struct { - // Identifier of the chat from which the message was originally forwarded - ChatID int64 - // Message identifier of the original message - MessageID int64 - // Original post author signature - AuthorSignature string -} - -// MessageForwardOriginChannelTypeID is TL type id of MessageForwardOriginChannel. -const MessageForwardOriginChannelTypeID = 0x58dabee3 - -// construct implements constructor of MessageForwardOriginClass. -func (m MessageForwardOriginChannel) construct() MessageForwardOriginClass { return &m } - -// Ensuring interfaces in compile-time for MessageForwardOriginChannel. -var ( - _ bin.Encoder = &MessageForwardOriginChannel{} - _ bin.Decoder = &MessageForwardOriginChannel{} - _ bin.BareEncoder = &MessageForwardOriginChannel{} - _ bin.BareDecoder = &MessageForwardOriginChannel{} - - _ MessageForwardOriginClass = &MessageForwardOriginChannel{} -) - -func (m *MessageForwardOriginChannel) Zero() bool { - if m == nil { - return true - } - if !(m.ChatID == 0) { - return false - } - if !(m.MessageID == 0) { - return false - } - if !(m.AuthorSignature == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageForwardOriginChannel) String() string { - if m == nil { - return "MessageForwardOriginChannel(nil)" - } - type Alias MessageForwardOriginChannel - return fmt.Sprintf("MessageForwardOriginChannel%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageForwardOriginChannel) TypeID() uint32 { - return MessageForwardOriginChannelTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageForwardOriginChannel) TypeName() string { - return "messageForwardOriginChannel" -} - -// TypeInfo returns info about TL type. -func (m *MessageForwardOriginChannel) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageForwardOriginChannel", - ID: MessageForwardOriginChannelTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ChatID", - SchemaName: "chat_id", - }, - { - Name: "MessageID", - SchemaName: "message_id", - }, - { - Name: "AuthorSignature", - SchemaName: "author_signature", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageForwardOriginChannel) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChannel#58dabee3 as nil") - } - b.PutID(MessageForwardOriginChannelTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageForwardOriginChannel) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChannel#58dabee3 as nil") - } - b.PutInt53(m.ChatID) - b.PutInt53(m.MessageID) - b.PutString(m.AuthorSignature) - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageForwardOriginChannel) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChannel#58dabee3 to nil") - } - if err := b.ConsumeID(MessageForwardOriginChannelTypeID); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageForwardOriginChannel) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChannel#58dabee3 to nil") - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field chat_id: %w", err) - } - m.ChatID = value - } - { - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field message_id: %w", err) - } - m.MessageID = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field author_signature: %w", err) - } - m.AuthorSignature = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageForwardOriginChannel) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageForwardOriginChannel#58dabee3 as nil") - } - b.ObjStart() - b.PutID("messageForwardOriginChannel") - b.Comma() - b.FieldStart("chat_id") - b.PutInt53(m.ChatID) - b.Comma() - b.FieldStart("message_id") - b.PutInt53(m.MessageID) - b.Comma() - b.FieldStart("author_signature") - b.PutString(m.AuthorSignature) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageForwardOriginChannel) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageForwardOriginChannel#58dabee3 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageForwardOriginChannel"); err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: %w", err) - } - case "chat_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field chat_id: %w", err) - } - m.ChatID = value - case "message_id": - value, err := b.Int53() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field message_id: %w", err) - } - m.MessageID = value - case "author_signature": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode messageForwardOriginChannel#58dabee3: field author_signature: %w", err) - } - m.AuthorSignature = value - default: - return b.Skip() - } - return nil - }) -} - -// GetChatID returns value of ChatID field. -func (m *MessageForwardOriginChannel) GetChatID() (value int64) { - if m == nil { - return - } - return m.ChatID -} - -// GetMessageID returns value of MessageID field. -func (m *MessageForwardOriginChannel) GetMessageID() (value int64) { - if m == nil { - return - } - return m.MessageID -} - -// GetAuthorSignature returns value of AuthorSignature field. -func (m *MessageForwardOriginChannel) GetAuthorSignature() (value string) { - if m == nil { - return - } - return m.AuthorSignature -} - -// MessageForwardOriginClassName is schema name of MessageForwardOriginClass. -const MessageForwardOriginClassName = "MessageForwardOrigin" - -// MessageForwardOriginClass represents MessageForwardOrigin generic type. -// -// Example: -// -// g, err := tdapi.DecodeMessageForwardOrigin(buf) -// if err != nil { -// panic(err) -// } -// switch v := g.(type) { -// case *tdapi.MessageForwardOriginUser: // messageForwardOriginUser#ead478d1 -// case *tdapi.MessageForwardOriginChat: // messageForwardOriginChat#5af51364 -// case *tdapi.MessageForwardOriginHiddenUser: // messageForwardOriginHiddenUser#efd4eee3 -// case *tdapi.MessageForwardOriginChannel: // messageForwardOriginChannel#58dabee3 -// default: panic(v) -// } -type MessageForwardOriginClass interface { - bin.Encoder - bin.Decoder - bin.BareEncoder - bin.BareDecoder - construct() MessageForwardOriginClass - - // 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 -} - -// DecodeMessageForwardOrigin implements binary de-serialization for MessageForwardOriginClass. -func DecodeMessageForwardOrigin(buf *bin.Buffer) (MessageForwardOriginClass, error) { - id, err := buf.PeekID() - if err != nil { - return nil, err - } - switch id { - case MessageForwardOriginUserTypeID: - // Decoding messageForwardOriginUser#ead478d1. - v := MessageForwardOriginUser{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case MessageForwardOriginChatTypeID: - // Decoding messageForwardOriginChat#5af51364. - v := MessageForwardOriginChat{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case MessageForwardOriginHiddenUserTypeID: - // Decoding messageForwardOriginHiddenUser#efd4eee3. - v := MessageForwardOriginHiddenUser{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case MessageForwardOriginChannelTypeID: - // Decoding messageForwardOriginChannel#58dabee3. - v := MessageForwardOriginChannel{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", bin.NewUnexpectedID(id)) - } -} - -// DecodeTDLibJSONMessageForwardOrigin implements binary de-serialization for MessageForwardOriginClass. -func DecodeTDLibJSONMessageForwardOrigin(buf tdjson.Decoder) (MessageForwardOriginClass, error) { - id, err := buf.FindTypeID() - if err != nil { - return nil, err - } - switch id { - case "messageForwardOriginUser": - // Decoding messageForwardOriginUser#ead478d1. - v := MessageForwardOriginUser{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case "messageForwardOriginChat": - // Decoding messageForwardOriginChat#5af51364. - v := MessageForwardOriginChat{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case "messageForwardOriginHiddenUser": - // Decoding messageForwardOriginHiddenUser#efd4eee3. - v := MessageForwardOriginHiddenUser{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - case "messageForwardOriginChannel": - // Decoding messageForwardOriginChannel#58dabee3. - v := MessageForwardOriginChannel{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode MessageForwardOriginClass: %w", tdjson.NewUnexpectedID(id)) - } -} - -// MessageForwardOrigin boxes the MessageForwardOriginClass providing a helper. -type MessageForwardOriginBox struct { - MessageForwardOrigin MessageForwardOriginClass -} - -// Decode implements bin.Decoder for MessageForwardOriginBox. -func (b *MessageForwardOriginBox) Decode(buf *bin.Buffer) error { - if b == nil { - return fmt.Errorf("unable to decode MessageForwardOriginBox to nil") - } - v, err := DecodeMessageForwardOrigin(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.MessageForwardOrigin = v - return nil -} - -// Encode implements bin.Encode for MessageForwardOriginBox. -func (b *MessageForwardOriginBox) Encode(buf *bin.Buffer) error { - if b == nil || b.MessageForwardOrigin == nil { - return fmt.Errorf("unable to encode MessageForwardOriginClass as nil") - } - return b.MessageForwardOrigin.Encode(buf) -} - -// DecodeTDLibJSON implements bin.Decoder for MessageForwardOriginBox. -func (b *MessageForwardOriginBox) DecodeTDLibJSON(buf tdjson.Decoder) error { - if b == nil { - return fmt.Errorf("unable to decode MessageForwardOriginBox to nil") - } - v, err := DecodeTDLibJSONMessageForwardOrigin(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.MessageForwardOrigin = v - return nil -} - -// EncodeTDLibJSON implements bin.Encode for MessageForwardOriginBox. -func (b *MessageForwardOriginBox) EncodeTDLibJSON(buf tdjson.Encoder) error { - if b == nil || b.MessageForwardOrigin == nil { - return fmt.Errorf("unable to encode MessageForwardOriginClass as nil") - } - return b.MessageForwardOrigin.EncodeTDLibJSON(buf) -} diff --git a/tdapi/tl_message_gen.go b/tdapi/tl_message_gen.go index cdf555a5cd..79868b9f97 100644 --- a/tdapi/tl_message_gen.go +++ b/tdapi/tl_message_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Message represents TL type `message#12947545`. +// Message represents TL type `message#5aa8fa7e`. type Message struct { // Message identifier; unique for the chat to which the message belongs ID int64 @@ -54,6 +54,8 @@ type Message struct { CanBeEdited bool // True, if the message can be forwarded CanBeForwarded bool + // True, if the message can be replied in another chat + CanBeRepliedInAnotherChat bool // True, if content of the message can be saved locally or copied CanBeSaved bool // True, if the message can be deleted only for the current user while other users will @@ -130,7 +132,7 @@ type Message struct { } // MessageTypeID is TL type id of Message. -const MessageTypeID = 0x12947545 +const MessageTypeID = 0x5aa8fa7e // Ensuring interfaces in compile-time for Message. var ( @@ -171,6 +173,9 @@ func (m *Message) Zero() bool { if !(m.CanBeForwarded == false) { return false } + if !(m.CanBeRepliedInAnotherChat == false) { + return false + } if !(m.CanBeSaved == false) { return false } @@ -333,6 +338,10 @@ func (m *Message) TypeInfo() tdp.Type { Name: "CanBeForwarded", SchemaName: "can_be_forwarded", }, + { + Name: "CanBeRepliedInAnotherChat", + SchemaName: "can_be_replied_in_another_chat", + }, { Name: "CanBeSaved", SchemaName: "can_be_saved", @@ -460,7 +469,7 @@ func (m *Message) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *Message) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode message#12947545 as nil") + return fmt.Errorf("can't encode message#5aa8fa7e as nil") } b.PutID(MessageTypeID) return m.EncodeBare(b) @@ -469,32 +478,33 @@ func (m *Message) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *Message) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode message#12947545 as nil") + return fmt.Errorf("can't encode message#5aa8fa7e as nil") } b.PutInt53(m.ID) if m.SenderID == nil { - return fmt.Errorf("unable to encode message#12947545: field sender_id is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field sender_id is nil") } if err := m.SenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field sender_id: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field sender_id: %w", err) } b.PutInt53(m.ChatID) if m.SendingState == nil { - return fmt.Errorf("unable to encode message#12947545: field sending_state is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field sending_state is nil") } if err := m.SendingState.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field sending_state: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field sending_state: %w", err) } if m.SchedulingState == nil { - return fmt.Errorf("unable to encode message#12947545: field scheduling_state is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field scheduling_state is nil") } if err := m.SchedulingState.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field scheduling_state: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field scheduling_state: %w", err) } b.PutBool(m.IsOutgoing) b.PutBool(m.IsPinned) b.PutBool(m.CanBeEdited) b.PutBool(m.CanBeForwarded) + b.PutBool(m.CanBeRepliedInAnotherChat) b.PutBool(m.CanBeSaved) b.PutBool(m.CanBeDeletedOnlyForSelf) b.PutBool(m.CanBeDeletedForAllUsers) @@ -511,32 +521,32 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { b.PutInt32(m.Date) b.PutInt32(m.EditDate) if err := m.ForwardInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field forward_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field forward_info: %w", err) } if err := m.ImportInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field import_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field import_info: %w", err) } if err := m.InteractionInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field interaction_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field interaction_info: %w", err) } b.PutInt(len(m.UnreadReactions)) for idx, v := range m.UnreadReactions { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare message#12947545: field unread_reactions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare message#5aa8fa7e: field unread_reactions element with index %d: %w", idx, err) } } if m.ReplyTo == nil { - return fmt.Errorf("unable to encode message#12947545: field reply_to is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_to is nil") } if err := m.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field reply_to: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_to: %w", err) } b.PutInt53(m.MessageThreadID) if m.SelfDestructType == nil { - return fmt.Errorf("unable to encode message#12947545: field self_destruct_type is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field self_destruct_type is nil") } if err := m.SelfDestructType.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field self_destruct_type: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field self_destruct_type: %w", err) } b.PutDouble(m.SelfDestructIn) b.PutDouble(m.AutoDeleteIn) @@ -545,16 +555,16 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { b.PutLong(m.MediaAlbumID) b.PutString(m.RestrictionReason) if m.Content == nil { - return fmt.Errorf("unable to encode message#12947545: field content is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field content is nil") } if err := m.Content.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field content: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field content: %w", err) } if m.ReplyMarkup == nil { - return fmt.Errorf("unable to encode message#12947545: field reply_markup is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_markup is nil") } if err := m.ReplyMarkup.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field reply_markup: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_markup: %w", err) } return nil } @@ -562,10 +572,10 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *Message) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode message#12947545 to nil") + return fmt.Errorf("can't decode message#5aa8fa7e to nil") } if err := b.ConsumeID(MessageTypeID); err != nil { - return fmt.Errorf("unable to decode message#12947545: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: %w", err) } return m.DecodeBare(b) } @@ -573,195 +583,202 @@ func (m *Message) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *Message) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode message#12947545 to nil") + return fmt.Errorf("can't decode message#5aa8fa7e to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field id: %w", err) } m.ID = value } { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field sender_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field sender_id: %w", err) } m.SenderID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field chat_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field chat_id: %w", err) } m.ChatID = value } { value, err := DecodeMessageSendingState(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field sending_state: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field sending_state: %w", err) } m.SendingState = value } { value, err := DecodeMessageSchedulingState(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field scheduling_state: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field scheduling_state: %w", err) } m.SchedulingState = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_outgoing: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_outgoing: %w", err) } m.IsOutgoing = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_pinned: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_pinned: %w", err) } m.IsPinned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_edited: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_edited: %w", err) } m.CanBeEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_forwarded: %w", err) } m.CanBeForwarded = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_saved: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_replied_in_another_chat: %w", err) + } + m.CanBeRepliedInAnotherChat = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_saved: %w", err) } m.CanBeSaved = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_deleted_only_for_self: %w", err) } m.CanBeDeletedOnlyForSelf = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_deleted_for_all_users: %w", err) } m.CanBeDeletedForAllUsers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_added_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_added_reactions: %w", err) } m.CanGetAddedReactions = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_statistics: %w", err) } m.CanGetStatistics = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_message_thread: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_message_thread: %w", err) } m.CanGetMessageThread = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_viewers: %w", err) } m.CanGetViewers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_media_timestamp_links: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_media_timestamp_links: %w", err) } m.CanGetMediaTimestampLinks = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_report_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_report_reactions: %w", err) } m.CanReportReactions = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field has_timestamped_media: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field has_timestamped_media: %w", err) } m.HasTimestampedMedia = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_channel_post: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_channel_post: %w", err) } m.IsChannelPost = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_topic_message: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_topic_message: %w", err) } m.IsTopicMessage = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field contains_unread_mention: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field contains_unread_mention: %w", err) } m.ContainsUnreadMention = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field date: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field date: %w", err) } m.Date = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field edit_date: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field edit_date: %w", err) } m.EditDate = value } { if err := m.ForwardInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field forward_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field forward_info: %w", err) } } { if err := m.ImportInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field import_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field import_info: %w", err) } } { if err := m.InteractionInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field interaction_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field interaction_info: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field unread_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field unread_reactions: %w", err) } if headerLen > 0 { @@ -770,7 +787,7 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value UnreadReaction if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare message#12947545: field unread_reactions: %w", err) + return fmt.Errorf("unable to decode bare message#5aa8fa7e: field unread_reactions: %w", err) } m.UnreadReactions = append(m.UnreadReactions, value) } @@ -778,77 +795,77 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { { value, err := DecodeMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field reply_to: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field reply_to: %w", err) } m.ReplyTo = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field message_thread_id: %w", err) } m.MessageThreadID = value } { value, err := DecodeMessageSelfDestructType(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field self_destruct_type: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field self_destruct_type: %w", err) } m.SelfDestructType = value } { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field self_destruct_in: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field self_destruct_in: %w", err) } m.SelfDestructIn = value } { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field auto_delete_in: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field auto_delete_in: %w", err) } m.AutoDeleteIn = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field via_bot_user_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field via_bot_user_id: %w", err) } m.ViaBotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field author_signature: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field author_signature: %w", err) } m.AuthorSignature = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field media_album_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field media_album_id: %w", err) } m.MediaAlbumID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field restriction_reason: %w", err) } m.RestrictionReason = value } { value, err := DecodeMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field content: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field content: %w", err) } m.Content = value } { value, err := DecodeReplyMarkup(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field reply_markup: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field reply_markup: %w", err) } m.ReplyMarkup = value } @@ -858,7 +875,7 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode message#12947545 as nil") + return fmt.Errorf("can't encode message#5aa8fa7e as nil") } b.ObjStart() b.PutID("message") @@ -868,10 +885,10 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sender_id") if m.SenderID == nil { - return fmt.Errorf("unable to encode message#12947545: field sender_id is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field sender_id is nil") } if err := m.SenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field sender_id: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field sender_id: %w", err) } b.Comma() b.FieldStart("chat_id") @@ -879,18 +896,18 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sending_state") if m.SendingState == nil { - return fmt.Errorf("unable to encode message#12947545: field sending_state is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field sending_state is nil") } if err := m.SendingState.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field sending_state: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field sending_state: %w", err) } b.Comma() b.FieldStart("scheduling_state") if m.SchedulingState == nil { - return fmt.Errorf("unable to encode message#12947545: field scheduling_state is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field scheduling_state is nil") } if err := m.SchedulingState.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field scheduling_state: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field scheduling_state: %w", err) } b.Comma() b.FieldStart("is_outgoing") @@ -905,6 +922,9 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("can_be_forwarded") b.PutBool(m.CanBeForwarded) b.Comma() + b.FieldStart("can_be_replied_in_another_chat") + b.PutBool(m.CanBeRepliedInAnotherChat) + b.Comma() b.FieldStart("can_be_saved") b.PutBool(m.CanBeSaved) b.Comma() @@ -952,24 +972,24 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("forward_info") if err := m.ForwardInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field forward_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field forward_info: %w", err) } b.Comma() b.FieldStart("import_info") if err := m.ImportInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field import_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field import_info: %w", err) } b.Comma() b.FieldStart("interaction_info") if err := m.InteractionInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field interaction_info: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field interaction_info: %w", err) } b.Comma() b.FieldStart("unread_reactions") b.ArrStart() for idx, v := range m.UnreadReactions { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field unread_reactions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field unread_reactions element with index %d: %w", idx, err) } b.Comma() } @@ -978,10 +998,10 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("reply_to") if m.ReplyTo == nil { - return fmt.Errorf("unable to encode message#12947545: field reply_to is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_to is nil") } if err := m.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field reply_to: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_to: %w", err) } b.Comma() b.FieldStart("message_thread_id") @@ -989,10 +1009,10 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("self_destruct_type") if m.SelfDestructType == nil { - return fmt.Errorf("unable to encode message#12947545: field self_destruct_type is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field self_destruct_type is nil") } if err := m.SelfDestructType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field self_destruct_type: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field self_destruct_type: %w", err) } b.Comma() b.FieldStart("self_destruct_in") @@ -1015,18 +1035,18 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("content") if m.Content == nil { - return fmt.Errorf("unable to encode message#12947545: field content is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field content is nil") } if err := m.Content.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field content: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field content: %w", err) } b.Comma() b.FieldStart("reply_markup") if m.ReplyMarkup == nil { - return fmt.Errorf("unable to encode message#12947545: field reply_markup is nil") + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_markup is nil") } if err := m.ReplyMarkup.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode message#12947545: field reply_markup: %w", err) + return fmt.Errorf("unable to encode message#5aa8fa7e: field reply_markup: %w", err) } b.Comma() b.StripComma() @@ -1037,246 +1057,252 @@ func (m *Message) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *Message) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode message#12947545 to nil") + return fmt.Errorf("can't decode message#5aa8fa7e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("message"); err != nil { - return fmt.Errorf("unable to decode message#12947545: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field id: %w", err) } m.ID = value case "sender_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field sender_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field sender_id: %w", err) } m.SenderID = value case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field chat_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field chat_id: %w", err) } m.ChatID = value case "sending_state": value, err := DecodeTDLibJSONMessageSendingState(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field sending_state: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field sending_state: %w", err) } m.SendingState = value case "scheduling_state": value, err := DecodeTDLibJSONMessageSchedulingState(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field scheduling_state: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field scheduling_state: %w", err) } m.SchedulingState = value case "is_outgoing": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_outgoing: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_outgoing: %w", err) } m.IsOutgoing = value case "is_pinned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_pinned: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_pinned: %w", err) } m.IsPinned = value case "can_be_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_edited: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_edited: %w", err) } m.CanBeEdited = value case "can_be_forwarded": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_forwarded: %w", err) } m.CanBeForwarded = value + case "can_be_replied_in_another_chat": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_replied_in_another_chat: %w", err) + } + m.CanBeRepliedInAnotherChat = value case "can_be_saved": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_saved: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_saved: %w", err) } m.CanBeSaved = value case "can_be_deleted_only_for_self": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_deleted_only_for_self: %w", err) } m.CanBeDeletedOnlyForSelf = value case "can_be_deleted_for_all_users": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_be_deleted_for_all_users: %w", err) } m.CanBeDeletedForAllUsers = value case "can_get_added_reactions": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_added_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_added_reactions: %w", err) } m.CanGetAddedReactions = value case "can_get_statistics": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_statistics: %w", err) } m.CanGetStatistics = value case "can_get_message_thread": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_message_thread: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_message_thread: %w", err) } m.CanGetMessageThread = value case "can_get_viewers": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_viewers: %w", err) } m.CanGetViewers = value case "can_get_media_timestamp_links": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_get_media_timestamp_links: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_get_media_timestamp_links: %w", err) } m.CanGetMediaTimestampLinks = value case "can_report_reactions": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field can_report_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field can_report_reactions: %w", err) } m.CanReportReactions = value case "has_timestamped_media": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field has_timestamped_media: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field has_timestamped_media: %w", err) } m.HasTimestampedMedia = value case "is_channel_post": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_channel_post: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_channel_post: %w", err) } m.IsChannelPost = value case "is_topic_message": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field is_topic_message: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field is_topic_message: %w", err) } m.IsTopicMessage = value case "contains_unread_mention": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field contains_unread_mention: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field contains_unread_mention: %w", err) } m.ContainsUnreadMention = value case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field date: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field date: %w", err) } m.Date = value case "edit_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field edit_date: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field edit_date: %w", err) } m.EditDate = value case "forward_info": if err := m.ForwardInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field forward_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field forward_info: %w", err) } case "import_info": if err := m.ImportInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field import_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field import_info: %w", err) } case "interaction_info": if err := m.InteractionInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field interaction_info: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field interaction_info: %w", err) } case "unread_reactions": if err := b.Arr(func(b tdjson.Decoder) error { var value UnreadReaction if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode message#12947545: field unread_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field unread_reactions: %w", err) } m.UnreadReactions = append(m.UnreadReactions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode message#12947545: field unread_reactions: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field unread_reactions: %w", err) } case "reply_to": value, err := DecodeTDLibJSONMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field reply_to: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field reply_to: %w", err) } m.ReplyTo = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field message_thread_id: %w", err) } m.MessageThreadID = value case "self_destruct_type": value, err := DecodeTDLibJSONMessageSelfDestructType(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field self_destruct_type: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field self_destruct_type: %w", err) } m.SelfDestructType = value case "self_destruct_in": value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field self_destruct_in: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field self_destruct_in: %w", err) } m.SelfDestructIn = value case "auto_delete_in": value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field auto_delete_in: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field auto_delete_in: %w", err) } m.AutoDeleteIn = value case "via_bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field via_bot_user_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field via_bot_user_id: %w", err) } m.ViaBotUserID = value case "author_signature": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field author_signature: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field author_signature: %w", err) } m.AuthorSignature = value case "media_album_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field media_album_id: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field media_album_id: %w", err) } m.MediaAlbumID = value case "restriction_reason": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#12947545: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field restriction_reason: %w", err) } m.RestrictionReason = value case "content": value, err := DecodeTDLibJSONMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field content: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field content: %w", err) } m.Content = value case "reply_markup": value, err := DecodeTDLibJSONReplyMarkup(b) if err != nil { - return fmt.Errorf("unable to decode message#12947545: field reply_markup: %w", err) + return fmt.Errorf("unable to decode message#5aa8fa7e: field reply_markup: %w", err) } m.ReplyMarkup = value default: @@ -1358,6 +1384,14 @@ func (m *Message) GetCanBeForwarded() (value bool) { return m.CanBeForwarded } +// GetCanBeRepliedInAnotherChat returns value of CanBeRepliedInAnotherChat field. +func (m *Message) GetCanBeRepliedInAnotherChat() (value bool) { + if m == nil { + return + } + return m.CanBeRepliedInAnotherChat +} + // GetCanBeSaved returns value of CanBeSaved field. func (m *Message) GetCanBeSaved() (value bool) { if m == nil { diff --git a/tdapi/tl_message_origin_gen.go b/tdapi/tl_message_origin_gen.go new file mode 100644 index 0000000000..47421d6f96 --- /dev/null +++ b/tdapi/tl_message_origin_gen.go @@ -0,0 +1,966 @@ +// 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{} +) + +// MessageOriginUser represents TL type `messageOriginUser#9c009043`. +type MessageOriginUser struct { + // Identifier of the user that originally sent the message + SenderUserID int64 +} + +// MessageOriginUserTypeID is TL type id of MessageOriginUser. +const MessageOriginUserTypeID = 0x9c009043 + +// construct implements constructor of MessageOriginClass. +func (m MessageOriginUser) construct() MessageOriginClass { return &m } + +// Ensuring interfaces in compile-time for MessageOriginUser. +var ( + _ bin.Encoder = &MessageOriginUser{} + _ bin.Decoder = &MessageOriginUser{} + _ bin.BareEncoder = &MessageOriginUser{} + _ bin.BareDecoder = &MessageOriginUser{} + + _ MessageOriginClass = &MessageOriginUser{} +) + +func (m *MessageOriginUser) Zero() bool { + if m == nil { + return true + } + if !(m.SenderUserID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageOriginUser) String() string { + if m == nil { + return "MessageOriginUser(nil)" + } + type Alias MessageOriginUser + return fmt.Sprintf("MessageOriginUser%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageOriginUser) TypeID() uint32 { + return MessageOriginUserTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageOriginUser) TypeName() string { + return "messageOriginUser" +} + +// TypeInfo returns info about TL type. +func (m *MessageOriginUser) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageOriginUser", + ID: MessageOriginUserTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderUserID", + SchemaName: "sender_user_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageOriginUser) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginUser#9c009043 as nil") + } + b.PutID(MessageOriginUserTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageOriginUser) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginUser#9c009043 as nil") + } + b.PutInt53(m.SenderUserID) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageOriginUser) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginUser#9c009043 to nil") + } + if err := b.ConsumeID(MessageOriginUserTypeID); err != nil { + return fmt.Errorf("unable to decode messageOriginUser#9c009043: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageOriginUser) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginUser#9c009043 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginUser#9c009043: field sender_user_id: %w", err) + } + m.SenderUserID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageOriginUser) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginUser#9c009043 as nil") + } + b.ObjStart() + b.PutID("messageOriginUser") + b.Comma() + b.FieldStart("sender_user_id") + b.PutInt53(m.SenderUserID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageOriginUser) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginUser#9c009043 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageOriginUser"); err != nil { + return fmt.Errorf("unable to decode messageOriginUser#9c009043: %w", err) + } + case "sender_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginUser#9c009043: field sender_user_id: %w", err) + } + m.SenderUserID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderUserID returns value of SenderUserID field. +func (m *MessageOriginUser) GetSenderUserID() (value int64) { + if m == nil { + return + } + return m.SenderUserID +} + +// MessageOriginHiddenUser represents TL type `messageOriginHiddenUser#ed0c23da`. +type MessageOriginHiddenUser struct { + // Name of the sender + SenderName string +} + +// MessageOriginHiddenUserTypeID is TL type id of MessageOriginHiddenUser. +const MessageOriginHiddenUserTypeID = 0xed0c23da + +// construct implements constructor of MessageOriginClass. +func (m MessageOriginHiddenUser) construct() MessageOriginClass { return &m } + +// Ensuring interfaces in compile-time for MessageOriginHiddenUser. +var ( + _ bin.Encoder = &MessageOriginHiddenUser{} + _ bin.Decoder = &MessageOriginHiddenUser{} + _ bin.BareEncoder = &MessageOriginHiddenUser{} + _ bin.BareDecoder = &MessageOriginHiddenUser{} + + _ MessageOriginClass = &MessageOriginHiddenUser{} +) + +func (m *MessageOriginHiddenUser) Zero() bool { + if m == nil { + return true + } + if !(m.SenderName == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageOriginHiddenUser) String() string { + if m == nil { + return "MessageOriginHiddenUser(nil)" + } + type Alias MessageOriginHiddenUser + return fmt.Sprintf("MessageOriginHiddenUser%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageOriginHiddenUser) TypeID() uint32 { + return MessageOriginHiddenUserTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageOriginHiddenUser) TypeName() string { + return "messageOriginHiddenUser" +} + +// TypeInfo returns info about TL type. +func (m *MessageOriginHiddenUser) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageOriginHiddenUser", + ID: MessageOriginHiddenUserTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderName", + SchemaName: "sender_name", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageOriginHiddenUser) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginHiddenUser#ed0c23da as nil") + } + b.PutID(MessageOriginHiddenUserTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageOriginHiddenUser) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginHiddenUser#ed0c23da as nil") + } + b.PutString(m.SenderName) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageOriginHiddenUser) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginHiddenUser#ed0c23da to nil") + } + if err := b.ConsumeID(MessageOriginHiddenUserTypeID); err != nil { + return fmt.Errorf("unable to decode messageOriginHiddenUser#ed0c23da: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageOriginHiddenUser) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginHiddenUser#ed0c23da to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginHiddenUser#ed0c23da: field sender_name: %w", err) + } + m.SenderName = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageOriginHiddenUser) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginHiddenUser#ed0c23da as nil") + } + b.ObjStart() + b.PutID("messageOriginHiddenUser") + b.Comma() + b.FieldStart("sender_name") + b.PutString(m.SenderName) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageOriginHiddenUser) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginHiddenUser#ed0c23da to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageOriginHiddenUser"); err != nil { + return fmt.Errorf("unable to decode messageOriginHiddenUser#ed0c23da: %w", err) + } + case "sender_name": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginHiddenUser#ed0c23da: field sender_name: %w", err) + } + m.SenderName = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderName returns value of SenderName field. +func (m *MessageOriginHiddenUser) GetSenderName() (value string) { + if m == nil { + return + } + return m.SenderName +} + +// MessageOriginChat represents TL type `messageOriginChat#f3bb5eb4`. +type MessageOriginChat struct { + // Identifier of the chat that originally sent the message + SenderChatID int64 + // For messages originally sent by an anonymous chat administrator, original message + // author signature + AuthorSignature string +} + +// MessageOriginChatTypeID is TL type id of MessageOriginChat. +const MessageOriginChatTypeID = 0xf3bb5eb4 + +// construct implements constructor of MessageOriginClass. +func (m MessageOriginChat) construct() MessageOriginClass { return &m } + +// Ensuring interfaces in compile-time for MessageOriginChat. +var ( + _ bin.Encoder = &MessageOriginChat{} + _ bin.Decoder = &MessageOriginChat{} + _ bin.BareEncoder = &MessageOriginChat{} + _ bin.BareDecoder = &MessageOriginChat{} + + _ MessageOriginClass = &MessageOriginChat{} +) + +func (m *MessageOriginChat) Zero() bool { + if m == nil { + return true + } + if !(m.SenderChatID == 0) { + return false + } + if !(m.AuthorSignature == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageOriginChat) String() string { + if m == nil { + return "MessageOriginChat(nil)" + } + type Alias MessageOriginChat + return fmt.Sprintf("MessageOriginChat%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageOriginChat) TypeID() uint32 { + return MessageOriginChatTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageOriginChat) TypeName() string { + return "messageOriginChat" +} + +// TypeInfo returns info about TL type. +func (m *MessageOriginChat) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageOriginChat", + ID: MessageOriginChatTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderChatID", + SchemaName: "sender_chat_id", + }, + { + Name: "AuthorSignature", + SchemaName: "author_signature", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageOriginChat) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChat#f3bb5eb4 as nil") + } + b.PutID(MessageOriginChatTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageOriginChat) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChat#f3bb5eb4 as nil") + } + b.PutInt53(m.SenderChatID) + b.PutString(m.AuthorSignature) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageOriginChat) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChat#f3bb5eb4 to nil") + } + if err := b.ConsumeID(MessageOriginChatTypeID); err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageOriginChat) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChat#f3bb5eb4 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: field sender_chat_id: %w", err) + } + m.SenderChatID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: field author_signature: %w", err) + } + m.AuthorSignature = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageOriginChat) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChat#f3bb5eb4 as nil") + } + b.ObjStart() + b.PutID("messageOriginChat") + b.Comma() + b.FieldStart("sender_chat_id") + b.PutInt53(m.SenderChatID) + b.Comma() + b.FieldStart("author_signature") + b.PutString(m.AuthorSignature) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageOriginChat) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChat#f3bb5eb4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageOriginChat"); err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: %w", err) + } + case "sender_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: field sender_chat_id: %w", err) + } + m.SenderChatID = value + case "author_signature": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChat#f3bb5eb4: field author_signature: %w", err) + } + m.AuthorSignature = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderChatID returns value of SenderChatID field. +func (m *MessageOriginChat) GetSenderChatID() (value int64) { + if m == nil { + return + } + return m.SenderChatID +} + +// GetAuthorSignature returns value of AuthorSignature field. +func (m *MessageOriginChat) GetAuthorSignature() (value string) { + if m == nil { + return + } + return m.AuthorSignature +} + +// MessageOriginChannel represents TL type `messageOriginChannel#a97b51be`. +type MessageOriginChannel struct { + // Identifier of the channel chat to which the message was originally sent + ChatID int64 + // Message identifier of the original message + MessageID int64 + // Original post author signature + AuthorSignature string +} + +// MessageOriginChannelTypeID is TL type id of MessageOriginChannel. +const MessageOriginChannelTypeID = 0xa97b51be + +// construct implements constructor of MessageOriginClass. +func (m MessageOriginChannel) construct() MessageOriginClass { return &m } + +// Ensuring interfaces in compile-time for MessageOriginChannel. +var ( + _ bin.Encoder = &MessageOriginChannel{} + _ bin.Decoder = &MessageOriginChannel{} + _ bin.BareEncoder = &MessageOriginChannel{} + _ bin.BareDecoder = &MessageOriginChannel{} + + _ MessageOriginClass = &MessageOriginChannel{} +) + +func (m *MessageOriginChannel) Zero() bool { + if m == nil { + return true + } + if !(m.ChatID == 0) { + return false + } + if !(m.MessageID == 0) { + return false + } + if !(m.AuthorSignature == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageOriginChannel) String() string { + if m == nil { + return "MessageOriginChannel(nil)" + } + type Alias MessageOriginChannel + return fmt.Sprintf("MessageOriginChannel%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageOriginChannel) TypeID() uint32 { + return MessageOriginChannelTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageOriginChannel) TypeName() string { + return "messageOriginChannel" +} + +// TypeInfo returns info about TL type. +func (m *MessageOriginChannel) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageOriginChannel", + ID: MessageOriginChannelTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "AuthorSignature", + SchemaName: "author_signature", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageOriginChannel) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChannel#a97b51be as nil") + } + b.PutID(MessageOriginChannelTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageOriginChannel) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChannel#a97b51be as nil") + } + b.PutInt53(m.ChatID) + b.PutInt53(m.MessageID) + b.PutString(m.AuthorSignature) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageOriginChannel) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChannel#a97b51be to nil") + } + if err := b.ConsumeID(MessageOriginChannelTypeID); err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageOriginChannel) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChannel#a97b51be to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field chat_id: %w", err) + } + m.ChatID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field message_id: %w", err) + } + m.MessageID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field author_signature: %w", err) + } + m.AuthorSignature = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageOriginChannel) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageOriginChannel#a97b51be as nil") + } + b.ObjStart() + b.PutID("messageOriginChannel") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(m.ChatID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(m.MessageID) + b.Comma() + b.FieldStart("author_signature") + b.PutString(m.AuthorSignature) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageOriginChannel) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageOriginChannel#a97b51be to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageOriginChannel"); err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field chat_id: %w", err) + } + m.ChatID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field message_id: %w", err) + } + m.MessageID = value + case "author_signature": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageOriginChannel#a97b51be: field author_signature: %w", err) + } + m.AuthorSignature = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (m *MessageOriginChannel) GetChatID() (value int64) { + if m == nil { + return + } + return m.ChatID +} + +// GetMessageID returns value of MessageID field. +func (m *MessageOriginChannel) GetMessageID() (value int64) { + if m == nil { + return + } + return m.MessageID +} + +// GetAuthorSignature returns value of AuthorSignature field. +func (m *MessageOriginChannel) GetAuthorSignature() (value string) { + if m == nil { + return + } + return m.AuthorSignature +} + +// MessageOriginClassName is schema name of MessageOriginClass. +const MessageOriginClassName = "MessageOrigin" + +// MessageOriginClass represents MessageOrigin generic type. +// +// Example: +// +// g, err := tdapi.DecodeMessageOrigin(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.MessageOriginUser: // messageOriginUser#9c009043 +// case *tdapi.MessageOriginHiddenUser: // messageOriginHiddenUser#ed0c23da +// case *tdapi.MessageOriginChat: // messageOriginChat#f3bb5eb4 +// case *tdapi.MessageOriginChannel: // messageOriginChannel#a97b51be +// default: panic(v) +// } +type MessageOriginClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() MessageOriginClass + + // 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 +} + +// DecodeMessageOrigin implements binary de-serialization for MessageOriginClass. +func DecodeMessageOrigin(buf *bin.Buffer) (MessageOriginClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case MessageOriginUserTypeID: + // Decoding messageOriginUser#9c009043. + v := MessageOriginUser{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case MessageOriginHiddenUserTypeID: + // Decoding messageOriginHiddenUser#ed0c23da. + v := MessageOriginHiddenUser{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case MessageOriginChatTypeID: + // Decoding messageOriginChat#f3bb5eb4. + v := MessageOriginChat{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case MessageOriginChannelTypeID: + // Decoding messageOriginChannel#a97b51be. + v := MessageOriginChannel{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONMessageOrigin implements binary de-serialization for MessageOriginClass. +func DecodeTDLibJSONMessageOrigin(buf tdjson.Decoder) (MessageOriginClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "messageOriginUser": + // Decoding messageOriginUser#9c009043. + v := MessageOriginUser{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case "messageOriginHiddenUser": + // Decoding messageOriginHiddenUser#ed0c23da. + v := MessageOriginHiddenUser{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case "messageOriginChat": + // Decoding messageOriginChat#f3bb5eb4. + v := MessageOriginChat{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + case "messageOriginChannel": + // Decoding messageOriginChannel#a97b51be. + v := MessageOriginChannel{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode MessageOriginClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// MessageOrigin boxes the MessageOriginClass providing a helper. +type MessageOriginBox struct { + MessageOrigin MessageOriginClass +} + +// Decode implements bin.Decoder for MessageOriginBox. +func (b *MessageOriginBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode MessageOriginBox to nil") + } + v, err := DecodeMessageOrigin(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.MessageOrigin = v + return nil +} + +// Encode implements bin.Encode for MessageOriginBox. +func (b *MessageOriginBox) Encode(buf *bin.Buffer) error { + if b == nil || b.MessageOrigin == nil { + return fmt.Errorf("unable to encode MessageOriginClass as nil") + } + return b.MessageOrigin.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for MessageOriginBox. +func (b *MessageOriginBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode MessageOriginBox to nil") + } + v, err := DecodeTDLibJSONMessageOrigin(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.MessageOrigin = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for MessageOriginBox. +func (b *MessageOriginBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.MessageOrigin == nil { + return fmt.Errorf("unable to encode MessageOriginClass as nil") + } + return b.MessageOrigin.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_message_reply_to_gen.go b/tdapi/tl_message_reply_to_gen.go index d4660ce6db..9ad78e1e65 100644 --- a/tdapi/tl_message_reply_to_gen.go +++ b/tdapi/tl_message_reply_to_gen.go @@ -31,18 +31,32 @@ var ( _ = tdjson.Encoder{} ) -// MessageReplyToMessage represents TL type `messageReplyToMessage#deb02f02`. +// MessageReplyToMessage represents TL type `messageReplyToMessage#1bb65082`. type MessageReplyToMessage struct { - // The identifier of the chat to which the replied message belongs; ignored for outgoing - // replies. For example, messages in the Replies chat are replies to messages in - // different chats + // The identifier of the chat to which the message belongs; may be 0 if the replied + // message is in unknown chat ChatID int64 - // The identifier of the replied message + // The identifier of the message; may be 0 if the replied message is in unknown chat MessageID int64 + // Manually or automatically chosen quote from the replied message; may be null if none. + // Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be + // present in the quote + Quote FormattedText + // True, if the quote was manually chosen by the message sender + IsQuoteManual bool + // Information about origin of the message if the message was replied from another chat; + // may be null for messages from the same chat + Origin MessageOriginClass + // Point in time (Unix timestamp) when the message was sent if the message was replied + // from another chat; 0 for messages from the same chat + OriginSendDate int32 + // Media content of the message if the message was replied from another chat; may be null + // for messages from the same chat and messages without media. + Content MessageContentClass } // MessageReplyToMessageTypeID is TL type id of MessageReplyToMessage. -const MessageReplyToMessageTypeID = 0xdeb02f02 +const MessageReplyToMessageTypeID = 0x1bb65082 // construct implements constructor of MessageReplyToClass. func (m MessageReplyToMessage) construct() MessageReplyToClass { return &m } @@ -67,6 +81,21 @@ func (m *MessageReplyToMessage) Zero() bool { if !(m.MessageID == 0) { return false } + if !(m.Quote.Zero()) { + return false + } + if !(m.IsQuoteManual == false) { + return false + } + if !(m.Origin == nil) { + return false + } + if !(m.OriginSendDate == 0) { + return false + } + if !(m.Content == nil) { + return false + } return true } @@ -111,6 +140,26 @@ func (m *MessageReplyToMessage) TypeInfo() tdp.Type { Name: "MessageID", SchemaName: "message_id", }, + { + Name: "Quote", + SchemaName: "quote", + }, + { + Name: "IsQuoteManual", + SchemaName: "is_quote_manual", + }, + { + Name: "Origin", + SchemaName: "origin", + }, + { + Name: "OriginSendDate", + SchemaName: "origin_send_date", + }, + { + Name: "Content", + SchemaName: "content", + }, } return typ } @@ -118,7 +167,7 @@ func (m *MessageReplyToMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageReplyToMessage) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplyToMessage#deb02f02 as nil") + return fmt.Errorf("can't encode messageReplyToMessage#1bb65082 as nil") } b.PutID(MessageReplyToMessageTypeID) return m.EncodeBare(b) @@ -127,20 +176,37 @@ func (m *MessageReplyToMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageReplyToMessage) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplyToMessage#deb02f02 as nil") + return fmt.Errorf("can't encode messageReplyToMessage#1bb65082 as nil") } b.PutInt53(m.ChatID) b.PutInt53(m.MessageID) + if err := m.Quote.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field quote: %w", err) + } + b.PutBool(m.IsQuoteManual) + if m.Origin == nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field origin is nil") + } + if err := m.Origin.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field origin: %w", err) + } + b.PutInt32(m.OriginSendDate) + if m.Content == nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field content is nil") + } + if err := m.Content.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field content: %w", err) + } return nil } // Decode implements bin.Decoder. func (m *MessageReplyToMessage) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplyToMessage#deb02f02 to nil") + return fmt.Errorf("can't decode messageReplyToMessage#1bb65082 to nil") } if err := b.ConsumeID(MessageReplyToMessageTypeID); err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: %w", err) } return m.DecodeBare(b) } @@ -148,29 +214,62 @@ func (m *MessageReplyToMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageReplyToMessage) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplyToMessage#deb02f02 to nil") + return fmt.Errorf("can't decode messageReplyToMessage#1bb65082 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: field chat_id: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field chat_id: %w", err) } m.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: field message_id: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field message_id: %w", err) } m.MessageID = value } + { + if err := m.Quote.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field quote: %w", err) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field is_quote_manual: %w", err) + } + m.IsQuoteManual = value + } + { + value, err := DecodeMessageOrigin(b) + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field origin: %w", err) + } + m.Origin = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field origin_send_date: %w", err) + } + m.OriginSendDate = value + } + { + value, err := DecodeMessageContent(b) + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field content: %w", err) + } + m.Content = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageReplyToMessage) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageReplyToMessage#deb02f02 as nil") + return fmt.Errorf("can't encode messageReplyToMessage#1bb65082 as nil") } b.ObjStart() b.PutID("messageReplyToMessage") @@ -181,6 +280,33 @@ func (m *MessageReplyToMessage) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("message_id") b.PutInt53(m.MessageID) b.Comma() + b.FieldStart("quote") + if err := m.Quote.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field quote: %w", err) + } + b.Comma() + b.FieldStart("is_quote_manual") + b.PutBool(m.IsQuoteManual) + b.Comma() + b.FieldStart("origin") + if m.Origin == nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field origin is nil") + } + if err := m.Origin.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field origin: %w", err) + } + b.Comma() + b.FieldStart("origin_send_date") + b.PutInt32(m.OriginSendDate) + b.Comma() + b.FieldStart("content") + if m.Content == nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field content is nil") + } + if err := m.Content.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageReplyToMessage#1bb65082: field content: %w", err) + } + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -189,27 +315,55 @@ func (m *MessageReplyToMessage) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageReplyToMessage) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageReplyToMessage#deb02f02 to nil") + return fmt.Errorf("can't decode messageReplyToMessage#1bb65082 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageReplyToMessage"); err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: field chat_id: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field chat_id: %w", err) } m.ChatID = value case "message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageReplyToMessage#deb02f02: field message_id: %w", err) + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field message_id: %w", err) } m.MessageID = value + case "quote": + if err := m.Quote.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field quote: %w", err) + } + case "is_quote_manual": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field is_quote_manual: %w", err) + } + m.IsQuoteManual = value + case "origin": + value, err := DecodeTDLibJSONMessageOrigin(b) + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field origin: %w", err) + } + m.Origin = value + case "origin_send_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field origin_send_date: %w", err) + } + m.OriginSendDate = value + case "content": + value, err := DecodeTDLibJSONMessageContent(b) + if err != nil { + return fmt.Errorf("unable to decode messageReplyToMessage#1bb65082: field content: %w", err) + } + m.Content = value default: return b.Skip() } @@ -233,12 +387,51 @@ func (m *MessageReplyToMessage) GetMessageID() (value int64) { return m.MessageID } +// GetQuote returns value of Quote field. +func (m *MessageReplyToMessage) GetQuote() (value FormattedText) { + if m == nil { + return + } + return m.Quote +} + +// GetIsQuoteManual returns value of IsQuoteManual field. +func (m *MessageReplyToMessage) GetIsQuoteManual() (value bool) { + if m == nil { + return + } + return m.IsQuoteManual +} + +// GetOrigin returns value of Origin field. +func (m *MessageReplyToMessage) GetOrigin() (value MessageOriginClass) { + if m == nil { + return + } + return m.Origin +} + +// GetOriginSendDate returns value of OriginSendDate field. +func (m *MessageReplyToMessage) GetOriginSendDate() (value int32) { + if m == nil { + return + } + return m.OriginSendDate +} + +// GetContent returns value of Content field. +func (m *MessageReplyToMessage) GetContent() (value MessageContentClass) { + if m == nil { + return + } + return m.Content +} + // MessageReplyToStory represents TL type `messageReplyToStory#708ca939`. type MessageReplyToStory struct { - // The identifier of the sender of the replied story. Currently, stories can be replied - // only in the sender's chat + // The identifier of the sender of the story StorySenderChatID int64 - // The identifier of the replied story + // The identifier of the story StoryID int32 } @@ -446,7 +639,7 @@ const MessageReplyToClassName = "MessageReplyTo" // panic(err) // } // switch v := g.(type) { -// case *tdapi.MessageReplyToMessage: // messageReplyToMessage#deb02f02 +// case *tdapi.MessageReplyToMessage: // messageReplyToMessage#1bb65082 // case *tdapi.MessageReplyToStory: // messageReplyToStory#708ca939 // default: panic(v) // } @@ -480,7 +673,7 @@ func DecodeMessageReplyTo(buf *bin.Buffer) (MessageReplyToClass, error) { } switch id { case MessageReplyToMessageTypeID: - // Decoding messageReplyToMessage#deb02f02. + // Decoding messageReplyToMessage#1bb65082. v := MessageReplyToMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageReplyToClass: %w", err) @@ -506,7 +699,7 @@ func DecodeTDLibJSONMessageReplyTo(buf tdjson.Decoder) (MessageReplyToClass, err } switch id { case "messageReplyToMessage": - // Decoding messageReplyToMessage#deb02f02. + // Decoding messageReplyToMessage#1bb65082. v := MessageReplyToMessage{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageReplyToClass: %w", err) diff --git a/tdapi/tl_message_send_options_gen.go b/tdapi/tl_message_send_options_gen.go index c4a4784af4..37125ec941 100644 --- a/tdapi/tl_message_send_options_gen.go +++ b/tdapi/tl_message_send_options_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// MessageSendOptions represents TL type `messageSendOptions#1f60b9e`. +// MessageSendOptions represents TL type `messageSendOptions#9cca9fb3`. type MessageSendOptions struct { // Pass true to disable notification for the message DisableNotification bool @@ -50,10 +50,12 @@ type MessageSendOptions struct { // object and can be used to match sent messages and corresponding updateNewMessage // updates SendingID int32 + // Pass true to get a fake message instead of actually sending them + OnlyPreview bool } // MessageSendOptionsTypeID is TL type id of MessageSendOptions. -const MessageSendOptionsTypeID = 0x1f60b9e +const MessageSendOptionsTypeID = 0x9cca9fb3 // Ensuring interfaces in compile-time for MessageSendOptions. var ( @@ -85,6 +87,9 @@ func (m *MessageSendOptions) Zero() bool { if !(m.SendingID == 0) { return false } + if !(m.OnlyPreview == false) { + return false + } return true } @@ -145,6 +150,10 @@ func (m *MessageSendOptions) TypeInfo() tdp.Type { Name: "SendingID", SchemaName: "sending_id", }, + { + Name: "OnlyPreview", + SchemaName: "only_preview", + }, } return typ } @@ -152,7 +161,7 @@ func (m *MessageSendOptions) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageSendOptions) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageSendOptions#1f60b9e as nil") + return fmt.Errorf("can't encode messageSendOptions#9cca9fb3 as nil") } b.PutID(MessageSendOptionsTypeID) return m.EncodeBare(b) @@ -161,29 +170,30 @@ func (m *MessageSendOptions) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageSendOptions) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageSendOptions#1f60b9e as nil") + return fmt.Errorf("can't encode messageSendOptions#9cca9fb3 as nil") } b.PutBool(m.DisableNotification) b.PutBool(m.FromBackground) b.PutBool(m.ProtectContent) b.PutBool(m.UpdateOrderOfInstalledStickerSets) if m.SchedulingState == nil { - return fmt.Errorf("unable to encode messageSendOptions#1f60b9e: field scheduling_state is nil") + return fmt.Errorf("unable to encode messageSendOptions#9cca9fb3: field scheduling_state is nil") } if err := m.SchedulingState.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageSendOptions#1f60b9e: field scheduling_state: %w", err) + return fmt.Errorf("unable to encode messageSendOptions#9cca9fb3: field scheduling_state: %w", err) } b.PutInt32(m.SendingID) + b.PutBool(m.OnlyPreview) return nil } // Decode implements bin.Decoder. func (m *MessageSendOptions) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageSendOptions#1f60b9e to nil") + return fmt.Errorf("can't decode messageSendOptions#9cca9fb3 to nil") } if err := b.ConsumeID(MessageSendOptionsTypeID); err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: %w", err) } return m.DecodeBare(b) } @@ -191,57 +201,64 @@ func (m *MessageSendOptions) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageSendOptions) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageSendOptions#1f60b9e to nil") + return fmt.Errorf("can't decode messageSendOptions#9cca9fb3 to nil") } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field disable_notification: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field disable_notification: %w", err) } m.DisableNotification = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field from_background: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field from_background: %w", err) } m.FromBackground = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field protect_content: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field protect_content: %w", err) } m.ProtectContent = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field update_order_of_installed_sticker_sets: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field update_order_of_installed_sticker_sets: %w", err) } m.UpdateOrderOfInstalledStickerSets = value } { value, err := DecodeMessageSchedulingState(b) if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field scheduling_state: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field scheduling_state: %w", err) } m.SchedulingState = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field sending_id: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field sending_id: %w", err) } m.SendingID = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field only_preview: %w", err) + } + m.OnlyPreview = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageSendOptions) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageSendOptions#1f60b9e as nil") + return fmt.Errorf("can't encode messageSendOptions#9cca9fb3 as nil") } b.ObjStart() b.PutID("messageSendOptions") @@ -260,15 +277,18 @@ func (m *MessageSendOptions) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("scheduling_state") if m.SchedulingState == nil { - return fmt.Errorf("unable to encode messageSendOptions#1f60b9e: field scheduling_state is nil") + return fmt.Errorf("unable to encode messageSendOptions#9cca9fb3: field scheduling_state is nil") } if err := m.SchedulingState.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageSendOptions#1f60b9e: field scheduling_state: %w", err) + return fmt.Errorf("unable to encode messageSendOptions#9cca9fb3: field scheduling_state: %w", err) } b.Comma() b.FieldStart("sending_id") b.PutInt32(m.SendingID) b.Comma() + b.FieldStart("only_preview") + b.PutBool(m.OnlyPreview) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -277,51 +297,57 @@ func (m *MessageSendOptions) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageSendOptions) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageSendOptions#1f60b9e to nil") + return fmt.Errorf("can't decode messageSendOptions#9cca9fb3 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageSendOptions"); err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: %w", err) } case "disable_notification": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field disable_notification: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field disable_notification: %w", err) } m.DisableNotification = value case "from_background": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field from_background: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field from_background: %w", err) } m.FromBackground = value case "protect_content": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field protect_content: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field protect_content: %w", err) } m.ProtectContent = value case "update_order_of_installed_sticker_sets": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field update_order_of_installed_sticker_sets: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field update_order_of_installed_sticker_sets: %w", err) } m.UpdateOrderOfInstalledStickerSets = value case "scheduling_state": value, err := DecodeTDLibJSONMessageSchedulingState(b) if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field scheduling_state: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field scheduling_state: %w", err) } m.SchedulingState = value case "sending_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode messageSendOptions#1f60b9e: field sending_id: %w", err) + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field sending_id: %w", err) } m.SendingID = value + case "only_preview": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendOptions#9cca9fb3: field only_preview: %w", err) + } + m.OnlyPreview = value default: return b.Skip() } @@ -376,3 +402,11 @@ func (m *MessageSendOptions) GetSendingID() (value int32) { } return m.SendingID } + +// GetOnlyPreview returns value of OnlyPreview field. +func (m *MessageSendOptions) GetOnlyPreview() (value bool) { + if m == nil { + return + } + return m.OnlyPreview +} diff --git a/tdapi/tl_message_sending_state_gen.go b/tdapi/tl_message_sending_state_gen.go index 89dd5ed402..8f5a85c071 100644 --- a/tdapi/tl_message_sending_state_gen.go +++ b/tdapi/tl_message_sending_state_gen.go @@ -197,7 +197,7 @@ func (m *MessageSendingStatePending) GetSendingID() (value int32) { return m.SendingID } -// MessageSendingStateFailed represents TL type `messageSendingStateFailed#fb75b2af`. +// MessageSendingStateFailed represents TL type `messageSendingStateFailed#ac81ee5e`. type MessageSendingStateFailed struct { // The cause of the message sending failure Error Error @@ -205,13 +205,19 @@ type MessageSendingStateFailed struct { CanRetry bool // True, if the message can be re-sent only on behalf of a different sender NeedAnotherSender bool + // True, if the message can be re-sent only if another quote is chosen in the message + // that is replied by the given message + NeedAnotherReplyQuote bool + // True, if the message can be re-sent only if the message to be replied is removed. This + // will be done automatically by resendMessages + NeedDropReply bool // Time left before the message can be re-sent, in seconds. No update is sent when this // field changes RetryAfter float64 } // MessageSendingStateFailedTypeID is TL type id of MessageSendingStateFailed. -const MessageSendingStateFailedTypeID = 0xfb75b2af +const MessageSendingStateFailedTypeID = 0xac81ee5e // construct implements constructor of MessageSendingStateClass. func (m MessageSendingStateFailed) construct() MessageSendingStateClass { return &m } @@ -239,6 +245,12 @@ func (m *MessageSendingStateFailed) Zero() bool { if !(m.NeedAnotherSender == false) { return false } + if !(m.NeedAnotherReplyQuote == false) { + return false + } + if !(m.NeedDropReply == false) { + return false + } if !(m.RetryAfter == 0) { return false } @@ -290,6 +302,14 @@ func (m *MessageSendingStateFailed) TypeInfo() tdp.Type { Name: "NeedAnotherSender", SchemaName: "need_another_sender", }, + { + Name: "NeedAnotherReplyQuote", + SchemaName: "need_another_reply_quote", + }, + { + Name: "NeedDropReply", + SchemaName: "need_drop_reply", + }, { Name: "RetryAfter", SchemaName: "retry_after", @@ -301,7 +321,7 @@ func (m *MessageSendingStateFailed) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageSendingStateFailed) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageSendingStateFailed#fb75b2af as nil") + return fmt.Errorf("can't encode messageSendingStateFailed#ac81ee5e as nil") } b.PutID(MessageSendingStateFailedTypeID) return m.EncodeBare(b) @@ -310,13 +330,15 @@ func (m *MessageSendingStateFailed) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageSendingStateFailed) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageSendingStateFailed#fb75b2af as nil") + return fmt.Errorf("can't encode messageSendingStateFailed#ac81ee5e as nil") } if err := m.Error.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageSendingStateFailed#fb75b2af: field error: %w", err) + return fmt.Errorf("unable to encode messageSendingStateFailed#ac81ee5e: field error: %w", err) } b.PutBool(m.CanRetry) b.PutBool(m.NeedAnotherSender) + b.PutBool(m.NeedAnotherReplyQuote) + b.PutBool(m.NeedDropReply) b.PutDouble(m.RetryAfter) return nil } @@ -324,10 +346,10 @@ func (m *MessageSendingStateFailed) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageSendingStateFailed) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageSendingStateFailed#fb75b2af to nil") + return fmt.Errorf("can't decode messageSendingStateFailed#ac81ee5e to nil") } if err := b.ConsumeID(MessageSendingStateFailedTypeID); err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: %w", err) } return m.DecodeBare(b) } @@ -335,31 +357,45 @@ func (m *MessageSendingStateFailed) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageSendingStateFailed) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageSendingStateFailed#fb75b2af to nil") + return fmt.Errorf("can't decode messageSendingStateFailed#ac81ee5e to nil") } { if err := m.Error.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field error: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field error: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field can_retry: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field can_retry: %w", err) } m.CanRetry = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field need_another_sender: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_another_sender: %w", err) } m.NeedAnotherSender = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_another_reply_quote: %w", err) + } + m.NeedAnotherReplyQuote = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_drop_reply: %w", err) + } + m.NeedDropReply = value + } { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field retry_after: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field retry_after: %w", err) } m.RetryAfter = value } @@ -369,14 +405,14 @@ func (m *MessageSendingStateFailed) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageSendingStateFailed) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageSendingStateFailed#fb75b2af as nil") + return fmt.Errorf("can't encode messageSendingStateFailed#ac81ee5e as nil") } b.ObjStart() b.PutID("messageSendingStateFailed") b.Comma() b.FieldStart("error") if err := m.Error.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageSendingStateFailed#fb75b2af: field error: %w", err) + return fmt.Errorf("unable to encode messageSendingStateFailed#ac81ee5e: field error: %w", err) } b.Comma() b.FieldStart("can_retry") @@ -385,6 +421,12 @@ func (m *MessageSendingStateFailed) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("need_another_sender") b.PutBool(m.NeedAnotherSender) b.Comma() + b.FieldStart("need_another_reply_quote") + b.PutBool(m.NeedAnotherReplyQuote) + b.Comma() + b.FieldStart("need_drop_reply") + b.PutBool(m.NeedDropReply) + b.Comma() b.FieldStart("retry_after") b.PutDouble(m.RetryAfter) b.Comma() @@ -396,35 +438,47 @@ func (m *MessageSendingStateFailed) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageSendingStateFailed) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageSendingStateFailed#fb75b2af to nil") + return fmt.Errorf("can't decode messageSendingStateFailed#ac81ee5e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageSendingStateFailed"); err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: %w", err) } case "error": if err := m.Error.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field error: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field error: %w", err) } case "can_retry": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field can_retry: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field can_retry: %w", err) } m.CanRetry = value case "need_another_sender": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field need_another_sender: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_another_sender: %w", err) } m.NeedAnotherSender = value + case "need_another_reply_quote": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_another_reply_quote: %w", err) + } + m.NeedAnotherReplyQuote = value + case "need_drop_reply": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field need_drop_reply: %w", err) + } + m.NeedDropReply = value case "retry_after": value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode messageSendingStateFailed#fb75b2af: field retry_after: %w", err) + return fmt.Errorf("unable to decode messageSendingStateFailed#ac81ee5e: field retry_after: %w", err) } m.RetryAfter = value default: @@ -458,6 +512,22 @@ func (m *MessageSendingStateFailed) GetNeedAnotherSender() (value bool) { return m.NeedAnotherSender } +// GetNeedAnotherReplyQuote returns value of NeedAnotherReplyQuote field. +func (m *MessageSendingStateFailed) GetNeedAnotherReplyQuote() (value bool) { + if m == nil { + return + } + return m.NeedAnotherReplyQuote +} + +// GetNeedDropReply returns value of NeedDropReply field. +func (m *MessageSendingStateFailed) GetNeedDropReply() (value bool) { + if m == nil { + return + } + return m.NeedDropReply +} + // GetRetryAfter returns value of RetryAfter field. func (m *MessageSendingStateFailed) GetRetryAfter() (value float64) { if m == nil { @@ -479,7 +549,7 @@ const MessageSendingStateClassName = "MessageSendingState" // } // switch v := g.(type) { // case *tdapi.MessageSendingStatePending: // messageSendingStatePending#f32b63b4 -// case *tdapi.MessageSendingStateFailed: // messageSendingStateFailed#fb75b2af +// case *tdapi.MessageSendingStateFailed: // messageSendingStateFailed#ac81ee5e // default: panic(v) // } type MessageSendingStateClass interface { @@ -519,7 +589,7 @@ func DecodeMessageSendingState(buf *bin.Buffer) (MessageSendingStateClass, error } return &v, nil case MessageSendingStateFailedTypeID: - // Decoding messageSendingStateFailed#fb75b2af. + // Decoding messageSendingStateFailed#ac81ee5e. v := MessageSendingStateFailed{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageSendingStateClass: %w", err) @@ -545,7 +615,7 @@ func DecodeTDLibJSONMessageSendingState(buf tdjson.Decoder) (MessageSendingState } return &v, nil case "messageSendingStateFailed": - // Decoding messageSendingStateFailed#fb75b2af. + // Decoding messageSendingStateFailed#ac81ee5e. v := MessageSendingStateFailed{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageSendingStateClass: %w", err) diff --git a/tdapi/tl_notification_type_gen.go b/tdapi/tl_notification_type_gen.go index de75c8d6b6..71bcd059cc 100644 --- a/tdapi/tl_notification_type_gen.go +++ b/tdapi/tl_notification_type_gen.go @@ -531,7 +531,7 @@ func (n *NotificationTypeNewCall) GetCallID() (value int32) { // NotificationTypeNewPushMessage represents TL type `notificationTypeNewPushMessage#d5949e32`. type NotificationTypeNewPushMessage struct { // The message identifier. The message will not be available in the chat history, but the - // identifier can be used in viewMessages, or as a message to reply + // identifier can be used in viewMessages, or as a message to be replied in the same chat MessageID int64 // Identifier of the sender of the message. Corresponding user or chat may be // inaccessible diff --git a/tdapi/tl_open_web_app_gen.go b/tdapi/tl_open_web_app_gen.go index 85b5b55ebb..d57cbfa336 100644 --- a/tdapi/tl_open_web_app_gen.go +++ b/tdapi/tl_open_web_app_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// OpenWebAppRequest represents TL type `openWebApp#3a621a`. +// OpenWebAppRequest represents TL type `openWebApp#b02666b0`. type OpenWebAppRequest struct { // Identifier of the chat in which the Web App is opened. The Web App can't be opened in // secret chats @@ -47,13 +47,13 @@ type OpenWebAppRequest struct { ApplicationName string // If not 0, a message thread identifier in which the message will be sent MessageThreadID int64 - // Identifier of the replied message or story for the message sent by the Web App; pass - // null if none - ReplyTo MessageReplyToClass + // Information about the message or story to be replied in the message sent by the Web + // App; pass null if none + ReplyTo InputMessageReplyToClass } // OpenWebAppRequestTypeID is TL type id of OpenWebAppRequest. -const OpenWebAppRequestTypeID = 0x3a621a +const OpenWebAppRequestTypeID = 0xb02666b0 // Ensuring interfaces in compile-time for OpenWebAppRequest. var ( @@ -159,7 +159,7 @@ func (o *OpenWebAppRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (o *OpenWebAppRequest) Encode(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#3a621a as nil") + return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") } b.PutID(OpenWebAppRequestTypeID) return o.EncodeBare(b) @@ -168,21 +168,21 @@ func (o *OpenWebAppRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (o *OpenWebAppRequest) EncodeBare(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#3a621a as nil") + return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") } b.PutInt53(o.ChatID) b.PutInt53(o.BotUserID) b.PutString(o.URL) if err := o.Theme.Encode(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field theme: %w", err) + return fmt.Errorf("unable to encode openWebApp#b02666b0: field theme: %w", err) } b.PutString(o.ApplicationName) b.PutInt53(o.MessageThreadID) if o.ReplyTo == nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field reply_to is nil") + return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to is nil") } if err := o.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field reply_to: %w", err) + return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to: %w", err) } return nil } @@ -190,10 +190,10 @@ func (o *OpenWebAppRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (o *OpenWebAppRequest) Decode(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#3a621a to nil") + return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") } if err := b.ConsumeID(OpenWebAppRequestTypeID); err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: %w", err) } return o.DecodeBare(b) } @@ -201,52 +201,52 @@ func (o *OpenWebAppRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (o *OpenWebAppRequest) DecodeBare(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#3a621a to nil") + return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field chat_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field chat_id: %w", err) } o.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field bot_user_id: %w", err) } o.BotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field url: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field url: %w", err) } o.URL = value } { if err := o.Theme.Decode(b); err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field theme: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field theme: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field application_name: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field application_name: %w", err) } o.ApplicationName = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field message_thread_id: %w", err) } o.MessageThreadID = value } { - value, err := DecodeMessageReplyTo(b) + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field reply_to: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field reply_to: %w", err) } o.ReplyTo = value } @@ -256,7 +256,7 @@ func (o *OpenWebAppRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#3a621a as nil") + return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") } b.ObjStart() b.PutID("openWebApp") @@ -272,7 +272,7 @@ func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("theme") if err := o.Theme.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field theme: %w", err) + return fmt.Errorf("unable to encode openWebApp#b02666b0: field theme: %w", err) } b.Comma() b.FieldStart("application_name") @@ -283,10 +283,10 @@ func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("reply_to") if o.ReplyTo == nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field reply_to is nil") + return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to is nil") } if err := o.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#3a621a: field reply_to: %w", err) + return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to: %w", err) } b.Comma() b.StripComma() @@ -297,53 +297,53 @@ func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (o *OpenWebAppRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#3a621a to nil") + return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("openWebApp"); err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field chat_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field chat_id: %w", err) } o.ChatID = value case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field bot_user_id: %w", err) } o.BotUserID = value case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field url: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field url: %w", err) } o.URL = value case "theme": if err := o.Theme.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field theme: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field theme: %w", err) } case "application_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field application_name: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field application_name: %w", err) } o.ApplicationName = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field message_thread_id: %w", err) } o.MessageThreadID = value case "reply_to": - value, err := DecodeTDLibJSONMessageReplyTo(b) + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode openWebApp#3a621a: field reply_to: %w", err) + return fmt.Errorf("unable to decode openWebApp#b02666b0: field reply_to: %w", err) } o.ReplyTo = value default: @@ -402,14 +402,14 @@ func (o *OpenWebAppRequest) GetMessageThreadID() (value int64) { } // GetReplyTo returns value of ReplyTo field. -func (o *OpenWebAppRequest) GetReplyTo() (value MessageReplyToClass) { +func (o *OpenWebAppRequest) GetReplyTo() (value InputMessageReplyToClass) { if o == nil { return } return o.ReplyTo } -// OpenWebApp invokes method openWebApp#3a621a returning error if any. +// OpenWebApp invokes method openWebApp#b02666b0 returning error if any. func (c *Client) OpenWebApp(ctx context.Context, request *OpenWebAppRequest) (*WebAppInfo, error) { var result WebAppInfo diff --git a/tdapi/tl_page_block_gen.go b/tdapi/tl_page_block_gen.go index f834d1389d..92c439be0e 100644 --- a/tdapi/tl_page_block_gen.go +++ b/tdapi/tl_page_block_gen.go @@ -5168,18 +5168,20 @@ func (p *PageBlockSlideshow) GetCaption() (value PageBlockCaption) { return p.Caption } -// PageBlockChatLink represents TL type `pageBlockChatLink#f3f4550b`. +// PageBlockChatLink represents TL type `pageBlockChatLink#621ed8bb`. type PageBlockChatLink struct { // Chat title Title string // Chat photo; may be null Photo ChatPhotoInfo + // Identifier of the accent color for chat title and background of chat photo + AccentColorID int32 // Chat username by which all other information about the chat can be resolved Username string } // PageBlockChatLinkTypeID is TL type id of PageBlockChatLink. -const PageBlockChatLinkTypeID = 0xf3f4550b +const PageBlockChatLinkTypeID = 0x621ed8bb // construct implements constructor of PageBlockClass. func (p PageBlockChatLink) construct() PageBlockClass { return &p } @@ -5204,6 +5206,9 @@ func (p *PageBlockChatLink) Zero() bool { if !(p.Photo.Zero()) { return false } + if !(p.AccentColorID == 0) { + return false + } if !(p.Username == "") { return false } @@ -5251,6 +5256,10 @@ func (p *PageBlockChatLink) TypeInfo() tdp.Type { Name: "Photo", SchemaName: "photo", }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, { Name: "Username", SchemaName: "username", @@ -5262,7 +5271,7 @@ func (p *PageBlockChatLink) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PageBlockChatLink) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode pageBlockChatLink#f3f4550b as nil") + return fmt.Errorf("can't encode pageBlockChatLink#621ed8bb as nil") } b.PutID(PageBlockChatLinkTypeID) return p.EncodeBare(b) @@ -5271,12 +5280,13 @@ func (p *PageBlockChatLink) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PageBlockChatLink) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode pageBlockChatLink#f3f4550b as nil") + return fmt.Errorf("can't encode pageBlockChatLink#621ed8bb as nil") } b.PutString(p.Title) if err := p.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode pageBlockChatLink#f3f4550b: field photo: %w", err) + return fmt.Errorf("unable to encode pageBlockChatLink#621ed8bb: field photo: %w", err) } + b.PutInt32(p.AccentColorID) b.PutString(p.Username) return nil } @@ -5284,10 +5294,10 @@ func (p *PageBlockChatLink) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PageBlockChatLink) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode pageBlockChatLink#f3f4550b to nil") + return fmt.Errorf("can't decode pageBlockChatLink#621ed8bb to nil") } if err := b.ConsumeID(PageBlockChatLinkTypeID); err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: %w", err) } return p.DecodeBare(b) } @@ -5295,24 +5305,31 @@ func (p *PageBlockChatLink) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PageBlockChatLink) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode pageBlockChatLink#f3f4550b to nil") + return fmt.Errorf("can't decode pageBlockChatLink#621ed8bb to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field title: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field title: %w", err) } p.Title = value } { if err := p.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field photo: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field photo: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field accent_color_id: %w", err) } + p.AccentColorID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field username: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field username: %w", err) } p.Username = value } @@ -5322,7 +5339,7 @@ func (p *PageBlockChatLink) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (p *PageBlockChatLink) EncodeTDLibJSON(b tdjson.Encoder) error { if p == nil { - return fmt.Errorf("can't encode pageBlockChatLink#f3f4550b as nil") + return fmt.Errorf("can't encode pageBlockChatLink#621ed8bb as nil") } b.ObjStart() b.PutID("pageBlockChatLink") @@ -5332,9 +5349,12 @@ func (p *PageBlockChatLink) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("photo") if err := p.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode pageBlockChatLink#f3f4550b: field photo: %w", err) + return fmt.Errorf("unable to encode pageBlockChatLink#621ed8bb: field photo: %w", err) } b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(p.AccentColorID) + b.Comma() b.FieldStart("username") b.PutString(p.Username) b.Comma() @@ -5346,29 +5366,35 @@ func (p *PageBlockChatLink) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (p *PageBlockChatLink) DecodeTDLibJSON(b tdjson.Decoder) error { if p == nil { - return fmt.Errorf("can't decode pageBlockChatLink#f3f4550b to nil") + return fmt.Errorf("can't decode pageBlockChatLink#621ed8bb to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("pageBlockChatLink"); err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: %w", err) } case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field title: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field title: %w", err) } p.Title = value case "photo": if err := p.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field photo: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field photo: %w", err) } + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field accent_color_id: %w", err) + } + p.AccentColorID = value case "username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode pageBlockChatLink#f3f4550b: field username: %w", err) + return fmt.Errorf("unable to decode pageBlockChatLink#621ed8bb: field username: %w", err) } p.Username = value default: @@ -5394,6 +5420,14 @@ func (p *PageBlockChatLink) GetPhoto() (value ChatPhotoInfo) { return p.Photo } +// GetAccentColorID returns value of AccentColorID field. +func (p *PageBlockChatLink) GetAccentColorID() (value int32) { + if p == nil { + return + } + return p.AccentColorID +} + // GetUsername returns value of Username field. func (p *PageBlockChatLink) GetUsername() (value string) { if p == nil { @@ -6590,7 +6624,7 @@ const PageBlockClassName = "PageBlock" // case *tdapi.PageBlockEmbeddedPost: // pageBlockEmbeddedPost#bc57cdf5 // case *tdapi.PageBlockCollage: // pageBlockCollage#40bcaaf0 // case *tdapi.PageBlockSlideshow: // pageBlockSlideshow#1107d496 -// case *tdapi.PageBlockChatLink: // pageBlockChatLink#f3f4550b +// case *tdapi.PageBlockChatLink: // pageBlockChatLink#621ed8bb // case *tdapi.PageBlockTable: // pageBlockTable#cc6352c3 // case *tdapi.PageBlockDetails: // pageBlockDetails#990a0c0b // case *tdapi.PageBlockRelatedArticles: // pageBlockRelatedArticles#936d81e6 @@ -6795,7 +6829,7 @@ func DecodePageBlock(buf *bin.Buffer) (PageBlockClass, error) { } return &v, nil case PageBlockChatLinkTypeID: - // Decoding pageBlockChatLink#f3f4550b. + // Decoding pageBlockChatLink#621ed8bb. v := PageBlockChatLink{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PageBlockClass: %w", err) @@ -7010,7 +7044,7 @@ func DecodeTDLibJSONPageBlock(buf tdjson.Decoder) (PageBlockClass, error) { } return &v, nil case "pageBlockChatLink": - // Decoding pageBlockChatLink#f3f4550b. + // Decoding pageBlockChatLink#621ed8bb. v := PageBlockChatLink{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode PageBlockClass: %w", err) diff --git a/tdapi/tl_premium_feature_gen.go b/tdapi/tl_premium_feature_gen.go index 2107bf2942..b88b2283f5 100644 --- a/tdapi/tl_premium_feature_gen.go +++ b/tdapi/tl_premium_feature_gen.go @@ -2258,6 +2258,137 @@ func (p *PremiumFeatureChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error { }) } +// PremiumFeatureAccentColor represents TL type `premiumFeatureAccentColor#361ac59e`. +type PremiumFeatureAccentColor struct { +} + +// PremiumFeatureAccentColorTypeID is TL type id of PremiumFeatureAccentColor. +const PremiumFeatureAccentColorTypeID = 0x361ac59e + +// construct implements constructor of PremiumFeatureClass. +func (p PremiumFeatureAccentColor) construct() PremiumFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumFeatureAccentColor. +var ( + _ bin.Encoder = &PremiumFeatureAccentColor{} + _ bin.Decoder = &PremiumFeatureAccentColor{} + _ bin.BareEncoder = &PremiumFeatureAccentColor{} + _ bin.BareDecoder = &PremiumFeatureAccentColor{} + + _ PremiumFeatureClass = &PremiumFeatureAccentColor{} +) + +func (p *PremiumFeatureAccentColor) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumFeatureAccentColor) String() string { + if p == nil { + return "PremiumFeatureAccentColor(nil)" + } + type Alias PremiumFeatureAccentColor + return fmt.Sprintf("PremiumFeatureAccentColor%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumFeatureAccentColor) TypeID() uint32 { + return PremiumFeatureAccentColorTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumFeatureAccentColor) TypeName() string { + return "premiumFeatureAccentColor" +} + +// TypeInfo returns info about TL type. +func (p *PremiumFeatureAccentColor) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumFeatureAccentColor", + ID: PremiumFeatureAccentColorTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumFeatureAccentColor) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil") + } + b.PutID(PremiumFeatureAccentColorTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumFeatureAccentColor) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumFeatureAccentColor) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil") + } + if err := b.ConsumeID(PremiumFeatureAccentColorTypeID); err != nil { + return fmt.Errorf("unable to decode premiumFeatureAccentColor#361ac59e: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumFeatureAccentColor) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumFeatureAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil") + } + b.ObjStart() + b.PutID("premiumFeatureAccentColor") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumFeatureAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumFeatureAccentColor"); err != nil { + return fmt.Errorf("unable to decode premiumFeatureAccentColor#361ac59e: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // PremiumFeatureClassName is schema name of PremiumFeatureClass. const PremiumFeatureClassName = "PremiumFeature" @@ -2287,6 +2418,7 @@ const PremiumFeatureClassName = "PremiumFeature" // case *tdapi.PremiumFeatureRealTimeChatTranslation: // premiumFeatureRealTimeChatTranslation#bbd80280 // case *tdapi.PremiumFeatureUpgradedStories: // premiumFeatureUpgradedStories#9008051b // case *tdapi.PremiumFeatureChatBoost: // premiumFeatureChatBoost#5df89f1b +// case *tdapi.PremiumFeatureAccentColor: // premiumFeatureAccentColor#361ac59e // default: panic(v) // } type PremiumFeatureClass interface { @@ -2437,6 +2569,13 @@ func DecodePremiumFeature(buf *bin.Buffer) (PremiumFeatureClass, error) { return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case PremiumFeatureAccentColorTypeID: + // Decoding premiumFeatureAccentColor#361ac59e. + v := PremiumFeatureAccentColor{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", bin.NewUnexpectedID(id)) } @@ -2568,6 +2707,13 @@ func DecodeTDLibJSONPremiumFeature(buf tdjson.Decoder) (PremiumFeatureClass, err return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case "premiumFeatureAccentColor": + // Decoding premiumFeatureAccentColor#361ac59e. + v := PremiumFeatureAccentColor{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_premium_gift_code_info_gen.go b/tdapi/tl_premium_gift_code_info_gen.go new file mode 100644 index 0000000000..3f1d9d006e --- /dev/null +++ b/tdapi/tl_premium_gift_code_info_gen.go @@ -0,0 +1,408 @@ +// 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{} +) + +// PremiumGiftCodeInfo represents TL type `premiumGiftCodeInfo#b88fa8de`. +type PremiumGiftCodeInfo struct { + // Identifier of a chat or a user that created the gift code + CreatorID MessageSenderClass + // Point in time (Unix timestamp) when the code was created + CreationDate int32 + // True, if the gift code was created for a giveaway + IsFromGiveaway bool + // Identifier of the corresponding giveaway message; 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 + MonthCount int32 + // Identifier of a user for which the code was created; 0 if none + UserID int64 + // Point in time (Unix timestamp) when the code was activated; 0 if none + UseDate int32 +} + +// PremiumGiftCodeInfoTypeID is TL type id of PremiumGiftCodeInfo. +const PremiumGiftCodeInfoTypeID = 0xb88fa8de + +// Ensuring interfaces in compile-time for PremiumGiftCodeInfo. +var ( + _ bin.Encoder = &PremiumGiftCodeInfo{} + _ bin.Decoder = &PremiumGiftCodeInfo{} + _ bin.BareEncoder = &PremiumGiftCodeInfo{} + _ bin.BareDecoder = &PremiumGiftCodeInfo{} +) + +func (p *PremiumGiftCodeInfo) Zero() bool { + if p == nil { + return true + } + if !(p.CreatorID == nil) { + return false + } + if !(p.CreationDate == 0) { + return false + } + if !(p.IsFromGiveaway == false) { + return false + } + if !(p.GiveawayMessageID == 0) { + return false + } + if !(p.MonthCount == 0) { + return false + } + if !(p.UserID == 0) { + return false + } + if !(p.UseDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiftCodeInfo) String() string { + if p == nil { + return "PremiumGiftCodeInfo(nil)" + } + type Alias PremiumGiftCodeInfo + return fmt.Sprintf("PremiumGiftCodeInfo%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiftCodeInfo) TypeID() uint32 { + return PremiumGiftCodeInfoTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiftCodeInfo) TypeName() string { + return "premiumGiftCodeInfo" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiftCodeInfo) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiftCodeInfo", + ID: PremiumGiftCodeInfoTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "CreatorID", + SchemaName: "creator_id", + }, + { + Name: "CreationDate", + SchemaName: "creation_date", + }, + { + Name: "IsFromGiveaway", + SchemaName: "is_from_giveaway", + }, + { + Name: "GiveawayMessageID", + SchemaName: "giveaway_message_id", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "UseDate", + SchemaName: "use_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiftCodeInfo) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodeInfo#b88fa8de as nil") + } + b.PutID(PremiumGiftCodeInfoTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiftCodeInfo) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodeInfo#b88fa8de as nil") + } + if p.CreatorID == nil { + return fmt.Errorf("unable to encode premiumGiftCodeInfo#b88fa8de: field creator_id is nil") + } + if err := p.CreatorID.Encode(b); err != nil { + return fmt.Errorf("unable to encode premiumGiftCodeInfo#b88fa8de: field creator_id: %w", err) + } + b.PutInt32(p.CreationDate) + b.PutBool(p.IsFromGiveaway) + b.PutInt53(p.GiveawayMessageID) + b.PutInt32(p.MonthCount) + b.PutInt53(p.UserID) + b.PutInt32(p.UseDate) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiftCodeInfo) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodeInfo#b88fa8de to nil") + } + if err := b.ConsumeID(PremiumGiftCodeInfoTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiftCodeInfo) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodeInfo#b88fa8de to nil") + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field creator_id: %w", err) + } + p.CreatorID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field creation_date: %w", err) + } + p.CreationDate = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field is_from_giveaway: %w", err) + } + p.IsFromGiveaway = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field giveaway_message_id: %w", err) + } + p.GiveawayMessageID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field month_count: %w", err) + } + p.MonthCount = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field user_id: %w", err) + } + p.UserID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field use_date: %w", err) + } + p.UseDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiftCodeInfo) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodeInfo#b88fa8de as nil") + } + b.ObjStart() + b.PutID("premiumGiftCodeInfo") + b.Comma() + b.FieldStart("creator_id") + if p.CreatorID == nil { + return fmt.Errorf("unable to encode premiumGiftCodeInfo#b88fa8de: field creator_id is nil") + } + if err := p.CreatorID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode premiumGiftCodeInfo#b88fa8de: field creator_id: %w", err) + } + b.Comma() + b.FieldStart("creation_date") + b.PutInt32(p.CreationDate) + b.Comma() + b.FieldStart("is_from_giveaway") + b.PutBool(p.IsFromGiveaway) + b.Comma() + b.FieldStart("giveaway_message_id") + b.PutInt53(p.GiveawayMessageID) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(p.MonthCount) + b.Comma() + b.FieldStart("user_id") + b.PutInt53(p.UserID) + b.Comma() + b.FieldStart("use_date") + b.PutInt32(p.UseDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiftCodeInfo) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodeInfo#b88fa8de to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiftCodeInfo"); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: %w", err) + } + case "creator_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field creator_id: %w", err) + } + p.CreatorID = value + case "creation_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field creation_date: %w", err) + } + p.CreationDate = value + case "is_from_giveaway": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field is_from_giveaway: %w", err) + } + p.IsFromGiveaway = value + case "giveaway_message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field giveaway_message_id: %w", err) + } + p.GiveawayMessageID = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field month_count: %w", err) + } + p.MonthCount = value + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field user_id: %w", err) + } + p.UserID = value + case "use_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodeInfo#b88fa8de: field use_date: %w", err) + } + p.UseDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCreatorID returns value of CreatorID field. +func (p *PremiumGiftCodeInfo) GetCreatorID() (value MessageSenderClass) { + if p == nil { + return + } + return p.CreatorID +} + +// GetCreationDate returns value of CreationDate field. +func (p *PremiumGiftCodeInfo) GetCreationDate() (value int32) { + if p == nil { + return + } + return p.CreationDate +} + +// GetIsFromGiveaway returns value of IsFromGiveaway field. +func (p *PremiumGiftCodeInfo) GetIsFromGiveaway() (value bool) { + if p == nil { + return + } + return p.IsFromGiveaway +} + +// GetGiveawayMessageID returns value of GiveawayMessageID field. +func (p *PremiumGiftCodeInfo) GetGiveawayMessageID() (value int64) { + if p == nil { + return + } + return p.GiveawayMessageID +} + +// GetMonthCount returns value of MonthCount field. +func (p *PremiumGiftCodeInfo) GetMonthCount() (value int32) { + if p == nil { + return + } + return p.MonthCount +} + +// GetUserID returns value of UserID field. +func (p *PremiumGiftCodeInfo) GetUserID() (value int64) { + if p == nil { + return + } + return p.UserID +} + +// GetUseDate returns value of UseDate field. +func (p *PremiumGiftCodeInfo) GetUseDate() (value int32) { + if p == nil { + return + } + return p.UseDate +} diff --git a/tdapi/tl_premium_gift_code_payment_option_gen.go b/tdapi/tl_premium_gift_code_payment_option_gen.go new file mode 100644 index 0000000000..0a4c2999ea --- /dev/null +++ b/tdapi/tl_premium_gift_code_payment_option_gen.go @@ -0,0 +1,363 @@ +// 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{} +) + +// PremiumGiftCodePaymentOption represents TL type `premiumGiftCodePaymentOption#e2f40fef`. +type PremiumGiftCodePaymentOption struct { + // ISO 4217 currency code for Telegram Premium gift code payment + Currency string + // The amount to pay, in the smallest units of the currency + 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 + MonthCount int32 + // Identifier of the store product associated with the option; may be empty if none + StoreProductID string + // Number of times the store product must be paid + StoreProductQuantity int32 +} + +// PremiumGiftCodePaymentOptionTypeID is TL type id of PremiumGiftCodePaymentOption. +const PremiumGiftCodePaymentOptionTypeID = 0xe2f40fef + +// Ensuring interfaces in compile-time for PremiumGiftCodePaymentOption. +var ( + _ bin.Encoder = &PremiumGiftCodePaymentOption{} + _ bin.Decoder = &PremiumGiftCodePaymentOption{} + _ bin.BareEncoder = &PremiumGiftCodePaymentOption{} + _ bin.BareDecoder = &PremiumGiftCodePaymentOption{} +) + +func (p *PremiumGiftCodePaymentOption) Zero() bool { + if p == nil { + return true + } + if !(p.Currency == "") { + return false + } + if !(p.Amount == 0) { + return false + } + if !(p.UserCount == 0) { + return false + } + if !(p.MonthCount == 0) { + return false + } + if !(p.StoreProductID == "") { + return false + } + if !(p.StoreProductQuantity == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiftCodePaymentOption) String() string { + if p == nil { + return "PremiumGiftCodePaymentOption(nil)" + } + type Alias PremiumGiftCodePaymentOption + return fmt.Sprintf("PremiumGiftCodePaymentOption%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiftCodePaymentOption) TypeID() uint32 { + return PremiumGiftCodePaymentOptionTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiftCodePaymentOption) TypeName() string { + return "premiumGiftCodePaymentOption" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiftCodePaymentOption) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiftCodePaymentOption", + ID: PremiumGiftCodePaymentOptionTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + { + Name: "UserCount", + SchemaName: "user_count", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "StoreProductID", + SchemaName: "store_product_id", + }, + { + Name: "StoreProductQuantity", + SchemaName: "store_product_quantity", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiftCodePaymentOption) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOption#e2f40fef as nil") + } + b.PutID(PremiumGiftCodePaymentOptionTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiftCodePaymentOption) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOption#e2f40fef as nil") + } + b.PutString(p.Currency) + b.PutInt53(p.Amount) + b.PutInt32(p.UserCount) + b.PutInt32(p.MonthCount) + b.PutString(p.StoreProductID) + b.PutInt32(p.StoreProductQuantity) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiftCodePaymentOption) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOption#e2f40fef to nil") + } + if err := b.ConsumeID(PremiumGiftCodePaymentOptionTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiftCodePaymentOption) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOption#e2f40fef to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field currency: %w", err) + } + p.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field amount: %w", err) + } + p.Amount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field user_count: %w", err) + } + p.UserCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field month_count: %w", err) + } + p.MonthCount = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field store_product_id: %w", err) + } + p.StoreProductID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field store_product_quantity: %w", err) + } + p.StoreProductQuantity = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiftCodePaymentOption) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOption#e2f40fef as nil") + } + b.ObjStart() + b.PutID("premiumGiftCodePaymentOption") + b.Comma() + b.FieldStart("currency") + b.PutString(p.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(p.Amount) + b.Comma() + b.FieldStart("user_count") + b.PutInt32(p.UserCount) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(p.MonthCount) + b.Comma() + b.FieldStart("store_product_id") + b.PutString(p.StoreProductID) + b.Comma() + b.FieldStart("store_product_quantity") + b.PutInt32(p.StoreProductQuantity) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiftCodePaymentOption) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOption#e2f40fef to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiftCodePaymentOption"); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: %w", err) + } + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field currency: %w", err) + } + p.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field amount: %w", err) + } + p.Amount = value + case "user_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field user_count: %w", err) + } + p.UserCount = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field month_count: %w", err) + } + p.MonthCount = value + case "store_product_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field store_product_id: %w", err) + } + p.StoreProductID = value + case "store_product_quantity": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOption#e2f40fef: field store_product_quantity: %w", err) + } + p.StoreProductQuantity = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCurrency returns value of Currency field. +func (p *PremiumGiftCodePaymentOption) GetCurrency() (value string) { + if p == nil { + return + } + return p.Currency +} + +// GetAmount returns value of Amount field. +func (p *PremiumGiftCodePaymentOption) GetAmount() (value int64) { + if p == nil { + return + } + return p.Amount +} + +// GetUserCount returns value of UserCount field. +func (p *PremiumGiftCodePaymentOption) GetUserCount() (value int32) { + if p == nil { + return + } + return p.UserCount +} + +// GetMonthCount returns value of MonthCount field. +func (p *PremiumGiftCodePaymentOption) GetMonthCount() (value int32) { + if p == nil { + return + } + return p.MonthCount +} + +// GetStoreProductID returns value of StoreProductID field. +func (p *PremiumGiftCodePaymentOption) GetStoreProductID() (value string) { + if p == nil { + return + } + return p.StoreProductID +} + +// GetStoreProductQuantity returns value of StoreProductQuantity field. +func (p *PremiumGiftCodePaymentOption) GetStoreProductQuantity() (value int32) { + if p == nil { + return + } + return p.StoreProductQuantity +} diff --git a/tdapi/tl_premium_gift_code_payment_options_gen.go b/tdapi/tl_premium_gift_code_payment_options_gen.go new file mode 100644 index 0000000000..50989bddeb --- /dev/null +++ b/tdapi/tl_premium_gift_code_payment_options_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{} +) + +// PremiumGiftCodePaymentOptions represents TL type `premiumGiftCodePaymentOptions#97a8cf2e`. +type PremiumGiftCodePaymentOptions struct { + // The list of options + Options []PremiumGiftCodePaymentOption +} + +// PremiumGiftCodePaymentOptionsTypeID is TL type id of PremiumGiftCodePaymentOptions. +const PremiumGiftCodePaymentOptionsTypeID = 0x97a8cf2e + +// Ensuring interfaces in compile-time for PremiumGiftCodePaymentOptions. +var ( + _ bin.Encoder = &PremiumGiftCodePaymentOptions{} + _ bin.Decoder = &PremiumGiftCodePaymentOptions{} + _ bin.BareEncoder = &PremiumGiftCodePaymentOptions{} + _ bin.BareDecoder = &PremiumGiftCodePaymentOptions{} +) + +func (p *PremiumGiftCodePaymentOptions) Zero() bool { + if p == nil { + return true + } + if !(p.Options == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiftCodePaymentOptions) String() string { + if p == nil { + return "PremiumGiftCodePaymentOptions(nil)" + } + type Alias PremiumGiftCodePaymentOptions + return fmt.Sprintf("PremiumGiftCodePaymentOptions%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiftCodePaymentOptions) TypeID() uint32 { + return PremiumGiftCodePaymentOptionsTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiftCodePaymentOptions) TypeName() string { + return "premiumGiftCodePaymentOptions" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiftCodePaymentOptions) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiftCodePaymentOptions", + ID: PremiumGiftCodePaymentOptionsTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Options", + SchemaName: "options", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiftCodePaymentOptions) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOptions#97a8cf2e as nil") + } + b.PutID(PremiumGiftCodePaymentOptionsTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiftCodePaymentOptions) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOptions#97a8cf2e as nil") + } + b.PutInt(len(p.Options)) + for idx, v := range p.Options { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare premiumGiftCodePaymentOptions#97a8cf2e: field options element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiftCodePaymentOptions) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOptions#97a8cf2e to nil") + } + if err := b.ConsumeID(PremiumGiftCodePaymentOptionsTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOptions#97a8cf2e: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiftCodePaymentOptions) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOptions#97a8cf2e to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOptions#97a8cf2e: field options: %w", err) + } + + if headerLen > 0 { + p.Options = make([]PremiumGiftCodePaymentOption, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value PremiumGiftCodePaymentOption + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare premiumGiftCodePaymentOptions#97a8cf2e: field options: %w", err) + } + p.Options = append(p.Options, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiftCodePaymentOptions) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiftCodePaymentOptions#97a8cf2e as nil") + } + b.ObjStart() + b.PutID("premiumGiftCodePaymentOptions") + b.Comma() + b.FieldStart("options") + b.ArrStart() + for idx, v := range p.Options { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode premiumGiftCodePaymentOptions#97a8cf2e: field options element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiftCodePaymentOptions) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiftCodePaymentOptions#97a8cf2e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiftCodePaymentOptions"); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOptions#97a8cf2e: %w", err) + } + case "options": + if err := b.Arr(func(b tdjson.Decoder) error { + var value PremiumGiftCodePaymentOption + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOptions#97a8cf2e: field options: %w", err) + } + p.Options = append(p.Options, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode premiumGiftCodePaymentOptions#97a8cf2e: field options: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetOptions returns value of Options field. +func (p *PremiumGiftCodePaymentOptions) GetOptions() (value []PremiumGiftCodePaymentOption) { + if p == nil { + return + } + return p.Options +} diff --git a/tdapi/tl_premium_giveaway_info_gen.go b/tdapi/tl_premium_giveaway_info_gen.go new file mode 100644 index 0000000000..9eabfcc2b3 --- /dev/null +++ b/tdapi/tl_premium_giveaway_info_gen.go @@ -0,0 +1,754 @@ +// 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{} +) + +// PremiumGiveawayInfoOngoing represents TL type `premiumGiveawayInfoOngoing#48d3ce6f`. +type PremiumGiveawayInfoOngoing struct { + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 + // Status of the current user in the giveaway + Status PremiumGiveawayParticipantStatusClass + // True, if the giveaway has ended and results are being prepared + IsEnded bool +} + +// PremiumGiveawayInfoOngoingTypeID is TL type id of PremiumGiveawayInfoOngoing. +const PremiumGiveawayInfoOngoingTypeID = 0x48d3ce6f + +// construct implements constructor of PremiumGiveawayInfoClass. +func (p PremiumGiveawayInfoOngoing) construct() PremiumGiveawayInfoClass { return &p } + +// Ensuring interfaces in compile-time for PremiumGiveawayInfoOngoing. +var ( + _ bin.Encoder = &PremiumGiveawayInfoOngoing{} + _ bin.Decoder = &PremiumGiveawayInfoOngoing{} + _ bin.BareEncoder = &PremiumGiveawayInfoOngoing{} + _ bin.BareDecoder = &PremiumGiveawayInfoOngoing{} + + _ PremiumGiveawayInfoClass = &PremiumGiveawayInfoOngoing{} +) + +func (p *PremiumGiveawayInfoOngoing) Zero() bool { + if p == nil { + return true + } + if !(p.CreationDate == 0) { + return false + } + if !(p.Status == nil) { + return false + } + if !(p.IsEnded == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayInfoOngoing) String() string { + if p == nil { + return "PremiumGiveawayInfoOngoing(nil)" + } + type Alias PremiumGiveawayInfoOngoing + return fmt.Sprintf("PremiumGiveawayInfoOngoing%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayInfoOngoing) TypeID() uint32 { + return PremiumGiveawayInfoOngoingTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayInfoOngoing) TypeName() string { + return "premiumGiveawayInfoOngoing" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayInfoOngoing) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayInfoOngoing", + ID: PremiumGiveawayInfoOngoingTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "CreationDate", + SchemaName: "creation_date", + }, + { + Name: "Status", + SchemaName: "status", + }, + { + Name: "IsEnded", + SchemaName: "is_ended", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayInfoOngoing) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoOngoing#48d3ce6f as nil") + } + b.PutID(PremiumGiveawayInfoOngoingTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayInfoOngoing) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoOngoing#48d3ce6f as nil") + } + b.PutInt32(p.CreationDate) + if p.Status == nil { + return fmt.Errorf("unable to encode premiumGiveawayInfoOngoing#48d3ce6f: field status is nil") + } + if err := p.Status.Encode(b); err != nil { + return fmt.Errorf("unable to encode premiumGiveawayInfoOngoing#48d3ce6f: field status: %w", err) + } + b.PutBool(p.IsEnded) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayInfoOngoing) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoOngoing#48d3ce6f to nil") + } + if err := b.ConsumeID(PremiumGiveawayInfoOngoingTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayInfoOngoing) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoOngoing#48d3ce6f to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field creation_date: %w", err) + } + p.CreationDate = value + } + { + value, err := DecodePremiumGiveawayParticipantStatus(b) + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field status: %w", err) + } + p.Status = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field is_ended: %w", err) + } + p.IsEnded = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayInfoOngoing) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoOngoing#48d3ce6f as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayInfoOngoing") + b.Comma() + b.FieldStart("creation_date") + b.PutInt32(p.CreationDate) + b.Comma() + b.FieldStart("status") + if p.Status == nil { + return fmt.Errorf("unable to encode premiumGiveawayInfoOngoing#48d3ce6f: field status is nil") + } + if err := p.Status.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode premiumGiveawayInfoOngoing#48d3ce6f: field status: %w", err) + } + b.Comma() + b.FieldStart("is_ended") + b.PutBool(p.IsEnded) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayInfoOngoing) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoOngoing#48d3ce6f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayInfoOngoing"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: %w", err) + } + case "creation_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field creation_date: %w", err) + } + p.CreationDate = value + case "status": + value, err := DecodeTDLibJSONPremiumGiveawayParticipantStatus(b) + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field status: %w", err) + } + p.Status = value + case "is_ended": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoOngoing#48d3ce6f: field is_ended: %w", err) + } + p.IsEnded = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCreationDate returns value of CreationDate field. +func (p *PremiumGiveawayInfoOngoing) GetCreationDate() (value int32) { + if p == nil { + return + } + return p.CreationDate +} + +// GetStatus returns value of Status field. +func (p *PremiumGiveawayInfoOngoing) GetStatus() (value PremiumGiveawayParticipantStatusClass) { + if p == nil { + return + } + return p.Status +} + +// GetIsEnded returns value of IsEnded field. +func (p *PremiumGiveawayInfoOngoing) GetIsEnded() (value bool) { + if p == nil { + return + } + return p.IsEnded +} + +// PremiumGiveawayInfoCompleted represents TL type `premiumGiveawayInfoCompleted#fc8b501b`. +type PremiumGiveawayInfoCompleted struct { + // Point in time (Unix timestamp) when the giveaway was created + CreationDate 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 the giveaway was canceled and was fully refunded + WasRefunded bool + // Number of winners in the giveaway + WinnerCount int32 + // Number of winners, which activated their gift codes + ActivationCount int32 + // Telegram Premium gift code that was received by the current user; empty if the user + // isn't a winner in the giveaway + GiftCode string +} + +// PremiumGiveawayInfoCompletedTypeID is TL type id of PremiumGiveawayInfoCompleted. +const PremiumGiveawayInfoCompletedTypeID = 0xfc8b501b + +// construct implements constructor of PremiumGiveawayInfoClass. +func (p PremiumGiveawayInfoCompleted) construct() PremiumGiveawayInfoClass { return &p } + +// Ensuring interfaces in compile-time for PremiumGiveawayInfoCompleted. +var ( + _ bin.Encoder = &PremiumGiveawayInfoCompleted{} + _ bin.Decoder = &PremiumGiveawayInfoCompleted{} + _ bin.BareEncoder = &PremiumGiveawayInfoCompleted{} + _ bin.BareDecoder = &PremiumGiveawayInfoCompleted{} + + _ PremiumGiveawayInfoClass = &PremiumGiveawayInfoCompleted{} +) + +func (p *PremiumGiveawayInfoCompleted) Zero() bool { + if p == nil { + return true + } + if !(p.CreationDate == 0) { + return false + } + if !(p.ActualWinnersSelectionDate == 0) { + return false + } + if !(p.WasRefunded == false) { + return false + } + if !(p.WinnerCount == 0) { + return false + } + if !(p.ActivationCount == 0) { + return false + } + if !(p.GiftCode == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayInfoCompleted) String() string { + if p == nil { + return "PremiumGiveawayInfoCompleted(nil)" + } + type Alias PremiumGiveawayInfoCompleted + return fmt.Sprintf("PremiumGiveawayInfoCompleted%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayInfoCompleted) TypeID() uint32 { + return PremiumGiveawayInfoCompletedTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayInfoCompleted) TypeName() string { + return "premiumGiveawayInfoCompleted" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayInfoCompleted) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayInfoCompleted", + ID: PremiumGiveawayInfoCompletedTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "CreationDate", + SchemaName: "creation_date", + }, + { + Name: "ActualWinnersSelectionDate", + SchemaName: "actual_winners_selection_date", + }, + { + Name: "WasRefunded", + SchemaName: "was_refunded", + }, + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "ActivationCount", + SchemaName: "activation_count", + }, + { + Name: "GiftCode", + SchemaName: "gift_code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayInfoCompleted) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoCompleted#fc8b501b as nil") + } + b.PutID(PremiumGiveawayInfoCompletedTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayInfoCompleted) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoCompleted#fc8b501b as nil") + } + b.PutInt32(p.CreationDate) + b.PutInt32(p.ActualWinnersSelectionDate) + b.PutBool(p.WasRefunded) + b.PutInt32(p.WinnerCount) + b.PutInt32(p.ActivationCount) + b.PutString(p.GiftCode) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayInfoCompleted) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoCompleted#fc8b501b to nil") + } + if err := b.ConsumeID(PremiumGiveawayInfoCompletedTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayInfoCompleted) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoCompleted#fc8b501b to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field creation_date: %w", err) + } + p.CreationDate = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field actual_winners_selection_date: %w", err) + } + p.ActualWinnersSelectionDate = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field was_refunded: %w", err) + } + p.WasRefunded = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field winner_count: %w", err) + } + p.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field activation_count: %w", err) + } + p.ActivationCount = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field gift_code: %w", err) + } + p.GiftCode = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayInfoCompleted) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayInfoCompleted#fc8b501b as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayInfoCompleted") + b.Comma() + b.FieldStart("creation_date") + b.PutInt32(p.CreationDate) + b.Comma() + b.FieldStart("actual_winners_selection_date") + b.PutInt32(p.ActualWinnersSelectionDate) + b.Comma() + b.FieldStart("was_refunded") + b.PutBool(p.WasRefunded) + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(p.WinnerCount) + b.Comma() + b.FieldStart("activation_count") + b.PutInt32(p.ActivationCount) + b.Comma() + b.FieldStart("gift_code") + b.PutString(p.GiftCode) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayInfoCompleted) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayInfoCompleted#fc8b501b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayInfoCompleted"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: %w", err) + } + case "creation_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field creation_date: %w", err) + } + p.CreationDate = value + case "actual_winners_selection_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field actual_winners_selection_date: %w", err) + } + p.ActualWinnersSelectionDate = value + case "was_refunded": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field was_refunded: %w", err) + } + p.WasRefunded = value + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field winner_count: %w", err) + } + p.WinnerCount = value + case "activation_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field activation_count: %w", err) + } + p.ActivationCount = value + case "gift_code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayInfoCompleted#fc8b501b: field gift_code: %w", err) + } + p.GiftCode = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCreationDate returns value of CreationDate field. +func (p *PremiumGiveawayInfoCompleted) GetCreationDate() (value int32) { + if p == nil { + return + } + return p.CreationDate +} + +// GetActualWinnersSelectionDate returns value of ActualWinnersSelectionDate field. +func (p *PremiumGiveawayInfoCompleted) GetActualWinnersSelectionDate() (value int32) { + if p == nil { + return + } + return p.ActualWinnersSelectionDate +} + +// GetWasRefunded returns value of WasRefunded field. +func (p *PremiumGiveawayInfoCompleted) GetWasRefunded() (value bool) { + if p == nil { + return + } + return p.WasRefunded +} + +// GetWinnerCount returns value of WinnerCount field. +func (p *PremiumGiveawayInfoCompleted) GetWinnerCount() (value int32) { + if p == nil { + return + } + return p.WinnerCount +} + +// GetActivationCount returns value of ActivationCount field. +func (p *PremiumGiveawayInfoCompleted) GetActivationCount() (value int32) { + if p == nil { + return + } + return p.ActivationCount +} + +// GetGiftCode returns value of GiftCode field. +func (p *PremiumGiveawayInfoCompleted) GetGiftCode() (value string) { + if p == nil { + return + } + return p.GiftCode +} + +// PremiumGiveawayInfoClassName is schema name of PremiumGiveawayInfoClass. +const PremiumGiveawayInfoClassName = "PremiumGiveawayInfo" + +// PremiumGiveawayInfoClass represents PremiumGiveawayInfo generic type. +// +// Example: +// +// g, err := tdapi.DecodePremiumGiveawayInfo(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.PremiumGiveawayInfoOngoing: // premiumGiveawayInfoOngoing#48d3ce6f +// case *tdapi.PremiumGiveawayInfoCompleted: // premiumGiveawayInfoCompleted#fc8b501b +// default: panic(v) +// } +type PremiumGiveawayInfoClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PremiumGiveawayInfoClass + + // 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 + + // Point in time (Unix timestamp) when the giveaway was created + GetCreationDate() (value int32) +} + +// DecodePremiumGiveawayInfo implements binary de-serialization for PremiumGiveawayInfoClass. +func DecodePremiumGiveawayInfo(buf *bin.Buffer) (PremiumGiveawayInfoClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PremiumGiveawayInfoOngoingTypeID: + // Decoding premiumGiveawayInfoOngoing#48d3ce6f. + v := PremiumGiveawayInfoOngoing{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", err) + } + return &v, nil + case PremiumGiveawayInfoCompletedTypeID: + // Decoding premiumGiveawayInfoCompleted#fc8b501b. + v := PremiumGiveawayInfoCompleted{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONPremiumGiveawayInfo implements binary de-serialization for PremiumGiveawayInfoClass. +func DecodeTDLibJSONPremiumGiveawayInfo(buf tdjson.Decoder) (PremiumGiveawayInfoClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "premiumGiveawayInfoOngoing": + // Decoding premiumGiveawayInfoOngoing#48d3ce6f. + v := PremiumGiveawayInfoOngoing{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", err) + } + return &v, nil + case "premiumGiveawayInfoCompleted": + // Decoding premiumGiveawayInfoCompleted#fc8b501b. + v := PremiumGiveawayInfoCompleted{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumGiveawayInfoClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// PremiumGiveawayInfo boxes the PremiumGiveawayInfoClass providing a helper. +type PremiumGiveawayInfoBox struct { + PremiumGiveawayInfo PremiumGiveawayInfoClass +} + +// Decode implements bin.Decoder for PremiumGiveawayInfoBox. +func (b *PremiumGiveawayInfoBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumGiveawayInfoBox to nil") + } + v, err := DecodePremiumGiveawayInfo(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumGiveawayInfo = v + return nil +} + +// Encode implements bin.Encode for PremiumGiveawayInfoBox. +func (b *PremiumGiveawayInfoBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PremiumGiveawayInfo == nil { + return fmt.Errorf("unable to encode PremiumGiveawayInfoClass as nil") + } + return b.PremiumGiveawayInfo.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for PremiumGiveawayInfoBox. +func (b *PremiumGiveawayInfoBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumGiveawayInfoBox to nil") + } + v, err := DecodeTDLibJSONPremiumGiveawayInfo(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumGiveawayInfo = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for PremiumGiveawayInfoBox. +func (b *PremiumGiveawayInfoBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.PremiumGiveawayInfo == nil { + return fmt.Errorf("unable to encode PremiumGiveawayInfoClass as nil") + } + return b.PremiumGiveawayInfo.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_premium_giveaway_parameters_gen.go b/tdapi/tl_premium_giveaway_parameters_gen.go new file mode 100644 index 0000000000..d9cf59d668 --- /dev/null +++ b/tdapi/tl_premium_giveaway_parameters_gen.go @@ -0,0 +1,382 @@ +// 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{} +) + +// PremiumGiveawayParameters represents TL type `premiumGiveawayParameters#de917baf`. +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 + BoostedChatID int64 + // 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 + AdditionalChatIDs []int64 + // 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 + WinnersSelectionDate int32 + // True, if only new subscribers of the chats will be eligible for the giveaway + OnlyNewMembers 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 +} + +// PremiumGiveawayParametersTypeID is TL type id of PremiumGiveawayParameters. +const PremiumGiveawayParametersTypeID = 0xde917baf + +// Ensuring interfaces in compile-time for PremiumGiveawayParameters. +var ( + _ bin.Encoder = &PremiumGiveawayParameters{} + _ bin.Decoder = &PremiumGiveawayParameters{} + _ bin.BareEncoder = &PremiumGiveawayParameters{} + _ bin.BareDecoder = &PremiumGiveawayParameters{} +) + +func (p *PremiumGiveawayParameters) Zero() bool { + if p == nil { + return true + } + if !(p.BoostedChatID == 0) { + return false + } + if !(p.AdditionalChatIDs == nil) { + return false + } + if !(p.WinnersSelectionDate == 0) { + return false + } + if !(p.OnlyNewMembers == false) { + return false + } + if !(p.CountryCodes == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParameters) String() string { + if p == nil { + return "PremiumGiveawayParameters(nil)" + } + type Alias PremiumGiveawayParameters + return fmt.Sprintf("PremiumGiveawayParameters%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParameters) TypeID() uint32 { + return PremiumGiveawayParametersTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParameters) TypeName() string { + return "premiumGiveawayParameters" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParameters) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParameters", + ID: PremiumGiveawayParametersTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BoostedChatID", + SchemaName: "boosted_chat_id", + }, + { + Name: "AdditionalChatIDs", + SchemaName: "additional_chat_ids", + }, + { + Name: "WinnersSelectionDate", + SchemaName: "winners_selection_date", + }, + { + Name: "OnlyNewMembers", + SchemaName: "only_new_members", + }, + { + Name: "CountryCodes", + SchemaName: "country_codes", + }, + } + return typ +} + +// 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") + } + b.PutID(PremiumGiveawayParametersTypeID) + return p.EncodeBare(b) +} + +// 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") + } + b.PutInt53(p.BoostedChatID) + b.PutInt(len(p.AdditionalChatIDs)) + for _, v := range p.AdditionalChatIDs { + b.PutInt53(v) + } + b.PutInt32(p.WinnersSelectionDate) + b.PutBool(p.OnlyNewMembers) + b.PutInt(len(p.CountryCodes)) + for _, v := range p.CountryCodes { + b.PutString(v) + } + 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") + } + if err := b.ConsumeID(PremiumGiveawayParametersTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: %w", err) + } + return p.DecodeBare(b) +} + +// 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") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: 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) + } + + if headerLen > 0 { + p.AdditionalChatIDs = 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 premiumGiveawayParameters#de917baf: field additional_chat_ids: %w", err) + } + p.AdditionalChatIDs = append(p.AdditionalChatIDs, value) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: 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) + } + p.OnlyNewMembers = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + } + + if headerLen > 0 { + p.CountryCodes = make([]string, 0, headerLen%bin.PreallocateLimit) + } + 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) + } + p.CountryCodes = append(p.CountryCodes, 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") + } + b.ObjStart() + b.PutID("premiumGiveawayParameters") + b.Comma() + b.FieldStart("boosted_chat_id") + b.PutInt53(p.BoostedChatID) + b.Comma() + b.FieldStart("additional_chat_ids") + b.ArrStart() + for _, v := range p.AdditionalChatIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("winners_selection_date") + b.PutInt32(p.WinnersSelectionDate) + b.Comma() + b.FieldStart("only_new_members") + b.PutBool(p.OnlyNewMembers) + b.Comma() + b.FieldStart("country_codes") + b.ArrStart() + for _, v := range p.CountryCodes { + b.PutString(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// 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 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) + } + 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) + } + 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) + } + p.AdditionalChatIDs = append(p.AdditionalChatIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: 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) + } + 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) + } + p.OnlyNewMembers = 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) + } + p.CountryCodes = append(p.CountryCodes, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParameters#de917baf: field country_codes: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetBoostedChatID returns value of BoostedChatID field. +func (p *PremiumGiveawayParameters) GetBoostedChatID() (value int64) { + if p == nil { + return + } + return p.BoostedChatID +} + +// GetAdditionalChatIDs returns value of AdditionalChatIDs field. +func (p *PremiumGiveawayParameters) GetAdditionalChatIDs() (value []int64) { + if p == nil { + return + } + return p.AdditionalChatIDs +} + +// GetWinnersSelectionDate returns value of WinnersSelectionDate field. +func (p *PremiumGiveawayParameters) GetWinnersSelectionDate() (value int32) { + if p == nil { + return + } + return p.WinnersSelectionDate +} + +// GetOnlyNewMembers returns value of OnlyNewMembers field. +func (p *PremiumGiveawayParameters) GetOnlyNewMembers() (value bool) { + if p == nil { + return + } + return p.OnlyNewMembers +} + +// GetCountryCodes returns value of CountryCodes field. +func (p *PremiumGiveawayParameters) GetCountryCodes() (value []string) { + if p == nil { + return + } + return p.CountryCodes +} diff --git a/tdapi/tl_premium_giveaway_participant_status_gen.go b/tdapi/tl_premium_giveaway_participant_status_gen.go new file mode 100644 index 0000000000..58035da349 --- /dev/null +++ b/tdapi/tl_premium_giveaway_participant_status_gen.go @@ -0,0 +1,984 @@ +// 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{} +) + +// PremiumGiveawayParticipantStatusEligible represents TL type `premiumGiveawayParticipantStatusEligible#7ee281c0`. +type PremiumGiveawayParticipantStatusEligible struct { +} + +// PremiumGiveawayParticipantStatusEligibleTypeID is TL type id of PremiumGiveawayParticipantStatusEligible. +const PremiumGiveawayParticipantStatusEligibleTypeID = 0x7ee281c0 + +// construct implements constructor of PremiumGiveawayParticipantStatusClass. +func (p PremiumGiveawayParticipantStatusEligible) construct() PremiumGiveawayParticipantStatusClass { + return &p +} + +// Ensuring interfaces in compile-time for PremiumGiveawayParticipantStatusEligible. +var ( + _ bin.Encoder = &PremiumGiveawayParticipantStatusEligible{} + _ bin.Decoder = &PremiumGiveawayParticipantStatusEligible{} + _ bin.BareEncoder = &PremiumGiveawayParticipantStatusEligible{} + _ bin.BareDecoder = &PremiumGiveawayParticipantStatusEligible{} + + _ PremiumGiveawayParticipantStatusClass = &PremiumGiveawayParticipantStatusEligible{} +) + +func (p *PremiumGiveawayParticipantStatusEligible) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParticipantStatusEligible) String() string { + if p == nil { + return "PremiumGiveawayParticipantStatusEligible(nil)" + } + type Alias PremiumGiveawayParticipantStatusEligible + return fmt.Sprintf("PremiumGiveawayParticipantStatusEligible%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParticipantStatusEligible) TypeID() uint32 { + return PremiumGiveawayParticipantStatusEligibleTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParticipantStatusEligible) TypeName() string { + return "premiumGiveawayParticipantStatusEligible" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParticipantStatusEligible) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParticipantStatusEligible", + ID: PremiumGiveawayParticipantStatusEligibleTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayParticipantStatusEligible) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusEligible#7ee281c0 as nil") + } + b.PutID(PremiumGiveawayParticipantStatusEligibleTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayParticipantStatusEligible) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusEligible#7ee281c0 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayParticipantStatusEligible) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusEligible#7ee281c0 to nil") + } + if err := b.ConsumeID(PremiumGiveawayParticipantStatusEligibleTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusEligible#7ee281c0: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayParticipantStatusEligible) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusEligible#7ee281c0 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayParticipantStatusEligible) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusEligible#7ee281c0 as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayParticipantStatusEligible") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayParticipantStatusEligible) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusEligible#7ee281c0 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayParticipantStatusEligible"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusEligible#7ee281c0: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumGiveawayParticipantStatusParticipating represents TL type `premiumGiveawayParticipantStatusParticipating#740406d1`. +type PremiumGiveawayParticipantStatusParticipating struct { +} + +// PremiumGiveawayParticipantStatusParticipatingTypeID is TL type id of PremiumGiveawayParticipantStatusParticipating. +const PremiumGiveawayParticipantStatusParticipatingTypeID = 0x740406d1 + +// construct implements constructor of PremiumGiveawayParticipantStatusClass. +func (p PremiumGiveawayParticipantStatusParticipating) construct() PremiumGiveawayParticipantStatusClass { + return &p +} + +// Ensuring interfaces in compile-time for PremiumGiveawayParticipantStatusParticipating. +var ( + _ bin.Encoder = &PremiumGiveawayParticipantStatusParticipating{} + _ bin.Decoder = &PremiumGiveawayParticipantStatusParticipating{} + _ bin.BareEncoder = &PremiumGiveawayParticipantStatusParticipating{} + _ bin.BareDecoder = &PremiumGiveawayParticipantStatusParticipating{} + + _ PremiumGiveawayParticipantStatusClass = &PremiumGiveawayParticipantStatusParticipating{} +) + +func (p *PremiumGiveawayParticipantStatusParticipating) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParticipantStatusParticipating) String() string { + if p == nil { + return "PremiumGiveawayParticipantStatusParticipating(nil)" + } + type Alias PremiumGiveawayParticipantStatusParticipating + return fmt.Sprintf("PremiumGiveawayParticipantStatusParticipating%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParticipantStatusParticipating) TypeID() uint32 { + return PremiumGiveawayParticipantStatusParticipatingTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParticipantStatusParticipating) TypeName() string { + return "premiumGiveawayParticipantStatusParticipating" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParticipantStatusParticipating) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParticipantStatusParticipating", + ID: PremiumGiveawayParticipantStatusParticipatingTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayParticipantStatusParticipating) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusParticipating#740406d1 as nil") + } + b.PutID(PremiumGiveawayParticipantStatusParticipatingTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayParticipantStatusParticipating) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusParticipating#740406d1 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayParticipantStatusParticipating) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusParticipating#740406d1 to nil") + } + if err := b.ConsumeID(PremiumGiveawayParticipantStatusParticipatingTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusParticipating#740406d1: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayParticipantStatusParticipating) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusParticipating#740406d1 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayParticipantStatusParticipating) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusParticipating#740406d1 as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayParticipantStatusParticipating") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayParticipantStatusParticipating) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusParticipating#740406d1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayParticipantStatusParticipating"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusParticipating#740406d1: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumGiveawayParticipantStatusAlreadyWasMember represents TL type `premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3`. +type PremiumGiveawayParticipantStatusAlreadyWasMember struct { + // Point in time (Unix timestamp) when the user joined the chat + JoinedChatDate int32 +} + +// PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID is TL type id of PremiumGiveawayParticipantStatusAlreadyWasMember. +const PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID = 0x8d3045a3 + +// construct implements constructor of PremiumGiveawayParticipantStatusClass. +func (p PremiumGiveawayParticipantStatusAlreadyWasMember) construct() PremiumGiveawayParticipantStatusClass { + return &p +} + +// Ensuring interfaces in compile-time for PremiumGiveawayParticipantStatusAlreadyWasMember. +var ( + _ bin.Encoder = &PremiumGiveawayParticipantStatusAlreadyWasMember{} + _ bin.Decoder = &PremiumGiveawayParticipantStatusAlreadyWasMember{} + _ bin.BareEncoder = &PremiumGiveawayParticipantStatusAlreadyWasMember{} + _ bin.BareDecoder = &PremiumGiveawayParticipantStatusAlreadyWasMember{} + + _ PremiumGiveawayParticipantStatusClass = &PremiumGiveawayParticipantStatusAlreadyWasMember{} +) + +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) Zero() bool { + if p == nil { + return true + } + if !(p.JoinedChatDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) String() string { + if p == nil { + return "PremiumGiveawayParticipantStatusAlreadyWasMember(nil)" + } + type Alias PremiumGiveawayParticipantStatusAlreadyWasMember + return fmt.Sprintf("PremiumGiveawayParticipantStatusAlreadyWasMember%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) TypeID() uint32 { + return PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) TypeName() string { + return "premiumGiveawayParticipantStatusAlreadyWasMember" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParticipantStatusAlreadyWasMember", + ID: PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "JoinedChatDate", + SchemaName: "joined_chat_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 as nil") + } + b.PutID(PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 as nil") + } + b.PutInt32(p.JoinedChatDate) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 to nil") + } + if err := b.ConsumeID(PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3: field joined_chat_date: %w", err) + } + p.JoinedChatDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayParticipantStatusAlreadyWasMember") + b.Comma() + b.FieldStart("joined_chat_date") + b.PutInt32(p.JoinedChatDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayParticipantStatusAlreadyWasMember"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3: %w", err) + } + case "joined_chat_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3: field joined_chat_date: %w", err) + } + p.JoinedChatDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetJoinedChatDate returns value of JoinedChatDate field. +func (p *PremiumGiveawayParticipantStatusAlreadyWasMember) GetJoinedChatDate() (value int32) { + if p == nil { + return + } + return p.JoinedChatDate +} + +// PremiumGiveawayParticipantStatusAdministrator represents TL type `premiumGiveawayParticipantStatusAdministrator#7244dace`. +type PremiumGiveawayParticipantStatusAdministrator struct { + // Identifier of the chat administered by the user + ChatID int64 +} + +// PremiumGiveawayParticipantStatusAdministratorTypeID is TL type id of PremiumGiveawayParticipantStatusAdministrator. +const PremiumGiveawayParticipantStatusAdministratorTypeID = 0x7244dace + +// construct implements constructor of PremiumGiveawayParticipantStatusClass. +func (p PremiumGiveawayParticipantStatusAdministrator) construct() PremiumGiveawayParticipantStatusClass { + return &p +} + +// Ensuring interfaces in compile-time for PremiumGiveawayParticipantStatusAdministrator. +var ( + _ bin.Encoder = &PremiumGiveawayParticipantStatusAdministrator{} + _ bin.Decoder = &PremiumGiveawayParticipantStatusAdministrator{} + _ bin.BareEncoder = &PremiumGiveawayParticipantStatusAdministrator{} + _ bin.BareDecoder = &PremiumGiveawayParticipantStatusAdministrator{} + + _ PremiumGiveawayParticipantStatusClass = &PremiumGiveawayParticipantStatusAdministrator{} +) + +func (p *PremiumGiveawayParticipantStatusAdministrator) Zero() bool { + if p == nil { + return true + } + if !(p.ChatID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParticipantStatusAdministrator) String() string { + if p == nil { + return "PremiumGiveawayParticipantStatusAdministrator(nil)" + } + type Alias PremiumGiveawayParticipantStatusAdministrator + return fmt.Sprintf("PremiumGiveawayParticipantStatusAdministrator%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParticipantStatusAdministrator) TypeID() uint32 { + return PremiumGiveawayParticipantStatusAdministratorTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParticipantStatusAdministrator) TypeName() string { + return "premiumGiveawayParticipantStatusAdministrator" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParticipantStatusAdministrator) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParticipantStatusAdministrator", + ID: PremiumGiveawayParticipantStatusAdministratorTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAdministrator#7244dace as nil") + } + b.PutID(PremiumGiveawayParticipantStatusAdministratorTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAdministrator#7244dace as nil") + } + b.PutInt53(p.ChatID) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAdministrator#7244dace to nil") + } + if err := b.ConsumeID(PremiumGiveawayParticipantStatusAdministratorTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAdministrator#7244dace: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAdministrator#7244dace to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAdministrator#7244dace: field chat_id: %w", err) + } + p.ChatID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusAdministrator#7244dace as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayParticipantStatusAdministrator") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(p.ChatID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayParticipantStatusAdministrator) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusAdministrator#7244dace to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayParticipantStatusAdministrator"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAdministrator#7244dace: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusAdministrator#7244dace: field chat_id: %w", err) + } + p.ChatID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (p *PremiumGiveawayParticipantStatusAdministrator) GetChatID() (value int64) { + if p == nil { + return + } + return p.ChatID +} + +// PremiumGiveawayParticipantStatusDisallowedCountry represents TL type `premiumGiveawayParticipantStatusDisallowedCountry#89684090`. +type PremiumGiveawayParticipantStatusDisallowedCountry struct { + // A two-letter ISO 3166-1 alpha-2 country code of the user's country + UserCountryCode string +} + +// PremiumGiveawayParticipantStatusDisallowedCountryTypeID is TL type id of PremiumGiveawayParticipantStatusDisallowedCountry. +const PremiumGiveawayParticipantStatusDisallowedCountryTypeID = 0x89684090 + +// construct implements constructor of PremiumGiveawayParticipantStatusClass. +func (p PremiumGiveawayParticipantStatusDisallowedCountry) construct() PremiumGiveawayParticipantStatusClass { + return &p +} + +// Ensuring interfaces in compile-time for PremiumGiveawayParticipantStatusDisallowedCountry. +var ( + _ bin.Encoder = &PremiumGiveawayParticipantStatusDisallowedCountry{} + _ bin.Decoder = &PremiumGiveawayParticipantStatusDisallowedCountry{} + _ bin.BareEncoder = &PremiumGiveawayParticipantStatusDisallowedCountry{} + _ bin.BareDecoder = &PremiumGiveawayParticipantStatusDisallowedCountry{} + + _ PremiumGiveawayParticipantStatusClass = &PremiumGiveawayParticipantStatusDisallowedCountry{} +) + +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) Zero() bool { + if p == nil { + return true + } + if !(p.UserCountryCode == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) String() string { + if p == nil { + return "PremiumGiveawayParticipantStatusDisallowedCountry(nil)" + } + type Alias PremiumGiveawayParticipantStatusDisallowedCountry + return fmt.Sprintf("PremiumGiveawayParticipantStatusDisallowedCountry%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGiveawayParticipantStatusDisallowedCountry) TypeID() uint32 { + return PremiumGiveawayParticipantStatusDisallowedCountryTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGiveawayParticipantStatusDisallowedCountry) TypeName() string { + return "premiumGiveawayParticipantStatusDisallowedCountry" +} + +// TypeInfo returns info about TL type. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumGiveawayParticipantStatusDisallowedCountry", + ID: PremiumGiveawayParticipantStatusDisallowedCountryTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserCountryCode", + SchemaName: "user_country_code", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusDisallowedCountry#89684090 as nil") + } + b.PutID(PremiumGiveawayParticipantStatusDisallowedCountryTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusDisallowedCountry#89684090 as nil") + } + b.PutString(p.UserCountryCode) + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusDisallowedCountry#89684090 to nil") + } + if err := b.ConsumeID(PremiumGiveawayParticipantStatusDisallowedCountryTypeID); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusDisallowedCountry#89684090: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusDisallowedCountry#89684090 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusDisallowedCountry#89684090: field user_country_code: %w", err) + } + p.UserCountryCode = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumGiveawayParticipantStatusDisallowedCountry#89684090 as nil") + } + b.ObjStart() + b.PutID("premiumGiveawayParticipantStatusDisallowedCountry") + b.Comma() + b.FieldStart("user_country_code") + b.PutString(p.UserCountryCode) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumGiveawayParticipantStatusDisallowedCountry#89684090 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumGiveawayParticipantStatusDisallowedCountry"); err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusDisallowedCountry#89684090: %w", err) + } + case "user_country_code": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode premiumGiveawayParticipantStatusDisallowedCountry#89684090: field user_country_code: %w", err) + } + p.UserCountryCode = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserCountryCode returns value of UserCountryCode field. +func (p *PremiumGiveawayParticipantStatusDisallowedCountry) GetUserCountryCode() (value string) { + if p == nil { + return + } + return p.UserCountryCode +} + +// PremiumGiveawayParticipantStatusClassName is schema name of PremiumGiveawayParticipantStatusClass. +const PremiumGiveawayParticipantStatusClassName = "PremiumGiveawayParticipantStatus" + +// PremiumGiveawayParticipantStatusClass represents PremiumGiveawayParticipantStatus generic type. +// +// Example: +// +// g, err := tdapi.DecodePremiumGiveawayParticipantStatus(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.PremiumGiveawayParticipantStatusEligible: // premiumGiveawayParticipantStatusEligible#7ee281c0 +// case *tdapi.PremiumGiveawayParticipantStatusParticipating: // premiumGiveawayParticipantStatusParticipating#740406d1 +// case *tdapi.PremiumGiveawayParticipantStatusAlreadyWasMember: // premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3 +// case *tdapi.PremiumGiveawayParticipantStatusAdministrator: // premiumGiveawayParticipantStatusAdministrator#7244dace +// case *tdapi.PremiumGiveawayParticipantStatusDisallowedCountry: // premiumGiveawayParticipantStatusDisallowedCountry#89684090 +// default: panic(v) +// } +type PremiumGiveawayParticipantStatusClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PremiumGiveawayParticipantStatusClass + + // 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 +} + +// DecodePremiumGiveawayParticipantStatus implements binary de-serialization for PremiumGiveawayParticipantStatusClass. +func DecodePremiumGiveawayParticipantStatus(buf *bin.Buffer) (PremiumGiveawayParticipantStatusClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PremiumGiveawayParticipantStatusEligibleTypeID: + // Decoding premiumGiveawayParticipantStatusEligible#7ee281c0. + v := PremiumGiveawayParticipantStatusEligible{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case PremiumGiveawayParticipantStatusParticipatingTypeID: + // Decoding premiumGiveawayParticipantStatusParticipating#740406d1. + v := PremiumGiveawayParticipantStatusParticipating{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID: + // Decoding premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3. + v := PremiumGiveawayParticipantStatusAlreadyWasMember{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case PremiumGiveawayParticipantStatusAdministratorTypeID: + // Decoding premiumGiveawayParticipantStatusAdministrator#7244dace. + v := PremiumGiveawayParticipantStatusAdministrator{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case PremiumGiveawayParticipantStatusDisallowedCountryTypeID: + // Decoding premiumGiveawayParticipantStatusDisallowedCountry#89684090. + v := PremiumGiveawayParticipantStatusDisallowedCountry{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONPremiumGiveawayParticipantStatus implements binary de-serialization for PremiumGiveawayParticipantStatusClass. +func DecodeTDLibJSONPremiumGiveawayParticipantStatus(buf tdjson.Decoder) (PremiumGiveawayParticipantStatusClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "premiumGiveawayParticipantStatusEligible": + // Decoding premiumGiveawayParticipantStatusEligible#7ee281c0. + v := PremiumGiveawayParticipantStatusEligible{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case "premiumGiveawayParticipantStatusParticipating": + // Decoding premiumGiveawayParticipantStatusParticipating#740406d1. + v := PremiumGiveawayParticipantStatusParticipating{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case "premiumGiveawayParticipantStatusAlreadyWasMember": + // Decoding premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3. + v := PremiumGiveawayParticipantStatusAlreadyWasMember{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case "premiumGiveawayParticipantStatusAdministrator": + // Decoding premiumGiveawayParticipantStatusAdministrator#7244dace. + v := PremiumGiveawayParticipantStatusAdministrator{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + case "premiumGiveawayParticipantStatusDisallowedCountry": + // Decoding premiumGiveawayParticipantStatusDisallowedCountry#89684090. + v := PremiumGiveawayParticipantStatusDisallowedCountry{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// PremiumGiveawayParticipantStatus boxes the PremiumGiveawayParticipantStatusClass providing a helper. +type PremiumGiveawayParticipantStatusBox struct { + PremiumGiveawayParticipantStatus PremiumGiveawayParticipantStatusClass +} + +// Decode implements bin.Decoder for PremiumGiveawayParticipantStatusBox. +func (b *PremiumGiveawayParticipantStatusBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusBox to nil") + } + v, err := DecodePremiumGiveawayParticipantStatus(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumGiveawayParticipantStatus = v + return nil +} + +// Encode implements bin.Encode for PremiumGiveawayParticipantStatusBox. +func (b *PremiumGiveawayParticipantStatusBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PremiumGiveawayParticipantStatus == nil { + return fmt.Errorf("unable to encode PremiumGiveawayParticipantStatusClass as nil") + } + return b.PremiumGiveawayParticipantStatus.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for PremiumGiveawayParticipantStatusBox. +func (b *PremiumGiveawayParticipantStatusBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumGiveawayParticipantStatusBox to nil") + } + v, err := DecodeTDLibJSONPremiumGiveawayParticipantStatus(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumGiveawayParticipantStatus = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for PremiumGiveawayParticipantStatusBox. +func (b *PremiumGiveawayParticipantStatusBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.PremiumGiveawayParticipantStatus == nil { + return fmt.Errorf("unable to encode PremiumGiveawayParticipantStatusClass as nil") + } + return b.PremiumGiveawayParticipantStatus.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_prepaid_premium_giveaway_gen.go b/tdapi/tl_prepaid_premium_giveaway_gen.go new file mode 100644 index 0000000000..4cceb6abb2 --- /dev/null +++ b/tdapi/tl_prepaid_premium_giveaway_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{} +) + +// PrepaidPremiumGiveaway represents TL type `prepaidPremiumGiveaway#6bd53140`. +type PrepaidPremiumGiveaway struct { + // Unique identifier of the prepaid giveaway + 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 + MonthCount int32 + // Point in time (Unix timestamp) when the giveaway was paid + PaymentDate int32 +} + +// PrepaidPremiumGiveawayTypeID is TL type id of PrepaidPremiumGiveaway. +const PrepaidPremiumGiveawayTypeID = 0x6bd53140 + +// Ensuring interfaces in compile-time for PrepaidPremiumGiveaway. +var ( + _ bin.Encoder = &PrepaidPremiumGiveaway{} + _ bin.Decoder = &PrepaidPremiumGiveaway{} + _ bin.BareEncoder = &PrepaidPremiumGiveaway{} + _ bin.BareDecoder = &PrepaidPremiumGiveaway{} +) + +func (p *PrepaidPremiumGiveaway) Zero() bool { + if p == nil { + return true + } + if !(p.ID == 0) { + return false + } + if !(p.WinnerCount == 0) { + return false + } + if !(p.MonthCount == 0) { + return false + } + if !(p.PaymentDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PrepaidPremiumGiveaway) String() string { + if p == nil { + return "PrepaidPremiumGiveaway(nil)" + } + type Alias PrepaidPremiumGiveaway + return fmt.Sprintf("PrepaidPremiumGiveaway%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PrepaidPremiumGiveaway) TypeID() uint32 { + return PrepaidPremiumGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*PrepaidPremiumGiveaway) TypeName() string { + return "prepaidPremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (p *PrepaidPremiumGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "prepaidPremiumGiveaway", + ID: PrepaidPremiumGiveawayTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "PaymentDate", + SchemaName: "payment_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PrepaidPremiumGiveaway) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode prepaidPremiumGiveaway#6bd53140 as nil") + } + b.PutID(PrepaidPremiumGiveawayTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PrepaidPremiumGiveaway) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode prepaidPremiumGiveaway#6bd53140 as nil") + } + b.PutLong(p.ID) + b.PutInt32(p.WinnerCount) + b.PutInt32(p.MonthCount) + b.PutInt32(p.PaymentDate) + return nil +} + +// Decode implements bin.Decoder. +func (p *PrepaidPremiumGiveaway) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode prepaidPremiumGiveaway#6bd53140 to nil") + } + if err := b.ConsumeID(PrepaidPremiumGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PrepaidPremiumGiveaway) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode prepaidPremiumGiveaway#6bd53140 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field id: %w", err) + } + p.ID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field winner_count: %w", err) + } + p.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field month_count: %w", err) + } + p.MonthCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field payment_date: %w", err) + } + p.PaymentDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PrepaidPremiumGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode prepaidPremiumGiveaway#6bd53140 as nil") + } + b.ObjStart() + b.PutID("prepaidPremiumGiveaway") + b.Comma() + b.FieldStart("id") + b.PutLong(p.ID) + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(p.WinnerCount) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(p.MonthCount) + b.Comma() + b.FieldStart("payment_date") + b.PutInt32(p.PaymentDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PrepaidPremiumGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode prepaidPremiumGiveaway#6bd53140 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("prepaidPremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: %w", err) + } + case "id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field id: %w", err) + } + p.ID = value + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field winner_count: %w", err) + } + p.WinnerCount = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field month_count: %w", err) + } + p.MonthCount = value + case "payment_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode prepaidPremiumGiveaway#6bd53140: field payment_date: %w", err) + } + p.PaymentDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetID returns value of ID field. +func (p *PrepaidPremiumGiveaway) GetID() (value int64) { + if p == nil { + return + } + return p.ID +} + +// GetWinnerCount returns value of WinnerCount field. +func (p *PrepaidPremiumGiveaway) GetWinnerCount() (value int32) { + if p == nil { + return + } + return p.WinnerCount +} + +// GetMonthCount returns value of MonthCount field. +func (p *PrepaidPremiumGiveaway) GetMonthCount() (value int32) { + if p == nil { + return + } + return p.MonthCount +} + +// GetPaymentDate returns value of PaymentDate field. +func (p *PrepaidPremiumGiveaway) GetPaymentDate() (value int32) { + if p == nil { + return + } + return p.PaymentDate +} diff --git a/tdapi/tl_push_message_content_gen.go b/tdapi/tl_push_message_content_gen.go index ac4474bbe4..7a498fda41 100644 --- a/tdapi/tl_push_message_content_gen.go +++ b/tdapi/tl_push_message_content_gen.go @@ -2498,6 +2498,408 @@ func (p *PushMessageContentPoll) GetIsPinned() (value bool) { return p.IsPinned } +// PushMessageContentPremiumGiftCode represents TL type `pushMessageContentPremiumGiftCode#18a15025`. +type PushMessageContentPremiumGiftCode struct { + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 +} + +// PushMessageContentPremiumGiftCodeTypeID is TL type id of PushMessageContentPremiumGiftCode. +const PushMessageContentPremiumGiftCodeTypeID = 0x18a15025 + +// construct implements constructor of PushMessageContentClass. +func (p PushMessageContentPremiumGiftCode) construct() PushMessageContentClass { return &p } + +// Ensuring interfaces in compile-time for PushMessageContentPremiumGiftCode. +var ( + _ bin.Encoder = &PushMessageContentPremiumGiftCode{} + _ bin.Decoder = &PushMessageContentPremiumGiftCode{} + _ bin.BareEncoder = &PushMessageContentPremiumGiftCode{} + _ bin.BareDecoder = &PushMessageContentPremiumGiftCode{} + + _ PushMessageContentClass = &PushMessageContentPremiumGiftCode{} +) + +func (p *PushMessageContentPremiumGiftCode) Zero() bool { + if p == nil { + return true + } + if !(p.MonthCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PushMessageContentPremiumGiftCode) String() string { + if p == nil { + return "PushMessageContentPremiumGiftCode(nil)" + } + type Alias PushMessageContentPremiumGiftCode + return fmt.Sprintf("PushMessageContentPremiumGiftCode%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PushMessageContentPremiumGiftCode) TypeID() uint32 { + return PushMessageContentPremiumGiftCodeTypeID +} + +// TypeName returns name of type in TL schema. +func (*PushMessageContentPremiumGiftCode) TypeName() string { + return "pushMessageContentPremiumGiftCode" +} + +// TypeInfo returns info about TL type. +func (p *PushMessageContentPremiumGiftCode) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "pushMessageContentPremiumGiftCode", + ID: PushMessageContentPremiumGiftCodeTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "MonthCount", + SchemaName: "month_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PushMessageContentPremiumGiftCode) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiftCode#18a15025 as nil") + } + b.PutID(PushMessageContentPremiumGiftCodeTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PushMessageContentPremiumGiftCode) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiftCode#18a15025 as nil") + } + b.PutInt32(p.MonthCount) + return nil +} + +// Decode implements bin.Decoder. +func (p *PushMessageContentPremiumGiftCode) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiftCode#18a15025 to nil") + } + if err := b.ConsumeID(PushMessageContentPremiumGiftCodeTypeID); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiftCode#18a15025: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PushMessageContentPremiumGiftCode) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiftCode#18a15025 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiftCode#18a15025: field month_count: %w", err) + } + p.MonthCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PushMessageContentPremiumGiftCode) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiftCode#18a15025 as nil") + } + b.ObjStart() + b.PutID("pushMessageContentPremiumGiftCode") + b.Comma() + b.FieldStart("month_count") + b.PutInt32(p.MonthCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PushMessageContentPremiumGiftCode) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiftCode#18a15025 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("pushMessageContentPremiumGiftCode"); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiftCode#18a15025: %w", err) + } + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiftCode#18a15025: field month_count: %w", err) + } + p.MonthCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetMonthCount returns value of MonthCount field. +func (p *PushMessageContentPremiumGiftCode) GetMonthCount() (value int32) { + if p == nil { + return + } + return p.MonthCount +} + +// PushMessageContentPremiumGiveaway represents TL type `pushMessageContentPremiumGiveaway#57d26df1`. +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 + // activation; 0 for pinned message + MonthCount int32 + // True, if the message is a pinned message with the specified content + IsPinned bool +} + +// PushMessageContentPremiumGiveawayTypeID is TL type id of PushMessageContentPremiumGiveaway. +const PushMessageContentPremiumGiveawayTypeID = 0x57d26df1 + +// construct implements constructor of PushMessageContentClass. +func (p PushMessageContentPremiumGiveaway) construct() PushMessageContentClass { return &p } + +// Ensuring interfaces in compile-time for PushMessageContentPremiumGiveaway. +var ( + _ bin.Encoder = &PushMessageContentPremiumGiveaway{} + _ bin.Decoder = &PushMessageContentPremiumGiveaway{} + _ bin.BareEncoder = &PushMessageContentPremiumGiveaway{} + _ bin.BareDecoder = &PushMessageContentPremiumGiveaway{} + + _ PushMessageContentClass = &PushMessageContentPremiumGiveaway{} +) + +func (p *PushMessageContentPremiumGiveaway) Zero() bool { + if p == nil { + return true + } + if !(p.WinnerCount == 0) { + return false + } + if !(p.MonthCount == 0) { + return false + } + if !(p.IsPinned == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PushMessageContentPremiumGiveaway) String() string { + if p == nil { + return "PushMessageContentPremiumGiveaway(nil)" + } + type Alias PushMessageContentPremiumGiveaway + return fmt.Sprintf("PushMessageContentPremiumGiveaway%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PushMessageContentPremiumGiveaway) TypeID() uint32 { + return PushMessageContentPremiumGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*PushMessageContentPremiumGiveaway) TypeName() string { + return "pushMessageContentPremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (p *PushMessageContentPremiumGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "pushMessageContentPremiumGiveaway", + ID: PushMessageContentPremiumGiveawayTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + { + Name: "IsPinned", + SchemaName: "is_pinned", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PushMessageContentPremiumGiveaway) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiveaway#57d26df1 as nil") + } + b.PutID(PushMessageContentPremiumGiveawayTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PushMessageContentPremiumGiveaway) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiveaway#57d26df1 as nil") + } + b.PutInt32(p.WinnerCount) + b.PutInt32(p.MonthCount) + b.PutBool(p.IsPinned) + return nil +} + +// Decode implements bin.Decoder. +func (p *PushMessageContentPremiumGiveaway) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiveaway#57d26df1 to nil") + } + if err := b.ConsumeID(PushMessageContentPremiumGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PushMessageContentPremiumGiveaway) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiveaway#57d26df1 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field winner_count: %w", err) + } + p.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field month_count: %w", err) + } + p.MonthCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field is_pinned: %w", err) + } + p.IsPinned = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PushMessageContentPremiumGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPremiumGiveaway#57d26df1 as nil") + } + b.ObjStart() + b.PutID("pushMessageContentPremiumGiveaway") + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(p.WinnerCount) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(p.MonthCount) + b.Comma() + b.FieldStart("is_pinned") + b.PutBool(p.IsPinned) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PushMessageContentPremiumGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPremiumGiveaway#57d26df1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("pushMessageContentPremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: %w", err) + } + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field winner_count: %w", err) + } + p.WinnerCount = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field month_count: %w", err) + } + p.MonthCount = value + case "is_pinned": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPremiumGiveaway#57d26df1: field is_pinned: %w", err) + } + p.IsPinned = value + default: + return b.Skip() + } + return nil + }) +} + +// GetWinnerCount returns value of WinnerCount field. +func (p *PushMessageContentPremiumGiveaway) GetWinnerCount() (value int32) { + if p == nil { + return + } + return p.WinnerCount +} + +// GetMonthCount returns value of MonthCount field. +func (p *PushMessageContentPremiumGiveaway) GetMonthCount() (value int32) { + if p == nil { + return + } + return p.MonthCount +} + +// GetIsPinned returns value of IsPinned field. +func (p *PushMessageContentPremiumGiveaway) GetIsPinned() (value bool) { + if p == nil { + return + } + return p.IsPinned +} + // PushMessageContentScreenshotTaken represents TL type `pushMessageContentScreenshotTaken#cc51ff9`. type PushMessageContentScreenshotTaken struct { } @@ -6177,6 +6579,8 @@ const PushMessageContentClassName = "PushMessageContent" // case *tdapi.PushMessageContentLocation: // pushMessageContentLocation#b33a97b3 // case *tdapi.PushMessageContentPhoto: // pushMessageContentPhoto#861dc52 // case *tdapi.PushMessageContentPoll: // pushMessageContentPoll#fd5a743a +// case *tdapi.PushMessageContentPremiumGiftCode: // pushMessageContentPremiumGiftCode#18a15025 +// case *tdapi.PushMessageContentPremiumGiveaway: // pushMessageContentPremiumGiveaway#57d26df1 // case *tdapi.PushMessageContentScreenshotTaken: // pushMessageContentScreenshotTaken#cc51ff9 // case *tdapi.PushMessageContentSticker: // pushMessageContentSticker#5c98bdd3 // case *tdapi.PushMessageContentStory: // pushMessageContentStory#996471c9 @@ -6312,6 +6716,20 @@ func DecodePushMessageContent(buf *bin.Buffer) (PushMessageContentClass, error) return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case PushMessageContentPremiumGiftCodeTypeID: + // Decoding pushMessageContentPremiumGiftCode#18a15025. + v := PushMessageContentPremiumGiftCode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil + case PushMessageContentPremiumGiveawayTypeID: + // Decoding pushMessageContentPremiumGiveaway#57d26df1. + v := PushMessageContentPremiumGiveaway{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case PushMessageContentScreenshotTakenTypeID: // Decoding pushMessageContentScreenshotTaken#cc51ff9. v := PushMessageContentScreenshotTaken{} @@ -6548,6 +6966,20 @@ func DecodeTDLibJSONPushMessageContent(buf tdjson.Decoder) (PushMessageContentCl return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case "pushMessageContentPremiumGiftCode": + // Decoding pushMessageContentPremiumGiftCode#18a15025. + v := PushMessageContentPremiumGiftCode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil + case "pushMessageContentPremiumGiveaway": + // Decoding pushMessageContentPremiumGiveaway#57d26df1. + v := PushMessageContentPremiumGiveaway{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case "pushMessageContentScreenshotTaken": // Decoding pushMessageContentScreenshotTaken#cc51ff9. v := PushMessageContentScreenshotTaken{} diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 35549b1723..2ec52209f4 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -155,10 +155,21 @@ func TypesMap() map[uint32]string { ChatAdministratorRightsTypeID: "chatAdministratorRights#5f4f9044", PremiumPaymentOptionTypeID: "premiumPaymentOption#8c0c5fb2", PremiumStatePaymentOptionTypeID: "premiumStatePaymentOption#7d06b579", + PremiumGiftCodePaymentOptionTypeID: "premiumGiftCodePaymentOption#e2f40fef", + PremiumGiftCodePaymentOptionsTypeID: "premiumGiftCodePaymentOptions#97a8cf2e", + PremiumGiftCodeInfoTypeID: "premiumGiftCodeInfo#b88fa8de", + PremiumGiveawayParticipantStatusEligibleTypeID: "premiumGiveawayParticipantStatusEligible#7ee281c0", + PremiumGiveawayParticipantStatusParticipatingTypeID: "premiumGiveawayParticipantStatusParticipating#740406d1", + PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID: "premiumGiveawayParticipantStatusAlreadyWasMember#8d3045a3", + PremiumGiveawayParticipantStatusAdministratorTypeID: "premiumGiveawayParticipantStatusAdministrator#7244dace", + PremiumGiveawayParticipantStatusDisallowedCountryTypeID: "premiumGiveawayParticipantStatusDisallowedCountry#89684090", + PremiumGiveawayInfoOngoingTypeID: "premiumGiveawayInfoOngoing#48d3ce6f", + PremiumGiveawayInfoCompletedTypeID: "premiumGiveawayInfoCompleted#fc8b501b", + AccentColorTypeID: "accentColor#83d57cd6", EmojiStatusTypeID: "emojiStatus#dbd91636", EmojiStatusesTypeID: "emojiStatuses#eaeb9bdc", UsernamesTypeID: "usernames#bf343063", - UserTypeID: "user#956ad2d2", + UserTypeID: "user#e39ad80a", BotInfoTypeID: "botInfo#bfdb89a", UserFullInfoTypeID: "userFullInfo#a53c620b", UsersTypeID: "users#9d955a12", @@ -196,7 +207,7 @@ func TypesMap() map[uint32]string { InviteLinkChatTypeBasicGroupTypeID: "inviteLinkChatTypeBasicGroup#4d43c5ee", InviteLinkChatTypeSupergroupTypeID: "inviteLinkChatTypeSupergroup#3de86758", InviteLinkChatTypeChannelTypeID: "inviteLinkChatTypeChannel#3012ef0b", - ChatInviteLinkInfoTypeID: "chatInviteLinkInfo#c8c16a57", + ChatInviteLinkInfoTypeID: "chatInviteLinkInfo#829e9f23", ChatJoinRequestTypeID: "chatJoinRequest#3897a68", ChatJoinRequestsTypeID: "chatJoinRequests#b2c5fd31", ChatJoinRequestsInfoTypeID: "chatJoinRequestsInfo#6aff5df5", @@ -215,23 +226,25 @@ func TypesMap() map[uint32]string { ChatMessageSendersTypeID: "chatMessageSenders#d80d336", MessageViewerTypeID: "messageViewer#56f111cd", MessageViewersTypeID: "messageViewers#87c73f6c", - MessageForwardOriginUserTypeID: "messageForwardOriginUser#ead478d1", - MessageForwardOriginChatTypeID: "messageForwardOriginChat#5af51364", - MessageForwardOriginHiddenUserTypeID: "messageForwardOriginHiddenUser#efd4eee3", - MessageForwardOriginChannelTypeID: "messageForwardOriginChannel#58dabee3", + MessageOriginUserTypeID: "messageOriginUser#9c009043", + MessageOriginHiddenUserTypeID: "messageOriginHiddenUser#ed0c23da", + MessageOriginChatTypeID: "messageOriginChat#f3bb5eb4", + MessageOriginChannelTypeID: "messageOriginChannel#a97b51be", ReactionTypeEmojiTypeID: "reactionTypeEmoji#8c3e22c8", ReactionTypeCustomEmojiTypeID: "reactionTypeCustomEmoji#c50b42f3", - MessageForwardInfoTypeID: "messageForwardInfo#ec7dcac8", + MessageForwardInfoTypeID: "messageForwardInfo#f22bdd30", MessageImportInfoTypeID: "messageImportInfo#e6dfabcf", MessageReplyInfoTypeID: "messageReplyInfo#69240cb9", MessageReactionTypeID: "messageReaction#7d9e9864", MessageInteractionInfoTypeID: "messageInteractionInfo#4af275ac", UnreadReactionTypeID: "unreadReaction#8c5b3b82", MessageSendingStatePendingTypeID: "messageSendingStatePending#f32b63b4", - MessageSendingStateFailedTypeID: "messageSendingStateFailed#fb75b2af", - MessageReplyToMessageTypeID: "messageReplyToMessage#deb02f02", + MessageSendingStateFailedTypeID: "messageSendingStateFailed#ac81ee5e", + MessageReplyToMessageTypeID: "messageReplyToMessage#1bb65082", MessageReplyToStoryTypeID: "messageReplyToStory#708ca939", - MessageTypeID: "message#12947545", + InputMessageReplyToMessageTypeID: "inputMessageReplyToMessage#20b16f06", + InputMessageReplyToStoryTypeID: "inputMessageReplyToStory#51aece78", + MessageTypeID: "message#5aa8fa7e", MessagesTypeID: "messages#b34c8c60", FoundMessagesTypeID: "foundMessages#2515f708", FoundChatMessagesTypeID: "foundChatMessages#4a25270c", @@ -264,7 +277,7 @@ func TypesMap() map[uint32]string { NotificationSettingsScopeChannelChatsTypeID: "notificationSettingsScopeChannelChats#20aa0588", ChatNotificationSettingsTypeID: "chatNotificationSettings#dddc12cf", ScopeNotificationSettingsTypeID: "scopeNotificationSettings#dc4a615f", - DraftMessageTypeID: "draftMessage#51d71500", + DraftMessageTypeID: "draftMessage#f67c6a5c", ChatTypePrivateTypeID: "chatTypePrivate#5e1e6374", ChatTypeBasicGroupTypeID: "chatTypeBasicGroup#3a0c4c5c", ChatTypeSupergroupTypeID: "chatTypeSupergroup#a83a5a6a", @@ -288,7 +301,7 @@ func TypesMap() map[uint32]string { ChatAvailableReactionsAllTypeID: "chatAvailableReactionsAll#dff07c4e", ChatAvailableReactionsSomeTypeID: "chatAvailableReactionsSome#d3cc0a6b", VideoChatTypeID: "videoChat#ae158d28", - ChatTypeID: "chat#3f50a728", + ChatTypeID: "chat#5a9e2993", ChatsTypeID: "chats#9b93e3eb", ChatNearbyTypeID: "chatNearby#2de4255", ChatsNearbyTypeID: "chatsNearby#cc744cff", @@ -325,13 +338,14 @@ func TypesMap() map[uint32]string { ReplyMarkupInlineKeyboardTypeID: "replyMarkupInlineKeyboard#92ac0efb", LoginURLInfoOpenTypeID: "loginUrlInfoOpen#31e7ea02", LoginURLInfoRequestConfirmationTypeID: "loginUrlInfoRequestConfirmation#7edb242f", - FoundWebAppTypeID: "foundWebApp#2b8136d4", + FoundWebAppTypeID: "foundWebApp#eea8d01e", WebAppInfoTypeID: "webAppInfo#2efdb2e8", MessageThreadInfoTypeID: "messageThreadInfo#683fd5ad", ForumTopicIconTypeID: "forumTopicIcon#cf32a193", ForumTopicInfoTypeID: "forumTopicInfo#8ff3df9e", ForumTopicTypeID: "forumTopic#1213ace6", ForumTopicsTypeID: "forumTopics#2d99b4ae", + LinkPreviewOptionsTypeID: "linkPreviewOptions#3e61b3f3", RichTextPlainTypeID: "richTextPlain#1cc42966", RichTextBoldTypeID: "richTextBold#63970f6c", RichTextItalicTypeID: "richTextItalic#6e77f03f", @@ -383,20 +397,20 @@ func TypesMap() map[uint32]string { PageBlockEmbeddedPostTypeID: "pageBlockEmbeddedPost#bc57cdf5", PageBlockCollageTypeID: "pageBlockCollage#40bcaaf0", PageBlockSlideshowTypeID: "pageBlockSlideshow#1107d496", - PageBlockChatLinkTypeID: "pageBlockChatLink#f3f4550b", + PageBlockChatLinkTypeID: "pageBlockChatLink#621ed8bb", PageBlockTableTypeID: "pageBlockTable#cc6352c3", PageBlockDetailsTypeID: "pageBlockDetails#990a0c0b", PageBlockRelatedArticlesTypeID: "pageBlockRelatedArticles#936d81e6", PageBlockMapTypeID: "pageBlockMap#5a0f7013", WebPageInstantViewTypeID: "webPageInstantView#2c0ec99c", - WebPageTypeID: "webPage#1ab72e80", + WebPageTypeID: "webPage#dafbc3a4", CountryInfoTypeID: "countryInfo#d9936dff", CountriesTypeID: "countries#94b50e0f", PhoneNumberInfoTypeID: "phoneNumberInfo#d2c398a1", BankCardActionOpenURLTypeID: "bankCardActionOpenUrl#f44a5885", BankCardInfoTypeID: "bankCardInfo#2bc7da9f", AddressTypeID: "address#86304f3a", - ThemeParametersTypeID: "themeParameters#d990fe6e", + ThemeParametersTypeID: "themeParameters#af3f42fc", LabeledPricePartTypeID: "labeledPricePart#20f2e726", InvoiceTypeID: "invoice#c19b2377", OrderInfoTypeID: "orderInfo#2ebad96e", @@ -416,10 +430,12 @@ func TypesMap() map[uint32]string { PaymentReceiptTypeID: "paymentReceipt#e819e6c1", InputInvoiceMessageTypeID: "inputInvoiceMessage#58dcea10", InputInvoiceNameTypeID: "inputInvoiceName#b1ca16f3", + InputInvoiceTelegramTypeID: "inputInvoiceTelegram#96ecfeed", MessageExtendedMediaPreviewTypeID: "messageExtendedMediaPreview#7703a347", MessageExtendedMediaPhotoTypeID: "messageExtendedMediaPhoto#c68b4530", MessageExtendedMediaVideoTypeID: "messageExtendedMediaVideo#11acbf3b", MessageExtendedMediaUnsupportedTypeID: "messageExtendedMediaUnsupported#141f5020", + PremiumGiveawayParametersTypeID: "premiumGiveawayParameters#de917baf", DatedFileTypeID: "datedFile#9247b09d", PassportElementTypePersonalDetailsTypeID: "passportElementTypePersonalDetails#c27ad953", PassportElementTypePassportTypeID: "passportElementTypePassport#e5fdab48", @@ -493,7 +509,7 @@ func TypesMap() map[uint32]string { InputPassportElementErrorSourceFileTypeID: "inputPassportElementErrorSourceFile#ee355dcb", InputPassportElementErrorSourceFilesTypeID: "inputPassportElementErrorSourceFiles#673401d6", InputPassportElementErrorTypeID: "inputPassportElementError#11084de2", - MessageTextTypeID: "messageText#768e4f93", + MessageTextTypeID: "messageText#c13562aa", MessageAnimationTypeID: "messageAnimation#3eb366fc", MessageAudioTypeID: "messageAudio#107e741c", MessageDocumentTypeID: "messageDocument#2394ab77", @@ -544,6 +560,9 @@ func TypesMap() map[uint32]string { MessagePaymentSuccessfulTypeID: "messagePaymentSuccessful#53d93cdc", MessagePaymentSuccessfulBotTypeID: "messagePaymentSuccessfulBot#68e13eb9", MessageGiftedPremiumTypeID: "messageGiftedPremium#78d1d0a", + MessagePremiumGiftCodeTypeID: "messagePremiumGiftCode#7a9c468f", + MessagePremiumGiveawayCreatedTypeID: "messagePremiumGiveawayCreated#270f2c44", + MessagePremiumGiveawayTypeID: "messagePremiumGiveaway#4aa0d0b0", MessageContactRegisteredTypeID: "messageContactRegistered#a678fcff", MessageUserSharedTypeID: "messageUserShared#d4dcb77c", MessageChatSharedTypeID: "messageChatShared#22db7091", @@ -570,6 +589,7 @@ func TypesMap() map[uint32]string { TextEntityTypeCodeTypeID: "textEntityTypeCode#c5e9c94a", TextEntityTypePreTypeID: "textEntityTypePre#62491c8e", TextEntityTypePreCodeTypeID: "textEntityTypePreCode#c7a77aab", + TextEntityTypeBlockQuoteTypeID: "textEntityTypeBlockQuote#c42830c8", TextEntityTypeTextURLTypeID: "textEntityTypeTextUrl#1a912463", TextEntityTypeMentionNameTypeID: "textEntityTypeMentionName#a25cd5af", TextEntityTypeCustomEmojiTypeID: "textEntityTypeCustomEmoji#66ceacc5", @@ -579,9 +599,9 @@ func TypesMap() map[uint32]string { MessageSchedulingStateSendWhenOnlineTypeID: "messageSchedulingStateSendWhenOnline#7cbfd808", MessageSelfDestructTypeTimerTypeID: "messageSelfDestructTypeTimer#508d57cd", MessageSelfDestructTypeImmediatelyTypeID: "messageSelfDestructTypeImmediately#c23c9005", - MessageSendOptionsTypeID: "messageSendOptions#1f60b9e", + MessageSendOptionsTypeID: "messageSendOptions#9cca9fb3", MessageCopyOptionsTypeID: "messageCopyOptions#48076039", - InputMessageTextTypeID: "inputMessageText#eb9b098", + InputMessageTextTypeID: "inputMessageText#f350d894", InputMessageAnimationTypeID: "inputMessageAnimation#cd68f5fe", InputMessageAudioTypeID: "inputMessageAudio#daa400b2", InputMessageDocumentTypeID: "inputMessageDocument#615b72b9", @@ -639,8 +659,8 @@ func TypesMap() map[uint32]string { UserStatusLastMonthTypeID: "userStatusLastMonth#77ebc742", StickersTypeID: "stickers#83491d00", EmojisTypeID: "emojis#77274a16", - StickerSetTypeID: "stickerSet#2e5aef95", - StickerSetInfoTypeID: "stickerSetInfo#bdeedde0", + StickerSetTypeID: "stickerSet#ac3cff8b", + StickerSetInfoTypeID: "stickerSetInfo#cbbbedfd", StickerSetsTypeID: "stickerSets#b8a6490d", TrendingStickerSetsTypeID: "trendingStickerSets#298f12cc", EmojiCategoryTypeID: "emojiCategory#c6e9e5a4", @@ -674,9 +694,15 @@ func TypesMap() map[uint32]string { StoriesTypeID: "stories#5a860711", StoryInfoTypeID: "storyInfo#8997c352", ChatActiveStoriesTypeID: "chatActiveStories#d923d773", - ChatBoostStatusTypeID: "chatBoostStatus#dc02a4b2", - ChatBoostTypeID: "chatBoost#8d029d82", + ChatBoostSourceGiftCodeTypeID: "chatBoostSourceGiftCode#fa2412ba", + ChatBoostSourceGiveawayTypeID: "chatBoostSourceGiveaway#90d1c70", + ChatBoostSourcePremiumTypeID: "chatBoostSourcePremium#ed4eb", + PrepaidPremiumGiveawayTypeID: "prepaidPremiumGiveaway#6bd53140", + ChatBoostStatusTypeID: "chatBoostStatus#a5007413", + ChatBoostTypeID: "chatBoost#96bfccb2", FoundChatBoostsTypeID: "foundChatBoosts#dc80d52e", + ChatBoostSlotTypeID: "chatBoostSlot#757fac7", + ChatBoostSlotsTypeID: "chatBoostSlots#6859c79", CallDiscardReasonEmptyTypeID: "callDiscardReasonEmpty#b4f66fc3", CallDiscardReasonMissedTypeID: "callDiscardReasonMissed#64283a7c", CallDiscardReasonDeclinedTypeID: "callDiscardReasonDeclined#98e36c32", @@ -731,7 +757,7 @@ func TypesMap() map[uint32]string { SpeechRecognitionResultTextTypeID: "speechRecognitionResultText#80e681dd", SpeechRecognitionResultErrorTypeID: "speechRecognitionResultError#9d243fc", AttachmentMenuBotColorTypeID: "attachmentMenuBotColor#64235ebc", - AttachmentMenuBotTypeID: "attachmentMenuBot#2176d831", + AttachmentMenuBotTypeID: "attachmentMenuBot#b96e1bbf", SentWebAppMessageTypeID: "sentWebAppMessage#4a24eec0", BotWriteAccessAllowReasonConnectedWebsiteTypeID: "botWriteAccessAllowReasonConnectedWebsite#782eafe3", BotWriteAccessAllowReasonAddedToAttachmentMenuTypeID: "botWriteAccessAllowReasonAddedToAttachmentMenu#828b5f9d", @@ -798,6 +824,8 @@ func TypesMap() map[uint32]string { ChatEventTitleChangedTypeID: "chatEventTitleChanged#43990ad2", ChatEventUsernameChangedTypeID: "chatEventUsernameChanged#6707b56b", ChatEventActiveUsernamesChangedTypeID: "chatEventActiveUsernamesChanged#95e54656", + ChatEventAccentColorChangedTypeID: "chatEventAccentColorChanged#2a327e32", + ChatEventBackgroundCustomEmojiChangedTypeID: "chatEventBackgroundCustomEmojiChanged#d2671e9a", ChatEventHasProtectedContentToggledTypeID: "chatEventHasProtectedContentToggled#f5044201", ChatEventInvitesToggledTypeID: "chatEventInvitesToggled#fc45966b", ChatEventIsAllHistoryAvailableToggledTypeID: "chatEventIsAllHistoryAvailableToggled#a0b03c15", @@ -862,6 +890,7 @@ func TypesMap() map[uint32]string { PremiumFeatureRealTimeChatTranslationTypeID: "premiumFeatureRealTimeChatTranslation#bbd80280", PremiumFeatureUpgradedStoriesTypeID: "premiumFeatureUpgradedStories#9008051b", PremiumFeatureChatBoostTypeID: "premiumFeatureChatBoost#5df89f1b", + PremiumFeatureAccentColorTypeID: "premiumFeatureAccentColor#361ac59e", PremiumStoryFeaturePriorityOrderTypeID: "premiumStoryFeaturePriorityOrder#8ff172c7", PremiumStoryFeatureStealthModeTypeID: "premiumStoryFeatureStealthMode#47343da4", PremiumStoryFeaturePermanentViewsHistoryTypeID: "premiumStoryFeaturePermanentViewsHistory#c2a047a0", @@ -879,6 +908,10 @@ func TypesMap() map[uint32]string { PremiumStateTypeID: "premiumState#fd42d2cd", StorePaymentPurposePremiumSubscriptionTypeID: "storePaymentPurposePremiumSubscription#4b558114", StorePaymentPurposeGiftedPremiumTypeID: "storePaymentPurposeGiftedPremium#7240c0d1", + StorePaymentPurposePremiumGiftCodesTypeID: "storePaymentPurposePremiumGiftCodes#9e11cf42", + StorePaymentPurposePremiumGiveawayTypeID: "storePaymentPurposePremiumGiveaway#504790d9", + TelegramPaymentPurposePremiumGiftCodesTypeID: "telegramPaymentPurposePremiumGiftCodes#91009cc", + TelegramPaymentPurposePremiumGiveawayTypeID: "telegramPaymentPurposePremiumGiveaway#bfd4a227", DeviceTokenFirebaseCloudMessagingTypeID: "deviceTokenFirebaseCloudMessaging#d0714a07", DeviceTokenApplePushTypeID: "deviceTokenApplePush#17196bc3", DeviceTokenApplePushVoIPTypeID: "deviceTokenApplePushVoIP#2ff045e9", @@ -910,12 +943,6 @@ func TypesMap() map[uint32]string { CanSendStoryResultActiveStoryLimitExceededTypeID: "canSendStoryResultActiveStoryLimitExceeded#afd9aad6", CanSendStoryResultWeeklyLimitExceededTypeID: "canSendStoryResultWeeklyLimitExceeded#1341a0b8", CanSendStoryResultMonthlyLimitExceededTypeID: "canSendStoryResultMonthlyLimitExceeded#dd8242d5", - CanBoostChatResultOkTypeID: "canBoostChatResultOk#1da13a8b", - CanBoostChatResultInvalidChatTypeID: "canBoostChatResultInvalidChat#3d4c3668", - CanBoostChatResultAlreadyBoostedTypeID: "canBoostChatResultAlreadyBoosted#3e012a69", - CanBoostChatResultPremiumNeededTypeID: "canBoostChatResultPremiumNeeded#d4b4e4f", - CanBoostChatResultPremiumSubscriptionNeededTypeID: "canBoostChatResultPremiumSubscriptionNeeded#7550d3cc", - CanBoostChatResultWaitNeededTypeID: "canBoostChatResultWaitNeeded#343aaeaa", CanTransferOwnershipResultOkTypeID: "canTransferOwnershipResultOk#faa48643", CanTransferOwnershipResultPasswordNeededTypeID: "canTransferOwnershipResultPasswordNeeded#5c4a4adf", CanTransferOwnershipResultPasswordTooFreshTypeID: "canTransferOwnershipResultPasswordTooFresh#305d9b11", @@ -947,6 +974,8 @@ func TypesMap() map[uint32]string { PushMessageContentLocationTypeID: "pushMessageContentLocation#b33a97b3", PushMessageContentPhotoTypeID: "pushMessageContentPhoto#861dc52", PushMessageContentPollTypeID: "pushMessageContentPoll#fd5a743a", + PushMessageContentPremiumGiftCodeTypeID: "pushMessageContentPremiumGiftCode#18a15025", + PushMessageContentPremiumGiveawayTypeID: "pushMessageContentPremiumGiveaway#57d26df1", PushMessageContentScreenshotTakenTypeID: "pushMessageContentScreenshotTaken#cc51ff9", PushMessageContentStickerTypeID: "pushMessageContentSticker#5c98bdd3", PushMessageContentStoryTypeID: "pushMessageContentStory#996471c9", @@ -1074,6 +1103,7 @@ func TypesMap() map[uint32]string { InternalLinkTypePassportDataRequestTypeID: "internalLinkTypePassportDataRequest#c50fce81", InternalLinkTypePhoneNumberConfirmationTypeID: "internalLinkTypePhoneNumberConfirmation#68bf6b16", InternalLinkTypePremiumFeaturesTypeID: "internalLinkTypePremiumFeatures#48884f49", + InternalLinkTypePremiumGiftCodeTypeID: "internalLinkTypePremiumGiftCode#de5c9892", InternalLinkTypePrivacyAndSecuritySettingsTypeID: "internalLinkTypePrivacyAndSecuritySettings#ad5f6acf", InternalLinkTypeProxyTypeID: "internalLinkTypeProxy#b1b12cea", InternalLinkTypePublicChatTypeID: "internalLinkTypePublicChat#a774573b", @@ -1151,6 +1181,7 @@ func TypesMap() map[uint32]string { TopChatCategoryInlineBotsTypeID: "topChatCategoryInlineBots#1678eb7c", TopChatCategoryCallsTypeID: "topChatCategoryCalls#153b50dd", TopChatCategoryForwardChatsTypeID: "topChatCategoryForwardChats#6515b7d5", + FoundPositionTypeID: "foundPosition#8f8adf88", FoundPositionsTypeID: "foundPositions#afab1f62", TMeURLTypeUserTypeID: "tMeUrlTypeUser#7787c1a", TMeURLTypeSupergroupTypeID: "tMeUrlTypeSupergroup#af5536a8", @@ -1167,944 +1198,969 @@ func TypesMap() map[uint32]string { SuggestedActionUpgradePremiumTypeID: "suggestedActionUpgradePremium#70aa79fb", SuggestedActionRestorePremiumTypeID: "suggestedActionRestorePremium#e909dd64", SuggestedActionSubscribeToAnnualPremiumTypeID: "suggestedActionSubscribeToAnnualPremium#164978bb", - CountTypeID: "count#4d38f104", - TextTypeID: "text#22765898", - SecondsTypeID: "seconds#3936e58e", - FileDownloadedPrefixSizeTypeID: "fileDownloadedPrefixSize#87e267fb", - DeepLinkInfoTypeID: "deepLinkInfo#6f1ba0fe", - TextParseModeMarkdownTypeID: "textParseModeMarkdown#157648bf", - TextParseModeHTMLTypeID: "textParseModeHTML#62f4c5f3", - ProxyTypeSocks5TypeID: "proxyTypeSocks5#caf342b3", - ProxyTypeHTTPTypeID: "proxyTypeHttp#a3c7c777", - ProxyTypeMtprotoTypeID: "proxyTypeMtproto#8ae31ffd", - ProxyTypeID: "proxy#baf7b73", - ProxiesTypeID: "proxies#5ee27a86", - InputStickerTypeID: "inputSticker#e3d1ef79", - DateRangeTypeID: "dateRange#51150c66", - StatisticalValueTypeID: "statisticalValue#626d6a76", - StatisticalGraphDataTypeID: "statisticalGraphData#89732e2c", - StatisticalGraphAsyncTypeID: "statisticalGraphAsync#19fb2b9f", - StatisticalGraphErrorTypeID: "statisticalGraphError#c3fda052", - ChatStatisticsMessageInteractionInfoTypeID: "chatStatisticsMessageInteractionInfo#d25e2a2c", - ChatStatisticsMessageSenderInfoTypeID: "chatStatisticsMessageSenderInfo#690a7e4b", - ChatStatisticsAdministratorActionsInfoTypeID: "chatStatisticsAdministratorActionsInfo#e7c5cd7e", - ChatStatisticsInviterInfoTypeID: "chatStatisticsInviterInfo#2583d48b", - ChatStatisticsSupergroupTypeID: "chatStatisticsSupergroup#c67549ef", - ChatStatisticsChannelTypeID: "chatStatisticsChannel#9be23786", - MessageStatisticsTypeID: "messageStatistics#c3b781b0", - PointTypeID: "point#1a13f5b9", - VectorPathCommandLineTypeID: "vectorPathCommandLine#db663c8a", - VectorPathCommandCubicBezierCurveTypeID: "vectorPathCommandCubicBezierCurve#494c3e3a", - BotCommandScopeDefaultTypeID: "botCommandScopeDefault#2f6cb2ab", - BotCommandScopeAllPrivateChatsTypeID: "botCommandScopeAllPrivateChats#eb716739", - BotCommandScopeAllGroupChatsTypeID: "botCommandScopeAllGroupChats#c585c85e", - BotCommandScopeAllChatAdministratorsTypeID: "botCommandScopeAllChatAdministrators#771c1551", - BotCommandScopeChatTypeID: "botCommandScopeChat#e65b22a5", - BotCommandScopeChatAdministratorsTypeID: "botCommandScopeChatAdministrators#42bcfe4e", - BotCommandScopeChatMemberTypeID: "botCommandScopeChatMember#f36696f2", - UpdateAuthorizationStateTypeID: "updateAuthorizationState#60b30ee2", - UpdateNewMessageTypeID: "updateNewMessage#de6fb20e", - UpdateMessageSendAcknowledgedTypeID: "updateMessageSendAcknowledged#4da7d239", - UpdateMessageSendSucceededTypeID: "updateMessageSendSucceeded#6c399d7d", - UpdateMessageSendFailedTypeID: "updateMessageSendFailed#da1bf8e7", - UpdateMessageContentTypeID: "updateMessageContent#1e36bb24", - UpdateMessageEditedTypeID: "updateMessageEdited#dea602e6", - UpdateMessageIsPinnedTypeID: "updateMessageIsPinned#41bc233d", - UpdateMessageInteractionInfoTypeID: "updateMessageInteractionInfo#ab803bfe", - UpdateMessageContentOpenedTypeID: "updateMessageContentOpened#a55ea885", - UpdateMessageMentionReadTypeID: "updateMessageMentionRead#f0f74d46", - UpdateMessageUnreadReactionsTypeID: "updateMessageUnreadReactions#12a7220a", - UpdateMessageLiveLocationViewedTypeID: "updateMessageLiveLocationViewed#b2058595", - UpdateNewChatTypeID: "updateNewChat#7bb98ccd", - UpdateChatTitleTypeID: "updateChatTitle#f58b85a4", - UpdateChatPhotoTypeID: "updateChatPhoto#eca5423f", - UpdateChatPermissionsTypeID: "updateChatPermissions#9f52176d", - UpdateChatLastMessageTypeID: "updateChatLastMessage#f10cab1d", - UpdateChatPositionTypeID: "updateChatPosition#ff76fa77", - UpdateChatReadInboxTypeID: "updateChatReadInbox#d07036e7", - UpdateChatReadOutboxTypeID: "updateChatReadOutbox#2a385285", - UpdateChatActionBarTypeID: "updateChatActionBar#d9a258c2", - UpdateChatAvailableReactionsTypeID: "updateChatAvailableReactions#8ab413f9", - UpdateChatDraftMessageTypeID: "updateChatDraftMessage#2bf257d4", - UpdateChatMessageSenderTypeID: "updateChatMessageSender#77705241", - UpdateChatMessageAutoDeleteTimeTypeID: "updateChatMessageAutoDeleteTime#71425de5", - UpdateChatNotificationSettingsTypeID: "updateChatNotificationSettings#d020b456", - UpdateChatPendingJoinRequestsTypeID: "updateChatPendingJoinRequests#14c6e3e1", - UpdateChatReplyMarkupTypeID: "updateChatReplyMarkup#4e0ba5a0", - UpdateChatBackgroundTypeID: "updateChatBackground#ff9d38b3", - UpdateChatThemeTypeID: "updateChatTheme#31f3d465", - UpdateChatUnreadMentionCountTypeID: "updateChatUnreadMentionCount#80f47b1c", - UpdateChatUnreadReactionCountTypeID: "updateChatUnreadReactionCount#81603cdd", - UpdateChatVideoChatTypeID: "updateChatVideoChat#25fb4ca6", - UpdateChatDefaultDisableNotificationTypeID: "updateChatDefaultDisableNotification#1ba96a9b", - UpdateChatHasProtectedContentTypeID: "updateChatHasProtectedContent#6b50071b", - UpdateChatIsTranslatableTypeID: "updateChatIsTranslatable#7b031617", - UpdateChatIsMarkedAsUnreadTypeID: "updateChatIsMarkedAsUnread#57853334", - UpdateChatBlockListTypeID: "updateChatBlockList#872af48e", - UpdateChatHasScheduledMessagesTypeID: "updateChatHasScheduledMessages#7b14c2d7", - UpdateChatFoldersTypeID: "updateChatFolders#71a4b3a", - UpdateChatOnlineMemberCountTypeID: "updateChatOnlineMemberCount#1d0caa9d", - UpdateForumTopicInfoTypeID: "updateForumTopicInfo#6b6f2cc9", - UpdateScopeNotificationSettingsTypeID: "updateScopeNotificationSettings#b83ccb73", - UpdateNotificationTypeID: "updateNotification#8ee67ed4", - UpdateNotificationGroupTypeID: "updateNotificationGroup#96cd9e06", - UpdateActiveNotificationsTypeID: "updateActiveNotifications#317d80f2", - UpdateHavePendingNotificationsTypeID: "updateHavePendingNotifications#aaee1db", - UpdateDeleteMessagesTypeID: "updateDeleteMessages#6a05bf9", - UpdateChatActionTypeID: "updateChatAction#9abfd628", - UpdateUserStatusTypeID: "updateUserStatus#39211211", - UpdateUserTypeID: "updateUser#468928f9", - UpdateBasicGroupTypeID: "updateBasicGroup#c433c763", - UpdateSupergroupTypeID: "updateSupergroup#fb6c6524", - UpdateSecretChatTypeID: "updateSecretChat#9ca5132b", - UpdateUserFullInfoTypeID: "updateUserFullInfo#fcf2cb17", - UpdateBasicGroupFullInfoTypeID: "updateBasicGroupFullInfo#52f66bbf", - UpdateSupergroupFullInfoTypeID: "updateSupergroupFullInfo#19f5cd0e", - UpdateServiceNotificationTypeID: "updateServiceNotification#4e9895ad", - UpdateFileTypeID: "updateFile#6cd875f", - UpdateFileGenerationStartTypeID: "updateFileGenerationStart#cec5eec", - UpdateFileGenerationStopTypeID: "updateFileGenerationStop#8f14fdeb", - UpdateFileDownloadsTypeID: "updateFileDownloads#e8cd12c7", - UpdateFileAddedToDownloadsTypeID: "updateFileAddedToDownloads#5ff5921a", - UpdateFileDownloadTypeID: "updateFileDownload#342f83ca", - UpdateFileRemovedFromDownloadsTypeID: "updateFileRemovedFromDownloads#6e7c14e8", - UpdateCallTypeID: "updateCall#4fb3d0dd", - UpdateGroupCallTypeID: "updateGroupCall#30324e00", - UpdateGroupCallParticipantTypeID: "updateGroupCallParticipant#d0213cf9", - UpdateNewCallSignalingDataTypeID: "updateNewCallSignalingData#22c98d8d", - UpdateUserPrivacySettingRulesTypeID: "updateUserPrivacySettingRules#c99552f6", - UpdateUnreadMessageCountTypeID: "updateUnreadMessageCount#4b541c9", - UpdateUnreadChatCountTypeID: "updateUnreadChatCount#76e19242", - UpdateStoryTypeID: "updateStory#1906572f", - UpdateStoryDeletedTypeID: "updateStoryDeleted#7007eb9d", - UpdateStorySendSucceededTypeID: "updateStorySendSucceeded#b9269e57", - UpdateStorySendFailedTypeID: "updateStorySendFailed#e046f199", - UpdateChatActiveStoriesTypeID: "updateChatActiveStories#79786c2c", - UpdateStoryListChatCountTypeID: "updateStoryListChatCount#8833cd3f", - UpdateStoryStealthModeTypeID: "updateStoryStealthMode#6ff7bd1a", - UpdateOptionTypeID: "updateOption#35b17404", - UpdateStickerSetTypeID: "updateStickerSet#70035dcc", - UpdateInstalledStickerSetsTypeID: "updateInstalledStickerSets#82cd5388", - UpdateTrendingStickerSetsTypeID: "updateTrendingStickerSets#4b7a50a7", - UpdateRecentStickersTypeID: "updateRecentStickers#aefdf8dc", - UpdateFavoriteStickersTypeID: "updateFavoriteStickers#113f2b6a", - UpdateSavedAnimationsTypeID: "updateSavedAnimations#1084a1c8", - UpdateSavedNotificationSoundsTypeID: "updateSavedNotificationSounds#5a6653b4", - UpdateSelectedBackgroundTypeID: "updateSelectedBackground#99bd205d", - UpdateChatThemesTypeID: "updateChatThemes#98dc58d5", - UpdateLanguagePackStringsTypeID: "updateLanguagePackStrings#af87919f", - UpdateConnectionStateTypeID: "updateConnectionState#57939e2e", - UpdateTermsOfServiceTypeID: "updateTermsOfService#b23cc55e", - UpdateUsersNearbyTypeID: "updateUsersNearby#97c8ab5", - UpdateUnconfirmedSessionTypeID: "updateUnconfirmedSession#fea6088c", - UpdateAttachmentMenuBotsTypeID: "updateAttachmentMenuBots#b6b910c", - UpdateWebAppMessageSentTypeID: "updateWebAppMessageSent#58431229", - UpdateActiveEmojiReactionsTypeID: "updateActiveEmojiReactions#691ffcb7", - UpdateDefaultReactionTypeTypeID: "updateDefaultReactionType#4b615105", - UpdateDiceEmojisTypeID: "updateDiceEmojis#9d0f91df", - UpdateAnimatedEmojiMessageClickedTypeID: "updateAnimatedEmojiMessageClicked#a3167405", - UpdateAnimationSearchParametersTypeID: "updateAnimationSearchParameters#6016ef01", - UpdateSuggestedActionsTypeID: "updateSuggestedActions#c2e5cccb", - UpdateAddChatMembersPrivacyForbiddenTypeID: "updateAddChatMembersPrivacyForbidden#b8b50363", - UpdateAutosaveSettingsTypeID: "updateAutosaveSettings#da274f0b", - UpdateNewInlineQueryTypeID: "updateNewInlineQuery#7171bf34", - UpdateNewChosenInlineResultTypeID: "updateNewChosenInlineResult#cb4c4f5d", - UpdateNewCallbackQueryTypeID: "updateNewCallbackQuery#8964d05e", - UpdateNewInlineCallbackQueryTypeID: "updateNewInlineCallbackQuery#ecf934ba", - UpdateNewShippingQueryTypeID: "updateNewShippingQuery#29584672", - UpdateNewPreCheckoutQueryTypeID: "updateNewPreCheckoutQuery#2a3871c9", - UpdateNewCustomEventTypeID: "updateNewCustomEvent#76dd6a0c", - UpdateNewCustomQueryTypeID: "updateNewCustomQuery#d702f9a6", - UpdatePollTypeID: "updatePoll#966b73ca", - UpdatePollAnswerTypeID: "updatePollAnswer#b67ac547", - UpdateChatMemberTypeID: "updateChatMember#6000e29c", - UpdateNewChatJoinRequestTypeID: "updateNewChatJoinRequest#7e48b843", - UpdatesTypeID: "updates#b9829222", - LogStreamDefaultTypeID: "logStreamDefault#52e296bc", - LogStreamFileTypeID: "logStreamFile#5b528de5", - LogStreamEmptyTypeID: "logStreamEmpty#e233f1cc", - LogVerbosityLevelTypeID: "logVerbosityLevel#676443ea", - LogTagsTypeID: "logTags#dc09ced4", - UserSupportInfoTypeID: "userSupportInfo#b50e1c29", - TestIntTypeID: "testInt#ddbd2c09", - TestStringTypeID: "testString#fe56688c", - TestBytesTypeID: "testBytes#a422c4de", - TestVectorIntTypeID: "testVectorInt#df9eb113", - TestVectorIntObjectTypeID: "testVectorIntObject#f152999b", - TestVectorStringTypeID: "testVectorString#5d6f85bc", - TestVectorStringObjectTypeID: "testVectorStringObject#e5ecc0d", - GetAuthorizationStateRequestTypeID: "getAuthorizationState#742dbe3d", - SetTdlibParametersRequestTypeID: "setTdlibParameters#52898239", - SetAuthenticationPhoneNumberRequestTypeID: "setAuthenticationPhoneNumber#33c0d823", - SetAuthenticationEmailAddressRequestTypeID: "setAuthenticationEmailAddress#69b2c502", - ResendAuthenticationCodeRequestTypeID: "resendAuthenticationCode#cf759719", - CheckAuthenticationEmailCodeRequestTypeID: "checkAuthenticationEmailCode#dd42c29f", - CheckAuthenticationCodeRequestTypeID: "checkAuthenticationCode#edfe44aa", - RequestQrCodeAuthenticationRequestTypeID: "requestQrCodeAuthentication#56fe3c4e", - RegisterUserRequestTypeID: "registerUser#f9719e1d", - ResetAuthenticationEmailAddressRequestTypeID: "resetAuthenticationEmailAddress#e742722c", - CheckAuthenticationPasswordRequestTypeID: "checkAuthenticationPassword#87424ba0", - RequestAuthenticationPasswordRecoveryRequestTypeID: "requestAuthenticationPasswordRecovery#53152ab6", - CheckAuthenticationPasswordRecoveryCodeRequestTypeID: "checkAuthenticationPasswordRecoveryCode#dc0a3be5", - RecoverAuthenticationPasswordRequestTypeID: "recoverAuthenticationPassword#f8311523", - SendAuthenticationFirebaseSMSRequestTypeID: "sendAuthenticationFirebaseSms#15c15e3f", - CheckAuthenticationBotTokenRequestTypeID: "checkAuthenticationBotToken#261b4476", - LogOutRequestTypeID: "logOut#a1b5c41b", - CloseRequestTypeID: "close#b933e17f", - DestroyRequestTypeID: "destroy#28d9534a", - ConfirmQrCodeAuthenticationRequestTypeID: "confirmQrCodeAuthentication#e993a72d", - GetCurrentStateRequestTypeID: "getCurrentState#b8fc6889", - SetDatabaseEncryptionKeyRequestTypeID: "setDatabaseEncryptionKey#b83345b5", - GetPasswordStateRequestTypeID: "getPasswordState#f5957b78", - SetPasswordRequestTypeID: "setPassword#b8db46dd", - SetLoginEmailAddressRequestTypeID: "setLoginEmailAddress#37bb43d4", - ResendLoginEmailAddressCodeRequestTypeID: "resendLoginEmailAddressCode#11765215", - CheckLoginEmailAddressCodeRequestTypeID: "checkLoginEmailAddressCode#a951fc62", - GetRecoveryEmailAddressRequestTypeID: "getRecoveryEmailAddress#a0f1b9fd", - SetRecoveryEmailAddressRequestTypeID: "setRecoveryEmailAddress#89df939f", - CheckRecoveryEmailAddressCodeRequestTypeID: "checkRecoveryEmailAddressCode#88f7981b", - ResendRecoveryEmailAddressCodeRequestTypeID: "resendRecoveryEmailAddressCode#19d66f1c", - RequestPasswordRecoveryRequestTypeID: "requestPasswordRecovery#ff2dc552", - CheckPasswordRecoveryCodeRequestTypeID: "checkPasswordRecoveryCode#f4081e18", - RecoverPasswordRequestTypeID: "recoverPassword#a5259973", - ResetPasswordRequestTypeID: "resetPassword#dc9e8c9d", - CancelPasswordResetRequestTypeID: "cancelPasswordReset#38127462", - CreateTemporaryPasswordRequestTypeID: "createTemporaryPassword#9f0d6f86", - GetTemporaryPasswordStateRequestTypeID: "getTemporaryPasswordState#ff3ea892", - GetMeRequestTypeID: "getMe#f495b27f", - GetUserRequestTypeID: "getUser#42999c0b", - GetUserFullInfoRequestTypeID: "getUserFullInfo#d1b29c58", - GetBasicGroupRequestTypeID: "getBasicGroup#9e893654", - GetBasicGroupFullInfoRequestTypeID: "getBasicGroupFullInfo#9365e32b", - GetSupergroupRequestTypeID: "getSupergroup#3afd10e2", - GetSupergroupFullInfoRequestTypeID: "getSupergroupFullInfo#418d4038", - GetSecretChatRequestTypeID: "getSecretChat#26b7e81", - GetChatRequestTypeID: "getChat#6f421440", - GetMessageRequestTypeID: "getMessage#9372c080", - GetMessageLocallyRequestTypeID: "getMessageLocally#dc062b6c", - GetRepliedMessageRequestTypeID: "getRepliedMessage#d9bd19bd", - GetChatPinnedMessageRequestTypeID: "getChatPinnedMessage#15731ab0", - GetCallbackQueryMessageRequestTypeID: "getCallbackQueryMessage#bd209172", - GetMessagesRequestTypeID: "getMessages#d5dd28bf", - GetMessageThreadRequestTypeID: "getMessageThread#7af23e3e", - GetMessageViewersRequestTypeID: "getMessageViewers#a18f1ace", - GetFileRequestTypeID: "getFile#5c9efd4e", - GetRemoteFileRequestTypeID: "getRemoteFile#7f632732", - LoadChatsRequestTypeID: "loadChats#8f9b7d7b", - GetChatsRequestTypeID: "getChats#c604bac2", - SearchPublicChatRequestTypeID: "searchPublicChat#3316d9ad", - SearchPublicChatsRequestTypeID: "searchPublicChats#39d6e7b9", - SearchChatsRequestTypeID: "searchChats#8ff4b9cc", - SearchChatsOnServerRequestTypeID: "searchChatsOnServer#baf42f74", - SearchChatsNearbyRequestTypeID: "searchChatsNearby#f445c81f", - GetTopChatsRequestTypeID: "getTopChats#e8d95221", - RemoveTopChatRequestTypeID: "removeTopChat#8e481e55", - SearchRecentlyFoundChatsRequestTypeID: "searchRecentlyFoundChats#62320591", - AddRecentlyFoundChatRequestTypeID: "addRecentlyFoundChat#97e8198d", - RemoveRecentlyFoundChatRequestTypeID: "removeRecentlyFoundChat#2ac1bf1c", - ClearRecentlyFoundChatsRequestTypeID: "clearRecentlyFoundChats#eefa5b32", - GetRecentlyOpenedChatsRequestTypeID: "getRecentlyOpenedChats#8d4fb223", - CheckChatUsernameRequestTypeID: "checkChatUsername#f8e66210", - GetCreatedPublicChatsRequestTypeID: "getCreatedPublicChats#2a5725ef", - CheckCreatedPublicChatsLimitRequestTypeID: "checkCreatedPublicChatsLimit#e5717fa1", - GetSuitableDiscussionChatsRequestTypeID: "getSuitableDiscussionChats#2ec5df6", - GetInactiveSupergroupChatsRequestTypeID: "getInactiveSupergroupChats#d8cbf9b5", - GetGroupsInCommonRequestTypeID: "getGroupsInCommon#16bdd36a", - GetChatHistoryRequestTypeID: "getChatHistory#d051927d", - GetMessageThreadHistoryRequestTypeID: "getMessageThreadHistory#9435d428", - DeleteChatHistoryRequestTypeID: "deleteChatHistory#a841d09f", - DeleteChatRequestTypeID: "deleteChat#f5cae05e", - SearchChatMessagesRequestTypeID: "searchChatMessages#70023dfc", - SearchMessagesRequestTypeID: "searchMessages#2a8f08a7", - SearchSecretMessagesRequestTypeID: "searchSecretMessages#cd2a4c9c", - SearchCallMessagesRequestTypeID: "searchCallMessages#8c3bef1b", - SearchOutgoingDocumentMessagesRequestTypeID: "searchOutgoingDocumentMessages#c023c47e", - DeleteAllCallMessagesRequestTypeID: "deleteAllCallMessages#a897d1f3", - SearchChatRecentLocationMessagesRequestTypeID: "searchChatRecentLocationMessages#38a37ee6", - GetActiveLiveLocationMessagesRequestTypeID: "getActiveLiveLocationMessages#ab093691", - GetChatMessageByDateRequestTypeID: "getChatMessageByDate#3f557136", - GetChatSparseMessagePositionsRequestTypeID: "getChatSparseMessagePositions#e472f784", - GetChatMessageCalendarRequestTypeID: "getChatMessageCalendar#ec8f2114", - GetChatMessageCountRequestTypeID: "getChatMessageCount#c3eb1ac", - GetChatMessagePositionRequestTypeID: "getChatMessagePosition#dea71718", - GetChatScheduledMessagesRequestTypeID: "getChatScheduledMessages#df3d2ffb", - GetChatSponsoredMessagesRequestTypeID: "getChatSponsoredMessages#50a84098", - ClickChatSponsoredMessageRequestTypeID: "clickChatSponsoredMessage#d9c09feb", - RemoveNotificationRequestTypeID: "removeNotification#336ab34e", - RemoveNotificationGroupRequestTypeID: "removeNotificationGroup#661a638e", - GetMessageLinkRequestTypeID: "getMessageLink#c556ef7a", - GetMessageEmbeddingCodeRequestTypeID: "getMessageEmbeddingCode#62a4cd09", - GetMessageLinkInfoRequestTypeID: "getMessageLinkInfo#d63eb458", - TranslateTextRequestTypeID: "translateText#252264f2", - TranslateMessageTextRequestTypeID: "translateMessageText#53c51ed2", - RecognizeSpeechRequestTypeID: "recognizeSpeech#67d402b9", - RateSpeechRecognitionRequestTypeID: "rateSpeechRecognition#eedcc3b5", - GetChatAvailableMessageSendersRequestTypeID: "getChatAvailableMessageSenders#450fe92b", - SetChatMessageSenderRequestTypeID: "setChatMessageSender#ab456b7e", - SendMessageRequestTypeID: "sendMessage#171a006f", - SendMessageAlbumRequestTypeID: "sendMessageAlbum#c765936", - SendBotStartMessageRequestTypeID: "sendBotStartMessage#aa6a3eee", - SendInlineQueryResultMessageRequestTypeID: "sendInlineQueryResultMessage#9d4807e9", - ForwardMessagesRequestTypeID: "forwardMessages#3f49f51e", - ResendMessagesRequestTypeID: "resendMessages#60d350b8", - AddLocalMessageRequestTypeID: "addLocalMessage#66e011a3", - DeleteMessagesRequestTypeID: "deleteMessages#c3ed9de2", - DeleteChatMessagesBySenderRequestTypeID: "deleteChatMessagesBySender#ba9b2e67", - DeleteChatMessagesByDateRequestTypeID: "deleteChatMessagesByDate#9e44e0bf", - EditMessageTextRequestTypeID: "editMessageText#bb2e1b7", - EditMessageLiveLocationRequestTypeID: "editMessageLiveLocation#ff29a512", - EditMessageMediaRequestTypeID: "editMessageMedia#bb4b8713", - EditMessageCaptionRequestTypeID: "editMessageCaption#44d2f92e", - EditMessageReplyMarkupRequestTypeID: "editMessageReplyMarkup#13cbde89", - EditInlineMessageTextRequestTypeID: "editInlineMessageText#cd02c1e5", - EditInlineMessageLiveLocationRequestTypeID: "editInlineMessageLiveLocation#f6a5da00", - EditInlineMessageMediaRequestTypeID: "editInlineMessageMedia#1676781", - EditInlineMessageCaptionRequestTypeID: "editInlineMessageCaption#d2a446b7", - EditInlineMessageReplyMarkupRequestTypeID: "editInlineMessageReplyMarkup#fbf906de", - EditMessageSchedulingStateRequestTypeID: "editMessageSchedulingState#ae2a0bc0", - GetForumTopicDefaultIconsRequestTypeID: "getForumTopicDefaultIcons#583574dc", - CreateForumTopicRequestTypeID: "createForumTopic#c1fa28e4", - EditForumTopicRequestTypeID: "editForumTopic#a7769060", - GetForumTopicRequestTypeID: "getForumTopic#e59bfe41", - GetForumTopicLinkRequestTypeID: "getForumTopicLink#c97b88cb", - GetForumTopicsRequestTypeID: "getForumTopics#fbab7d5a", - SetForumTopicNotificationSettingsRequestTypeID: "setForumTopicNotificationSettings#1f433467", - ToggleForumTopicIsClosedRequestTypeID: "toggleForumTopicIsClosed#c7648af3", - ToggleGeneralForumTopicIsHiddenRequestTypeID: "toggleGeneralForumTopicIsHidden#5f1d1448", - ToggleForumTopicIsPinnedRequestTypeID: "toggleForumTopicIsPinned#466ceab4", - SetPinnedForumTopicsRequestTypeID: "setPinnedForumTopics#ddf26f21", - DeleteForumTopicRequestTypeID: "deleteForumTopic#6f285cb8", - GetEmojiReactionRequestTypeID: "getEmojiReaction#e53411dc", - GetCustomEmojiReactionAnimationsRequestTypeID: "getCustomEmojiReactionAnimations#49748dd2", - GetMessageAvailableReactionsRequestTypeID: "getMessageAvailableReactions#76db86b2", - ClearRecentReactionsRequestTypeID: "clearRecentReactions#4d61c752", - AddMessageReactionRequestTypeID: "addMessageReaction#549855ed", - RemoveMessageReactionRequestTypeID: "removeMessageReaction#97474d7b", - GetMessageAddedReactionsRequestTypeID: "getMessageAddedReactions#7dc6ae52", - SetDefaultReactionTypeRequestTypeID: "setDefaultReactionType#65038a3d", - GetTextEntitiesRequestTypeID: "getTextEntities#eba543fb", - ParseTextEntitiesRequestTypeID: "parseTextEntities#9a1fc29f", - ParseMarkdownRequestTypeID: "parseMarkdown#2d153aef", - GetMarkdownTextRequestTypeID: "getMarkdownText#9ce7228", - GetFileMimeTypeRequestTypeID: "getFileMimeType#84631b89", - GetFileExtensionRequestTypeID: "getFileExtension#f9adb934", - CleanFileNameRequestTypeID: "cleanFileName#39b1f7fb", - GetLanguagePackStringRequestTypeID: "getLanguagePackString#8fcde73", - GetJSONValueRequestTypeID: "getJsonValue#92fa5a05", - GetJSONStringRequestTypeID: "getJsonString#278b9421", - GetThemeParametersJSONStringRequestTypeID: "getThemeParametersJsonString#91b905f8", - SetPollAnswerRequestTypeID: "setPollAnswer#5303b916", - GetPollVotersRequestTypeID: "getPollVoters#c45ba9ac", - StopPollRequestTypeID: "stopPoll#62e80aad", - HideSuggestedActionRequestTypeID: "hideSuggestedAction#a2ef2b7f", - GetLoginURLInfoRequestTypeID: "getLoginUrlInfo#ccc99db3", - GetLoginURLRequestTypeID: "getLoginUrl#2f3295d1", - ShareUserWithBotRequestTypeID: "shareUserWithBot#f132ffdc", - ShareChatWithBotRequestTypeID: "shareChatWithBot#a6530ae2", - GetInlineQueryResultsRequestTypeID: "getInlineQueryResults#79dcf86c", - AnswerInlineQueryRequestTypeID: "answerInlineQuery#ac7cc5e6", - SearchWebAppRequestTypeID: "searchWebApp#b5fc8a35", - GetWebAppLinkURLRequestTypeID: "getWebAppLinkUrl#4f0ef3cc", - GetWebAppURLRequestTypeID: "getWebAppUrl#64c42cbe", - SendWebAppDataRequestTypeID: "sendWebAppData#ab1fce0c", - OpenWebAppRequestTypeID: "openWebApp#3a621a", - CloseWebAppRequestTypeID: "closeWebApp#68a124c6", - AnswerWebAppQueryRequestTypeID: "answerWebAppQuery#a0b49cf1", - GetCallbackQueryAnswerRequestTypeID: "getCallbackQueryAnswer#6ef7a5f", - AnswerCallbackQueryRequestTypeID: "answerCallbackQuery#bb462e76", - AnswerShippingQueryRequestTypeID: "answerShippingQuery#7a3c2432", - AnswerPreCheckoutQueryRequestTypeID: "answerPreCheckoutQuery#a76163eb", - SetGameScoreRequestTypeID: "setGameScore#7eccedc6", - SetInlineGameScoreRequestTypeID: "setInlineGameScore#c7715d8b", - GetGameHighScoresRequestTypeID: "getGameHighScores#f0459b", - GetInlineGameHighScoresRequestTypeID: "getInlineGameHighScores#e0396baa", - DeleteChatReplyMarkupRequestTypeID: "deleteChatReplyMarkup#5ff9b5b", - SendChatActionRequestTypeID: "sendChatAction#7cfce154", - OpenChatRequestTypeID: "openChat#ecb9be0b", - CloseChatRequestTypeID: "closeChat#25e86e9", - ViewMessagesRequestTypeID: "viewMessages#aa2f0438", - OpenMessageContentRequestTypeID: "openMessageContent#d3f2697b", - ClickAnimatedEmojiMessageRequestTypeID: "clickAnimatedEmojiMessage#bb17662", - GetInternalLinkRequestTypeID: "getInternalLink#3960f1b0", - GetInternalLinkTypeRequestTypeID: "getInternalLinkType#8bdd5709", - GetExternalLinkInfoRequestTypeID: "getExternalLinkInfo#460d7a3f", - GetExternalLinkRequestTypeID: "getExternalLink#5e92f0eb", - ReadAllChatMentionsRequestTypeID: "readAllChatMentions#50eab2b5", - ReadAllMessageThreadMentionsRequestTypeID: "readAllMessageThreadMentions#4edd7555", - ReadAllChatReactionsRequestTypeID: "readAllChatReactions#54c1976d", - ReadAllMessageThreadReactionsRequestTypeID: "readAllMessageThreadReactions#d0bc273e", - CreatePrivateChatRequestTypeID: "createPrivateChat#c7825b09", - CreateBasicGroupChatRequestTypeID: "createBasicGroupChat#758ab4e4", - CreateSupergroupChatRequestTypeID: "createSupergroupChat#46c770eb", - CreateSecretChatRequestTypeID: "createSecretChat#730dd22f", - CreateNewBasicGroupChatRequestTypeID: "createNewBasicGroupChat#c479e224", - CreateNewSupergroupChatRequestTypeID: "createNewSupergroupChat#2fecf6c6", - CreateNewSecretChatRequestTypeID: "createNewSecretChat#db012265", - UpgradeBasicGroupChatToSupergroupChatRequestTypeID: "upgradeBasicGroupChatToSupergroupChat#11e915ba", - GetChatListsToAddChatRequestTypeID: "getChatListsToAddChat#2709d6a1", - AddChatToListRequestTypeID: "addChatToList#fb334eb5", - GetChatFolderRequestTypeID: "getChatFolder#5882a98", - CreateChatFolderRequestTypeID: "createChatFolder#3c85c500", - EditChatFolderRequestTypeID: "editChatFolder#332fb32", - DeleteChatFolderRequestTypeID: "deleteChatFolder#74260b87", - GetChatFolderChatsToLeaveRequestTypeID: "getChatFolderChatsToLeave#8dc1e6af", - GetChatFolderChatCountRequestTypeID: "getChatFolderChatCount#7dd4cbbe", - ReorderChatFoldersRequestTypeID: "reorderChatFolders#59544c32", - GetRecommendedChatFoldersRequestTypeID: "getRecommendedChatFolders#f7533b87", - GetChatFolderDefaultIconNameRequestTypeID: "getChatFolderDefaultIconName#2cf7a067", - GetChatsForChatFolderInviteLinkRequestTypeID: "getChatsForChatFolderInviteLink#6fac4949", - CreateChatFolderInviteLinkRequestTypeID: "createChatFolderInviteLink#fba5e198", - GetChatFolderInviteLinksRequestTypeID: "getChatFolderInviteLinks#139d5be0", - EditChatFolderInviteLinkRequestTypeID: "editChatFolderInviteLink#5cc415a8", - DeleteChatFolderInviteLinkRequestTypeID: "deleteChatFolderInviteLink#c890717e", - CheckChatFolderInviteLinkRequestTypeID: "checkChatFolderInviteLink#1f25999b", - AddChatFolderByInviteLinkRequestTypeID: "addChatFolderByInviteLink#1ed19dae", - GetChatFolderNewChatsRequestTypeID: "getChatFolderNewChats#7e8d2ccc", - ProcessChatFolderNewChatsRequestTypeID: "processChatFolderNewChats#109f8a8b", - GetArchiveChatListSettingsRequestTypeID: "getArchiveChatListSettings#838d8e60", - SetArchiveChatListSettingsRequestTypeID: "setArchiveChatListSettings#cb454c0a", - SetChatTitleRequestTypeID: "setChatTitle#9cabebf", - SetChatPhotoRequestTypeID: "setChatPhoto#e97b8d03", - SetChatMessageAutoDeleteTimeRequestTypeID: "setChatMessageAutoDeleteTime#a641b4ff", - SetChatPermissionsRequestTypeID: "setChatPermissions#7f7706fe", - SetChatBackgroundRequestTypeID: "setChatBackground#3d3f1b28", - SetChatThemeRequestTypeID: "setChatTheme#8f090293", - SetChatDraftMessageRequestTypeID: "setChatDraftMessage#645e1f1a", - SetChatNotificationSettingsRequestTypeID: "setChatNotificationSettings#2e531ffe", - ToggleChatHasProtectedContentRequestTypeID: "toggleChatHasProtectedContent#3a20d94d", - ToggleChatIsTranslatableRequestTypeID: "toggleChatIsTranslatable#93f9cbdf", - ToggleChatIsMarkedAsUnreadRequestTypeID: "toggleChatIsMarkedAsUnread#c538dadf", - ToggleChatDefaultDisableNotificationRequestTypeID: "toggleChatDefaultDisableNotification#12c36012", - SetChatAvailableReactionsRequestTypeID: "setChatAvailableReactions#feb3e06", - SetChatClientDataRequestTypeID: "setChatClientData#ceb3273d", - SetChatDescriptionRequestTypeID: "setChatDescription#74a8b45d", - SetChatDiscussionGroupRequestTypeID: "setChatDiscussionGroup#c93c32b8", - SetChatLocationRequestTypeID: "setChatLocation#d2471daa", - SetChatSlowModeDelayRequestTypeID: "setChatSlowModeDelay#dfcae63e", - PinChatMessageRequestTypeID: "pinChatMessage#79475baf", - UnpinChatMessageRequestTypeID: "unpinChatMessage#7b1c3ede", - UnpinAllChatMessagesRequestTypeID: "unpinAllChatMessages#aa4cd4b7", - UnpinAllMessageThreadMessagesRequestTypeID: "unpinAllMessageThreadMessages#b7c69f00", - JoinChatRequestTypeID: "joinChat#137a1aa1", - LeaveChatRequestTypeID: "leaveChat#93377a61", - AddChatMemberRequestTypeID: "addChatMember#1dc4a5fa", - AddChatMembersRequestTypeID: "addChatMembers#b4f60138", - SetChatMemberStatusRequestTypeID: "setChatMemberStatus#4e0171f", - BanChatMemberRequestTypeID: "banChatMember#cb107d7c", - CanTransferOwnershipRequestTypeID: "canTransferOwnership#25d3440c", - TransferChatOwnershipRequestTypeID: "transferChatOwnership#77a00a13", - GetChatMemberRequestTypeID: "getChatMember#d0c15272", - SearchChatMembersRequestTypeID: "searchChatMembers#e56d46c5", - GetChatAdministratorsRequestTypeID: "getChatAdministrators#5c0eb6bb", - ClearAllDraftMessagesRequestTypeID: "clearAllDraftMessages#fd3c74db", - GetSavedNotificationSoundRequestTypeID: "getSavedNotificationSound#1b647917", - GetSavedNotificationSoundsRequestTypeID: "getSavedNotificationSounds#c0346fa8", - AddSavedNotificationSoundRequestTypeID: "addSavedNotificationSound#3e3984ef", - RemoveSavedNotificationSoundRequestTypeID: "removeSavedNotificationSound#e363474e", - GetChatNotificationSettingsExceptionsRequestTypeID: "getChatNotificationSettingsExceptions#bfe0e11", - GetScopeNotificationSettingsRequestTypeID: "getScopeNotificationSettings#c4a8254f", - SetScopeNotificationSettingsRequestTypeID: "setScopeNotificationSettings#85cfb63a", - ResetAllNotificationSettingsRequestTypeID: "resetAllNotificationSettings#f5a0a8f9", - ToggleChatIsPinnedRequestTypeID: "toggleChatIsPinned#a776263e", - SetPinnedChatsRequestTypeID: "setPinnedChats#c6c6edf1", - ReadChatListRequestTypeID: "readChatList#bd6498aa", - GetStoryRequestTypeID: "getStory#717b1c78", - GetChatsToSendStoriesRequestTypeID: "getChatsToSendStories#22f9e3a4", - CanSendStoryRequestTypeID: "canSendStory#b6e0216b", - SendStoryRequestTypeID: "sendStory#53242a4", - EditStoryRequestTypeID: "editStory#5e6a21b1", - SetStoryPrivacySettingsRequestTypeID: "setStoryPrivacySettings#1b6c5434", - ToggleStoryIsPinnedRequestTypeID: "toggleStoryIsPinned#b493b30e", - DeleteStoryRequestTypeID: "deleteStory#9f35af16", - GetStoryNotificationSettingsExceptionsRequestTypeID: "getStoryNotificationSettingsExceptions#256a2eb0", - LoadActiveStoriesRequestTypeID: "loadActiveStories#7d8cf738", - SetChatActiveStoriesListRequestTypeID: "setChatActiveStoriesList#e0e35d11", - GetChatActiveStoriesRequestTypeID: "getChatActiveStories#2e4ffbf5", - GetChatPinnedStoriesRequestTypeID: "getChatPinnedStories#53c82a1", - GetChatArchivedStoriesRequestTypeID: "getChatArchivedStories#af1e9488", - OpenStoryRequestTypeID: "openStory#ceda7c7d", - CloseStoryRequestTypeID: "closeStory#443d0f55", - GetStoryAvailableReactionsRequestTypeID: "getStoryAvailableReactions#23854d3b", - SetStoryReactionRequestTypeID: "setStoryReaction#ac8b4fa7", - GetStoryViewersRequestTypeID: "getStoryViewers#40df8dba", - ReportStoryRequestTypeID: "reportStory#9b5f709b", - ActivateStoryStealthModeRequestTypeID: "activateStoryStealthMode#c3db8491", - GetChatBoostStatusRequestTypeID: "getChatBoostStatus#cfac8acf", - CanBoostChatRequestTypeID: "canBoostChat#836e6e58", - BoostChatRequestTypeID: "boostChat#4e314c2d", - GetChatBoostLinkRequestTypeID: "getChatBoostLink#56f16c85", - GetChatBoostLinkInfoRequestTypeID: "getChatBoostLinkInfo#26fc4b5c", - GetChatBoostsRequestTypeID: "getChatBoosts#d82a288e", - GetAttachmentMenuBotRequestTypeID: "getAttachmentMenuBot#3da561fb", - ToggleBotIsAddedToAttachmentMenuRequestTypeID: "toggleBotIsAddedToAttachmentMenu#8e59de9a", - GetThemedEmojiStatusesRequestTypeID: "getThemedEmojiStatuses#6ac5c8c2", - GetRecentEmojiStatusesRequestTypeID: "getRecentEmojiStatuses#ae3a3d29", - GetDefaultEmojiStatusesRequestTypeID: "getDefaultEmojiStatuses#24e45ec3", - ClearRecentEmojiStatusesRequestTypeID: "clearRecentEmojiStatuses#e671cb5e", - DownloadFileRequestTypeID: "downloadFile#3f253234", - GetFileDownloadedPrefixSizeRequestTypeID: "getFileDownloadedPrefixSize#3304bd2d", - CancelDownloadFileRequestTypeID: "cancelDownloadFile#8b8052de", - GetSuggestedFileNameRequestTypeID: "getSuggestedFileName#85d8a486", - PreliminaryUploadFileRequestTypeID: "preliminaryUploadFile#70e7cb99", - CancelPreliminaryUploadFileRequestTypeID: "cancelPreliminaryUploadFile#311446be", - WriteGeneratedFilePartRequestTypeID: "writeGeneratedFilePart#cc89e95", - SetFileGenerationProgressRequestTypeID: "setFileGenerationProgress#6d754b3e", - FinishFileGenerationRequestTypeID: "finishFileGeneration#c11d0c9d", - ReadFilePartRequestTypeID: "readFilePart#360ca70d", - DeleteFileRequestTypeID: "deleteFile#6bbe9b2c", - AddFileToDownloadsRequestTypeID: "addFileToDownloads#33b583b7", - ToggleDownloadIsPausedRequestTypeID: "toggleDownloadIsPaused#c7866715", - ToggleAllDownloadsArePausedRequestTypeID: "toggleAllDownloadsArePaused#4a989002", - RemoveFileFromDownloadsRequestTypeID: "removeFileFromDownloads#5706bfee", - RemoveAllFilesFromDownloadsRequestTypeID: "removeAllFilesFromDownloads#b9487686", - SearchFileDownloadsRequestTypeID: "searchFileDownloads#2a1e0856", - GetMessageFileTypeRequestTypeID: "getMessageFileType#e2c70fd4", - GetMessageImportConfirmationTextRequestTypeID: "getMessageImportConfirmationText#174881a8", - ImportMessagesRequestTypeID: "importMessages#7e98592b", - ReplacePrimaryChatInviteLinkRequestTypeID: "replacePrimaryChatInviteLink#3f9e7b9d", - CreateChatInviteLinkRequestTypeID: "createChatInviteLink#1126a341", - EditChatInviteLinkRequestTypeID: "editChatInviteLink#4eb23d7c", - GetChatInviteLinkRequestTypeID: "getChatInviteLink#e36a41fd", - GetChatInviteLinkCountsRequestTypeID: "getChatInviteLinkCounts#3510e291", - GetChatInviteLinksRequestTypeID: "getChatInviteLinks#34a55cac", - GetChatInviteLinkMembersRequestTypeID: "getChatInviteLinkMembers#c5b6199a", - RevokeChatInviteLinkRequestTypeID: "revokeChatInviteLink#d1b755a9", - DeleteRevokedChatInviteLinkRequestTypeID: "deleteRevokedChatInviteLink#91270c7f", - DeleteAllRevokedChatInviteLinksRequestTypeID: "deleteAllRevokedChatInviteLinks#424816da", - CheckChatInviteLinkRequestTypeID: "checkChatInviteLink#e261483b", - JoinChatByInviteLinkRequestTypeID: "joinChatByInviteLink#c16aab86", - GetChatJoinRequestsRequestTypeID: "getChatJoinRequests#e8d90ea2", - ProcessChatJoinRequestRequestTypeID: "processChatJoinRequest#3be534a3", - ProcessChatJoinRequestsRequestTypeID: "processChatJoinRequests#3e823dce", - CreateCallRequestTypeID: "createCall#be282e10", - AcceptCallRequestTypeID: "acceptCall#d97562d0", - SendCallSignalingDataRequestTypeID: "sendCallSignalingData#542db19c", - DiscardCallRequestTypeID: "discardCall#95a9a57e", - SendCallRatingRequestTypeID: "sendCallRating#d89b576c", - SendCallDebugInformationRequestTypeID: "sendCallDebugInformation#785b373f", - SendCallLogRequestTypeID: "sendCallLog#3f0a47d1", - GetVideoChatAvailableParticipantsRequestTypeID: "getVideoChatAvailableParticipants#c45da305", - SetVideoChatDefaultParticipantRequestTypeID: "setVideoChatDefaultParticipant#f1a672b3", - CreateVideoChatRequestTypeID: "createVideoChat#7ea4958d", - GetVideoChatRtmpURLRequestTypeID: "getVideoChatRtmpUrl#482b1b1f", - ReplaceVideoChatRtmpURLRequestTypeID: "replaceVideoChatRtmpUrl#214f8fe0", - GetGroupCallRequestTypeID: "getGroupCall#5787668e", - StartScheduledGroupCallRequestTypeID: "startScheduledGroupCall#5a986d16", - ToggleGroupCallEnabledStartNotificationRequestTypeID: "toggleGroupCallEnabledStartNotification#2a30c752", - JoinGroupCallRequestTypeID: "joinGroupCall#c1c947e5", - StartGroupCallScreenSharingRequestTypeID: "startGroupCallScreenSharing#cb4e312d", - ToggleGroupCallScreenSharingIsPausedRequestTypeID: "toggleGroupCallScreenSharingIsPaused#a07b5360", - EndGroupCallScreenSharingRequestTypeID: "endGroupCallScreenSharing#85f41c4c", - SetGroupCallTitleRequestTypeID: "setGroupCallTitle#b6c19dcd", - ToggleGroupCallMuteNewParticipantsRequestTypeID: "toggleGroupCallMuteNewParticipants#10eec1c2", - InviteGroupCallParticipantsRequestTypeID: "inviteGroupCallParticipants#56c030a6", - GetGroupCallInviteLinkRequestTypeID: "getGroupCallInviteLink#2ae14924", - RevokeGroupCallInviteLinkRequestTypeID: "revokeGroupCallInviteLink#1de5a494", - StartGroupCallRecordingRequestTypeID: "startGroupCallRecording#68c5847b", - EndGroupCallRecordingRequestTypeID: "endGroupCallRecording#fb7b6289", - ToggleGroupCallIsMyVideoPausedRequestTypeID: "toggleGroupCallIsMyVideoPaused#e374f199", - ToggleGroupCallIsMyVideoEnabledRequestTypeID: "toggleGroupCallIsMyVideoEnabled#9f2f50fa", - SetGroupCallParticipantIsSpeakingRequestTypeID: "setGroupCallParticipantIsSpeaking#3748a1e5", - ToggleGroupCallParticipantIsMutedRequestTypeID: "toggleGroupCallParticipantIsMuted#b2081407", - SetGroupCallParticipantVolumeLevelRequestTypeID: "setGroupCallParticipantVolumeLevel#97779828", - ToggleGroupCallParticipantIsHandRaisedRequestTypeID: "toggleGroupCallParticipantIsHandRaised#8efb63e1", - LoadGroupCallParticipantsRequestTypeID: "loadGroupCallParticipants#37f3bece", - LeaveGroupCallRequestTypeID: "leaveGroupCall#3a6befa9", - EndGroupCallRequestTypeID: "endGroupCall#22294cb7", - GetGroupCallStreamsRequestTypeID: "getGroupCallStreams#9f7c9164", - GetGroupCallStreamSegmentRequestTypeID: "getGroupCallStreamSegment#8424daa5", - SetMessageSenderBlockListRequestTypeID: "setMessageSenderBlockList#898b5c91", - BlockMessageSenderFromRepliesRequestTypeID: "blockMessageSenderFromReplies#b79df58b", - GetBlockedMessageSendersRequestTypeID: "getBlockedMessageSenders#8ce52f16", - AddContactRequestTypeID: "addContact#6f707140", - ImportContactsRequestTypeID: "importContacts#77bdb718", - GetContactsRequestTypeID: "getContacts#ab7f4470", - SearchContactsRequestTypeID: "searchContacts#95073165", - RemoveContactsRequestTypeID: "removeContacts#b464dfff", - GetImportedContactCountRequestTypeID: "getImportedContactCount#d8e11a26", - ChangeImportedContactsRequestTypeID: "changeImportedContacts#24885905", - ClearImportedContactsRequestTypeID: "clearImportedContacts#33d39142", - SetCloseFriendsRequestTypeID: "setCloseFriends#7ff8f69f", - GetCloseFriendsRequestTypeID: "getCloseFriends#a9d574ce", - SetUserPersonalProfilePhotoRequestTypeID: "setUserPersonalProfilePhoto#1baa28f6", - SuggestUserProfilePhotoRequestTypeID: "suggestUserProfilePhoto#9561f463", - SearchUserByPhoneNumberRequestTypeID: "searchUserByPhoneNumber#a2e22b12", - SharePhoneNumberRequestTypeID: "sharePhoneNumber#4164e055", - GetUserProfilePhotosRequestTypeID: "getUserProfilePhotos#c9defe42", - GetStickersRequestTypeID: "getStickers#45069343", - GetAllStickerEmojisRequestTypeID: "getAllStickerEmojis#11ad2e30", - SearchStickersRequestTypeID: "searchStickers#9a19e90b", - GetPremiumStickersRequestTypeID: "getPremiumStickers#ef410a50", - GetInstalledStickerSetsRequestTypeID: "getInstalledStickerSets#612ef6f6", - GetArchivedStickerSetsRequestTypeID: "getArchivedStickerSets#3bb8424d", - GetTrendingStickerSetsRequestTypeID: "getTrendingStickerSets#e058455e", - GetAttachedStickerSetsRequestTypeID: "getAttachedStickerSets#4d9d930d", - GetStickerSetRequestTypeID: "getStickerSet#3eb91bc3", - SearchStickerSetRequestTypeID: "searchStickerSet#45049cee", - SearchInstalledStickerSetsRequestTypeID: "searchInstalledStickerSets#7e5e7fa4", - SearchStickerSetsRequestTypeID: "searchStickerSets#bf7d307b", - ChangeStickerSetRequestTypeID: "changeStickerSet#1ac8a5ed", - ViewTrendingStickerSetsRequestTypeID: "viewTrendingStickerSets#36d6469", - ReorderInstalledStickerSetsRequestTypeID: "reorderInstalledStickerSets#4a830a78", - GetRecentStickersRequestTypeID: "getRecentStickers#dd73aa9f", - AddRecentStickerRequestTypeID: "addRecentSticker#a7e5d89e", - RemoveRecentStickerRequestTypeID: "removeRecentSticker#4a4d440d", - ClearRecentStickersRequestTypeID: "clearRecentStickers#ecda39c4", - GetFavoriteStickersRequestTypeID: "getFavoriteStickers#ebcbcf40", - AddFavoriteStickerRequestTypeID: "addFavoriteSticker#13578cdf", - RemoveFavoriteStickerRequestTypeID: "removeFavoriteSticker#44b88c70", - GetStickerEmojisRequestTypeID: "getStickerEmojis#8f04d547", - SearchEmojisRequestTypeID: "searchEmojis#9fb0feea", - GetEmojiCategoriesRequestTypeID: "getEmojiCategories#7f86c16e", - GetAnimatedEmojiRequestTypeID: "getAnimatedEmoji#3f844f76", - GetEmojiSuggestionsURLRequestTypeID: "getEmojiSuggestionsUrl#ac4f1b2f", - GetCustomEmojiStickersRequestTypeID: "getCustomEmojiStickers#a5156885", - GetDefaultChatPhotoCustomEmojiStickersRequestTypeID: "getDefaultChatPhotoCustomEmojiStickers#e9917765", - GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID: "getDefaultProfilePhotoCustomEmojiStickers#4c4be2b7", - GetSavedAnimationsRequestTypeID: "getSavedAnimations#6b9718", - AddSavedAnimationRequestTypeID: "addSavedAnimation#a44bf860", - RemoveSavedAnimationRequestTypeID: "removeSavedAnimation#e275a919", - GetRecentInlineBotsRequestTypeID: "getRecentInlineBots#55b3723c", - SearchHashtagsRequestTypeID: "searchHashtags#3e34a571", - RemoveRecentHashtagRequestTypeID: "removeRecentHashtag#c393a0a4", - GetWebPagePreviewRequestTypeID: "getWebPagePreview#222e062c", - GetWebPageInstantViewRequestTypeID: "getWebPageInstantView#8b045689", - SetProfilePhotoRequestTypeID: "setProfilePhoto#85ea05ed", - DeleteProfilePhotoRequestTypeID: "deleteProfilePhoto#4eaa77c1", - SetNameRequestTypeID: "setName#66065f10", - SetBioRequestTypeID: "setBio#9f772354", - SetUsernameRequestTypeID: "setUsername#1a385c1e", - ToggleUsernameIsActiveRequestTypeID: "toggleUsernameIsActive#4a276de3", - ReorderActiveUsernamesRequestTypeID: "reorderActiveUsernames#c659414f", - SetEmojiStatusRequestTypeID: "setEmojiStatus#92f83e5d", - SetLocationRequestTypeID: "setLocation#5993371", - ChangePhoneNumberRequestTypeID: "changePhoneNumber#f891bba3", - ResendChangePhoneNumberCodeRequestTypeID: "resendChangePhoneNumberCode#d11acfa4", - CheckChangePhoneNumberCodeRequestTypeID: "checkChangePhoneNumberCode#9976a263", - GetUserLinkRequestTypeID: "getUserLink#492014e6", - SearchUserByTokenRequestTypeID: "searchUserByToken#d841f436", - SetCommandsRequestTypeID: "setCommands#b0e0217a", - DeleteCommandsRequestTypeID: "deleteCommands#3bc47c2a", - GetCommandsRequestTypeID: "getCommands#58ba8ff7", - SetMenuButtonRequestTypeID: "setMenuButton#b44fc141", - GetMenuButtonRequestTypeID: "getMenuButton#e5eef440", - SetDefaultGroupAdministratorRightsRequestTypeID: "setDefaultGroupAdministratorRights#65577768", - SetDefaultChannelAdministratorRightsRequestTypeID: "setDefaultChannelAdministratorRights#f20d5e19", - CanBotSendMessagesRequestTypeID: "canBotSendMessages#206d948c", - AllowBotToSendMessagesRequestTypeID: "allowBotToSendMessages#69e9c58e", - SendWebAppCustomRequestRequestTypeID: "sendWebAppCustomRequest#36ff5dc8", - SetBotNameRequestTypeID: "setBotName#d295fa71", - GetBotNameRequestTypeID: "getBotName#9a3f722c", - SetBotProfilePhotoRequestTypeID: "setBotProfilePhoto#bd864b66", - ToggleBotUsernameIsActiveRequestTypeID: "toggleBotUsernameIsActive#79639409", - ReorderBotActiveUsernamesRequestTypeID: "reorderBotActiveUsernames#acadc444", - SetBotInfoDescriptionRequestTypeID: "setBotInfoDescription#29571d48", - GetBotInfoDescriptionRequestTypeID: "getBotInfoDescription#d287f835", - SetBotInfoShortDescriptionRequestTypeID: "setBotInfoShortDescription#3a96bae3", - GetBotInfoShortDescriptionRequestTypeID: "getBotInfoShortDescription#4a1c2614", - GetActiveSessionsRequestTypeID: "getActiveSessions#42bd6d3e", - TerminateSessionRequestTypeID: "terminateSession#e7b7c92c", - TerminateAllOtherSessionsRequestTypeID: "terminateAllOtherSessions#6fba6113", - ConfirmSessionRequestTypeID: "confirmSession#d7c9b41f", - ToggleSessionCanAcceptCallsRequestTypeID: "toggleSessionCanAcceptCalls#6c6c2708", - ToggleSessionCanAcceptSecretChatsRequestTypeID: "toggleSessionCanAcceptSecretChats#3ba7a87e", - SetInactiveSessionTTLRequestTypeID: "setInactiveSessionTtl#5d9ca950", - GetConnectedWebsitesRequestTypeID: "getConnectedWebsites#f5d5d352", - DisconnectWebsiteRequestTypeID: "disconnectWebsite#d194f3dd", - DisconnectAllWebsitesRequestTypeID: "disconnectAllWebsites#bf72f203", - SetSupergroupUsernameRequestTypeID: "setSupergroupUsername#503f4b04", - ToggleSupergroupUsernameIsActiveRequestTypeID: "toggleSupergroupUsernameIsActive#a68b6dff", - DisableAllSupergroupUsernamesRequestTypeID: "disableAllSupergroupUsernames#3246f5b0", - ReorderSupergroupActiveUsernamesRequestTypeID: "reorderSupergroupActiveUsernames#663c7f3b", - SetSupergroupStickerSetRequestTypeID: "setSupergroupStickerSet#856ead69", - ToggleSupergroupSignMessagesRequestTypeID: "toggleSupergroupSignMessages#44efd524", - ToggleSupergroupJoinToSendMessagesRequestTypeID: "toggleSupergroupJoinToSendMessages#f5268e0e", - ToggleSupergroupJoinByRequestRequestTypeID: "toggleSupergroupJoinByRequest#7ddf9fde", - ToggleSupergroupIsAllHistoryAvailableRequestTypeID: "toggleSupergroupIsAllHistoryAvailable#44d9964e", - ToggleSupergroupHasHiddenMembersRequestTypeID: "toggleSupergroupHasHiddenMembers#a4559dca", - ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID: "toggleSupergroupHasAggressiveAntiSpamEnabled#683ef70f", - ToggleSupergroupIsForumRequestTypeID: "toggleSupergroupIsForum#966f960a", - ToggleSupergroupIsBroadcastGroupRequestTypeID: "toggleSupergroupIsBroadcastGroup#34b22215", - ReportSupergroupSpamRequestTypeID: "reportSupergroupSpam#383e26f2", - ReportSupergroupAntiSpamFalsePositiveRequestTypeID: "reportSupergroupAntiSpamFalsePositive#e13db048", - GetSupergroupMembersRequestTypeID: "getSupergroupMembers#ddf821c8", - CloseSecretChatRequestTypeID: "closeSecretChat#e3ed044b", - GetChatEventLogRequestTypeID: "getChatEventLog#f47b0a9b", - GetPaymentFormRequestTypeID: "getPaymentForm#8d4f76d4", - ValidateOrderInfoRequestTypeID: "validateOrderInfo#b5985fcf", - SendPaymentFormRequestTypeID: "sendPaymentForm#c66e388a", - GetPaymentReceiptRequestTypeID: "getPaymentReceipt#3c6cb956", - GetSavedOrderInfoRequestTypeID: "getSavedOrderInfo#bb559edd", - DeleteSavedOrderInfoRequestTypeID: "deleteSavedOrderInfo#61197474", - 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", - GetLocalizationTargetInfoRequestTypeID: "getLocalizationTargetInfo#6e3d1f86", - GetLanguagePackInfoRequestTypeID: "getLanguagePackInfo#7bd8daa8", - GetLanguagePackStringsRequestTypeID: "getLanguagePackStrings#b0b867bb", - SynchronizeLanguagePackRequestTypeID: "synchronizeLanguagePack#84e5e72e", - AddCustomServerLanguagePackRequestTypeID: "addCustomServerLanguagePack#448de3", - SetCustomLanguagePackRequestTypeID: "setCustomLanguagePack#234b0607", - EditCustomLanguagePackInfoRequestTypeID: "editCustomLanguagePackInfo#4eb91099", - SetCustomLanguagePackStringRequestTypeID: "setCustomLanguagePackString#4e762518", - DeleteLanguagePackRequestTypeID: "deleteLanguagePack#824edc3e", - RegisterDeviceRequestTypeID: "registerDevice#ff140196", - ProcessPushNotificationRequestTypeID: "processPushNotification#2ee3c890", - GetPushReceiverIDRequestTypeID: "getPushReceiverId#eeec46b2", - GetRecentlyVisitedTMeURLsRequestTypeID: "getRecentlyVisitedTMeUrls#30161a91", - SetUserPrivacySettingRulesRequestTypeID: "setUserPrivacySettingRules#e3c230fb", - GetUserPrivacySettingRulesRequestTypeID: "getUserPrivacySettingRules#84301671", - GetOptionRequestTypeID: "getOption#a2459e7e", - SetOptionRequestTypeID: "setOption#7e0b4ef2", - SetAccountTTLRequestTypeID: "setAccountTtl#29ce58e8", - GetAccountTTLRequestTypeID: "getAccountTtl#e58a8b77", - DeleteAccountRequestTypeID: "deleteAccount#533276c6", - SetDefaultMessageAutoDeleteTimeRequestTypeID: "setDefaultMessageAutoDeleteTime#965cd36c", - GetDefaultMessageAutoDeleteTimeRequestTypeID: "getDefaultMessageAutoDeleteTime#e520759a", - RemoveChatActionBarRequestTypeID: "removeChatActionBar#9d9839fa", - ReportChatRequestTypeID: "reportChat#d92c3a8a", - ReportChatPhotoRequestTypeID: "reportChatPhoto#d9701288", - ReportMessageReactionsRequestTypeID: "reportMessageReactions#36c88827", - GetChatStatisticsRequestTypeID: "getChatStatistics#137e8198", - GetMessageStatisticsRequestTypeID: "getMessageStatistics#4bb5a1d8", - GetMessagePublicForwardsRequestTypeID: "getMessagePublicForwards#6006a949", - GetStatisticalGraphRequestTypeID: "getStatisticalGraph#419f8d9b", - GetStorageStatisticsRequestTypeID: "getStorageStatistics#cd254b37", - GetStorageStatisticsFastRequestTypeID: "getStorageStatisticsFast#3a86702", - GetDatabaseStatisticsRequestTypeID: "getDatabaseStatistics#8c33d4b9", - OptimizeStorageRequestTypeID: "optimizeStorage#ef73c8c5", - SetNetworkTypeRequestTypeID: "setNetworkType#d62de55e", - GetNetworkStatisticsRequestTypeID: "getNetworkStatistics#c537581e", - AddNetworkStatisticsRequestTypeID: "addNetworkStatistics#4b63b3d9", - ResetNetworkStatisticsRequestTypeID: "resetNetworkStatistics#6222dd86", - GetAutoDownloadSettingsPresetsRequestTypeID: "getAutoDownloadSettingsPresets#996a4737", - SetAutoDownloadSettingsRequestTypeID: "setAutoDownloadSettings#eaeb64f4", - GetAutosaveSettingsRequestTypeID: "getAutosaveSettings#7f53f22a", - SetAutosaveSettingsRequestTypeID: "setAutosaveSettings#6878c0", - ClearAutosaveSettingsExceptionsRequestTypeID: "clearAutosaveSettingsExceptions#57ec63f2", - GetBankCardInfoRequestTypeID: "getBankCardInfo#b1e31db0", - GetPassportElementRequestTypeID: "getPassportElement#8fcce17a", - GetAllPassportElementsRequestTypeID: "getAllPassportElements#86782aeb", - SetPassportElementRequestTypeID: "setPassportElement#7b45d19c", - DeletePassportElementRequestTypeID: "deletePassportElement#9981aa74", - SetPassportElementErrorsRequestTypeID: "setPassportElementErrors#80fa80bf", - GetPreferredCountryLanguageRequestTypeID: "getPreferredCountryLanguage#c862cbd6", - SendPhoneNumberVerificationCodeRequestTypeID: "sendPhoneNumberVerificationCode#7c140dcb", - ResendPhoneNumberVerificationCodeRequestTypeID: "resendPhoneNumberVerificationCode#51845ffc", - CheckPhoneNumberVerificationCodeRequestTypeID: "checkPhoneNumberVerificationCode#594177be", - SendEmailAddressVerificationCodeRequestTypeID: "sendEmailAddressVerificationCode#f2ca537d", - ResendEmailAddressVerificationCodeRequestTypeID: "resendEmailAddressVerificationCode#90653024", - CheckEmailAddressVerificationCodeRequestTypeID: "checkEmailAddressVerificationCode#e695db03", - GetPassportAuthorizationFormRequestTypeID: "getPassportAuthorizationForm#61850486", - GetPassportAuthorizationFormAvailableElementsRequestTypeID: "getPassportAuthorizationFormAvailableElements#3fb314fc", - SendPassportAuthorizationFormRequestTypeID: "sendPassportAuthorizationForm#d9c77579", - SendPhoneNumberConfirmationCodeRequestTypeID: "sendPhoneNumberConfirmationCode#8eae6cd9", - ResendPhoneNumberConfirmationCodeRequestTypeID: "resendPhoneNumberConfirmationCode#7b537aea", - CheckPhoneNumberConfirmationCodeRequestTypeID: "checkPhoneNumberConfirmationCode#afa638da", - SetBotUpdatesStatusRequestTypeID: "setBotUpdatesStatus#bb293991", - UploadStickerFileRequestTypeID: "uploadStickerFile#269650c3", - GetSuggestedStickerSetNameRequestTypeID: "getSuggestedStickerSetName#b0120840", - CheckStickerSetNameRequestTypeID: "checkStickerSetName#955808fe", - CreateNewStickerSetRequestTypeID: "createNewStickerSet#19454551", - AddStickerToSetRequestTypeID: "addStickerToSet#56dc1e3b", - SetStickerSetThumbnailRequestTypeID: "setStickerSetThumbnail#6f813221", - SetCustomEmojiStickerSetThumbnailRequestTypeID: "setCustomEmojiStickerSetThumbnail#bd12e0ea", - SetStickerSetTitleRequestTypeID: "setStickerSetTitle#64e933a2", - DeleteStickerSetRequestTypeID: "deleteStickerSet#5e0a7bad", - SetStickerPositionInSetRequestTypeID: "setStickerPositionInSet#7bb24721", - RemoveStickerFromSetRequestTypeID: "removeStickerFromSet#61e1eea4", - SetStickerEmojisRequestTypeID: "setStickerEmojis#d9ec0431", - SetStickerKeywordsRequestTypeID: "setStickerKeywords#462481d", - SetStickerMaskPositionRequestTypeID: "setStickerMaskPosition#47a959d0", - GetMapThumbnailFileRequestTypeID: "getMapThumbnailFile#f6e6979a", - GetPremiumLimitRequestTypeID: "getPremiumLimit#4017fcea", - GetPremiumFeaturesRequestTypeID: "getPremiumFeatures#b4dc2649", - GetPremiumStickerExamplesRequestTypeID: "getPremiumStickerExamples#5369cb98", - ViewPremiumFeatureRequestTypeID: "viewPremiumFeature#b8031b2", - ClickPremiumSubscriptionButtonRequestTypeID: "clickPremiumSubscriptionButton#e9fca306", - GetPremiumStateRequestTypeID: "getPremiumState#278e3ae2", - CanPurchasePremiumRequestTypeID: "canPurchasePremium#e9de1cc0", - AssignAppStoreTransactionRequestTypeID: "assignAppStoreTransaction#86f30bb0", - AssignGooglePlayTransactionRequestTypeID: "assignGooglePlayTransaction#8939bca4", - AcceptTermsOfServiceRequestTypeID: "acceptTermsOfService#7efe03e4", - SearchStringsByPrefixRequestTypeID: "searchStringsByPrefix#a8145813", - SendCustomRequestRequestTypeID: "sendCustomRequest#10fd71a1", - AnswerCustomQueryRequestTypeID: "answerCustomQuery#b2e52d3f", - SetAlarmRequestTypeID: "setAlarm#cbef7e15", - GetCountriesRequestTypeID: "getCountries#fce8099e", - GetCountryCodeRequestTypeID: "getCountryCode#5bd398f2", - GetPhoneNumberInfoRequestTypeID: "getPhoneNumberInfo#a0229bf9", - GetPhoneNumberInfoSyncRequestTypeID: "getPhoneNumberInfoSync#209b7d38", - GetDeepLinkInfoRequestTypeID: "getDeepLinkInfo#28923f7e", - GetApplicationConfigRequestTypeID: "getApplicationConfig#93550682", - AddApplicationChangelogRequestTypeID: "addApplicationChangelog#8bf37fc9", - SaveApplicationLogEventRequestTypeID: "saveApplicationLogEvent#cfa6c20e", - GetApplicationDownloadLinkRequestTypeID: "getApplicationDownloadLink#6ad2fc4", - AddProxyRequestTypeID: "addProxy#13c2bcd8", - EditProxyRequestTypeID: "editProxy#a0482853", - EnableProxyRequestTypeID: "enableProxy#59138296", - DisableProxyRequestTypeID: "disableProxy#82d31782", - RemoveProxyRequestTypeID: "removeProxy#519ca307", - GetProxiesRequestTypeID: "getProxies#fa560333", - GetProxyLinkRequestTypeID: "getProxyLink#c125ae78", - PingProxyRequestTypeID: "pingProxy#c59b40b1", - SetLogStreamRequestTypeID: "setLogStream#aeaff791", - GetLogStreamRequestTypeID: "getLogStream#45984b5b", - SetLogVerbosityLevelRequestTypeID: "setLogVerbosityLevel#edea07d2", - GetLogVerbosityLevelRequestTypeID: "getLogVerbosityLevel#23689ae4", - GetLogTagsRequestTypeID: "getLogTags#f0d569da", - SetLogTagVerbosityLevelRequestTypeID: "setLogTagVerbosityLevel#8317d696", - GetLogTagVerbosityLevelRequestTypeID: "getLogTagVerbosityLevel#38af2d83", - AddLogMessageRequestTypeID: "addLogMessage#5f36cfec", - GetUserSupportInfoRequestTypeID: "getUserSupportInfo#74a59305", - SetUserSupportInfoRequestTypeID: "setUserSupportInfo#837c9803", - GetSupportNameRequestTypeID: "getSupportName#4d9e1562", - TestCallEmptyRequestTypeID: "testCallEmpty#da9c4a16", - TestCallStringRequestTypeID: "testCallString#98b74a2f", - TestCallBytesRequestTypeID: "testCallBytes#d4215aa9", - TestCallVectorIntRequestTypeID: "testCallVectorInt#65ed7e72", - TestCallVectorIntObjectRequestTypeID: "testCallVectorIntObject#ca57f472", - TestCallVectorStringRequestTypeID: "testCallVectorString#8e5a6ed8", - TestCallVectorStringObjectRequestTypeID: "testCallVectorStringObject#96cd6de", - TestSquareIntRequestTypeID: "testSquareInt#fc6a6990", - TestNetworkRequestTypeID: "testNetwork#afe4344b", - TestProxyRequestTypeID: "testProxy#b8a1a29e", - TestGetDifferenceRequestTypeID: "testGetDifference#68226325", - TestUseUpdateRequestTypeID: "testUseUpdate#2abdff1e", - TestReturnErrorRequestTypeID: "testReturnError#1b217cf2", + CountTypeID: "count#4d38f104", + TextTypeID: "text#22765898", + SecondsTypeID: "seconds#3936e58e", + FileDownloadedPrefixSizeTypeID: "fileDownloadedPrefixSize#87e267fb", + DeepLinkInfoTypeID: "deepLinkInfo#6f1ba0fe", + TextParseModeMarkdownTypeID: "textParseModeMarkdown#157648bf", + TextParseModeHTMLTypeID: "textParseModeHTML#62f4c5f3", + ProxyTypeSocks5TypeID: "proxyTypeSocks5#caf342b3", + ProxyTypeHTTPTypeID: "proxyTypeHttp#a3c7c777", + ProxyTypeMtprotoTypeID: "proxyTypeMtproto#8ae31ffd", + ProxyTypeID: "proxy#baf7b73", + ProxiesTypeID: "proxies#5ee27a86", + InputStickerTypeID: "inputSticker#e3d1ef79", + DateRangeTypeID: "dateRange#51150c66", + StatisticalValueTypeID: "statisticalValue#626d6a76", + StatisticalGraphDataTypeID: "statisticalGraphData#89732e2c", + StatisticalGraphAsyncTypeID: "statisticalGraphAsync#19fb2b9f", + StatisticalGraphErrorTypeID: "statisticalGraphError#c3fda052", + ChatStatisticsMessageInteractionInfoTypeID: "chatStatisticsMessageInteractionInfo#d25e2a2c", + ChatStatisticsMessageSenderInfoTypeID: "chatStatisticsMessageSenderInfo#690a7e4b", + ChatStatisticsAdministratorActionsInfoTypeID: "chatStatisticsAdministratorActionsInfo#e7c5cd7e", + ChatStatisticsInviterInfoTypeID: "chatStatisticsInviterInfo#2583d48b", + ChatStatisticsSupergroupTypeID: "chatStatisticsSupergroup#c67549ef", + ChatStatisticsChannelTypeID: "chatStatisticsChannel#9be23786", + MessageStatisticsTypeID: "messageStatistics#c3b781b0", + PointTypeID: "point#1a13f5b9", + VectorPathCommandLineTypeID: "vectorPathCommandLine#db663c8a", + VectorPathCommandCubicBezierCurveTypeID: "vectorPathCommandCubicBezierCurve#494c3e3a", + BotCommandScopeDefaultTypeID: "botCommandScopeDefault#2f6cb2ab", + BotCommandScopeAllPrivateChatsTypeID: "botCommandScopeAllPrivateChats#eb716739", + BotCommandScopeAllGroupChatsTypeID: "botCommandScopeAllGroupChats#c585c85e", + BotCommandScopeAllChatAdministratorsTypeID: "botCommandScopeAllChatAdministrators#771c1551", + BotCommandScopeChatTypeID: "botCommandScopeChat#e65b22a5", + BotCommandScopeChatAdministratorsTypeID: "botCommandScopeChatAdministrators#42bcfe4e", + BotCommandScopeChatMemberTypeID: "botCommandScopeChatMember#f36696f2", + UpdateAuthorizationStateTypeID: "updateAuthorizationState#60b30ee2", + UpdateNewMessageTypeID: "updateNewMessage#de6fb20e", + UpdateMessageSendAcknowledgedTypeID: "updateMessageSendAcknowledged#4da7d239", + UpdateMessageSendSucceededTypeID: "updateMessageSendSucceeded#6c399d7d", + UpdateMessageSendFailedTypeID: "updateMessageSendFailed#da1bf8e7", + UpdateMessageContentTypeID: "updateMessageContent#1e36bb24", + UpdateMessageEditedTypeID: "updateMessageEdited#dea602e6", + UpdateMessageIsPinnedTypeID: "updateMessageIsPinned#41bc233d", + UpdateMessageInteractionInfoTypeID: "updateMessageInteractionInfo#ab803bfe", + UpdateMessageContentOpenedTypeID: "updateMessageContentOpened#a55ea885", + UpdateMessageMentionReadTypeID: "updateMessageMentionRead#f0f74d46", + UpdateMessageUnreadReactionsTypeID: "updateMessageUnreadReactions#12a7220a", + UpdateMessageLiveLocationViewedTypeID: "updateMessageLiveLocationViewed#b2058595", + UpdateNewChatTypeID: "updateNewChat#7bb98ccd", + UpdateChatTitleTypeID: "updateChatTitle#f58b85a4", + UpdateChatPhotoTypeID: "updateChatPhoto#eca5423f", + UpdateChatAccentColorTypeID: "updateChatAccentColor#fc111634", + UpdateChatBackgroundCustomEmojiTypeID: "updateChatBackgroundCustomEmoji#dcbad97a", + UpdateChatPermissionsTypeID: "updateChatPermissions#9f52176d", + UpdateChatLastMessageTypeID: "updateChatLastMessage#f10cab1d", + UpdateChatPositionTypeID: "updateChatPosition#ff76fa77", + UpdateChatReadInboxTypeID: "updateChatReadInbox#d07036e7", + UpdateChatReadOutboxTypeID: "updateChatReadOutbox#2a385285", + UpdateChatActionBarTypeID: "updateChatActionBar#d9a258c2", + UpdateChatAvailableReactionsTypeID: "updateChatAvailableReactions#8ab413f9", + UpdateChatDraftMessageTypeID: "updateChatDraftMessage#2bf257d4", + UpdateChatMessageSenderTypeID: "updateChatMessageSender#77705241", + UpdateChatMessageAutoDeleteTimeTypeID: "updateChatMessageAutoDeleteTime#71425de5", + UpdateChatNotificationSettingsTypeID: "updateChatNotificationSettings#d020b456", + UpdateChatPendingJoinRequestsTypeID: "updateChatPendingJoinRequests#14c6e3e1", + UpdateChatReplyMarkupTypeID: "updateChatReplyMarkup#4e0ba5a0", + UpdateChatBackgroundTypeID: "updateChatBackground#ff9d38b3", + UpdateChatThemeTypeID: "updateChatTheme#31f3d465", + UpdateChatUnreadMentionCountTypeID: "updateChatUnreadMentionCount#80f47b1c", + UpdateChatUnreadReactionCountTypeID: "updateChatUnreadReactionCount#81603cdd", + UpdateChatVideoChatTypeID: "updateChatVideoChat#25fb4ca6", + UpdateChatDefaultDisableNotificationTypeID: "updateChatDefaultDisableNotification#1ba96a9b", + UpdateChatHasProtectedContentTypeID: "updateChatHasProtectedContent#6b50071b", + UpdateChatIsTranslatableTypeID: "updateChatIsTranslatable#7b031617", + UpdateChatIsMarkedAsUnreadTypeID: "updateChatIsMarkedAsUnread#57853334", + UpdateChatBlockListTypeID: "updateChatBlockList#872af48e", + UpdateChatHasScheduledMessagesTypeID: "updateChatHasScheduledMessages#7b14c2d7", + UpdateChatFoldersTypeID: "updateChatFolders#71a4b3a", + UpdateChatOnlineMemberCountTypeID: "updateChatOnlineMemberCount#1d0caa9d", + UpdateForumTopicInfoTypeID: "updateForumTopicInfo#6b6f2cc9", + UpdateScopeNotificationSettingsTypeID: "updateScopeNotificationSettings#b83ccb73", + UpdateNotificationTypeID: "updateNotification#8ee67ed4", + UpdateNotificationGroupTypeID: "updateNotificationGroup#96cd9e06", + UpdateActiveNotificationsTypeID: "updateActiveNotifications#317d80f2", + UpdateHavePendingNotificationsTypeID: "updateHavePendingNotifications#aaee1db", + UpdateDeleteMessagesTypeID: "updateDeleteMessages#6a05bf9", + UpdateChatActionTypeID: "updateChatAction#9abfd628", + UpdateUserStatusTypeID: "updateUserStatus#39211211", + UpdateUserTypeID: "updateUser#468928f9", + UpdateBasicGroupTypeID: "updateBasicGroup#c433c763", + UpdateSupergroupTypeID: "updateSupergroup#fb6c6524", + UpdateSecretChatTypeID: "updateSecretChat#9ca5132b", + UpdateUserFullInfoTypeID: "updateUserFullInfo#fcf2cb17", + UpdateBasicGroupFullInfoTypeID: "updateBasicGroupFullInfo#52f66bbf", + UpdateSupergroupFullInfoTypeID: "updateSupergroupFullInfo#19f5cd0e", + UpdateServiceNotificationTypeID: "updateServiceNotification#4e9895ad", + UpdateFileTypeID: "updateFile#6cd875f", + UpdateFileGenerationStartTypeID: "updateFileGenerationStart#cec5eec", + UpdateFileGenerationStopTypeID: "updateFileGenerationStop#8f14fdeb", + UpdateFileDownloadsTypeID: "updateFileDownloads#e8cd12c7", + UpdateFileAddedToDownloadsTypeID: "updateFileAddedToDownloads#5ff5921a", + UpdateFileDownloadTypeID: "updateFileDownload#342f83ca", + UpdateFileRemovedFromDownloadsTypeID: "updateFileRemovedFromDownloads#6e7c14e8", + UpdateCallTypeID: "updateCall#4fb3d0dd", + UpdateGroupCallTypeID: "updateGroupCall#30324e00", + UpdateGroupCallParticipantTypeID: "updateGroupCallParticipant#d0213cf9", + UpdateNewCallSignalingDataTypeID: "updateNewCallSignalingData#22c98d8d", + UpdateUserPrivacySettingRulesTypeID: "updateUserPrivacySettingRules#c99552f6", + UpdateUnreadMessageCountTypeID: "updateUnreadMessageCount#4b541c9", + UpdateUnreadChatCountTypeID: "updateUnreadChatCount#76e19242", + UpdateStoryTypeID: "updateStory#1906572f", + UpdateStoryDeletedTypeID: "updateStoryDeleted#7007eb9d", + UpdateStorySendSucceededTypeID: "updateStorySendSucceeded#b9269e57", + UpdateStorySendFailedTypeID: "updateStorySendFailed#e046f199", + UpdateChatActiveStoriesTypeID: "updateChatActiveStories#79786c2c", + UpdateStoryListChatCountTypeID: "updateStoryListChatCount#8833cd3f", + UpdateStoryStealthModeTypeID: "updateStoryStealthMode#6ff7bd1a", + UpdateOptionTypeID: "updateOption#35b17404", + UpdateStickerSetTypeID: "updateStickerSet#70035dcc", + UpdateInstalledStickerSetsTypeID: "updateInstalledStickerSets#82cd5388", + UpdateTrendingStickerSetsTypeID: "updateTrendingStickerSets#4b7a50a7", + UpdateRecentStickersTypeID: "updateRecentStickers#aefdf8dc", + UpdateFavoriteStickersTypeID: "updateFavoriteStickers#113f2b6a", + UpdateSavedAnimationsTypeID: "updateSavedAnimations#1084a1c8", + UpdateSavedNotificationSoundsTypeID: "updateSavedNotificationSounds#5a6653b4", + UpdateSelectedBackgroundTypeID: "updateSelectedBackground#99bd205d", + UpdateChatThemesTypeID: "updateChatThemes#98dc58d5", + UpdateAccentColorsTypeID: "updateAccentColors#1316555e", + UpdateLanguagePackStringsTypeID: "updateLanguagePackStrings#af87919f", + UpdateConnectionStateTypeID: "updateConnectionState#57939e2e", + UpdateTermsOfServiceTypeID: "updateTermsOfService#b23cc55e", + UpdateUsersNearbyTypeID: "updateUsersNearby#97c8ab5", + UpdateUnconfirmedSessionTypeID: "updateUnconfirmedSession#fea6088c", + UpdateAttachmentMenuBotsTypeID: "updateAttachmentMenuBots#b6b910c", + UpdateWebAppMessageSentTypeID: "updateWebAppMessageSent#58431229", + UpdateActiveEmojiReactionsTypeID: "updateActiveEmojiReactions#691ffcb7", + UpdateDefaultReactionTypeTypeID: "updateDefaultReactionType#4b615105", + UpdateDiceEmojisTypeID: "updateDiceEmojis#9d0f91df", + UpdateAnimatedEmojiMessageClickedTypeID: "updateAnimatedEmojiMessageClicked#a3167405", + UpdateAnimationSearchParametersTypeID: "updateAnimationSearchParameters#6016ef01", + UpdateSuggestedActionsTypeID: "updateSuggestedActions#c2e5cccb", + UpdateAddChatMembersPrivacyForbiddenTypeID: "updateAddChatMembersPrivacyForbidden#b8b50363", + UpdateAutosaveSettingsTypeID: "updateAutosaveSettings#da274f0b", + UpdateNewInlineQueryTypeID: "updateNewInlineQuery#7171bf34", + UpdateNewChosenInlineResultTypeID: "updateNewChosenInlineResult#cb4c4f5d", + UpdateNewCallbackQueryTypeID: "updateNewCallbackQuery#8964d05e", + UpdateNewInlineCallbackQueryTypeID: "updateNewInlineCallbackQuery#ecf934ba", + UpdateNewShippingQueryTypeID: "updateNewShippingQuery#29584672", + UpdateNewPreCheckoutQueryTypeID: "updateNewPreCheckoutQuery#2a3871c9", + UpdateNewCustomEventTypeID: "updateNewCustomEvent#76dd6a0c", + UpdateNewCustomQueryTypeID: "updateNewCustomQuery#d702f9a6", + UpdatePollTypeID: "updatePoll#966b73ca", + UpdatePollAnswerTypeID: "updatePollAnswer#b67ac547", + UpdateChatMemberTypeID: "updateChatMember#6000e29c", + UpdateNewChatJoinRequestTypeID: "updateNewChatJoinRequest#7e48b843", + UpdateChatBoostTypeID: "updateChatBoost#50727e24", + UpdatesTypeID: "updates#b9829222", + LogStreamDefaultTypeID: "logStreamDefault#52e296bc", + LogStreamFileTypeID: "logStreamFile#5b528de5", + LogStreamEmptyTypeID: "logStreamEmpty#e233f1cc", + LogVerbosityLevelTypeID: "logVerbosityLevel#676443ea", + LogTagsTypeID: "logTags#dc09ced4", + UserSupportInfoTypeID: "userSupportInfo#b50e1c29", + TestIntTypeID: "testInt#ddbd2c09", + TestStringTypeID: "testString#fe56688c", + TestBytesTypeID: "testBytes#a422c4de", + TestVectorIntTypeID: "testVectorInt#df9eb113", + TestVectorIntObjectTypeID: "testVectorIntObject#f152999b", + TestVectorStringTypeID: "testVectorString#5d6f85bc", + TestVectorStringObjectTypeID: "testVectorStringObject#e5ecc0d", + GetAuthorizationStateRequestTypeID: "getAuthorizationState#742dbe3d", + SetTdlibParametersRequestTypeID: "setTdlibParameters#52898239", + SetAuthenticationPhoneNumberRequestTypeID: "setAuthenticationPhoneNumber#33c0d823", + SetAuthenticationEmailAddressRequestTypeID: "setAuthenticationEmailAddress#69b2c502", + ResendAuthenticationCodeRequestTypeID: "resendAuthenticationCode#cf759719", + CheckAuthenticationEmailCodeRequestTypeID: "checkAuthenticationEmailCode#dd42c29f", + CheckAuthenticationCodeRequestTypeID: "checkAuthenticationCode#edfe44aa", + RequestQrCodeAuthenticationRequestTypeID: "requestQrCodeAuthentication#56fe3c4e", + RegisterUserRequestTypeID: "registerUser#f9719e1d", + ResetAuthenticationEmailAddressRequestTypeID: "resetAuthenticationEmailAddress#e742722c", + CheckAuthenticationPasswordRequestTypeID: "checkAuthenticationPassword#87424ba0", + RequestAuthenticationPasswordRecoveryRequestTypeID: "requestAuthenticationPasswordRecovery#53152ab6", + CheckAuthenticationPasswordRecoveryCodeRequestTypeID: "checkAuthenticationPasswordRecoveryCode#dc0a3be5", + RecoverAuthenticationPasswordRequestTypeID: "recoverAuthenticationPassword#f8311523", + SendAuthenticationFirebaseSMSRequestTypeID: "sendAuthenticationFirebaseSms#15c15e3f", + CheckAuthenticationBotTokenRequestTypeID: "checkAuthenticationBotToken#261b4476", + LogOutRequestTypeID: "logOut#a1b5c41b", + CloseRequestTypeID: "close#b933e17f", + DestroyRequestTypeID: "destroy#28d9534a", + ConfirmQrCodeAuthenticationRequestTypeID: "confirmQrCodeAuthentication#e993a72d", + GetCurrentStateRequestTypeID: "getCurrentState#b8fc6889", + SetDatabaseEncryptionKeyRequestTypeID: "setDatabaseEncryptionKey#b83345b5", + GetPasswordStateRequestTypeID: "getPasswordState#f5957b78", + SetPasswordRequestTypeID: "setPassword#b8db46dd", + SetLoginEmailAddressRequestTypeID: "setLoginEmailAddress#37bb43d4", + ResendLoginEmailAddressCodeRequestTypeID: "resendLoginEmailAddressCode#11765215", + CheckLoginEmailAddressCodeRequestTypeID: "checkLoginEmailAddressCode#a951fc62", + GetRecoveryEmailAddressRequestTypeID: "getRecoveryEmailAddress#a0f1b9fd", + SetRecoveryEmailAddressRequestTypeID: "setRecoveryEmailAddress#89df939f", + CheckRecoveryEmailAddressCodeRequestTypeID: "checkRecoveryEmailAddressCode#88f7981b", + ResendRecoveryEmailAddressCodeRequestTypeID: "resendRecoveryEmailAddressCode#19d66f1c", + RequestPasswordRecoveryRequestTypeID: "requestPasswordRecovery#ff2dc552", + CheckPasswordRecoveryCodeRequestTypeID: "checkPasswordRecoveryCode#f4081e18", + RecoverPasswordRequestTypeID: "recoverPassword#a5259973", + ResetPasswordRequestTypeID: "resetPassword#dc9e8c9d", + CancelPasswordResetRequestTypeID: "cancelPasswordReset#38127462", + CreateTemporaryPasswordRequestTypeID: "createTemporaryPassword#9f0d6f86", + GetTemporaryPasswordStateRequestTypeID: "getTemporaryPasswordState#ff3ea892", + GetMeRequestTypeID: "getMe#f495b27f", + GetUserRequestTypeID: "getUser#42999c0b", + GetUserFullInfoRequestTypeID: "getUserFullInfo#d1b29c58", + GetBasicGroupRequestTypeID: "getBasicGroup#9e893654", + GetBasicGroupFullInfoRequestTypeID: "getBasicGroupFullInfo#9365e32b", + GetSupergroupRequestTypeID: "getSupergroup#3afd10e2", + GetSupergroupFullInfoRequestTypeID: "getSupergroupFullInfo#418d4038", + GetSecretChatRequestTypeID: "getSecretChat#26b7e81", + GetChatRequestTypeID: "getChat#6f421440", + GetMessageRequestTypeID: "getMessage#9372c080", + GetMessageLocallyRequestTypeID: "getMessageLocally#dc062b6c", + GetRepliedMessageRequestTypeID: "getRepliedMessage#d9bd19bd", + GetChatPinnedMessageRequestTypeID: "getChatPinnedMessage#15731ab0", + GetCallbackQueryMessageRequestTypeID: "getCallbackQueryMessage#bd209172", + GetMessagesRequestTypeID: "getMessages#d5dd28bf", + GetMessageThreadRequestTypeID: "getMessageThread#7af23e3e", + GetMessageViewersRequestTypeID: "getMessageViewers#a18f1ace", + GetFileRequestTypeID: "getFile#5c9efd4e", + GetRemoteFileRequestTypeID: "getRemoteFile#7f632732", + LoadChatsRequestTypeID: "loadChats#8f9b7d7b", + GetChatsRequestTypeID: "getChats#c604bac2", + SearchPublicChatRequestTypeID: "searchPublicChat#3316d9ad", + SearchPublicChatsRequestTypeID: "searchPublicChats#39d6e7b9", + SearchChatsRequestTypeID: "searchChats#8ff4b9cc", + SearchChatsOnServerRequestTypeID: "searchChatsOnServer#baf42f74", + SearchChatsNearbyRequestTypeID: "searchChatsNearby#f445c81f", + GetTopChatsRequestTypeID: "getTopChats#e8d95221", + RemoveTopChatRequestTypeID: "removeTopChat#8e481e55", + SearchRecentlyFoundChatsRequestTypeID: "searchRecentlyFoundChats#62320591", + AddRecentlyFoundChatRequestTypeID: "addRecentlyFoundChat#97e8198d", + RemoveRecentlyFoundChatRequestTypeID: "removeRecentlyFoundChat#2ac1bf1c", + ClearRecentlyFoundChatsRequestTypeID: "clearRecentlyFoundChats#eefa5b32", + GetRecentlyOpenedChatsRequestTypeID: "getRecentlyOpenedChats#8d4fb223", + CheckChatUsernameRequestTypeID: "checkChatUsername#f8e66210", + GetCreatedPublicChatsRequestTypeID: "getCreatedPublicChats#2a5725ef", + CheckCreatedPublicChatsLimitRequestTypeID: "checkCreatedPublicChatsLimit#e5717fa1", + GetSuitableDiscussionChatsRequestTypeID: "getSuitableDiscussionChats#2ec5df6", + GetInactiveSupergroupChatsRequestTypeID: "getInactiveSupergroupChats#d8cbf9b5", + GetGroupsInCommonRequestTypeID: "getGroupsInCommon#16bdd36a", + GetChatHistoryRequestTypeID: "getChatHistory#d051927d", + GetMessageThreadHistoryRequestTypeID: "getMessageThreadHistory#9435d428", + DeleteChatHistoryRequestTypeID: "deleteChatHistory#a841d09f", + DeleteChatRequestTypeID: "deleteChat#f5cae05e", + SearchChatMessagesRequestTypeID: "searchChatMessages#70023dfc", + SearchMessagesRequestTypeID: "searchMessages#2a8f08a7", + SearchSecretMessagesRequestTypeID: "searchSecretMessages#cd2a4c9c", + SearchCallMessagesRequestTypeID: "searchCallMessages#8c3bef1b", + SearchOutgoingDocumentMessagesRequestTypeID: "searchOutgoingDocumentMessages#c023c47e", + DeleteAllCallMessagesRequestTypeID: "deleteAllCallMessages#a897d1f3", + SearchChatRecentLocationMessagesRequestTypeID: "searchChatRecentLocationMessages#38a37ee6", + GetActiveLiveLocationMessagesRequestTypeID: "getActiveLiveLocationMessages#ab093691", + GetChatMessageByDateRequestTypeID: "getChatMessageByDate#3f557136", + GetChatSparseMessagePositionsRequestTypeID: "getChatSparseMessagePositions#e472f784", + GetChatMessageCalendarRequestTypeID: "getChatMessageCalendar#ec8f2114", + GetChatMessageCountRequestTypeID: "getChatMessageCount#c3eb1ac", + GetChatMessagePositionRequestTypeID: "getChatMessagePosition#dea71718", + GetChatScheduledMessagesRequestTypeID: "getChatScheduledMessages#df3d2ffb", + GetChatSponsoredMessagesRequestTypeID: "getChatSponsoredMessages#50a84098", + ClickChatSponsoredMessageRequestTypeID: "clickChatSponsoredMessage#d9c09feb", + RemoveNotificationRequestTypeID: "removeNotification#336ab34e", + RemoveNotificationGroupRequestTypeID: "removeNotificationGroup#661a638e", + GetMessageLinkRequestTypeID: "getMessageLink#c556ef7a", + GetMessageEmbeddingCodeRequestTypeID: "getMessageEmbeddingCode#62a4cd09", + GetMessageLinkInfoRequestTypeID: "getMessageLinkInfo#d63eb458", + TranslateTextRequestTypeID: "translateText#252264f2", + TranslateMessageTextRequestTypeID: "translateMessageText#53c51ed2", + RecognizeSpeechRequestTypeID: "recognizeSpeech#67d402b9", + RateSpeechRecognitionRequestTypeID: "rateSpeechRecognition#eedcc3b5", + GetChatAvailableMessageSendersRequestTypeID: "getChatAvailableMessageSenders#450fe92b", + SetChatMessageSenderRequestTypeID: "setChatMessageSender#ab456b7e", + SendMessageRequestTypeID: "sendMessage#e02d01e9", + SendMessageAlbumRequestTypeID: "sendMessageAlbum#74bcdacf", + SendBotStartMessageRequestTypeID: "sendBotStartMessage#aa6a3eee", + SendInlineQueryResultMessageRequestTypeID: "sendInlineQueryResultMessage#467c5478", + ForwardMessagesRequestTypeID: "forwardMessages#34de5b20", + ResendMessagesRequestTypeID: "resendMessages#4a0c68af", + AddLocalMessageRequestTypeID: "addLocalMessage#f617b7a1", + DeleteMessagesRequestTypeID: "deleteMessages#c3ed9de2", + DeleteChatMessagesBySenderRequestTypeID: "deleteChatMessagesBySender#ba9b2e67", + DeleteChatMessagesByDateRequestTypeID: "deleteChatMessagesByDate#9e44e0bf", + EditMessageTextRequestTypeID: "editMessageText#bb2e1b7", + EditMessageLiveLocationRequestTypeID: "editMessageLiveLocation#ff29a512", + EditMessageMediaRequestTypeID: "editMessageMedia#bb4b8713", + EditMessageCaptionRequestTypeID: "editMessageCaption#44d2f92e", + EditMessageReplyMarkupRequestTypeID: "editMessageReplyMarkup#13cbde89", + EditInlineMessageTextRequestTypeID: "editInlineMessageText#cd02c1e5", + EditInlineMessageLiveLocationRequestTypeID: "editInlineMessageLiveLocation#f6a5da00", + EditInlineMessageMediaRequestTypeID: "editInlineMessageMedia#1676781", + EditInlineMessageCaptionRequestTypeID: "editInlineMessageCaption#d2a446b7", + EditInlineMessageReplyMarkupRequestTypeID: "editInlineMessageReplyMarkup#fbf906de", + EditMessageSchedulingStateRequestTypeID: "editMessageSchedulingState#ae2a0bc0", + GetForumTopicDefaultIconsRequestTypeID: "getForumTopicDefaultIcons#583574dc", + CreateForumTopicRequestTypeID: "createForumTopic#c1fa28e4", + EditForumTopicRequestTypeID: "editForumTopic#a7769060", + GetForumTopicRequestTypeID: "getForumTopic#e59bfe41", + GetForumTopicLinkRequestTypeID: "getForumTopicLink#c97b88cb", + GetForumTopicsRequestTypeID: "getForumTopics#fbab7d5a", + SetForumTopicNotificationSettingsRequestTypeID: "setForumTopicNotificationSettings#1f433467", + ToggleForumTopicIsClosedRequestTypeID: "toggleForumTopicIsClosed#c7648af3", + ToggleGeneralForumTopicIsHiddenRequestTypeID: "toggleGeneralForumTopicIsHidden#5f1d1448", + ToggleForumTopicIsPinnedRequestTypeID: "toggleForumTopicIsPinned#466ceab4", + SetPinnedForumTopicsRequestTypeID: "setPinnedForumTopics#ddf26f21", + DeleteForumTopicRequestTypeID: "deleteForumTopic#6f285cb8", + GetEmojiReactionRequestTypeID: "getEmojiReaction#e53411dc", + GetCustomEmojiReactionAnimationsRequestTypeID: "getCustomEmojiReactionAnimations#49748dd2", + GetMessageAvailableReactionsRequestTypeID: "getMessageAvailableReactions#76db86b2", + ClearRecentReactionsRequestTypeID: "clearRecentReactions#4d61c752", + AddMessageReactionRequestTypeID: "addMessageReaction#549855ed", + RemoveMessageReactionRequestTypeID: "removeMessageReaction#97474d7b", + GetMessageAddedReactionsRequestTypeID: "getMessageAddedReactions#7dc6ae52", + SetDefaultReactionTypeRequestTypeID: "setDefaultReactionType#65038a3d", + SearchQuoteRequestTypeID: "searchQuote#6864011f", + GetTextEntitiesRequestTypeID: "getTextEntities#eba543fb", + ParseTextEntitiesRequestTypeID: "parseTextEntities#9a1fc29f", + ParseMarkdownRequestTypeID: "parseMarkdown#2d153aef", + GetMarkdownTextRequestTypeID: "getMarkdownText#9ce7228", + GetFileMimeTypeRequestTypeID: "getFileMimeType#84631b89", + GetFileExtensionRequestTypeID: "getFileExtension#f9adb934", + CleanFileNameRequestTypeID: "cleanFileName#39b1f7fb", + GetLanguagePackStringRequestTypeID: "getLanguagePackString#8fcde73", + GetJSONValueRequestTypeID: "getJsonValue#92fa5a05", + GetJSONStringRequestTypeID: "getJsonString#278b9421", + GetThemeParametersJSONStringRequestTypeID: "getThemeParametersJsonString#91b905f8", + SetPollAnswerRequestTypeID: "setPollAnswer#5303b916", + GetPollVotersRequestTypeID: "getPollVoters#c45ba9ac", + StopPollRequestTypeID: "stopPoll#62e80aad", + HideSuggestedActionRequestTypeID: "hideSuggestedAction#a2ef2b7f", + GetLoginURLInfoRequestTypeID: "getLoginUrlInfo#ccc99db3", + GetLoginURLRequestTypeID: "getLoginUrl#2f3295d1", + ShareUserWithBotRequestTypeID: "shareUserWithBot#f132ffdc", + ShareChatWithBotRequestTypeID: "shareChatWithBot#a6530ae2", + GetInlineQueryResultsRequestTypeID: "getInlineQueryResults#79dcf86c", + AnswerInlineQueryRequestTypeID: "answerInlineQuery#ac7cc5e6", + SearchWebAppRequestTypeID: "searchWebApp#b5fc8a35", + GetWebAppLinkURLRequestTypeID: "getWebAppLinkUrl#4f0ef3cc", + GetWebAppURLRequestTypeID: "getWebAppUrl#64c42cbe", + SendWebAppDataRequestTypeID: "sendWebAppData#ab1fce0c", + OpenWebAppRequestTypeID: "openWebApp#b02666b0", + CloseWebAppRequestTypeID: "closeWebApp#68a124c6", + AnswerWebAppQueryRequestTypeID: "answerWebAppQuery#a0b49cf1", + GetCallbackQueryAnswerRequestTypeID: "getCallbackQueryAnswer#6ef7a5f", + AnswerCallbackQueryRequestTypeID: "answerCallbackQuery#bb462e76", + AnswerShippingQueryRequestTypeID: "answerShippingQuery#7a3c2432", + AnswerPreCheckoutQueryRequestTypeID: "answerPreCheckoutQuery#a76163eb", + SetGameScoreRequestTypeID: "setGameScore#7eccedc6", + SetInlineGameScoreRequestTypeID: "setInlineGameScore#c7715d8b", + GetGameHighScoresRequestTypeID: "getGameHighScores#f0459b", + GetInlineGameHighScoresRequestTypeID: "getInlineGameHighScores#e0396baa", + DeleteChatReplyMarkupRequestTypeID: "deleteChatReplyMarkup#5ff9b5b", + SendChatActionRequestTypeID: "sendChatAction#7cfce154", + OpenChatRequestTypeID: "openChat#ecb9be0b", + CloseChatRequestTypeID: "closeChat#25e86e9", + ViewMessagesRequestTypeID: "viewMessages#aa2f0438", + OpenMessageContentRequestTypeID: "openMessageContent#d3f2697b", + ClickAnimatedEmojiMessageRequestTypeID: "clickAnimatedEmojiMessage#bb17662", + GetInternalLinkRequestTypeID: "getInternalLink#3960f1b0", + GetInternalLinkTypeRequestTypeID: "getInternalLinkType#8bdd5709", + GetExternalLinkInfoRequestTypeID: "getExternalLinkInfo#460d7a3f", + GetExternalLinkRequestTypeID: "getExternalLink#5e92f0eb", + ReadAllChatMentionsRequestTypeID: "readAllChatMentions#50eab2b5", + ReadAllMessageThreadMentionsRequestTypeID: "readAllMessageThreadMentions#4edd7555", + ReadAllChatReactionsRequestTypeID: "readAllChatReactions#54c1976d", + ReadAllMessageThreadReactionsRequestTypeID: "readAllMessageThreadReactions#d0bc273e", + CreatePrivateChatRequestTypeID: "createPrivateChat#c7825b09", + CreateBasicGroupChatRequestTypeID: "createBasicGroupChat#758ab4e4", + CreateSupergroupChatRequestTypeID: "createSupergroupChat#46c770eb", + CreateSecretChatRequestTypeID: "createSecretChat#730dd22f", + CreateNewBasicGroupChatRequestTypeID: "createNewBasicGroupChat#c479e224", + CreateNewSupergroupChatRequestTypeID: "createNewSupergroupChat#2fecf6c6", + CreateNewSecretChatRequestTypeID: "createNewSecretChat#db012265", + UpgradeBasicGroupChatToSupergroupChatRequestTypeID: "upgradeBasicGroupChatToSupergroupChat#11e915ba", + GetChatListsToAddChatRequestTypeID: "getChatListsToAddChat#2709d6a1", + AddChatToListRequestTypeID: "addChatToList#fb334eb5", + GetChatFolderRequestTypeID: "getChatFolder#5882a98", + CreateChatFolderRequestTypeID: "createChatFolder#3c85c500", + EditChatFolderRequestTypeID: "editChatFolder#332fb32", + DeleteChatFolderRequestTypeID: "deleteChatFolder#74260b87", + GetChatFolderChatsToLeaveRequestTypeID: "getChatFolderChatsToLeave#8dc1e6af", + GetChatFolderChatCountRequestTypeID: "getChatFolderChatCount#7dd4cbbe", + ReorderChatFoldersRequestTypeID: "reorderChatFolders#59544c32", + GetRecommendedChatFoldersRequestTypeID: "getRecommendedChatFolders#f7533b87", + GetChatFolderDefaultIconNameRequestTypeID: "getChatFolderDefaultIconName#2cf7a067", + GetChatsForChatFolderInviteLinkRequestTypeID: "getChatsForChatFolderInviteLink#6fac4949", + CreateChatFolderInviteLinkRequestTypeID: "createChatFolderInviteLink#fba5e198", + GetChatFolderInviteLinksRequestTypeID: "getChatFolderInviteLinks#139d5be0", + EditChatFolderInviteLinkRequestTypeID: "editChatFolderInviteLink#5cc415a8", + DeleteChatFolderInviteLinkRequestTypeID: "deleteChatFolderInviteLink#c890717e", + CheckChatFolderInviteLinkRequestTypeID: "checkChatFolderInviteLink#1f25999b", + AddChatFolderByInviteLinkRequestTypeID: "addChatFolderByInviteLink#1ed19dae", + GetChatFolderNewChatsRequestTypeID: "getChatFolderNewChats#7e8d2ccc", + ProcessChatFolderNewChatsRequestTypeID: "processChatFolderNewChats#109f8a8b", + GetArchiveChatListSettingsRequestTypeID: "getArchiveChatListSettings#838d8e60", + SetArchiveChatListSettingsRequestTypeID: "setArchiveChatListSettings#cb454c0a", + SetChatTitleRequestTypeID: "setChatTitle#9cabebf", + SetChatPhotoRequestTypeID: "setChatPhoto#e97b8d03", + SetChatAccentColorRequestTypeID: "setChatAccentColor#349f57ca", + SetChatMessageAutoDeleteTimeRequestTypeID: "setChatMessageAutoDeleteTime#a641b4ff", + SetChatPermissionsRequestTypeID: "setChatPermissions#7f7706fe", + SetChatBackgroundRequestTypeID: "setChatBackground#3d3f1b28", + SetChatThemeRequestTypeID: "setChatTheme#8f090293", + SetChatDraftMessageRequestTypeID: "setChatDraftMessage#645e1f1a", + SetChatNotificationSettingsRequestTypeID: "setChatNotificationSettings#2e531ffe", + ToggleChatHasProtectedContentRequestTypeID: "toggleChatHasProtectedContent#3a20d94d", + ToggleChatIsTranslatableRequestTypeID: "toggleChatIsTranslatable#93f9cbdf", + ToggleChatIsMarkedAsUnreadRequestTypeID: "toggleChatIsMarkedAsUnread#c538dadf", + ToggleChatDefaultDisableNotificationRequestTypeID: "toggleChatDefaultDisableNotification#12c36012", + SetChatAvailableReactionsRequestTypeID: "setChatAvailableReactions#feb3e06", + SetChatClientDataRequestTypeID: "setChatClientData#ceb3273d", + SetChatDescriptionRequestTypeID: "setChatDescription#74a8b45d", + SetChatDiscussionGroupRequestTypeID: "setChatDiscussionGroup#c93c32b8", + SetChatLocationRequestTypeID: "setChatLocation#d2471daa", + SetChatSlowModeDelayRequestTypeID: "setChatSlowModeDelay#dfcae63e", + PinChatMessageRequestTypeID: "pinChatMessage#79475baf", + UnpinChatMessageRequestTypeID: "unpinChatMessage#7b1c3ede", + UnpinAllChatMessagesRequestTypeID: "unpinAllChatMessages#aa4cd4b7", + UnpinAllMessageThreadMessagesRequestTypeID: "unpinAllMessageThreadMessages#b7c69f00", + JoinChatRequestTypeID: "joinChat#137a1aa1", + LeaveChatRequestTypeID: "leaveChat#93377a61", + AddChatMemberRequestTypeID: "addChatMember#1dc4a5fa", + AddChatMembersRequestTypeID: "addChatMembers#b4f60138", + SetChatMemberStatusRequestTypeID: "setChatMemberStatus#4e0171f", + BanChatMemberRequestTypeID: "banChatMember#cb107d7c", + CanTransferOwnershipRequestTypeID: "canTransferOwnership#25d3440c", + TransferChatOwnershipRequestTypeID: "transferChatOwnership#77a00a13", + GetChatMemberRequestTypeID: "getChatMember#d0c15272", + SearchChatMembersRequestTypeID: "searchChatMembers#e56d46c5", + GetChatAdministratorsRequestTypeID: "getChatAdministrators#5c0eb6bb", + ClearAllDraftMessagesRequestTypeID: "clearAllDraftMessages#fd3c74db", + GetSavedNotificationSoundRequestTypeID: "getSavedNotificationSound#1b647917", + GetSavedNotificationSoundsRequestTypeID: "getSavedNotificationSounds#c0346fa8", + AddSavedNotificationSoundRequestTypeID: "addSavedNotificationSound#3e3984ef", + RemoveSavedNotificationSoundRequestTypeID: "removeSavedNotificationSound#e363474e", + GetChatNotificationSettingsExceptionsRequestTypeID: "getChatNotificationSettingsExceptions#bfe0e11", + GetScopeNotificationSettingsRequestTypeID: "getScopeNotificationSettings#c4a8254f", + SetScopeNotificationSettingsRequestTypeID: "setScopeNotificationSettings#85cfb63a", + ResetAllNotificationSettingsRequestTypeID: "resetAllNotificationSettings#f5a0a8f9", + ToggleChatIsPinnedRequestTypeID: "toggleChatIsPinned#a776263e", + SetPinnedChatsRequestTypeID: "setPinnedChats#c6c6edf1", + ReadChatListRequestTypeID: "readChatList#bd6498aa", + GetStoryRequestTypeID: "getStory#717b1c78", + GetChatsToSendStoriesRequestTypeID: "getChatsToSendStories#22f9e3a4", + CanSendStoryRequestTypeID: "canSendStory#b6e0216b", + SendStoryRequestTypeID: "sendStory#53242a4", + EditStoryRequestTypeID: "editStory#5e6a21b1", + SetStoryPrivacySettingsRequestTypeID: "setStoryPrivacySettings#1b6c5434", + ToggleStoryIsPinnedRequestTypeID: "toggleStoryIsPinned#b493b30e", + DeleteStoryRequestTypeID: "deleteStory#9f35af16", + GetStoryNotificationSettingsExceptionsRequestTypeID: "getStoryNotificationSettingsExceptions#256a2eb0", + LoadActiveStoriesRequestTypeID: "loadActiveStories#7d8cf738", + SetChatActiveStoriesListRequestTypeID: "setChatActiveStoriesList#e0e35d11", + GetChatActiveStoriesRequestTypeID: "getChatActiveStories#2e4ffbf5", + GetChatPinnedStoriesRequestTypeID: "getChatPinnedStories#53c82a1", + GetChatArchivedStoriesRequestTypeID: "getChatArchivedStories#af1e9488", + OpenStoryRequestTypeID: "openStory#ceda7c7d", + CloseStoryRequestTypeID: "closeStory#443d0f55", + GetStoryAvailableReactionsRequestTypeID: "getStoryAvailableReactions#23854d3b", + SetStoryReactionRequestTypeID: "setStoryReaction#ac8b4fa7", + GetStoryViewersRequestTypeID: "getStoryViewers#40df8dba", + ReportStoryRequestTypeID: "reportStory#9b5f709b", + ActivateStoryStealthModeRequestTypeID: "activateStoryStealthMode#c3db8491", + GetAvailableChatBoostSlotsRequestTypeID: "getAvailableChatBoostSlots#7307ebd5", + GetChatBoostStatusRequestTypeID: "getChatBoostStatus#cfac8acf", + BoostChatRequestTypeID: "boostChat#890ccd68", + GetChatBoostLinkRequestTypeID: "getChatBoostLink#56f16c85", + GetChatBoostLinkInfoRequestTypeID: "getChatBoostLinkInfo#26fc4b5c", + GetChatBoostsRequestTypeID: "getChatBoosts#ab5eaa38", + GetUserChatBoostsRequestTypeID: "getUserChatBoosts#b90ee799", + GetAttachmentMenuBotRequestTypeID: "getAttachmentMenuBot#3da561fb", + ToggleBotIsAddedToAttachmentMenuRequestTypeID: "toggleBotIsAddedToAttachmentMenu#8e59de9a", + GetThemedEmojiStatusesRequestTypeID: "getThemedEmojiStatuses#6ac5c8c2", + GetRecentEmojiStatusesRequestTypeID: "getRecentEmojiStatuses#ae3a3d29", + GetDefaultEmojiStatusesRequestTypeID: "getDefaultEmojiStatuses#24e45ec3", + ClearRecentEmojiStatusesRequestTypeID: "clearRecentEmojiStatuses#e671cb5e", + DownloadFileRequestTypeID: "downloadFile#3f253234", + GetFileDownloadedPrefixSizeRequestTypeID: "getFileDownloadedPrefixSize#3304bd2d", + CancelDownloadFileRequestTypeID: "cancelDownloadFile#8b8052de", + GetSuggestedFileNameRequestTypeID: "getSuggestedFileName#85d8a486", + PreliminaryUploadFileRequestTypeID: "preliminaryUploadFile#70e7cb99", + CancelPreliminaryUploadFileRequestTypeID: "cancelPreliminaryUploadFile#311446be", + WriteGeneratedFilePartRequestTypeID: "writeGeneratedFilePart#cc89e95", + SetFileGenerationProgressRequestTypeID: "setFileGenerationProgress#6d754b3e", + FinishFileGenerationRequestTypeID: "finishFileGeneration#c11d0c9d", + ReadFilePartRequestTypeID: "readFilePart#360ca70d", + DeleteFileRequestTypeID: "deleteFile#6bbe9b2c", + AddFileToDownloadsRequestTypeID: "addFileToDownloads#33b583b7", + ToggleDownloadIsPausedRequestTypeID: "toggleDownloadIsPaused#c7866715", + ToggleAllDownloadsArePausedRequestTypeID: "toggleAllDownloadsArePaused#4a989002", + RemoveFileFromDownloadsRequestTypeID: "removeFileFromDownloads#5706bfee", + RemoveAllFilesFromDownloadsRequestTypeID: "removeAllFilesFromDownloads#b9487686", + SearchFileDownloadsRequestTypeID: "searchFileDownloads#2a1e0856", + GetMessageFileTypeRequestTypeID: "getMessageFileType#e2c70fd4", + GetMessageImportConfirmationTextRequestTypeID: "getMessageImportConfirmationText#174881a8", + ImportMessagesRequestTypeID: "importMessages#7e98592b", + ReplacePrimaryChatInviteLinkRequestTypeID: "replacePrimaryChatInviteLink#3f9e7b9d", + CreateChatInviteLinkRequestTypeID: "createChatInviteLink#1126a341", + EditChatInviteLinkRequestTypeID: "editChatInviteLink#4eb23d7c", + GetChatInviteLinkRequestTypeID: "getChatInviteLink#e36a41fd", + GetChatInviteLinkCountsRequestTypeID: "getChatInviteLinkCounts#3510e291", + GetChatInviteLinksRequestTypeID: "getChatInviteLinks#34a55cac", + GetChatInviteLinkMembersRequestTypeID: "getChatInviteLinkMembers#c5b6199a", + RevokeChatInviteLinkRequestTypeID: "revokeChatInviteLink#d1b755a9", + DeleteRevokedChatInviteLinkRequestTypeID: "deleteRevokedChatInviteLink#91270c7f", + DeleteAllRevokedChatInviteLinksRequestTypeID: "deleteAllRevokedChatInviteLinks#424816da", + CheckChatInviteLinkRequestTypeID: "checkChatInviteLink#e261483b", + JoinChatByInviteLinkRequestTypeID: "joinChatByInviteLink#c16aab86", + GetChatJoinRequestsRequestTypeID: "getChatJoinRequests#e8d90ea2", + ProcessChatJoinRequestRequestTypeID: "processChatJoinRequest#3be534a3", + ProcessChatJoinRequestsRequestTypeID: "processChatJoinRequests#3e823dce", + CreateCallRequestTypeID: "createCall#be282e10", + AcceptCallRequestTypeID: "acceptCall#d97562d0", + SendCallSignalingDataRequestTypeID: "sendCallSignalingData#542db19c", + DiscardCallRequestTypeID: "discardCall#95a9a57e", + SendCallRatingRequestTypeID: "sendCallRating#d89b576c", + SendCallDebugInformationRequestTypeID: "sendCallDebugInformation#785b373f", + SendCallLogRequestTypeID: "sendCallLog#3f0a47d1", + GetVideoChatAvailableParticipantsRequestTypeID: "getVideoChatAvailableParticipants#c45da305", + SetVideoChatDefaultParticipantRequestTypeID: "setVideoChatDefaultParticipant#f1a672b3", + CreateVideoChatRequestTypeID: "createVideoChat#7ea4958d", + GetVideoChatRtmpURLRequestTypeID: "getVideoChatRtmpUrl#482b1b1f", + ReplaceVideoChatRtmpURLRequestTypeID: "replaceVideoChatRtmpUrl#214f8fe0", + GetGroupCallRequestTypeID: "getGroupCall#5787668e", + StartScheduledGroupCallRequestTypeID: "startScheduledGroupCall#5a986d16", + ToggleGroupCallEnabledStartNotificationRequestTypeID: "toggleGroupCallEnabledStartNotification#2a30c752", + JoinGroupCallRequestTypeID: "joinGroupCall#c1c947e5", + StartGroupCallScreenSharingRequestTypeID: "startGroupCallScreenSharing#cb4e312d", + ToggleGroupCallScreenSharingIsPausedRequestTypeID: "toggleGroupCallScreenSharingIsPaused#a07b5360", + EndGroupCallScreenSharingRequestTypeID: "endGroupCallScreenSharing#85f41c4c", + SetGroupCallTitleRequestTypeID: "setGroupCallTitle#b6c19dcd", + ToggleGroupCallMuteNewParticipantsRequestTypeID: "toggleGroupCallMuteNewParticipants#10eec1c2", + InviteGroupCallParticipantsRequestTypeID: "inviteGroupCallParticipants#56c030a6", + GetGroupCallInviteLinkRequestTypeID: "getGroupCallInviteLink#2ae14924", + RevokeGroupCallInviteLinkRequestTypeID: "revokeGroupCallInviteLink#1de5a494", + StartGroupCallRecordingRequestTypeID: "startGroupCallRecording#68c5847b", + EndGroupCallRecordingRequestTypeID: "endGroupCallRecording#fb7b6289", + ToggleGroupCallIsMyVideoPausedRequestTypeID: "toggleGroupCallIsMyVideoPaused#e374f199", + ToggleGroupCallIsMyVideoEnabledRequestTypeID: "toggleGroupCallIsMyVideoEnabled#9f2f50fa", + SetGroupCallParticipantIsSpeakingRequestTypeID: "setGroupCallParticipantIsSpeaking#3748a1e5", + ToggleGroupCallParticipantIsMutedRequestTypeID: "toggleGroupCallParticipantIsMuted#b2081407", + SetGroupCallParticipantVolumeLevelRequestTypeID: "setGroupCallParticipantVolumeLevel#97779828", + ToggleGroupCallParticipantIsHandRaisedRequestTypeID: "toggleGroupCallParticipantIsHandRaised#8efb63e1", + LoadGroupCallParticipantsRequestTypeID: "loadGroupCallParticipants#37f3bece", + LeaveGroupCallRequestTypeID: "leaveGroupCall#3a6befa9", + EndGroupCallRequestTypeID: "endGroupCall#22294cb7", + GetGroupCallStreamsRequestTypeID: "getGroupCallStreams#9f7c9164", + GetGroupCallStreamSegmentRequestTypeID: "getGroupCallStreamSegment#8424daa5", + SetMessageSenderBlockListRequestTypeID: "setMessageSenderBlockList#898b5c91", + BlockMessageSenderFromRepliesRequestTypeID: "blockMessageSenderFromReplies#b79df58b", + GetBlockedMessageSendersRequestTypeID: "getBlockedMessageSenders#8ce52f16", + AddContactRequestTypeID: "addContact#6f707140", + ImportContactsRequestTypeID: "importContacts#77bdb718", + GetContactsRequestTypeID: "getContacts#ab7f4470", + SearchContactsRequestTypeID: "searchContacts#95073165", + RemoveContactsRequestTypeID: "removeContacts#b464dfff", + GetImportedContactCountRequestTypeID: "getImportedContactCount#d8e11a26", + ChangeImportedContactsRequestTypeID: "changeImportedContacts#24885905", + ClearImportedContactsRequestTypeID: "clearImportedContacts#33d39142", + SetCloseFriendsRequestTypeID: "setCloseFriends#7ff8f69f", + GetCloseFriendsRequestTypeID: "getCloseFriends#a9d574ce", + SetUserPersonalProfilePhotoRequestTypeID: "setUserPersonalProfilePhoto#1baa28f6", + SuggestUserProfilePhotoRequestTypeID: "suggestUserProfilePhoto#9561f463", + SearchUserByPhoneNumberRequestTypeID: "searchUserByPhoneNumber#a2e22b12", + SharePhoneNumberRequestTypeID: "sharePhoneNumber#4164e055", + GetUserProfilePhotosRequestTypeID: "getUserProfilePhotos#c9defe42", + GetStickersRequestTypeID: "getStickers#45069343", + GetAllStickerEmojisRequestTypeID: "getAllStickerEmojis#11ad2e30", + SearchStickersRequestTypeID: "searchStickers#9a19e90b", + GetPremiumStickersRequestTypeID: "getPremiumStickers#ef410a50", + GetInstalledStickerSetsRequestTypeID: "getInstalledStickerSets#612ef6f6", + GetArchivedStickerSetsRequestTypeID: "getArchivedStickerSets#3bb8424d", + GetTrendingStickerSetsRequestTypeID: "getTrendingStickerSets#e058455e", + GetAttachedStickerSetsRequestTypeID: "getAttachedStickerSets#4d9d930d", + GetStickerSetRequestTypeID: "getStickerSet#3eb91bc3", + SearchStickerSetRequestTypeID: "searchStickerSet#45049cee", + SearchInstalledStickerSetsRequestTypeID: "searchInstalledStickerSets#7e5e7fa4", + SearchStickerSetsRequestTypeID: "searchStickerSets#bf7d307b", + ChangeStickerSetRequestTypeID: "changeStickerSet#1ac8a5ed", + ViewTrendingStickerSetsRequestTypeID: "viewTrendingStickerSets#36d6469", + ReorderInstalledStickerSetsRequestTypeID: "reorderInstalledStickerSets#4a830a78", + GetRecentStickersRequestTypeID: "getRecentStickers#dd73aa9f", + AddRecentStickerRequestTypeID: "addRecentSticker#a7e5d89e", + RemoveRecentStickerRequestTypeID: "removeRecentSticker#4a4d440d", + ClearRecentStickersRequestTypeID: "clearRecentStickers#ecda39c4", + GetFavoriteStickersRequestTypeID: "getFavoriteStickers#ebcbcf40", + AddFavoriteStickerRequestTypeID: "addFavoriteSticker#13578cdf", + RemoveFavoriteStickerRequestTypeID: "removeFavoriteSticker#44b88c70", + GetStickerEmojisRequestTypeID: "getStickerEmojis#8f04d547", + SearchEmojisRequestTypeID: "searchEmojis#9fb0feea", + GetEmojiCategoriesRequestTypeID: "getEmojiCategories#7f86c16e", + GetAnimatedEmojiRequestTypeID: "getAnimatedEmoji#3f844f76", + GetEmojiSuggestionsURLRequestTypeID: "getEmojiSuggestionsUrl#ac4f1b2f", + GetCustomEmojiStickersRequestTypeID: "getCustomEmojiStickers#a5156885", + GetDefaultChatPhotoCustomEmojiStickersRequestTypeID: "getDefaultChatPhotoCustomEmojiStickers#e9917765", + GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID: "getDefaultProfilePhotoCustomEmojiStickers#4c4be2b7", + GetDefaultBackgroundCustomEmojiStickersRequestTypeID: "getDefaultBackgroundCustomEmojiStickers#1cf6680e", + GetSavedAnimationsRequestTypeID: "getSavedAnimations#6b9718", + AddSavedAnimationRequestTypeID: "addSavedAnimation#a44bf860", + RemoveSavedAnimationRequestTypeID: "removeSavedAnimation#e275a919", + GetRecentInlineBotsRequestTypeID: "getRecentInlineBots#55b3723c", + SearchHashtagsRequestTypeID: "searchHashtags#3e34a571", + RemoveRecentHashtagRequestTypeID: "removeRecentHashtag#c393a0a4", + GetWebPagePreviewRequestTypeID: "getWebPagePreview#a850b8d8", + GetWebPageInstantViewRequestTypeID: "getWebPageInstantView#8b045689", + SetProfilePhotoRequestTypeID: "setProfilePhoto#85ea05ed", + DeleteProfilePhotoRequestTypeID: "deleteProfilePhoto#4eaa77c1", + SetAccentColorRequestTypeID: "setAccentColor#6389cb39", + SetNameRequestTypeID: "setName#66065f10", + SetBioRequestTypeID: "setBio#9f772354", + SetUsernameRequestTypeID: "setUsername#1a385c1e", + ToggleUsernameIsActiveRequestTypeID: "toggleUsernameIsActive#4a276de3", + ReorderActiveUsernamesRequestTypeID: "reorderActiveUsernames#c659414f", + SetEmojiStatusRequestTypeID: "setEmojiStatus#92f83e5d", + SetLocationRequestTypeID: "setLocation#5993371", + ChangePhoneNumberRequestTypeID: "changePhoneNumber#f891bba3", + ResendChangePhoneNumberCodeRequestTypeID: "resendChangePhoneNumberCode#d11acfa4", + CheckChangePhoneNumberCodeRequestTypeID: "checkChangePhoneNumberCode#9976a263", + GetUserLinkRequestTypeID: "getUserLink#492014e6", + SearchUserByTokenRequestTypeID: "searchUserByToken#d841f436", + SetCommandsRequestTypeID: "setCommands#b0e0217a", + DeleteCommandsRequestTypeID: "deleteCommands#3bc47c2a", + GetCommandsRequestTypeID: "getCommands#58ba8ff7", + SetMenuButtonRequestTypeID: "setMenuButton#b44fc141", + GetMenuButtonRequestTypeID: "getMenuButton#e5eef440", + SetDefaultGroupAdministratorRightsRequestTypeID: "setDefaultGroupAdministratorRights#65577768", + SetDefaultChannelAdministratorRightsRequestTypeID: "setDefaultChannelAdministratorRights#f20d5e19", + CanBotSendMessagesRequestTypeID: "canBotSendMessages#206d948c", + AllowBotToSendMessagesRequestTypeID: "allowBotToSendMessages#69e9c58e", + SendWebAppCustomRequestRequestTypeID: "sendWebAppCustomRequest#36ff5dc8", + SetBotNameRequestTypeID: "setBotName#d295fa71", + GetBotNameRequestTypeID: "getBotName#9a3f722c", + SetBotProfilePhotoRequestTypeID: "setBotProfilePhoto#bd864b66", + ToggleBotUsernameIsActiveRequestTypeID: "toggleBotUsernameIsActive#79639409", + ReorderBotActiveUsernamesRequestTypeID: "reorderBotActiveUsernames#acadc444", + SetBotInfoDescriptionRequestTypeID: "setBotInfoDescription#29571d48", + GetBotInfoDescriptionRequestTypeID: "getBotInfoDescription#d287f835", + SetBotInfoShortDescriptionRequestTypeID: "setBotInfoShortDescription#3a96bae3", + GetBotInfoShortDescriptionRequestTypeID: "getBotInfoShortDescription#4a1c2614", + GetActiveSessionsRequestTypeID: "getActiveSessions#42bd6d3e", + TerminateSessionRequestTypeID: "terminateSession#e7b7c92c", + TerminateAllOtherSessionsRequestTypeID: "terminateAllOtherSessions#6fba6113", + ConfirmSessionRequestTypeID: "confirmSession#d7c9b41f", + ToggleSessionCanAcceptCallsRequestTypeID: "toggleSessionCanAcceptCalls#6c6c2708", + ToggleSessionCanAcceptSecretChatsRequestTypeID: "toggleSessionCanAcceptSecretChats#3ba7a87e", + SetInactiveSessionTTLRequestTypeID: "setInactiveSessionTtl#5d9ca950", + GetConnectedWebsitesRequestTypeID: "getConnectedWebsites#f5d5d352", + DisconnectWebsiteRequestTypeID: "disconnectWebsite#d194f3dd", + DisconnectAllWebsitesRequestTypeID: "disconnectAllWebsites#bf72f203", + SetSupergroupUsernameRequestTypeID: "setSupergroupUsername#503f4b04", + ToggleSupergroupUsernameIsActiveRequestTypeID: "toggleSupergroupUsernameIsActive#a68b6dff", + DisableAllSupergroupUsernamesRequestTypeID: "disableAllSupergroupUsernames#3246f5b0", + ReorderSupergroupActiveUsernamesRequestTypeID: "reorderSupergroupActiveUsernames#663c7f3b", + SetSupergroupStickerSetRequestTypeID: "setSupergroupStickerSet#856ead69", + ToggleSupergroupSignMessagesRequestTypeID: "toggleSupergroupSignMessages#44efd524", + ToggleSupergroupJoinToSendMessagesRequestTypeID: "toggleSupergroupJoinToSendMessages#f5268e0e", + ToggleSupergroupJoinByRequestRequestTypeID: "toggleSupergroupJoinByRequest#7ddf9fde", + ToggleSupergroupIsAllHistoryAvailableRequestTypeID: "toggleSupergroupIsAllHistoryAvailable#44d9964e", + ToggleSupergroupHasHiddenMembersRequestTypeID: "toggleSupergroupHasHiddenMembers#a4559dca", + ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID: "toggleSupergroupHasAggressiveAntiSpamEnabled#683ef70f", + ToggleSupergroupIsForumRequestTypeID: "toggleSupergroupIsForum#966f960a", + ToggleSupergroupIsBroadcastGroupRequestTypeID: "toggleSupergroupIsBroadcastGroup#34b22215", + ReportSupergroupSpamRequestTypeID: "reportSupergroupSpam#383e26f2", + ReportSupergroupAntiSpamFalsePositiveRequestTypeID: "reportSupergroupAntiSpamFalsePositive#e13db048", + GetSupergroupMembersRequestTypeID: "getSupergroupMembers#ddf821c8", + CloseSecretChatRequestTypeID: "closeSecretChat#e3ed044b", + GetChatEventLogRequestTypeID: "getChatEventLog#f47b0a9b", + GetPaymentFormRequestTypeID: "getPaymentForm#8d4f76d4", + ValidateOrderInfoRequestTypeID: "validateOrderInfo#b5985fcf", + SendPaymentFormRequestTypeID: "sendPaymentForm#c66e388a", + GetPaymentReceiptRequestTypeID: "getPaymentReceipt#3c6cb956", + GetSavedOrderInfoRequestTypeID: "getSavedOrderInfo#bb559edd", + DeleteSavedOrderInfoRequestTypeID: "deleteSavedOrderInfo#61197474", + 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", + GetLocalizationTargetInfoRequestTypeID: "getLocalizationTargetInfo#6e3d1f86", + GetLanguagePackInfoRequestTypeID: "getLanguagePackInfo#7bd8daa8", + GetLanguagePackStringsRequestTypeID: "getLanguagePackStrings#b0b867bb", + SynchronizeLanguagePackRequestTypeID: "synchronizeLanguagePack#84e5e72e", + AddCustomServerLanguagePackRequestTypeID: "addCustomServerLanguagePack#448de3", + SetCustomLanguagePackRequestTypeID: "setCustomLanguagePack#234b0607", + EditCustomLanguagePackInfoRequestTypeID: "editCustomLanguagePackInfo#4eb91099", + SetCustomLanguagePackStringRequestTypeID: "setCustomLanguagePackString#4e762518", + DeleteLanguagePackRequestTypeID: "deleteLanguagePack#824edc3e", + RegisterDeviceRequestTypeID: "registerDevice#ff140196", + ProcessPushNotificationRequestTypeID: "processPushNotification#2ee3c890", + GetPushReceiverIDRequestTypeID: "getPushReceiverId#eeec46b2", + GetRecentlyVisitedTMeURLsRequestTypeID: "getRecentlyVisitedTMeUrls#30161a91", + SetUserPrivacySettingRulesRequestTypeID: "setUserPrivacySettingRules#e3c230fb", + GetUserPrivacySettingRulesRequestTypeID: "getUserPrivacySettingRules#84301671", + GetOptionRequestTypeID: "getOption#a2459e7e", + SetOptionRequestTypeID: "setOption#7e0b4ef2", + SetAccountTTLRequestTypeID: "setAccountTtl#29ce58e8", + GetAccountTTLRequestTypeID: "getAccountTtl#e58a8b77", + DeleteAccountRequestTypeID: "deleteAccount#533276c6", + SetDefaultMessageAutoDeleteTimeRequestTypeID: "setDefaultMessageAutoDeleteTime#965cd36c", + GetDefaultMessageAutoDeleteTimeRequestTypeID: "getDefaultMessageAutoDeleteTime#e520759a", + RemoveChatActionBarRequestTypeID: "removeChatActionBar#9d9839fa", + ReportChatRequestTypeID: "reportChat#d92c3a8a", + ReportChatPhotoRequestTypeID: "reportChatPhoto#d9701288", + ReportMessageReactionsRequestTypeID: "reportMessageReactions#36c88827", + GetChatStatisticsRequestTypeID: "getChatStatistics#137e8198", + GetMessageStatisticsRequestTypeID: "getMessageStatistics#4bb5a1d8", + GetMessagePublicForwardsRequestTypeID: "getMessagePublicForwards#6006a949", + GetStatisticalGraphRequestTypeID: "getStatisticalGraph#419f8d9b", + GetStorageStatisticsRequestTypeID: "getStorageStatistics#cd254b37", + GetStorageStatisticsFastRequestTypeID: "getStorageStatisticsFast#3a86702", + GetDatabaseStatisticsRequestTypeID: "getDatabaseStatistics#8c33d4b9", + OptimizeStorageRequestTypeID: "optimizeStorage#ef73c8c5", + SetNetworkTypeRequestTypeID: "setNetworkType#d62de55e", + GetNetworkStatisticsRequestTypeID: "getNetworkStatistics#c537581e", + AddNetworkStatisticsRequestTypeID: "addNetworkStatistics#4b63b3d9", + ResetNetworkStatisticsRequestTypeID: "resetNetworkStatistics#6222dd86", + GetAutoDownloadSettingsPresetsRequestTypeID: "getAutoDownloadSettingsPresets#996a4737", + SetAutoDownloadSettingsRequestTypeID: "setAutoDownloadSettings#eaeb64f4", + GetAutosaveSettingsRequestTypeID: "getAutosaveSettings#7f53f22a", + SetAutosaveSettingsRequestTypeID: "setAutosaveSettings#6878c0", + ClearAutosaveSettingsExceptionsRequestTypeID: "clearAutosaveSettingsExceptions#57ec63f2", + GetBankCardInfoRequestTypeID: "getBankCardInfo#b1e31db0", + GetPassportElementRequestTypeID: "getPassportElement#8fcce17a", + GetAllPassportElementsRequestTypeID: "getAllPassportElements#86782aeb", + SetPassportElementRequestTypeID: "setPassportElement#7b45d19c", + DeletePassportElementRequestTypeID: "deletePassportElement#9981aa74", + SetPassportElementErrorsRequestTypeID: "setPassportElementErrors#80fa80bf", + GetPreferredCountryLanguageRequestTypeID: "getPreferredCountryLanguage#c862cbd6", + SendPhoneNumberVerificationCodeRequestTypeID: "sendPhoneNumberVerificationCode#7c140dcb", + ResendPhoneNumberVerificationCodeRequestTypeID: "resendPhoneNumberVerificationCode#51845ffc", + CheckPhoneNumberVerificationCodeRequestTypeID: "checkPhoneNumberVerificationCode#594177be", + SendEmailAddressVerificationCodeRequestTypeID: "sendEmailAddressVerificationCode#f2ca537d", + ResendEmailAddressVerificationCodeRequestTypeID: "resendEmailAddressVerificationCode#90653024", + CheckEmailAddressVerificationCodeRequestTypeID: "checkEmailAddressVerificationCode#e695db03", + GetPassportAuthorizationFormRequestTypeID: "getPassportAuthorizationForm#61850486", + GetPassportAuthorizationFormAvailableElementsRequestTypeID: "getPassportAuthorizationFormAvailableElements#3fb314fc", + SendPassportAuthorizationFormRequestTypeID: "sendPassportAuthorizationForm#d9c77579", + SendPhoneNumberConfirmationCodeRequestTypeID: "sendPhoneNumberConfirmationCode#8eae6cd9", + ResendPhoneNumberConfirmationCodeRequestTypeID: "resendPhoneNumberConfirmationCode#7b537aea", + CheckPhoneNumberConfirmationCodeRequestTypeID: "checkPhoneNumberConfirmationCode#afa638da", + SetBotUpdatesStatusRequestTypeID: "setBotUpdatesStatus#bb293991", + UploadStickerFileRequestTypeID: "uploadStickerFile#269650c3", + GetSuggestedStickerSetNameRequestTypeID: "getSuggestedStickerSetName#b0120840", + CheckStickerSetNameRequestTypeID: "checkStickerSetName#955808fe", + CreateNewStickerSetRequestTypeID: "createNewStickerSet#19454551", + AddStickerToSetRequestTypeID: "addStickerToSet#56dc1e3b", + SetStickerSetThumbnailRequestTypeID: "setStickerSetThumbnail#6f813221", + SetCustomEmojiStickerSetThumbnailRequestTypeID: "setCustomEmojiStickerSetThumbnail#bd12e0ea", + SetStickerSetTitleRequestTypeID: "setStickerSetTitle#64e933a2", + DeleteStickerSetRequestTypeID: "deleteStickerSet#5e0a7bad", + SetStickerPositionInSetRequestTypeID: "setStickerPositionInSet#7bb24721", + RemoveStickerFromSetRequestTypeID: "removeStickerFromSet#61e1eea4", + SetStickerEmojisRequestTypeID: "setStickerEmojis#d9ec0431", + SetStickerKeywordsRequestTypeID: "setStickerKeywords#462481d", + SetStickerMaskPositionRequestTypeID: "setStickerMaskPosition#47a959d0", + GetMapThumbnailFileRequestTypeID: "getMapThumbnailFile#f6e6979a", + GetPremiumLimitRequestTypeID: "getPremiumLimit#4017fcea", + GetPremiumFeaturesRequestTypeID: "getPremiumFeatures#b4dc2649", + GetPremiumStickerExamplesRequestTypeID: "getPremiumStickerExamples#5369cb98", + ViewPremiumFeatureRequestTypeID: "viewPremiumFeature#b8031b2", + ClickPremiumSubscriptionButtonRequestTypeID: "clickPremiumSubscriptionButton#e9fca306", + GetPremiumStateRequestTypeID: "getPremiumState#278e3ae2", + GetPremiumGiftCodePaymentOptionsRequestTypeID: "getPremiumGiftCodePaymentOptions#89523a2c", + CheckPremiumGiftCodeRequestTypeID: "checkPremiumGiftCode#958ad664", + ApplyPremiumGiftCodeRequestTypeID: "applyPremiumGiftCode#afb44c1e", + LaunchPrepaidPremiumGiveawayRequestTypeID: "launchPrepaidPremiumGiveaway#5328fea1", + GetPremiumGiveawayInfoRequestTypeID: "getPremiumGiveawayInfo#6adb7b97", + CanPurchasePremiumRequestTypeID: "canPurchasePremium#e9de1cc0", + AssignAppStoreTransactionRequestTypeID: "assignAppStoreTransaction#86f30bb0", + AssignGooglePlayTransactionRequestTypeID: "assignGooglePlayTransaction#8939bca4", + AcceptTermsOfServiceRequestTypeID: "acceptTermsOfService#7efe03e4", + SearchStringsByPrefixRequestTypeID: "searchStringsByPrefix#a8145813", + SendCustomRequestRequestTypeID: "sendCustomRequest#10fd71a1", + AnswerCustomQueryRequestTypeID: "answerCustomQuery#b2e52d3f", + SetAlarmRequestTypeID: "setAlarm#cbef7e15", + GetCountriesRequestTypeID: "getCountries#fce8099e", + GetCountryCodeRequestTypeID: "getCountryCode#5bd398f2", + GetPhoneNumberInfoRequestTypeID: "getPhoneNumberInfo#a0229bf9", + GetPhoneNumberInfoSyncRequestTypeID: "getPhoneNumberInfoSync#209b7d38", + GetDeepLinkInfoRequestTypeID: "getDeepLinkInfo#28923f7e", + GetApplicationConfigRequestTypeID: "getApplicationConfig#93550682", + AddApplicationChangelogRequestTypeID: "addApplicationChangelog#8bf37fc9", + SaveApplicationLogEventRequestTypeID: "saveApplicationLogEvent#cfa6c20e", + GetApplicationDownloadLinkRequestTypeID: "getApplicationDownloadLink#6ad2fc4", + AddProxyRequestTypeID: "addProxy#13c2bcd8", + EditProxyRequestTypeID: "editProxy#a0482853", + EnableProxyRequestTypeID: "enableProxy#59138296", + DisableProxyRequestTypeID: "disableProxy#82d31782", + RemoveProxyRequestTypeID: "removeProxy#519ca307", + GetProxiesRequestTypeID: "getProxies#fa560333", + GetProxyLinkRequestTypeID: "getProxyLink#c125ae78", + PingProxyRequestTypeID: "pingProxy#c59b40b1", + SetLogStreamRequestTypeID: "setLogStream#aeaff791", + GetLogStreamRequestTypeID: "getLogStream#45984b5b", + SetLogVerbosityLevelRequestTypeID: "setLogVerbosityLevel#edea07d2", + GetLogVerbosityLevelRequestTypeID: "getLogVerbosityLevel#23689ae4", + GetLogTagsRequestTypeID: "getLogTags#f0d569da", + SetLogTagVerbosityLevelRequestTypeID: "setLogTagVerbosityLevel#8317d696", + GetLogTagVerbosityLevelRequestTypeID: "getLogTagVerbosityLevel#38af2d83", + AddLogMessageRequestTypeID: "addLogMessage#5f36cfec", + GetUserSupportInfoRequestTypeID: "getUserSupportInfo#74a59305", + SetUserSupportInfoRequestTypeID: "setUserSupportInfo#837c9803", + GetSupportNameRequestTypeID: "getSupportName#4d9e1562", + TestCallEmptyRequestTypeID: "testCallEmpty#da9c4a16", + TestCallStringRequestTypeID: "testCallString#98b74a2f", + TestCallBytesRequestTypeID: "testCallBytes#d4215aa9", + TestCallVectorIntRequestTypeID: "testCallVectorInt#65ed7e72", + TestCallVectorIntObjectRequestTypeID: "testCallVectorIntObject#ca57f472", + TestCallVectorStringRequestTypeID: "testCallVectorString#8e5a6ed8", + TestCallVectorStringObjectRequestTypeID: "testCallVectorStringObject#96cd6de", + TestSquareIntRequestTypeID: "testSquareInt#fc6a6990", + TestNetworkRequestTypeID: "testNetwork#afe4344b", + TestProxyRequestTypeID: "testProxy#b8a1a29e", + TestGetDifferenceRequestTypeID: "testGetDifference#68226325", + TestUseUpdateRequestTypeID: "testUseUpdate#2abdff1e", + TestReturnErrorRequestTypeID: "testReturnError#1b217cf2", } } // NamesMap returns mapping from type names to TL type ids. func NamesMap() map[string]uint32 { return map[string]uint32{ - "double": DoubleTypeID, - "string": StringTypeID, - "int32": Int32TypeID, - "int53": Int53TypeID, - "int64": Int64TypeID, - "bytes": BytesTypeID, - "boolFalse": BoolFalseTypeID, - "boolTrue": BoolTrueTypeID, - "error": ErrorTypeID, - "ok": OkTypeID, - "authenticationCodeTypeTelegramMessage": AuthenticationCodeTypeTelegramMessageTypeID, - "authenticationCodeTypeSms": AuthenticationCodeTypeSMSTypeID, - "authenticationCodeTypeCall": AuthenticationCodeTypeCallTypeID, - "authenticationCodeTypeFlashCall": AuthenticationCodeTypeFlashCallTypeID, - "authenticationCodeTypeMissedCall": AuthenticationCodeTypeMissedCallTypeID, - "authenticationCodeTypeFragment": AuthenticationCodeTypeFragmentTypeID, - "authenticationCodeTypeFirebaseAndroid": AuthenticationCodeTypeFirebaseAndroidTypeID, - "authenticationCodeTypeFirebaseIos": AuthenticationCodeTypeFirebaseIosTypeID, - "authenticationCodeInfo": AuthenticationCodeInfoTypeID, - "emailAddressAuthenticationCodeInfo": EmailAddressAuthenticationCodeInfoTypeID, - "emailAddressAuthenticationCode": EmailAddressAuthenticationCodeTypeID, - "emailAddressAuthenticationAppleId": EmailAddressAuthenticationAppleIDTypeID, - "emailAddressAuthenticationGoogleId": EmailAddressAuthenticationGoogleIDTypeID, - "emailAddressResetStateAvailable": EmailAddressResetStateAvailableTypeID, - "emailAddressResetStatePending": EmailAddressResetStatePendingTypeID, - "textEntity": TextEntityTypeID, - "textEntities": TextEntitiesTypeID, - "formattedText": FormattedTextTypeID, - "termsOfService": TermsOfServiceTypeID, - "authorizationStateWaitTdlibParameters": AuthorizationStateWaitTdlibParametersTypeID, - "authorizationStateWaitPhoneNumber": AuthorizationStateWaitPhoneNumberTypeID, - "authorizationStateWaitEmailAddress": AuthorizationStateWaitEmailAddressTypeID, - "authorizationStateWaitEmailCode": AuthorizationStateWaitEmailCodeTypeID, - "authorizationStateWaitCode": AuthorizationStateWaitCodeTypeID, - "authorizationStateWaitOtherDeviceConfirmation": AuthorizationStateWaitOtherDeviceConfirmationTypeID, - "authorizationStateWaitRegistration": AuthorizationStateWaitRegistrationTypeID, - "authorizationStateWaitPassword": AuthorizationStateWaitPasswordTypeID, - "authorizationStateReady": AuthorizationStateReadyTypeID, - "authorizationStateLoggingOut": AuthorizationStateLoggingOutTypeID, - "authorizationStateClosing": AuthorizationStateClosingTypeID, - "authorizationStateClosed": AuthorizationStateClosedTypeID, - "passwordState": PasswordStateTypeID, - "recoveryEmailAddress": RecoveryEmailAddressTypeID, - "temporaryPasswordState": TemporaryPasswordStateTypeID, - "localFile": LocalFileTypeID, - "remoteFile": RemoteFileTypeID, - "file": FileTypeID, - "inputFileId": InputFileIDTypeID, - "inputFileRemote": InputFileRemoteTypeID, - "inputFileLocal": InputFileLocalTypeID, - "inputFileGenerated": InputFileGeneratedTypeID, - "photoSize": PhotoSizeTypeID, - "minithumbnail": MinithumbnailTypeID, - "thumbnailFormatJpeg": ThumbnailFormatJpegTypeID, - "thumbnailFormatGif": ThumbnailFormatGifTypeID, - "thumbnailFormatMpeg4": ThumbnailFormatMpeg4TypeID, - "thumbnailFormatPng": ThumbnailFormatPngTypeID, - "thumbnailFormatTgs": ThumbnailFormatTgsTypeID, - "thumbnailFormatWebm": ThumbnailFormatWebmTypeID, - "thumbnailFormatWebp": ThumbnailFormatWebpTypeID, - "thumbnail": ThumbnailTypeID, - "maskPointForehead": MaskPointForeheadTypeID, - "maskPointEyes": MaskPointEyesTypeID, - "maskPointMouth": MaskPointMouthTypeID, - "maskPointChin": MaskPointChinTypeID, - "maskPosition": MaskPositionTypeID, - "stickerFormatWebp": StickerFormatWebpTypeID, - "stickerFormatTgs": StickerFormatTgsTypeID, - "stickerFormatWebm": StickerFormatWebmTypeID, - "stickerTypeRegular": StickerTypeRegularTypeID, - "stickerTypeMask": StickerTypeMaskTypeID, - "stickerTypeCustomEmoji": StickerTypeCustomEmojiTypeID, - "stickerFullTypeRegular": StickerFullTypeRegularTypeID, - "stickerFullTypeMask": StickerFullTypeMaskTypeID, - "stickerFullTypeCustomEmoji": StickerFullTypeCustomEmojiTypeID, - "closedVectorPath": ClosedVectorPathTypeID, - "pollOption": PollOptionTypeID, - "pollTypeRegular": PollTypeRegularTypeID, - "pollTypeQuiz": PollTypeQuizTypeID, - "animation": AnimationTypeID, - "audio": AudioTypeID, - "document": DocumentTypeID, - "photo": PhotoTypeID, - "sticker": StickerTypeID, - "video": VideoTypeID, - "videoNote": VideoNoteTypeID, - "voiceNote": VoiceNoteTypeID, - "animatedEmoji": AnimatedEmojiTypeID, - "contact": ContactTypeID, - "location": LocationTypeID, - "venue": VenueTypeID, - "game": GameTypeID, - "webApp": WebAppTypeID, - "poll": PollTypeID, - "background": BackgroundTypeID, - "backgrounds": BackgroundsTypeID, - "chatBackground": ChatBackgroundTypeID, - "profilePhoto": ProfilePhotoTypeID, - "chatPhotoInfo": ChatPhotoInfoTypeID, - "userTypeRegular": UserTypeRegularTypeID, - "userTypeDeleted": UserTypeDeletedTypeID, - "userTypeBot": UserTypeBotTypeID, - "userTypeUnknown": UserTypeUnknownTypeID, - "botCommand": BotCommandTypeID, - "botCommands": BotCommandsTypeID, - "botMenuButton": BotMenuButtonTypeID, - "chatLocation": ChatLocationTypeID, - "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, - "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, - "chatPhotoSticker": ChatPhotoStickerTypeID, - "animatedChatPhoto": AnimatedChatPhotoTypeID, - "chatPhoto": ChatPhotoTypeID, - "chatPhotos": ChatPhotosTypeID, - "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, - "inputChatPhotoStatic": InputChatPhotoStaticTypeID, - "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, - "inputChatPhotoSticker": InputChatPhotoStickerTypeID, - "chatPermissions": ChatPermissionsTypeID, - "chatAdministratorRights": ChatAdministratorRightsTypeID, - "premiumPaymentOption": PremiumPaymentOptionTypeID, - "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, + "double": DoubleTypeID, + "string": StringTypeID, + "int32": Int32TypeID, + "int53": Int53TypeID, + "int64": Int64TypeID, + "bytes": BytesTypeID, + "boolFalse": BoolFalseTypeID, + "boolTrue": BoolTrueTypeID, + "error": ErrorTypeID, + "ok": OkTypeID, + "authenticationCodeTypeTelegramMessage": AuthenticationCodeTypeTelegramMessageTypeID, + "authenticationCodeTypeSms": AuthenticationCodeTypeSMSTypeID, + "authenticationCodeTypeCall": AuthenticationCodeTypeCallTypeID, + "authenticationCodeTypeFlashCall": AuthenticationCodeTypeFlashCallTypeID, + "authenticationCodeTypeMissedCall": AuthenticationCodeTypeMissedCallTypeID, + "authenticationCodeTypeFragment": AuthenticationCodeTypeFragmentTypeID, + "authenticationCodeTypeFirebaseAndroid": AuthenticationCodeTypeFirebaseAndroidTypeID, + "authenticationCodeTypeFirebaseIos": AuthenticationCodeTypeFirebaseIosTypeID, + "authenticationCodeInfo": AuthenticationCodeInfoTypeID, + "emailAddressAuthenticationCodeInfo": EmailAddressAuthenticationCodeInfoTypeID, + "emailAddressAuthenticationCode": EmailAddressAuthenticationCodeTypeID, + "emailAddressAuthenticationAppleId": EmailAddressAuthenticationAppleIDTypeID, + "emailAddressAuthenticationGoogleId": EmailAddressAuthenticationGoogleIDTypeID, + "emailAddressResetStateAvailable": EmailAddressResetStateAvailableTypeID, + "emailAddressResetStatePending": EmailAddressResetStatePendingTypeID, + "textEntity": TextEntityTypeID, + "textEntities": TextEntitiesTypeID, + "formattedText": FormattedTextTypeID, + "termsOfService": TermsOfServiceTypeID, + "authorizationStateWaitTdlibParameters": AuthorizationStateWaitTdlibParametersTypeID, + "authorizationStateWaitPhoneNumber": AuthorizationStateWaitPhoneNumberTypeID, + "authorizationStateWaitEmailAddress": AuthorizationStateWaitEmailAddressTypeID, + "authorizationStateWaitEmailCode": AuthorizationStateWaitEmailCodeTypeID, + "authorizationStateWaitCode": AuthorizationStateWaitCodeTypeID, + "authorizationStateWaitOtherDeviceConfirmation": AuthorizationStateWaitOtherDeviceConfirmationTypeID, + "authorizationStateWaitRegistration": AuthorizationStateWaitRegistrationTypeID, + "authorizationStateWaitPassword": AuthorizationStateWaitPasswordTypeID, + "authorizationStateReady": AuthorizationStateReadyTypeID, + "authorizationStateLoggingOut": AuthorizationStateLoggingOutTypeID, + "authorizationStateClosing": AuthorizationStateClosingTypeID, + "authorizationStateClosed": AuthorizationStateClosedTypeID, + "passwordState": PasswordStateTypeID, + "recoveryEmailAddress": RecoveryEmailAddressTypeID, + "temporaryPasswordState": TemporaryPasswordStateTypeID, + "localFile": LocalFileTypeID, + "remoteFile": RemoteFileTypeID, + "file": FileTypeID, + "inputFileId": InputFileIDTypeID, + "inputFileRemote": InputFileRemoteTypeID, + "inputFileLocal": InputFileLocalTypeID, + "inputFileGenerated": InputFileGeneratedTypeID, + "photoSize": PhotoSizeTypeID, + "minithumbnail": MinithumbnailTypeID, + "thumbnailFormatJpeg": ThumbnailFormatJpegTypeID, + "thumbnailFormatGif": ThumbnailFormatGifTypeID, + "thumbnailFormatMpeg4": ThumbnailFormatMpeg4TypeID, + "thumbnailFormatPng": ThumbnailFormatPngTypeID, + "thumbnailFormatTgs": ThumbnailFormatTgsTypeID, + "thumbnailFormatWebm": ThumbnailFormatWebmTypeID, + "thumbnailFormatWebp": ThumbnailFormatWebpTypeID, + "thumbnail": ThumbnailTypeID, + "maskPointForehead": MaskPointForeheadTypeID, + "maskPointEyes": MaskPointEyesTypeID, + "maskPointMouth": MaskPointMouthTypeID, + "maskPointChin": MaskPointChinTypeID, + "maskPosition": MaskPositionTypeID, + "stickerFormatWebp": StickerFormatWebpTypeID, + "stickerFormatTgs": StickerFormatTgsTypeID, + "stickerFormatWebm": StickerFormatWebmTypeID, + "stickerTypeRegular": StickerTypeRegularTypeID, + "stickerTypeMask": StickerTypeMaskTypeID, + "stickerTypeCustomEmoji": StickerTypeCustomEmojiTypeID, + "stickerFullTypeRegular": StickerFullTypeRegularTypeID, + "stickerFullTypeMask": StickerFullTypeMaskTypeID, + "stickerFullTypeCustomEmoji": StickerFullTypeCustomEmojiTypeID, + "closedVectorPath": ClosedVectorPathTypeID, + "pollOption": PollOptionTypeID, + "pollTypeRegular": PollTypeRegularTypeID, + "pollTypeQuiz": PollTypeQuizTypeID, + "animation": AnimationTypeID, + "audio": AudioTypeID, + "document": DocumentTypeID, + "photo": PhotoTypeID, + "sticker": StickerTypeID, + "video": VideoTypeID, + "videoNote": VideoNoteTypeID, + "voiceNote": VoiceNoteTypeID, + "animatedEmoji": AnimatedEmojiTypeID, + "contact": ContactTypeID, + "location": LocationTypeID, + "venue": VenueTypeID, + "game": GameTypeID, + "webApp": WebAppTypeID, + "poll": PollTypeID, + "background": BackgroundTypeID, + "backgrounds": BackgroundsTypeID, + "chatBackground": ChatBackgroundTypeID, + "profilePhoto": ProfilePhotoTypeID, + "chatPhotoInfo": ChatPhotoInfoTypeID, + "userTypeRegular": UserTypeRegularTypeID, + "userTypeDeleted": UserTypeDeletedTypeID, + "userTypeBot": UserTypeBotTypeID, + "userTypeUnknown": UserTypeUnknownTypeID, + "botCommand": BotCommandTypeID, + "botCommands": BotCommandsTypeID, + "botMenuButton": BotMenuButtonTypeID, + "chatLocation": ChatLocationTypeID, + "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, + "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, + "chatPhotoSticker": ChatPhotoStickerTypeID, + "animatedChatPhoto": AnimatedChatPhotoTypeID, + "chatPhoto": ChatPhotoTypeID, + "chatPhotos": ChatPhotosTypeID, + "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, + "inputChatPhotoStatic": InputChatPhotoStaticTypeID, + "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, + "inputChatPhotoSticker": InputChatPhotoStickerTypeID, + "chatPermissions": ChatPermissionsTypeID, + "chatAdministratorRights": ChatAdministratorRightsTypeID, + "premiumPaymentOption": PremiumPaymentOptionTypeID, + "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, + "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, + "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, + "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, + "premiumGiveawayParticipantStatusEligible": PremiumGiveawayParticipantStatusEligibleTypeID, + "premiumGiveawayParticipantStatusParticipating": PremiumGiveawayParticipantStatusParticipatingTypeID, + "premiumGiveawayParticipantStatusAlreadyWasMember": PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID, + "premiumGiveawayParticipantStatusAdministrator": PremiumGiveawayParticipantStatusAdministratorTypeID, + "premiumGiveawayParticipantStatusDisallowedCountry": PremiumGiveawayParticipantStatusDisallowedCountryTypeID, + "premiumGiveawayInfoOngoing": PremiumGiveawayInfoOngoingTypeID, + "premiumGiveawayInfoCompleted": PremiumGiveawayInfoCompletedTypeID, + "accentColor": AccentColorTypeID, "emojiStatus": EmojiStatusTypeID, "emojiStatuses": EmojiStatusesTypeID, "usernames": UsernamesTypeID, @@ -2165,10 +2221,10 @@ func NamesMap() map[string]uint32 { "chatMessageSenders": ChatMessageSendersTypeID, "messageViewer": MessageViewerTypeID, "messageViewers": MessageViewersTypeID, - "messageForwardOriginUser": MessageForwardOriginUserTypeID, - "messageForwardOriginChat": MessageForwardOriginChatTypeID, - "messageForwardOriginHiddenUser": MessageForwardOriginHiddenUserTypeID, - "messageForwardOriginChannel": MessageForwardOriginChannelTypeID, + "messageOriginUser": MessageOriginUserTypeID, + "messageOriginHiddenUser": MessageOriginHiddenUserTypeID, + "messageOriginChat": MessageOriginChatTypeID, + "messageOriginChannel": MessageOriginChannelTypeID, "reactionTypeEmoji": ReactionTypeEmojiTypeID, "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, "messageForwardInfo": MessageForwardInfoTypeID, @@ -2181,6 +2237,8 @@ func NamesMap() map[string]uint32 { "messageSendingStateFailed": MessageSendingStateFailedTypeID, "messageReplyToMessage": MessageReplyToMessageTypeID, "messageReplyToStory": MessageReplyToStoryTypeID, + "inputMessageReplyToMessage": InputMessageReplyToMessageTypeID, + "inputMessageReplyToStory": InputMessageReplyToStoryTypeID, "message": MessageTypeID, "messages": MessagesTypeID, "foundMessages": FoundMessagesTypeID, @@ -2282,6 +2340,7 @@ func NamesMap() map[string]uint32 { "forumTopicInfo": ForumTopicInfoTypeID, "forumTopic": ForumTopicTypeID, "forumTopics": ForumTopicsTypeID, + "linkPreviewOptions": LinkPreviewOptionsTypeID, "richTextPlain": RichTextPlainTypeID, "richTextBold": RichTextBoldTypeID, "richTextItalic": RichTextItalicTypeID, @@ -2366,10 +2425,12 @@ func NamesMap() map[string]uint32 { "paymentReceipt": PaymentReceiptTypeID, "inputInvoiceMessage": InputInvoiceMessageTypeID, "inputInvoiceName": InputInvoiceNameTypeID, + "inputInvoiceTelegram": InputInvoiceTelegramTypeID, "messageExtendedMediaPreview": MessageExtendedMediaPreviewTypeID, "messageExtendedMediaPhoto": MessageExtendedMediaPhotoTypeID, "messageExtendedMediaVideo": MessageExtendedMediaVideoTypeID, "messageExtendedMediaUnsupported": MessageExtendedMediaUnsupportedTypeID, + "premiumGiveawayParameters": PremiumGiveawayParametersTypeID, "datedFile": DatedFileTypeID, "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, "passportElementTypePassport": PassportElementTypePassportTypeID, @@ -2494,6 +2555,9 @@ func NamesMap() map[string]uint32 { "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, "messageGiftedPremium": MessageGiftedPremiumTypeID, + "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, + "messagePremiumGiveawayCreated": MessagePremiumGiveawayCreatedTypeID, + "messagePremiumGiveaway": MessagePremiumGiveawayTypeID, "messageContactRegistered": MessageContactRegisteredTypeID, "messageUserShared": MessageUserSharedTypeID, "messageChatShared": MessageChatSharedTypeID, @@ -2520,6 +2584,7 @@ func NamesMap() map[string]uint32 { "textEntityTypeCode": TextEntityTypeCodeTypeID, "textEntityTypePre": TextEntityTypePreTypeID, "textEntityTypePreCode": TextEntityTypePreCodeTypeID, + "textEntityTypeBlockQuote": TextEntityTypeBlockQuoteTypeID, "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, @@ -2624,9 +2689,15 @@ func NamesMap() map[string]uint32 { "stories": StoriesTypeID, "storyInfo": StoryInfoTypeID, "chatActiveStories": ChatActiveStoriesTypeID, + "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, + "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, + "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, + "prepaidPremiumGiveaway": PrepaidPremiumGiveawayTypeID, "chatBoostStatus": ChatBoostStatusTypeID, "chatBoost": ChatBoostTypeID, "foundChatBoosts": FoundChatBoostsTypeID, + "chatBoostSlot": ChatBoostSlotTypeID, + "chatBoostSlots": ChatBoostSlotsTypeID, "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, @@ -2748,6 +2819,8 @@ func NamesMap() map[string]uint32 { "chatEventTitleChanged": ChatEventTitleChangedTypeID, "chatEventUsernameChanged": ChatEventUsernameChangedTypeID, "chatEventActiveUsernamesChanged": ChatEventActiveUsernamesChangedTypeID, + "chatEventAccentColorChanged": ChatEventAccentColorChangedTypeID, + "chatEventBackgroundCustomEmojiChanged": ChatEventBackgroundCustomEmojiChangedTypeID, "chatEventHasProtectedContentToggled": ChatEventHasProtectedContentToggledTypeID, "chatEventInvitesToggled": ChatEventInvitesToggledTypeID, "chatEventIsAllHistoryAvailableToggled": ChatEventIsAllHistoryAvailableToggledTypeID, @@ -2812,6 +2885,7 @@ func NamesMap() map[string]uint32 { "premiumFeatureRealTimeChatTranslation": PremiumFeatureRealTimeChatTranslationTypeID, "premiumFeatureUpgradedStories": PremiumFeatureUpgradedStoriesTypeID, "premiumFeatureChatBoost": PremiumFeatureChatBoostTypeID, + "premiumFeatureAccentColor": PremiumFeatureAccentColorTypeID, "premiumStoryFeaturePriorityOrder": PremiumStoryFeaturePriorityOrderTypeID, "premiumStoryFeatureStealthMode": PremiumStoryFeatureStealthModeTypeID, "premiumStoryFeaturePermanentViewsHistory": PremiumStoryFeaturePermanentViewsHistoryTypeID, @@ -2829,6 +2903,10 @@ func NamesMap() map[string]uint32 { "premiumState": PremiumStateTypeID, "storePaymentPurposePremiumSubscription": StorePaymentPurposePremiumSubscriptionTypeID, "storePaymentPurposeGiftedPremium": StorePaymentPurposeGiftedPremiumTypeID, + "storePaymentPurposePremiumGiftCodes": StorePaymentPurposePremiumGiftCodesTypeID, + "storePaymentPurposePremiumGiveaway": StorePaymentPurposePremiumGiveawayTypeID, + "telegramPaymentPurposePremiumGiftCodes": TelegramPaymentPurposePremiumGiftCodesTypeID, + "telegramPaymentPurposePremiumGiveaway": TelegramPaymentPurposePremiumGiveawayTypeID, "deviceTokenFirebaseCloudMessaging": DeviceTokenFirebaseCloudMessagingTypeID, "deviceTokenApplePush": DeviceTokenApplePushTypeID, "deviceTokenApplePushVoIP": DeviceTokenApplePushVoIPTypeID, @@ -2860,12 +2938,6 @@ func NamesMap() map[string]uint32 { "canSendStoryResultActiveStoryLimitExceeded": CanSendStoryResultActiveStoryLimitExceededTypeID, "canSendStoryResultWeeklyLimitExceeded": CanSendStoryResultWeeklyLimitExceededTypeID, "canSendStoryResultMonthlyLimitExceeded": CanSendStoryResultMonthlyLimitExceededTypeID, - "canBoostChatResultOk": CanBoostChatResultOkTypeID, - "canBoostChatResultInvalidChat": CanBoostChatResultInvalidChatTypeID, - "canBoostChatResultAlreadyBoosted": CanBoostChatResultAlreadyBoostedTypeID, - "canBoostChatResultPremiumNeeded": CanBoostChatResultPremiumNeededTypeID, - "canBoostChatResultPremiumSubscriptionNeeded": CanBoostChatResultPremiumSubscriptionNeededTypeID, - "canBoostChatResultWaitNeeded": CanBoostChatResultWaitNeededTypeID, "canTransferOwnershipResultOk": CanTransferOwnershipResultOkTypeID, "canTransferOwnershipResultPasswordNeeded": CanTransferOwnershipResultPasswordNeededTypeID, "canTransferOwnershipResultPasswordTooFresh": CanTransferOwnershipResultPasswordTooFreshTypeID, @@ -2897,6 +2969,8 @@ func NamesMap() map[string]uint32 { "pushMessageContentLocation": PushMessageContentLocationTypeID, "pushMessageContentPhoto": PushMessageContentPhotoTypeID, "pushMessageContentPoll": PushMessageContentPollTypeID, + "pushMessageContentPremiumGiftCode": PushMessageContentPremiumGiftCodeTypeID, + "pushMessageContentPremiumGiveaway": PushMessageContentPremiumGiveawayTypeID, "pushMessageContentScreenshotTaken": PushMessageContentScreenshotTakenTypeID, "pushMessageContentSticker": PushMessageContentStickerTypeID, "pushMessageContentStory": PushMessageContentStoryTypeID, @@ -3024,6 +3098,7 @@ func NamesMap() map[string]uint32 { "internalLinkTypePassportDataRequest": InternalLinkTypePassportDataRequestTypeID, "internalLinkTypePhoneNumberConfirmation": InternalLinkTypePhoneNumberConfirmationTypeID, "internalLinkTypePremiumFeatures": InternalLinkTypePremiumFeaturesTypeID, + "internalLinkTypePremiumGiftCode": InternalLinkTypePremiumGiftCodeTypeID, "internalLinkTypePrivacyAndSecuritySettings": InternalLinkTypePrivacyAndSecuritySettingsTypeID, "internalLinkTypeProxy": InternalLinkTypeProxyTypeID, "internalLinkTypePublicChat": InternalLinkTypePublicChatTypeID, @@ -3101,6 +3176,7 @@ func NamesMap() map[string]uint32 { "topChatCategoryInlineBots": TopChatCategoryInlineBotsTypeID, "topChatCategoryCalls": TopChatCategoryCallsTypeID, "topChatCategoryForwardChats": TopChatCategoryForwardChatsTypeID, + "foundPosition": FoundPositionTypeID, "foundPositions": FoundPositionsTypeID, "tMeUrlTypeUser": TMeURLTypeUserTypeID, "tMeUrlTypeSupergroup": TMeURLTypeSupergroupTypeID, @@ -3168,6 +3244,8 @@ func NamesMap() map[string]uint32 { "updateNewChat": UpdateNewChatTypeID, "updateChatTitle": UpdateChatTitleTypeID, "updateChatPhoto": UpdateChatPhotoTypeID, + "updateChatAccentColor": UpdateChatAccentColorTypeID, + "updateChatBackgroundCustomEmoji": UpdateChatBackgroundCustomEmojiTypeID, "updateChatPermissions": UpdateChatPermissionsTypeID, "updateChatLastMessage": UpdateChatLastMessageTypeID, "updateChatPosition": UpdateChatPositionTypeID, @@ -3242,6 +3320,7 @@ func NamesMap() map[string]uint32 { "updateSavedNotificationSounds": UpdateSavedNotificationSoundsTypeID, "updateSelectedBackground": UpdateSelectedBackgroundTypeID, "updateChatThemes": UpdateChatThemesTypeID, + "updateAccentColors": UpdateAccentColorsTypeID, "updateLanguagePackStrings": UpdateLanguagePackStringsTypeID, "updateConnectionState": UpdateConnectionStateTypeID, "updateTermsOfService": UpdateTermsOfServiceTypeID, @@ -3269,6 +3348,7 @@ func NamesMap() map[string]uint32 { "updatePollAnswer": UpdatePollAnswerTypeID, "updateChatMember": UpdateChatMemberTypeID, "updateNewChatJoinRequest": UpdateNewChatJoinRequestTypeID, + "updateChatBoost": UpdateChatBoostTypeID, "updates": UpdatesTypeID, "logStreamDefault": LogStreamDefaultTypeID, "logStreamFile": LogStreamFileTypeID, @@ -3432,6 +3512,7 @@ func NamesMap() map[string]uint32 { "removeMessageReaction": RemoveMessageReactionRequestTypeID, "getMessageAddedReactions": GetMessageAddedReactionsRequestTypeID, "setDefaultReactionType": SetDefaultReactionTypeRequestTypeID, + "searchQuote": SearchQuoteRequestTypeID, "getTextEntities": GetTextEntitiesRequestTypeID, "parseTextEntities": ParseTextEntitiesRequestTypeID, "parseMarkdown": ParseMarkdownRequestTypeID, @@ -3515,6 +3596,7 @@ func NamesMap() map[string]uint32 { "setArchiveChatListSettings": SetArchiveChatListSettingsRequestTypeID, "setChatTitle": SetChatTitleRequestTypeID, "setChatPhoto": SetChatPhotoRequestTypeID, + "setChatAccentColor": SetChatAccentColorRequestTypeID, "setChatMessageAutoDeleteTime": SetChatMessageAutoDeleteTimeRequestTypeID, "setChatPermissions": SetChatPermissionsRequestTypeID, "setChatBackground": SetChatBackgroundRequestTypeID, @@ -3579,12 +3661,13 @@ func NamesMap() map[string]uint32 { "getStoryViewers": GetStoryViewersRequestTypeID, "reportStory": ReportStoryRequestTypeID, "activateStoryStealthMode": ActivateStoryStealthModeRequestTypeID, + "getAvailableChatBoostSlots": GetAvailableChatBoostSlotsRequestTypeID, "getChatBoostStatus": GetChatBoostStatusRequestTypeID, - "canBoostChat": CanBoostChatRequestTypeID, "boostChat": BoostChatRequestTypeID, "getChatBoostLink": GetChatBoostLinkRequestTypeID, "getChatBoostLinkInfo": GetChatBoostLinkInfoRequestTypeID, "getChatBoosts": GetChatBoostsRequestTypeID, + "getUserChatBoosts": GetUserChatBoostsRequestTypeID, "getAttachmentMenuBot": GetAttachmentMenuBotRequestTypeID, "toggleBotIsAddedToAttachmentMenu": ToggleBotIsAddedToAttachmentMenuRequestTypeID, "getThemedEmojiStatuses": GetThemedEmojiStatusesRequestTypeID, @@ -3711,6 +3794,7 @@ func NamesMap() map[string]uint32 { "getCustomEmojiStickers": GetCustomEmojiStickersRequestTypeID, "getDefaultChatPhotoCustomEmojiStickers": GetDefaultChatPhotoCustomEmojiStickersRequestTypeID, "getDefaultProfilePhotoCustomEmojiStickers": GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID, + "getDefaultBackgroundCustomEmojiStickers": GetDefaultBackgroundCustomEmojiStickersRequestTypeID, "getSavedAnimations": GetSavedAnimationsRequestTypeID, "addSavedAnimation": AddSavedAnimationRequestTypeID, "removeSavedAnimation": RemoveSavedAnimationRequestTypeID, @@ -3721,6 +3805,7 @@ func NamesMap() map[string]uint32 { "getWebPageInstantView": GetWebPageInstantViewRequestTypeID, "setProfilePhoto": SetProfilePhotoRequestTypeID, "deleteProfilePhoto": DeleteProfilePhotoRequestTypeID, + "setAccentColor": SetAccentColorRequestTypeID, "setName": SetNameRequestTypeID, "setBio": SetBioRequestTypeID, "setUsername": SetUsernameRequestTypeID, @@ -3879,6 +3964,11 @@ func NamesMap() map[string]uint32 { "viewPremiumFeature": ViewPremiumFeatureRequestTypeID, "clickPremiumSubscriptionButton": ClickPremiumSubscriptionButtonRequestTypeID, "getPremiumState": GetPremiumStateRequestTypeID, + "getPremiumGiftCodePaymentOptions": GetPremiumGiftCodePaymentOptionsRequestTypeID, + "checkPremiumGiftCode": CheckPremiumGiftCodeRequestTypeID, + "applyPremiumGiftCode": ApplyPremiumGiftCodeRequestTypeID, + "launchPrepaidPremiumGiveaway": LaunchPrepaidPremiumGiveawayRequestTypeID, + "getPremiumGiveawayInfo": GetPremiumGiveawayInfoRequestTypeID, "canPurchasePremium": CanPurchasePremiumRequestTypeID, "assignAppStoreTransaction": AssignAppStoreTransactionRequestTypeID, "assignGooglePlayTransaction": AssignGooglePlayTransactionRequestTypeID, @@ -4055,6 +4145,17 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatAdministratorRightsTypeID: func() bin.Object { return &ChatAdministratorRights{} }, PremiumPaymentOptionTypeID: func() bin.Object { return &PremiumPaymentOption{} }, PremiumStatePaymentOptionTypeID: func() bin.Object { return &PremiumStatePaymentOption{} }, + PremiumGiftCodePaymentOptionTypeID: func() bin.Object { return &PremiumGiftCodePaymentOption{} }, + PremiumGiftCodePaymentOptionsTypeID: func() bin.Object { return &PremiumGiftCodePaymentOptions{} }, + PremiumGiftCodeInfoTypeID: func() bin.Object { return &PremiumGiftCodeInfo{} }, + PremiumGiveawayParticipantStatusEligibleTypeID: func() bin.Object { return &PremiumGiveawayParticipantStatusEligible{} }, + PremiumGiveawayParticipantStatusParticipatingTypeID: func() bin.Object { return &PremiumGiveawayParticipantStatusParticipating{} }, + PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID: func() bin.Object { return &PremiumGiveawayParticipantStatusAlreadyWasMember{} }, + PremiumGiveawayParticipantStatusAdministratorTypeID: func() bin.Object { return &PremiumGiveawayParticipantStatusAdministrator{} }, + PremiumGiveawayParticipantStatusDisallowedCountryTypeID: func() bin.Object { return &PremiumGiveawayParticipantStatusDisallowedCountry{} }, + PremiumGiveawayInfoOngoingTypeID: func() bin.Object { return &PremiumGiveawayInfoOngoing{} }, + PremiumGiveawayInfoCompletedTypeID: func() bin.Object { return &PremiumGiveawayInfoCompleted{} }, + AccentColorTypeID: func() bin.Object { return &AccentColor{} }, EmojiStatusTypeID: func() bin.Object { return &EmojiStatus{} }, EmojiStatusesTypeID: func() bin.Object { return &EmojiStatuses{} }, UsernamesTypeID: func() bin.Object { return &Usernames{} }, @@ -4115,10 +4216,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatMessageSendersTypeID: func() bin.Object { return &ChatMessageSenders{} }, MessageViewerTypeID: func() bin.Object { return &MessageViewer{} }, MessageViewersTypeID: func() bin.Object { return &MessageViewers{} }, - MessageForwardOriginUserTypeID: func() bin.Object { return &MessageForwardOriginUser{} }, - MessageForwardOriginChatTypeID: func() bin.Object { return &MessageForwardOriginChat{} }, - MessageForwardOriginHiddenUserTypeID: func() bin.Object { return &MessageForwardOriginHiddenUser{} }, - MessageForwardOriginChannelTypeID: func() bin.Object { return &MessageForwardOriginChannel{} }, + MessageOriginUserTypeID: func() bin.Object { return &MessageOriginUser{} }, + MessageOriginHiddenUserTypeID: func() bin.Object { return &MessageOriginHiddenUser{} }, + MessageOriginChatTypeID: func() bin.Object { return &MessageOriginChat{} }, + MessageOriginChannelTypeID: func() bin.Object { return &MessageOriginChannel{} }, ReactionTypeEmojiTypeID: func() bin.Object { return &ReactionTypeEmoji{} }, ReactionTypeCustomEmojiTypeID: func() bin.Object { return &ReactionTypeCustomEmoji{} }, MessageForwardInfoTypeID: func() bin.Object { return &MessageForwardInfo{} }, @@ -4131,6 +4232,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageSendingStateFailedTypeID: func() bin.Object { return &MessageSendingStateFailed{} }, MessageReplyToMessageTypeID: func() bin.Object { return &MessageReplyToMessage{} }, MessageReplyToStoryTypeID: func() bin.Object { return &MessageReplyToStory{} }, + InputMessageReplyToMessageTypeID: func() bin.Object { return &InputMessageReplyToMessage{} }, + InputMessageReplyToStoryTypeID: func() bin.Object { return &InputMessageReplyToStory{} }, MessageTypeID: func() bin.Object { return &Message{} }, MessagesTypeID: func() bin.Object { return &Messages{} }, FoundMessagesTypeID: func() bin.Object { return &FoundMessages{} }, @@ -4232,6 +4335,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ForumTopicInfoTypeID: func() bin.Object { return &ForumTopicInfo{} }, ForumTopicTypeID: func() bin.Object { return &ForumTopic{} }, ForumTopicsTypeID: func() bin.Object { return &ForumTopics{} }, + LinkPreviewOptionsTypeID: func() bin.Object { return &LinkPreviewOptions{} }, RichTextPlainTypeID: func() bin.Object { return &RichTextPlain{} }, RichTextBoldTypeID: func() bin.Object { return &RichTextBold{} }, RichTextItalicTypeID: func() bin.Object { return &RichTextItalic{} }, @@ -4316,10 +4420,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PaymentReceiptTypeID: func() bin.Object { return &PaymentReceipt{} }, InputInvoiceMessageTypeID: func() bin.Object { return &InputInvoiceMessage{} }, InputInvoiceNameTypeID: func() bin.Object { return &InputInvoiceName{} }, + InputInvoiceTelegramTypeID: func() bin.Object { return &InputInvoiceTelegram{} }, MessageExtendedMediaPreviewTypeID: func() bin.Object { return &MessageExtendedMediaPreview{} }, MessageExtendedMediaPhotoTypeID: func() bin.Object { return &MessageExtendedMediaPhoto{} }, MessageExtendedMediaVideoTypeID: func() bin.Object { return &MessageExtendedMediaVideo{} }, MessageExtendedMediaUnsupportedTypeID: func() bin.Object { return &MessageExtendedMediaUnsupported{} }, + PremiumGiveawayParametersTypeID: func() bin.Object { return &PremiumGiveawayParameters{} }, DatedFileTypeID: func() bin.Object { return &DatedFile{} }, PassportElementTypePersonalDetailsTypeID: func() bin.Object { return &PassportElementTypePersonalDetails{} }, PassportElementTypePassportTypeID: func() bin.Object { return &PassportElementTypePassport{} }, @@ -4444,6 +4550,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessagePaymentSuccessfulTypeID: func() bin.Object { return &MessagePaymentSuccessful{} }, MessagePaymentSuccessfulBotTypeID: func() bin.Object { return &MessagePaymentSuccessfulBot{} }, MessageGiftedPremiumTypeID: func() bin.Object { return &MessageGiftedPremium{} }, + MessagePremiumGiftCodeTypeID: func() bin.Object { return &MessagePremiumGiftCode{} }, + MessagePremiumGiveawayCreatedTypeID: func() bin.Object { return &MessagePremiumGiveawayCreated{} }, + MessagePremiumGiveawayTypeID: func() bin.Object { return &MessagePremiumGiveaway{} }, MessageContactRegisteredTypeID: func() bin.Object { return &MessageContactRegistered{} }, MessageUserSharedTypeID: func() bin.Object { return &MessageUserShared{} }, MessageChatSharedTypeID: func() bin.Object { return &MessageChatShared{} }, @@ -4470,6 +4579,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { TextEntityTypeCodeTypeID: func() bin.Object { return &TextEntityTypeCode{} }, TextEntityTypePreTypeID: func() bin.Object { return &TextEntityTypePre{} }, TextEntityTypePreCodeTypeID: func() bin.Object { return &TextEntityTypePreCode{} }, + TextEntityTypeBlockQuoteTypeID: func() bin.Object { return &TextEntityTypeBlockQuote{} }, TextEntityTypeTextURLTypeID: func() bin.Object { return &TextEntityTypeTextURL{} }, TextEntityTypeMentionNameTypeID: func() bin.Object { return &TextEntityTypeMentionName{} }, TextEntityTypeCustomEmojiTypeID: func() bin.Object { return &TextEntityTypeCustomEmoji{} }, @@ -4574,9 +4684,15 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StoriesTypeID: func() bin.Object { return &Stories{} }, StoryInfoTypeID: func() bin.Object { return &StoryInfo{} }, ChatActiveStoriesTypeID: func() bin.Object { return &ChatActiveStories{} }, + ChatBoostSourceGiftCodeTypeID: func() bin.Object { return &ChatBoostSourceGiftCode{} }, + ChatBoostSourceGiveawayTypeID: func() bin.Object { return &ChatBoostSourceGiveaway{} }, + ChatBoostSourcePremiumTypeID: func() bin.Object { return &ChatBoostSourcePremium{} }, + PrepaidPremiumGiveawayTypeID: func() bin.Object { return &PrepaidPremiumGiveaway{} }, ChatBoostStatusTypeID: func() bin.Object { return &ChatBoostStatus{} }, ChatBoostTypeID: func() bin.Object { return &ChatBoost{} }, FoundChatBoostsTypeID: func() bin.Object { return &FoundChatBoosts{} }, + ChatBoostSlotTypeID: func() bin.Object { return &ChatBoostSlot{} }, + ChatBoostSlotsTypeID: func() bin.Object { return &ChatBoostSlots{} }, CallDiscardReasonEmptyTypeID: func() bin.Object { return &CallDiscardReasonEmpty{} }, CallDiscardReasonMissedTypeID: func() bin.Object { return &CallDiscardReasonMissed{} }, CallDiscardReasonDeclinedTypeID: func() bin.Object { return &CallDiscardReasonDeclined{} }, @@ -4698,6 +4814,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatEventTitleChangedTypeID: func() bin.Object { return &ChatEventTitleChanged{} }, ChatEventUsernameChangedTypeID: func() bin.Object { return &ChatEventUsernameChanged{} }, ChatEventActiveUsernamesChangedTypeID: func() bin.Object { return &ChatEventActiveUsernamesChanged{} }, + ChatEventAccentColorChangedTypeID: func() bin.Object { return &ChatEventAccentColorChanged{} }, + ChatEventBackgroundCustomEmojiChangedTypeID: func() bin.Object { return &ChatEventBackgroundCustomEmojiChanged{} }, ChatEventHasProtectedContentToggledTypeID: func() bin.Object { return &ChatEventHasProtectedContentToggled{} }, ChatEventInvitesToggledTypeID: func() bin.Object { return &ChatEventInvitesToggled{} }, ChatEventIsAllHistoryAvailableToggledTypeID: func() bin.Object { return &ChatEventIsAllHistoryAvailableToggled{} }, @@ -4762,6 +4880,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PremiumFeatureRealTimeChatTranslationTypeID: func() bin.Object { return &PremiumFeatureRealTimeChatTranslation{} }, PremiumFeatureUpgradedStoriesTypeID: func() bin.Object { return &PremiumFeatureUpgradedStories{} }, PremiumFeatureChatBoostTypeID: func() bin.Object { return &PremiumFeatureChatBoost{} }, + PremiumFeatureAccentColorTypeID: func() bin.Object { return &PremiumFeatureAccentColor{} }, PremiumStoryFeaturePriorityOrderTypeID: func() bin.Object { return &PremiumStoryFeaturePriorityOrder{} }, PremiumStoryFeatureStealthModeTypeID: func() bin.Object { return &PremiumStoryFeatureStealthMode{} }, PremiumStoryFeaturePermanentViewsHistoryTypeID: func() bin.Object { return &PremiumStoryFeaturePermanentViewsHistory{} }, @@ -4779,6 +4898,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PremiumStateTypeID: func() bin.Object { return &PremiumState{} }, StorePaymentPurposePremiumSubscriptionTypeID: func() bin.Object { return &StorePaymentPurposePremiumSubscription{} }, StorePaymentPurposeGiftedPremiumTypeID: func() bin.Object { return &StorePaymentPurposeGiftedPremium{} }, + StorePaymentPurposePremiumGiftCodesTypeID: func() bin.Object { return &StorePaymentPurposePremiumGiftCodes{} }, + StorePaymentPurposePremiumGiveawayTypeID: func() bin.Object { return &StorePaymentPurposePremiumGiveaway{} }, + TelegramPaymentPurposePremiumGiftCodesTypeID: func() bin.Object { return &TelegramPaymentPurposePremiumGiftCodes{} }, + TelegramPaymentPurposePremiumGiveawayTypeID: func() bin.Object { return &TelegramPaymentPurposePremiumGiveaway{} }, DeviceTokenFirebaseCloudMessagingTypeID: func() bin.Object { return &DeviceTokenFirebaseCloudMessaging{} }, DeviceTokenApplePushTypeID: func() bin.Object { return &DeviceTokenApplePush{} }, DeviceTokenApplePushVoIPTypeID: func() bin.Object { return &DeviceTokenApplePushVoIP{} }, @@ -4810,12 +4933,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { CanSendStoryResultActiveStoryLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultActiveStoryLimitExceeded{} }, CanSendStoryResultWeeklyLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultWeeklyLimitExceeded{} }, CanSendStoryResultMonthlyLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultMonthlyLimitExceeded{} }, - CanBoostChatResultOkTypeID: func() bin.Object { return &CanBoostChatResultOk{} }, - CanBoostChatResultInvalidChatTypeID: func() bin.Object { return &CanBoostChatResultInvalidChat{} }, - CanBoostChatResultAlreadyBoostedTypeID: func() bin.Object { return &CanBoostChatResultAlreadyBoosted{} }, - CanBoostChatResultPremiumNeededTypeID: func() bin.Object { return &CanBoostChatResultPremiumNeeded{} }, - CanBoostChatResultPremiumSubscriptionNeededTypeID: func() bin.Object { return &CanBoostChatResultPremiumSubscriptionNeeded{} }, - CanBoostChatResultWaitNeededTypeID: func() bin.Object { return &CanBoostChatResultWaitNeeded{} }, CanTransferOwnershipResultOkTypeID: func() bin.Object { return &CanTransferOwnershipResultOk{} }, CanTransferOwnershipResultPasswordNeededTypeID: func() bin.Object { return &CanTransferOwnershipResultPasswordNeeded{} }, CanTransferOwnershipResultPasswordTooFreshTypeID: func() bin.Object { return &CanTransferOwnershipResultPasswordTooFresh{} }, @@ -4847,6 +4964,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PushMessageContentLocationTypeID: func() bin.Object { return &PushMessageContentLocation{} }, PushMessageContentPhotoTypeID: func() bin.Object { return &PushMessageContentPhoto{} }, PushMessageContentPollTypeID: func() bin.Object { return &PushMessageContentPoll{} }, + PushMessageContentPremiumGiftCodeTypeID: func() bin.Object { return &PushMessageContentPremiumGiftCode{} }, + PushMessageContentPremiumGiveawayTypeID: func() bin.Object { return &PushMessageContentPremiumGiveaway{} }, PushMessageContentScreenshotTakenTypeID: func() bin.Object { return &PushMessageContentScreenshotTaken{} }, PushMessageContentStickerTypeID: func() bin.Object { return &PushMessageContentSticker{} }, PushMessageContentStoryTypeID: func() bin.Object { return &PushMessageContentStory{} }, @@ -4974,6 +5093,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{} }, + InternalLinkTypePremiumGiftCodeTypeID: func() bin.Object { return &InternalLinkTypePremiumGiftCode{} }, InternalLinkTypePrivacyAndSecuritySettingsTypeID: func() bin.Object { return &InternalLinkTypePrivacyAndSecuritySettings{} }, InternalLinkTypeProxyTypeID: func() bin.Object { return &InternalLinkTypeProxy{} }, InternalLinkTypePublicChatTypeID: func() bin.Object { return &InternalLinkTypePublicChat{} }, @@ -5051,6 +5171,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { TopChatCategoryInlineBotsTypeID: func() bin.Object { return &TopChatCategoryInlineBots{} }, TopChatCategoryCallsTypeID: func() bin.Object { return &TopChatCategoryCalls{} }, TopChatCategoryForwardChatsTypeID: func() bin.Object { return &TopChatCategoryForwardChats{} }, + FoundPositionTypeID: func() bin.Object { return &FoundPosition{} }, FoundPositionsTypeID: func() bin.Object { return &FoundPositions{} }, TMeURLTypeUserTypeID: func() bin.Object { return &TMeURLTypeUser{} }, TMeURLTypeSupergroupTypeID: func() bin.Object { return &TMeURLTypeSupergroup{} }, @@ -5067,817 +5188,831 @@ 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{} }, - CountTypeID: func() bin.Object { return &Count{} }, - TextTypeID: func() bin.Object { return &Text{} }, - SecondsTypeID: func() bin.Object { return &Seconds{} }, - FileDownloadedPrefixSizeTypeID: func() bin.Object { return &FileDownloadedPrefixSize{} }, - DeepLinkInfoTypeID: func() bin.Object { return &DeepLinkInfo{} }, - TextParseModeMarkdownTypeID: func() bin.Object { return &TextParseModeMarkdown{} }, - TextParseModeHTMLTypeID: func() bin.Object { return &TextParseModeHTML{} }, - ProxyTypeSocks5TypeID: func() bin.Object { return &ProxyTypeSocks5{} }, - ProxyTypeHTTPTypeID: func() bin.Object { return &ProxyTypeHTTP{} }, - ProxyTypeMtprotoTypeID: func() bin.Object { return &ProxyTypeMtproto{} }, - ProxyTypeID: func() bin.Object { return &Proxy{} }, - ProxiesTypeID: func() bin.Object { return &Proxies{} }, - InputStickerTypeID: func() bin.Object { return &InputSticker{} }, - DateRangeTypeID: func() bin.Object { return &DateRange{} }, - StatisticalValueTypeID: func() bin.Object { return &StatisticalValue{} }, - StatisticalGraphDataTypeID: func() bin.Object { return &StatisticalGraphData{} }, - StatisticalGraphAsyncTypeID: func() bin.Object { return &StatisticalGraphAsync{} }, - StatisticalGraphErrorTypeID: func() bin.Object { return &StatisticalGraphError{} }, - ChatStatisticsMessageInteractionInfoTypeID: func() bin.Object { return &ChatStatisticsMessageInteractionInfo{} }, - ChatStatisticsMessageSenderInfoTypeID: func() bin.Object { return &ChatStatisticsMessageSenderInfo{} }, - ChatStatisticsAdministratorActionsInfoTypeID: func() bin.Object { return &ChatStatisticsAdministratorActionsInfo{} }, - ChatStatisticsInviterInfoTypeID: func() bin.Object { return &ChatStatisticsInviterInfo{} }, - ChatStatisticsSupergroupTypeID: func() bin.Object { return &ChatStatisticsSupergroup{} }, - ChatStatisticsChannelTypeID: func() bin.Object { return &ChatStatisticsChannel{} }, - MessageStatisticsTypeID: func() bin.Object { return &MessageStatistics{} }, - PointTypeID: func() bin.Object { return &Point{} }, - VectorPathCommandLineTypeID: func() bin.Object { return &VectorPathCommandLine{} }, - VectorPathCommandCubicBezierCurveTypeID: func() bin.Object { return &VectorPathCommandCubicBezierCurve{} }, - BotCommandScopeDefaultTypeID: func() bin.Object { return &BotCommandScopeDefault{} }, - BotCommandScopeAllPrivateChatsTypeID: func() bin.Object { return &BotCommandScopeAllPrivateChats{} }, - BotCommandScopeAllGroupChatsTypeID: func() bin.Object { return &BotCommandScopeAllGroupChats{} }, - BotCommandScopeAllChatAdministratorsTypeID: func() bin.Object { return &BotCommandScopeAllChatAdministrators{} }, - BotCommandScopeChatTypeID: func() bin.Object { return &BotCommandScopeChat{} }, - BotCommandScopeChatAdministratorsTypeID: func() bin.Object { return &BotCommandScopeChatAdministrators{} }, - BotCommandScopeChatMemberTypeID: func() bin.Object { return &BotCommandScopeChatMember{} }, - UpdateAuthorizationStateTypeID: func() bin.Object { return &UpdateAuthorizationState{} }, - UpdateNewMessageTypeID: func() bin.Object { return &UpdateNewMessage{} }, - UpdateMessageSendAcknowledgedTypeID: func() bin.Object { return &UpdateMessageSendAcknowledged{} }, - UpdateMessageSendSucceededTypeID: func() bin.Object { return &UpdateMessageSendSucceeded{} }, - UpdateMessageSendFailedTypeID: func() bin.Object { return &UpdateMessageSendFailed{} }, - UpdateMessageContentTypeID: func() bin.Object { return &UpdateMessageContent{} }, - UpdateMessageEditedTypeID: func() bin.Object { return &UpdateMessageEdited{} }, - UpdateMessageIsPinnedTypeID: func() bin.Object { return &UpdateMessageIsPinned{} }, - UpdateMessageInteractionInfoTypeID: func() bin.Object { return &UpdateMessageInteractionInfo{} }, - UpdateMessageContentOpenedTypeID: func() bin.Object { return &UpdateMessageContentOpened{} }, - UpdateMessageMentionReadTypeID: func() bin.Object { return &UpdateMessageMentionRead{} }, - UpdateMessageUnreadReactionsTypeID: func() bin.Object { return &UpdateMessageUnreadReactions{} }, - UpdateMessageLiveLocationViewedTypeID: func() bin.Object { return &UpdateMessageLiveLocationViewed{} }, - UpdateNewChatTypeID: func() bin.Object { return &UpdateNewChat{} }, - UpdateChatTitleTypeID: func() bin.Object { return &UpdateChatTitle{} }, - UpdateChatPhotoTypeID: func() bin.Object { return &UpdateChatPhoto{} }, - UpdateChatPermissionsTypeID: func() bin.Object { return &UpdateChatPermissions{} }, - UpdateChatLastMessageTypeID: func() bin.Object { return &UpdateChatLastMessage{} }, - UpdateChatPositionTypeID: func() bin.Object { return &UpdateChatPosition{} }, - UpdateChatReadInboxTypeID: func() bin.Object { return &UpdateChatReadInbox{} }, - UpdateChatReadOutboxTypeID: func() bin.Object { return &UpdateChatReadOutbox{} }, - UpdateChatActionBarTypeID: func() bin.Object { return &UpdateChatActionBar{} }, - UpdateChatAvailableReactionsTypeID: func() bin.Object { return &UpdateChatAvailableReactions{} }, - UpdateChatDraftMessageTypeID: func() bin.Object { return &UpdateChatDraftMessage{} }, - UpdateChatMessageSenderTypeID: func() bin.Object { return &UpdateChatMessageSender{} }, - UpdateChatMessageAutoDeleteTimeTypeID: func() bin.Object { return &UpdateChatMessageAutoDeleteTime{} }, - UpdateChatNotificationSettingsTypeID: func() bin.Object { return &UpdateChatNotificationSettings{} }, - UpdateChatPendingJoinRequestsTypeID: func() bin.Object { return &UpdateChatPendingJoinRequests{} }, - UpdateChatReplyMarkupTypeID: func() bin.Object { return &UpdateChatReplyMarkup{} }, - UpdateChatBackgroundTypeID: func() bin.Object { return &UpdateChatBackground{} }, - UpdateChatThemeTypeID: func() bin.Object { return &UpdateChatTheme{} }, - UpdateChatUnreadMentionCountTypeID: func() bin.Object { return &UpdateChatUnreadMentionCount{} }, - UpdateChatUnreadReactionCountTypeID: func() bin.Object { return &UpdateChatUnreadReactionCount{} }, - UpdateChatVideoChatTypeID: func() bin.Object { return &UpdateChatVideoChat{} }, - UpdateChatDefaultDisableNotificationTypeID: func() bin.Object { return &UpdateChatDefaultDisableNotification{} }, - UpdateChatHasProtectedContentTypeID: func() bin.Object { return &UpdateChatHasProtectedContent{} }, - UpdateChatIsTranslatableTypeID: func() bin.Object { return &UpdateChatIsTranslatable{} }, - UpdateChatIsMarkedAsUnreadTypeID: func() bin.Object { return &UpdateChatIsMarkedAsUnread{} }, - UpdateChatBlockListTypeID: func() bin.Object { return &UpdateChatBlockList{} }, - UpdateChatHasScheduledMessagesTypeID: func() bin.Object { return &UpdateChatHasScheduledMessages{} }, - UpdateChatFoldersTypeID: func() bin.Object { return &UpdateChatFolders{} }, - UpdateChatOnlineMemberCountTypeID: func() bin.Object { return &UpdateChatOnlineMemberCount{} }, - UpdateForumTopicInfoTypeID: func() bin.Object { return &UpdateForumTopicInfo{} }, - UpdateScopeNotificationSettingsTypeID: func() bin.Object { return &UpdateScopeNotificationSettings{} }, - UpdateNotificationTypeID: func() bin.Object { return &UpdateNotification{} }, - UpdateNotificationGroupTypeID: func() bin.Object { return &UpdateNotificationGroup{} }, - UpdateActiveNotificationsTypeID: func() bin.Object { return &UpdateActiveNotifications{} }, - UpdateHavePendingNotificationsTypeID: func() bin.Object { return &UpdateHavePendingNotifications{} }, - UpdateDeleteMessagesTypeID: func() bin.Object { return &UpdateDeleteMessages{} }, - UpdateChatActionTypeID: func() bin.Object { return &UpdateChatAction{} }, - UpdateUserStatusTypeID: func() bin.Object { return &UpdateUserStatus{} }, - UpdateUserTypeID: func() bin.Object { return &UpdateUser{} }, - UpdateBasicGroupTypeID: func() bin.Object { return &UpdateBasicGroup{} }, - UpdateSupergroupTypeID: func() bin.Object { return &UpdateSupergroup{} }, - UpdateSecretChatTypeID: func() bin.Object { return &UpdateSecretChat{} }, - UpdateUserFullInfoTypeID: func() bin.Object { return &UpdateUserFullInfo{} }, - UpdateBasicGroupFullInfoTypeID: func() bin.Object { return &UpdateBasicGroupFullInfo{} }, - UpdateSupergroupFullInfoTypeID: func() bin.Object { return &UpdateSupergroupFullInfo{} }, - UpdateServiceNotificationTypeID: func() bin.Object { return &UpdateServiceNotification{} }, - UpdateFileTypeID: func() bin.Object { return &UpdateFile{} }, - UpdateFileGenerationStartTypeID: func() bin.Object { return &UpdateFileGenerationStart{} }, - UpdateFileGenerationStopTypeID: func() bin.Object { return &UpdateFileGenerationStop{} }, - UpdateFileDownloadsTypeID: func() bin.Object { return &UpdateFileDownloads{} }, - UpdateFileAddedToDownloadsTypeID: func() bin.Object { return &UpdateFileAddedToDownloads{} }, - UpdateFileDownloadTypeID: func() bin.Object { return &UpdateFileDownload{} }, - UpdateFileRemovedFromDownloadsTypeID: func() bin.Object { return &UpdateFileRemovedFromDownloads{} }, - UpdateCallTypeID: func() bin.Object { return &UpdateCall{} }, - UpdateGroupCallTypeID: func() bin.Object { return &UpdateGroupCall{} }, - UpdateGroupCallParticipantTypeID: func() bin.Object { return &UpdateGroupCallParticipant{} }, - UpdateNewCallSignalingDataTypeID: func() bin.Object { return &UpdateNewCallSignalingData{} }, - UpdateUserPrivacySettingRulesTypeID: func() bin.Object { return &UpdateUserPrivacySettingRules{} }, - UpdateUnreadMessageCountTypeID: func() bin.Object { return &UpdateUnreadMessageCount{} }, - UpdateUnreadChatCountTypeID: func() bin.Object { return &UpdateUnreadChatCount{} }, - UpdateStoryTypeID: func() bin.Object { return &UpdateStory{} }, - UpdateStoryDeletedTypeID: func() bin.Object { return &UpdateStoryDeleted{} }, - UpdateStorySendSucceededTypeID: func() bin.Object { return &UpdateStorySendSucceeded{} }, - UpdateStorySendFailedTypeID: func() bin.Object { return &UpdateStorySendFailed{} }, - UpdateChatActiveStoriesTypeID: func() bin.Object { return &UpdateChatActiveStories{} }, - UpdateStoryListChatCountTypeID: func() bin.Object { return &UpdateStoryListChatCount{} }, - UpdateStoryStealthModeTypeID: func() bin.Object { return &UpdateStoryStealthMode{} }, - UpdateOptionTypeID: func() bin.Object { return &UpdateOption{} }, - UpdateStickerSetTypeID: func() bin.Object { return &UpdateStickerSet{} }, - UpdateInstalledStickerSetsTypeID: func() bin.Object { return &UpdateInstalledStickerSets{} }, - UpdateTrendingStickerSetsTypeID: func() bin.Object { return &UpdateTrendingStickerSets{} }, - UpdateRecentStickersTypeID: func() bin.Object { return &UpdateRecentStickers{} }, - UpdateFavoriteStickersTypeID: func() bin.Object { return &UpdateFavoriteStickers{} }, - UpdateSavedAnimationsTypeID: func() bin.Object { return &UpdateSavedAnimations{} }, - UpdateSavedNotificationSoundsTypeID: func() bin.Object { return &UpdateSavedNotificationSounds{} }, - UpdateSelectedBackgroundTypeID: func() bin.Object { return &UpdateSelectedBackground{} }, - UpdateChatThemesTypeID: func() bin.Object { return &UpdateChatThemes{} }, - UpdateLanguagePackStringsTypeID: func() bin.Object { return &UpdateLanguagePackStrings{} }, - UpdateConnectionStateTypeID: func() bin.Object { return &UpdateConnectionState{} }, - UpdateTermsOfServiceTypeID: func() bin.Object { return &UpdateTermsOfService{} }, - UpdateUsersNearbyTypeID: func() bin.Object { return &UpdateUsersNearby{} }, - UpdateUnconfirmedSessionTypeID: func() bin.Object { return &UpdateUnconfirmedSession{} }, - UpdateAttachmentMenuBotsTypeID: func() bin.Object { return &UpdateAttachmentMenuBots{} }, - UpdateWebAppMessageSentTypeID: func() bin.Object { return &UpdateWebAppMessageSent{} }, - UpdateActiveEmojiReactionsTypeID: func() bin.Object { return &UpdateActiveEmojiReactions{} }, - UpdateDefaultReactionTypeTypeID: func() bin.Object { return &UpdateDefaultReactionType{} }, - UpdateDiceEmojisTypeID: func() bin.Object { return &UpdateDiceEmojis{} }, - UpdateAnimatedEmojiMessageClickedTypeID: func() bin.Object { return &UpdateAnimatedEmojiMessageClicked{} }, - UpdateAnimationSearchParametersTypeID: func() bin.Object { return &UpdateAnimationSearchParameters{} }, - UpdateSuggestedActionsTypeID: func() bin.Object { return &UpdateSuggestedActions{} }, - UpdateAddChatMembersPrivacyForbiddenTypeID: func() bin.Object { return &UpdateAddChatMembersPrivacyForbidden{} }, - UpdateAutosaveSettingsTypeID: func() bin.Object { return &UpdateAutosaveSettings{} }, - UpdateNewInlineQueryTypeID: func() bin.Object { return &UpdateNewInlineQuery{} }, - UpdateNewChosenInlineResultTypeID: func() bin.Object { return &UpdateNewChosenInlineResult{} }, - UpdateNewCallbackQueryTypeID: func() bin.Object { return &UpdateNewCallbackQuery{} }, - UpdateNewInlineCallbackQueryTypeID: func() bin.Object { return &UpdateNewInlineCallbackQuery{} }, - UpdateNewShippingQueryTypeID: func() bin.Object { return &UpdateNewShippingQuery{} }, - UpdateNewPreCheckoutQueryTypeID: func() bin.Object { return &UpdateNewPreCheckoutQuery{} }, - UpdateNewCustomEventTypeID: func() bin.Object { return &UpdateNewCustomEvent{} }, - UpdateNewCustomQueryTypeID: func() bin.Object { return &UpdateNewCustomQuery{} }, - UpdatePollTypeID: func() bin.Object { return &UpdatePoll{} }, - UpdatePollAnswerTypeID: func() bin.Object { return &UpdatePollAnswer{} }, - UpdateChatMemberTypeID: func() bin.Object { return &UpdateChatMember{} }, - UpdateNewChatJoinRequestTypeID: func() bin.Object { return &UpdateNewChatJoinRequest{} }, - UpdatesTypeID: func() bin.Object { return &Updates{} }, - LogStreamDefaultTypeID: func() bin.Object { return &LogStreamDefault{} }, - LogStreamFileTypeID: func() bin.Object { return &LogStreamFile{} }, - LogStreamEmptyTypeID: func() bin.Object { return &LogStreamEmpty{} }, - LogVerbosityLevelTypeID: func() bin.Object { return &LogVerbosityLevel{} }, - LogTagsTypeID: func() bin.Object { return &LogTags{} }, - UserSupportInfoTypeID: func() bin.Object { return &UserSupportInfo{} }, - TestIntTypeID: func() bin.Object { return &TestInt{} }, - TestStringTypeID: func() bin.Object { return &TestString{} }, - TestBytesTypeID: func() bin.Object { return &TestBytes{} }, - TestVectorIntTypeID: func() bin.Object { return &TestVectorInt{} }, - TestVectorIntObjectTypeID: func() bin.Object { return &TestVectorIntObject{} }, - TestVectorStringTypeID: func() bin.Object { return &TestVectorString{} }, - TestVectorStringObjectTypeID: func() bin.Object { return &TestVectorStringObject{} }, - GetAuthorizationStateRequestTypeID: func() bin.Object { return &GetAuthorizationStateRequest{} }, - SetTdlibParametersRequestTypeID: func() bin.Object { return &SetTdlibParametersRequest{} }, - SetAuthenticationPhoneNumberRequestTypeID: func() bin.Object { return &SetAuthenticationPhoneNumberRequest{} }, - SetAuthenticationEmailAddressRequestTypeID: func() bin.Object { return &SetAuthenticationEmailAddressRequest{} }, - ResendAuthenticationCodeRequestTypeID: func() bin.Object { return &ResendAuthenticationCodeRequest{} }, - CheckAuthenticationEmailCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationEmailCodeRequest{} }, - CheckAuthenticationCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationCodeRequest{} }, - RequestQrCodeAuthenticationRequestTypeID: func() bin.Object { return &RequestQrCodeAuthenticationRequest{} }, - RegisterUserRequestTypeID: func() bin.Object { return &RegisterUserRequest{} }, - ResetAuthenticationEmailAddressRequestTypeID: func() bin.Object { return &ResetAuthenticationEmailAddressRequest{} }, - CheckAuthenticationPasswordRequestTypeID: func() bin.Object { return &CheckAuthenticationPasswordRequest{} }, - RequestAuthenticationPasswordRecoveryRequestTypeID: func() bin.Object { return &RequestAuthenticationPasswordRecoveryRequest{} }, - CheckAuthenticationPasswordRecoveryCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationPasswordRecoveryCodeRequest{} }, - RecoverAuthenticationPasswordRequestTypeID: func() bin.Object { return &RecoverAuthenticationPasswordRequest{} }, - SendAuthenticationFirebaseSMSRequestTypeID: func() bin.Object { return &SendAuthenticationFirebaseSMSRequest{} }, - CheckAuthenticationBotTokenRequestTypeID: func() bin.Object { return &CheckAuthenticationBotTokenRequest{} }, - LogOutRequestTypeID: func() bin.Object { return &LogOutRequest{} }, - CloseRequestTypeID: func() bin.Object { return &CloseRequest{} }, - DestroyRequestTypeID: func() bin.Object { return &DestroyRequest{} }, - ConfirmQrCodeAuthenticationRequestTypeID: func() bin.Object { return &ConfirmQrCodeAuthenticationRequest{} }, - GetCurrentStateRequestTypeID: func() bin.Object { return &GetCurrentStateRequest{} }, - SetDatabaseEncryptionKeyRequestTypeID: func() bin.Object { return &SetDatabaseEncryptionKeyRequest{} }, - GetPasswordStateRequestTypeID: func() bin.Object { return &GetPasswordStateRequest{} }, - SetPasswordRequestTypeID: func() bin.Object { return &SetPasswordRequest{} }, - SetLoginEmailAddressRequestTypeID: func() bin.Object { return &SetLoginEmailAddressRequest{} }, - ResendLoginEmailAddressCodeRequestTypeID: func() bin.Object { return &ResendLoginEmailAddressCodeRequest{} }, - CheckLoginEmailAddressCodeRequestTypeID: func() bin.Object { return &CheckLoginEmailAddressCodeRequest{} }, - GetRecoveryEmailAddressRequestTypeID: func() bin.Object { return &GetRecoveryEmailAddressRequest{} }, - SetRecoveryEmailAddressRequestTypeID: func() bin.Object { return &SetRecoveryEmailAddressRequest{} }, - CheckRecoveryEmailAddressCodeRequestTypeID: func() bin.Object { return &CheckRecoveryEmailAddressCodeRequest{} }, - ResendRecoveryEmailAddressCodeRequestTypeID: func() bin.Object { return &ResendRecoveryEmailAddressCodeRequest{} }, - RequestPasswordRecoveryRequestTypeID: func() bin.Object { return &RequestPasswordRecoveryRequest{} }, - CheckPasswordRecoveryCodeRequestTypeID: func() bin.Object { return &CheckPasswordRecoveryCodeRequest{} }, - RecoverPasswordRequestTypeID: func() bin.Object { return &RecoverPasswordRequest{} }, - ResetPasswordRequestTypeID: func() bin.Object { return &ResetPasswordRequest{} }, - CancelPasswordResetRequestTypeID: func() bin.Object { return &CancelPasswordResetRequest{} }, - CreateTemporaryPasswordRequestTypeID: func() bin.Object { return &CreateTemporaryPasswordRequest{} }, - GetTemporaryPasswordStateRequestTypeID: func() bin.Object { return &GetTemporaryPasswordStateRequest{} }, - GetMeRequestTypeID: func() bin.Object { return &GetMeRequest{} }, - GetUserRequestTypeID: func() bin.Object { return &GetUserRequest{} }, - GetUserFullInfoRequestTypeID: func() bin.Object { return &GetUserFullInfoRequest{} }, - GetBasicGroupRequestTypeID: func() bin.Object { return &GetBasicGroupRequest{} }, - GetBasicGroupFullInfoRequestTypeID: func() bin.Object { return &GetBasicGroupFullInfoRequest{} }, - GetSupergroupRequestTypeID: func() bin.Object { return &GetSupergroupRequest{} }, - GetSupergroupFullInfoRequestTypeID: func() bin.Object { return &GetSupergroupFullInfoRequest{} }, - GetSecretChatRequestTypeID: func() bin.Object { return &GetSecretChatRequest{} }, - GetChatRequestTypeID: func() bin.Object { return &GetChatRequest{} }, - GetMessageRequestTypeID: func() bin.Object { return &GetMessageRequest{} }, - GetMessageLocallyRequestTypeID: func() bin.Object { return &GetMessageLocallyRequest{} }, - GetRepliedMessageRequestTypeID: func() bin.Object { return &GetRepliedMessageRequest{} }, - GetChatPinnedMessageRequestTypeID: func() bin.Object { return &GetChatPinnedMessageRequest{} }, - GetCallbackQueryMessageRequestTypeID: func() bin.Object { return &GetCallbackQueryMessageRequest{} }, - GetMessagesRequestTypeID: func() bin.Object { return &GetMessagesRequest{} }, - GetMessageThreadRequestTypeID: func() bin.Object { return &GetMessageThreadRequest{} }, - GetMessageViewersRequestTypeID: func() bin.Object { return &GetMessageViewersRequest{} }, - GetFileRequestTypeID: func() bin.Object { return &GetFileRequest{} }, - GetRemoteFileRequestTypeID: func() bin.Object { return &GetRemoteFileRequest{} }, - LoadChatsRequestTypeID: func() bin.Object { return &LoadChatsRequest{} }, - GetChatsRequestTypeID: func() bin.Object { return &GetChatsRequest{} }, - SearchPublicChatRequestTypeID: func() bin.Object { return &SearchPublicChatRequest{} }, - SearchPublicChatsRequestTypeID: func() bin.Object { return &SearchPublicChatsRequest{} }, - SearchChatsRequestTypeID: func() bin.Object { return &SearchChatsRequest{} }, - SearchChatsOnServerRequestTypeID: func() bin.Object { return &SearchChatsOnServerRequest{} }, - SearchChatsNearbyRequestTypeID: func() bin.Object { return &SearchChatsNearbyRequest{} }, - GetTopChatsRequestTypeID: func() bin.Object { return &GetTopChatsRequest{} }, - RemoveTopChatRequestTypeID: func() bin.Object { return &RemoveTopChatRequest{} }, - SearchRecentlyFoundChatsRequestTypeID: func() bin.Object { return &SearchRecentlyFoundChatsRequest{} }, - AddRecentlyFoundChatRequestTypeID: func() bin.Object { return &AddRecentlyFoundChatRequest{} }, - RemoveRecentlyFoundChatRequestTypeID: func() bin.Object { return &RemoveRecentlyFoundChatRequest{} }, - ClearRecentlyFoundChatsRequestTypeID: func() bin.Object { return &ClearRecentlyFoundChatsRequest{} }, - GetRecentlyOpenedChatsRequestTypeID: func() bin.Object { return &GetRecentlyOpenedChatsRequest{} }, - CheckChatUsernameRequestTypeID: func() bin.Object { return &CheckChatUsernameRequest{} }, - GetCreatedPublicChatsRequestTypeID: func() bin.Object { return &GetCreatedPublicChatsRequest{} }, - CheckCreatedPublicChatsLimitRequestTypeID: func() bin.Object { return &CheckCreatedPublicChatsLimitRequest{} }, - GetSuitableDiscussionChatsRequestTypeID: func() bin.Object { return &GetSuitableDiscussionChatsRequest{} }, - GetInactiveSupergroupChatsRequestTypeID: func() bin.Object { return &GetInactiveSupergroupChatsRequest{} }, - GetGroupsInCommonRequestTypeID: func() bin.Object { return &GetGroupsInCommonRequest{} }, - GetChatHistoryRequestTypeID: func() bin.Object { return &GetChatHistoryRequest{} }, - GetMessageThreadHistoryRequestTypeID: func() bin.Object { return &GetMessageThreadHistoryRequest{} }, - DeleteChatHistoryRequestTypeID: func() bin.Object { return &DeleteChatHistoryRequest{} }, - DeleteChatRequestTypeID: func() bin.Object { return &DeleteChatRequest{} }, - SearchChatMessagesRequestTypeID: func() bin.Object { return &SearchChatMessagesRequest{} }, - SearchMessagesRequestTypeID: func() bin.Object { return &SearchMessagesRequest{} }, - SearchSecretMessagesRequestTypeID: func() bin.Object { return &SearchSecretMessagesRequest{} }, - SearchCallMessagesRequestTypeID: func() bin.Object { return &SearchCallMessagesRequest{} }, - SearchOutgoingDocumentMessagesRequestTypeID: func() bin.Object { return &SearchOutgoingDocumentMessagesRequest{} }, - DeleteAllCallMessagesRequestTypeID: func() bin.Object { return &DeleteAllCallMessagesRequest{} }, - SearchChatRecentLocationMessagesRequestTypeID: func() bin.Object { return &SearchChatRecentLocationMessagesRequest{} }, - GetActiveLiveLocationMessagesRequestTypeID: func() bin.Object { return &GetActiveLiveLocationMessagesRequest{} }, - GetChatMessageByDateRequestTypeID: func() bin.Object { return &GetChatMessageByDateRequest{} }, - GetChatSparseMessagePositionsRequestTypeID: func() bin.Object { return &GetChatSparseMessagePositionsRequest{} }, - GetChatMessageCalendarRequestTypeID: func() bin.Object { return &GetChatMessageCalendarRequest{} }, - GetChatMessageCountRequestTypeID: func() bin.Object { return &GetChatMessageCountRequest{} }, - GetChatMessagePositionRequestTypeID: func() bin.Object { return &GetChatMessagePositionRequest{} }, - GetChatScheduledMessagesRequestTypeID: func() bin.Object { return &GetChatScheduledMessagesRequest{} }, - GetChatSponsoredMessagesRequestTypeID: func() bin.Object { return &GetChatSponsoredMessagesRequest{} }, - ClickChatSponsoredMessageRequestTypeID: func() bin.Object { return &ClickChatSponsoredMessageRequest{} }, - RemoveNotificationRequestTypeID: func() bin.Object { return &RemoveNotificationRequest{} }, - RemoveNotificationGroupRequestTypeID: func() bin.Object { return &RemoveNotificationGroupRequest{} }, - GetMessageLinkRequestTypeID: func() bin.Object { return &GetMessageLinkRequest{} }, - GetMessageEmbeddingCodeRequestTypeID: func() bin.Object { return &GetMessageEmbeddingCodeRequest{} }, - GetMessageLinkInfoRequestTypeID: func() bin.Object { return &GetMessageLinkInfoRequest{} }, - TranslateTextRequestTypeID: func() bin.Object { return &TranslateTextRequest{} }, - TranslateMessageTextRequestTypeID: func() bin.Object { return &TranslateMessageTextRequest{} }, - RecognizeSpeechRequestTypeID: func() bin.Object { return &RecognizeSpeechRequest{} }, - RateSpeechRecognitionRequestTypeID: func() bin.Object { return &RateSpeechRecognitionRequest{} }, - GetChatAvailableMessageSendersRequestTypeID: func() bin.Object { return &GetChatAvailableMessageSendersRequest{} }, - SetChatMessageSenderRequestTypeID: func() bin.Object { return &SetChatMessageSenderRequest{} }, - SendMessageRequestTypeID: func() bin.Object { return &SendMessageRequest{} }, - SendMessageAlbumRequestTypeID: func() bin.Object { return &SendMessageAlbumRequest{} }, - SendBotStartMessageRequestTypeID: func() bin.Object { return &SendBotStartMessageRequest{} }, - SendInlineQueryResultMessageRequestTypeID: func() bin.Object { return &SendInlineQueryResultMessageRequest{} }, - ForwardMessagesRequestTypeID: func() bin.Object { return &ForwardMessagesRequest{} }, - ResendMessagesRequestTypeID: func() bin.Object { return &ResendMessagesRequest{} }, - AddLocalMessageRequestTypeID: func() bin.Object { return &AddLocalMessageRequest{} }, - DeleteMessagesRequestTypeID: func() bin.Object { return &DeleteMessagesRequest{} }, - DeleteChatMessagesBySenderRequestTypeID: func() bin.Object { return &DeleteChatMessagesBySenderRequest{} }, - DeleteChatMessagesByDateRequestTypeID: func() bin.Object { return &DeleteChatMessagesByDateRequest{} }, - EditMessageTextRequestTypeID: func() bin.Object { return &EditMessageTextRequest{} }, - EditMessageLiveLocationRequestTypeID: func() bin.Object { return &EditMessageLiveLocationRequest{} }, - EditMessageMediaRequestTypeID: func() bin.Object { return &EditMessageMediaRequest{} }, - EditMessageCaptionRequestTypeID: func() bin.Object { return &EditMessageCaptionRequest{} }, - EditMessageReplyMarkupRequestTypeID: func() bin.Object { return &EditMessageReplyMarkupRequest{} }, - EditInlineMessageTextRequestTypeID: func() bin.Object { return &EditInlineMessageTextRequest{} }, - EditInlineMessageLiveLocationRequestTypeID: func() bin.Object { return &EditInlineMessageLiveLocationRequest{} }, - EditInlineMessageMediaRequestTypeID: func() bin.Object { return &EditInlineMessageMediaRequest{} }, - EditInlineMessageCaptionRequestTypeID: func() bin.Object { return &EditInlineMessageCaptionRequest{} }, - EditInlineMessageReplyMarkupRequestTypeID: func() bin.Object { return &EditInlineMessageReplyMarkupRequest{} }, - EditMessageSchedulingStateRequestTypeID: func() bin.Object { return &EditMessageSchedulingStateRequest{} }, - GetForumTopicDefaultIconsRequestTypeID: func() bin.Object { return &GetForumTopicDefaultIconsRequest{} }, - CreateForumTopicRequestTypeID: func() bin.Object { return &CreateForumTopicRequest{} }, - EditForumTopicRequestTypeID: func() bin.Object { return &EditForumTopicRequest{} }, - GetForumTopicRequestTypeID: func() bin.Object { return &GetForumTopicRequest{} }, - GetForumTopicLinkRequestTypeID: func() bin.Object { return &GetForumTopicLinkRequest{} }, - GetForumTopicsRequestTypeID: func() bin.Object { return &GetForumTopicsRequest{} }, - SetForumTopicNotificationSettingsRequestTypeID: func() bin.Object { return &SetForumTopicNotificationSettingsRequest{} }, - ToggleForumTopicIsClosedRequestTypeID: func() bin.Object { return &ToggleForumTopicIsClosedRequest{} }, - ToggleGeneralForumTopicIsHiddenRequestTypeID: func() bin.Object { return &ToggleGeneralForumTopicIsHiddenRequest{} }, - ToggleForumTopicIsPinnedRequestTypeID: func() bin.Object { return &ToggleForumTopicIsPinnedRequest{} }, - SetPinnedForumTopicsRequestTypeID: func() bin.Object { return &SetPinnedForumTopicsRequest{} }, - DeleteForumTopicRequestTypeID: func() bin.Object { return &DeleteForumTopicRequest{} }, - GetEmojiReactionRequestTypeID: func() bin.Object { return &GetEmojiReactionRequest{} }, - GetCustomEmojiReactionAnimationsRequestTypeID: func() bin.Object { return &GetCustomEmojiReactionAnimationsRequest{} }, - GetMessageAvailableReactionsRequestTypeID: func() bin.Object { return &GetMessageAvailableReactionsRequest{} }, - ClearRecentReactionsRequestTypeID: func() bin.Object { return &ClearRecentReactionsRequest{} }, - AddMessageReactionRequestTypeID: func() bin.Object { return &AddMessageReactionRequest{} }, - RemoveMessageReactionRequestTypeID: func() bin.Object { return &RemoveMessageReactionRequest{} }, - GetMessageAddedReactionsRequestTypeID: func() bin.Object { return &GetMessageAddedReactionsRequest{} }, - SetDefaultReactionTypeRequestTypeID: func() bin.Object { return &SetDefaultReactionTypeRequest{} }, - GetTextEntitiesRequestTypeID: func() bin.Object { return &GetTextEntitiesRequest{} }, - ParseTextEntitiesRequestTypeID: func() bin.Object { return &ParseTextEntitiesRequest{} }, - ParseMarkdownRequestTypeID: func() bin.Object { return &ParseMarkdownRequest{} }, - GetMarkdownTextRequestTypeID: func() bin.Object { return &GetMarkdownTextRequest{} }, - GetFileMimeTypeRequestTypeID: func() bin.Object { return &GetFileMimeTypeRequest{} }, - GetFileExtensionRequestTypeID: func() bin.Object { return &GetFileExtensionRequest{} }, - CleanFileNameRequestTypeID: func() bin.Object { return &CleanFileNameRequest{} }, - GetLanguagePackStringRequestTypeID: func() bin.Object { return &GetLanguagePackStringRequest{} }, - GetJSONValueRequestTypeID: func() bin.Object { return &GetJSONValueRequest{} }, - GetJSONStringRequestTypeID: func() bin.Object { return &GetJSONStringRequest{} }, - GetThemeParametersJSONStringRequestTypeID: func() bin.Object { return &GetThemeParametersJSONStringRequest{} }, - SetPollAnswerRequestTypeID: func() bin.Object { return &SetPollAnswerRequest{} }, - GetPollVotersRequestTypeID: func() bin.Object { return &GetPollVotersRequest{} }, - StopPollRequestTypeID: func() bin.Object { return &StopPollRequest{} }, - HideSuggestedActionRequestTypeID: func() bin.Object { return &HideSuggestedActionRequest{} }, - GetLoginURLInfoRequestTypeID: func() bin.Object { return &GetLoginURLInfoRequest{} }, - GetLoginURLRequestTypeID: func() bin.Object { return &GetLoginURLRequest{} }, - ShareUserWithBotRequestTypeID: func() bin.Object { return &ShareUserWithBotRequest{} }, - ShareChatWithBotRequestTypeID: func() bin.Object { return &ShareChatWithBotRequest{} }, - GetInlineQueryResultsRequestTypeID: func() bin.Object { return &GetInlineQueryResultsRequest{} }, - AnswerInlineQueryRequestTypeID: func() bin.Object { return &AnswerInlineQueryRequest{} }, - SearchWebAppRequestTypeID: func() bin.Object { return &SearchWebAppRequest{} }, - GetWebAppLinkURLRequestTypeID: func() bin.Object { return &GetWebAppLinkURLRequest{} }, - GetWebAppURLRequestTypeID: func() bin.Object { return &GetWebAppURLRequest{} }, - SendWebAppDataRequestTypeID: func() bin.Object { return &SendWebAppDataRequest{} }, - OpenWebAppRequestTypeID: func() bin.Object { return &OpenWebAppRequest{} }, - CloseWebAppRequestTypeID: func() bin.Object { return &CloseWebAppRequest{} }, - AnswerWebAppQueryRequestTypeID: func() bin.Object { return &AnswerWebAppQueryRequest{} }, - GetCallbackQueryAnswerRequestTypeID: func() bin.Object { return &GetCallbackQueryAnswerRequest{} }, - AnswerCallbackQueryRequestTypeID: func() bin.Object { return &AnswerCallbackQueryRequest{} }, - AnswerShippingQueryRequestTypeID: func() bin.Object { return &AnswerShippingQueryRequest{} }, - AnswerPreCheckoutQueryRequestTypeID: func() bin.Object { return &AnswerPreCheckoutQueryRequest{} }, - SetGameScoreRequestTypeID: func() bin.Object { return &SetGameScoreRequest{} }, - SetInlineGameScoreRequestTypeID: func() bin.Object { return &SetInlineGameScoreRequest{} }, - GetGameHighScoresRequestTypeID: func() bin.Object { return &GetGameHighScoresRequest{} }, - GetInlineGameHighScoresRequestTypeID: func() bin.Object { return &GetInlineGameHighScoresRequest{} }, - DeleteChatReplyMarkupRequestTypeID: func() bin.Object { return &DeleteChatReplyMarkupRequest{} }, - SendChatActionRequestTypeID: func() bin.Object { return &SendChatActionRequest{} }, - OpenChatRequestTypeID: func() bin.Object { return &OpenChatRequest{} }, - CloseChatRequestTypeID: func() bin.Object { return &CloseChatRequest{} }, - ViewMessagesRequestTypeID: func() bin.Object { return &ViewMessagesRequest{} }, - OpenMessageContentRequestTypeID: func() bin.Object { return &OpenMessageContentRequest{} }, - ClickAnimatedEmojiMessageRequestTypeID: func() bin.Object { return &ClickAnimatedEmojiMessageRequest{} }, - GetInternalLinkRequestTypeID: func() bin.Object { return &GetInternalLinkRequest{} }, - GetInternalLinkTypeRequestTypeID: func() bin.Object { return &GetInternalLinkTypeRequest{} }, - GetExternalLinkInfoRequestTypeID: func() bin.Object { return &GetExternalLinkInfoRequest{} }, - GetExternalLinkRequestTypeID: func() bin.Object { return &GetExternalLinkRequest{} }, - ReadAllChatMentionsRequestTypeID: func() bin.Object { return &ReadAllChatMentionsRequest{} }, - ReadAllMessageThreadMentionsRequestTypeID: func() bin.Object { return &ReadAllMessageThreadMentionsRequest{} }, - ReadAllChatReactionsRequestTypeID: func() bin.Object { return &ReadAllChatReactionsRequest{} }, - ReadAllMessageThreadReactionsRequestTypeID: func() bin.Object { return &ReadAllMessageThreadReactionsRequest{} }, - CreatePrivateChatRequestTypeID: func() bin.Object { return &CreatePrivateChatRequest{} }, - CreateBasicGroupChatRequestTypeID: func() bin.Object { return &CreateBasicGroupChatRequest{} }, - CreateSupergroupChatRequestTypeID: func() bin.Object { return &CreateSupergroupChatRequest{} }, - CreateSecretChatRequestTypeID: func() bin.Object { return &CreateSecretChatRequest{} }, - CreateNewBasicGroupChatRequestTypeID: func() bin.Object { return &CreateNewBasicGroupChatRequest{} }, - CreateNewSupergroupChatRequestTypeID: func() bin.Object { return &CreateNewSupergroupChatRequest{} }, - CreateNewSecretChatRequestTypeID: func() bin.Object { return &CreateNewSecretChatRequest{} }, - UpgradeBasicGroupChatToSupergroupChatRequestTypeID: func() bin.Object { return &UpgradeBasicGroupChatToSupergroupChatRequest{} }, - GetChatListsToAddChatRequestTypeID: func() bin.Object { return &GetChatListsToAddChatRequest{} }, - AddChatToListRequestTypeID: func() bin.Object { return &AddChatToListRequest{} }, - GetChatFolderRequestTypeID: func() bin.Object { return &GetChatFolderRequest{} }, - CreateChatFolderRequestTypeID: func() bin.Object { return &CreateChatFolderRequest{} }, - EditChatFolderRequestTypeID: func() bin.Object { return &EditChatFolderRequest{} }, - DeleteChatFolderRequestTypeID: func() bin.Object { return &DeleteChatFolderRequest{} }, - GetChatFolderChatsToLeaveRequestTypeID: func() bin.Object { return &GetChatFolderChatsToLeaveRequest{} }, - GetChatFolderChatCountRequestTypeID: func() bin.Object { return &GetChatFolderChatCountRequest{} }, - ReorderChatFoldersRequestTypeID: func() bin.Object { return &ReorderChatFoldersRequest{} }, - GetRecommendedChatFoldersRequestTypeID: func() bin.Object { return &GetRecommendedChatFoldersRequest{} }, - GetChatFolderDefaultIconNameRequestTypeID: func() bin.Object { return &GetChatFolderDefaultIconNameRequest{} }, - GetChatsForChatFolderInviteLinkRequestTypeID: func() bin.Object { return &GetChatsForChatFolderInviteLinkRequest{} }, - CreateChatFolderInviteLinkRequestTypeID: func() bin.Object { return &CreateChatFolderInviteLinkRequest{} }, - GetChatFolderInviteLinksRequestTypeID: func() bin.Object { return &GetChatFolderInviteLinksRequest{} }, - EditChatFolderInviteLinkRequestTypeID: func() bin.Object { return &EditChatFolderInviteLinkRequest{} }, - DeleteChatFolderInviteLinkRequestTypeID: func() bin.Object { return &DeleteChatFolderInviteLinkRequest{} }, - CheckChatFolderInviteLinkRequestTypeID: func() bin.Object { return &CheckChatFolderInviteLinkRequest{} }, - AddChatFolderByInviteLinkRequestTypeID: func() bin.Object { return &AddChatFolderByInviteLinkRequest{} }, - GetChatFolderNewChatsRequestTypeID: func() bin.Object { return &GetChatFolderNewChatsRequest{} }, - ProcessChatFolderNewChatsRequestTypeID: func() bin.Object { return &ProcessChatFolderNewChatsRequest{} }, - GetArchiveChatListSettingsRequestTypeID: func() bin.Object { return &GetArchiveChatListSettingsRequest{} }, - SetArchiveChatListSettingsRequestTypeID: func() bin.Object { return &SetArchiveChatListSettingsRequest{} }, - SetChatTitleRequestTypeID: func() bin.Object { return &SetChatTitleRequest{} }, - SetChatPhotoRequestTypeID: func() bin.Object { return &SetChatPhotoRequest{} }, - SetChatMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &SetChatMessageAutoDeleteTimeRequest{} }, - SetChatPermissionsRequestTypeID: func() bin.Object { return &SetChatPermissionsRequest{} }, - SetChatBackgroundRequestTypeID: func() bin.Object { return &SetChatBackgroundRequest{} }, - SetChatThemeRequestTypeID: func() bin.Object { return &SetChatThemeRequest{} }, - SetChatDraftMessageRequestTypeID: func() bin.Object { return &SetChatDraftMessageRequest{} }, - SetChatNotificationSettingsRequestTypeID: func() bin.Object { return &SetChatNotificationSettingsRequest{} }, - ToggleChatHasProtectedContentRequestTypeID: func() bin.Object { return &ToggleChatHasProtectedContentRequest{} }, - ToggleChatIsTranslatableRequestTypeID: func() bin.Object { return &ToggleChatIsTranslatableRequest{} }, - ToggleChatIsMarkedAsUnreadRequestTypeID: func() bin.Object { return &ToggleChatIsMarkedAsUnreadRequest{} }, - ToggleChatDefaultDisableNotificationRequestTypeID: func() bin.Object { return &ToggleChatDefaultDisableNotificationRequest{} }, - SetChatAvailableReactionsRequestTypeID: func() bin.Object { return &SetChatAvailableReactionsRequest{} }, - SetChatClientDataRequestTypeID: func() bin.Object { return &SetChatClientDataRequest{} }, - SetChatDescriptionRequestTypeID: func() bin.Object { return &SetChatDescriptionRequest{} }, - SetChatDiscussionGroupRequestTypeID: func() bin.Object { return &SetChatDiscussionGroupRequest{} }, - SetChatLocationRequestTypeID: func() bin.Object { return &SetChatLocationRequest{} }, - SetChatSlowModeDelayRequestTypeID: func() bin.Object { return &SetChatSlowModeDelayRequest{} }, - PinChatMessageRequestTypeID: func() bin.Object { return &PinChatMessageRequest{} }, - UnpinChatMessageRequestTypeID: func() bin.Object { return &UnpinChatMessageRequest{} }, - UnpinAllChatMessagesRequestTypeID: func() bin.Object { return &UnpinAllChatMessagesRequest{} }, - UnpinAllMessageThreadMessagesRequestTypeID: func() bin.Object { return &UnpinAllMessageThreadMessagesRequest{} }, - JoinChatRequestTypeID: func() bin.Object { return &JoinChatRequest{} }, - LeaveChatRequestTypeID: func() bin.Object { return &LeaveChatRequest{} }, - AddChatMemberRequestTypeID: func() bin.Object { return &AddChatMemberRequest{} }, - AddChatMembersRequestTypeID: func() bin.Object { return &AddChatMembersRequest{} }, - SetChatMemberStatusRequestTypeID: func() bin.Object { return &SetChatMemberStatusRequest{} }, - BanChatMemberRequestTypeID: func() bin.Object { return &BanChatMemberRequest{} }, - CanTransferOwnershipRequestTypeID: func() bin.Object { return &CanTransferOwnershipRequest{} }, - TransferChatOwnershipRequestTypeID: func() bin.Object { return &TransferChatOwnershipRequest{} }, - GetChatMemberRequestTypeID: func() bin.Object { return &GetChatMemberRequest{} }, - SearchChatMembersRequestTypeID: func() bin.Object { return &SearchChatMembersRequest{} }, - GetChatAdministratorsRequestTypeID: func() bin.Object { return &GetChatAdministratorsRequest{} }, - ClearAllDraftMessagesRequestTypeID: func() bin.Object { return &ClearAllDraftMessagesRequest{} }, - GetSavedNotificationSoundRequestTypeID: func() bin.Object { return &GetSavedNotificationSoundRequest{} }, - GetSavedNotificationSoundsRequestTypeID: func() bin.Object { return &GetSavedNotificationSoundsRequest{} }, - AddSavedNotificationSoundRequestTypeID: func() bin.Object { return &AddSavedNotificationSoundRequest{} }, - RemoveSavedNotificationSoundRequestTypeID: func() bin.Object { return &RemoveSavedNotificationSoundRequest{} }, - GetChatNotificationSettingsExceptionsRequestTypeID: func() bin.Object { return &GetChatNotificationSettingsExceptionsRequest{} }, - GetScopeNotificationSettingsRequestTypeID: func() bin.Object { return &GetScopeNotificationSettingsRequest{} }, - SetScopeNotificationSettingsRequestTypeID: func() bin.Object { return &SetScopeNotificationSettingsRequest{} }, - ResetAllNotificationSettingsRequestTypeID: func() bin.Object { return &ResetAllNotificationSettingsRequest{} }, - ToggleChatIsPinnedRequestTypeID: func() bin.Object { return &ToggleChatIsPinnedRequest{} }, - SetPinnedChatsRequestTypeID: func() bin.Object { return &SetPinnedChatsRequest{} }, - ReadChatListRequestTypeID: func() bin.Object { return &ReadChatListRequest{} }, - GetStoryRequestTypeID: func() bin.Object { return &GetStoryRequest{} }, - GetChatsToSendStoriesRequestTypeID: func() bin.Object { return &GetChatsToSendStoriesRequest{} }, - CanSendStoryRequestTypeID: func() bin.Object { return &CanSendStoryRequest{} }, - SendStoryRequestTypeID: func() bin.Object { return &SendStoryRequest{} }, - EditStoryRequestTypeID: func() bin.Object { return &EditStoryRequest{} }, - SetStoryPrivacySettingsRequestTypeID: func() bin.Object { return &SetStoryPrivacySettingsRequest{} }, - ToggleStoryIsPinnedRequestTypeID: func() bin.Object { return &ToggleStoryIsPinnedRequest{} }, - DeleteStoryRequestTypeID: func() bin.Object { return &DeleteStoryRequest{} }, - GetStoryNotificationSettingsExceptionsRequestTypeID: func() bin.Object { return &GetStoryNotificationSettingsExceptionsRequest{} }, - LoadActiveStoriesRequestTypeID: func() bin.Object { return &LoadActiveStoriesRequest{} }, - SetChatActiveStoriesListRequestTypeID: func() bin.Object { return &SetChatActiveStoriesListRequest{} }, - GetChatActiveStoriesRequestTypeID: func() bin.Object { return &GetChatActiveStoriesRequest{} }, - GetChatPinnedStoriesRequestTypeID: func() bin.Object { return &GetChatPinnedStoriesRequest{} }, - GetChatArchivedStoriesRequestTypeID: func() bin.Object { return &GetChatArchivedStoriesRequest{} }, - OpenStoryRequestTypeID: func() bin.Object { return &OpenStoryRequest{} }, - CloseStoryRequestTypeID: func() bin.Object { return &CloseStoryRequest{} }, - GetStoryAvailableReactionsRequestTypeID: func() bin.Object { return &GetStoryAvailableReactionsRequest{} }, - SetStoryReactionRequestTypeID: func() bin.Object { return &SetStoryReactionRequest{} }, - GetStoryViewersRequestTypeID: func() bin.Object { return &GetStoryViewersRequest{} }, - ReportStoryRequestTypeID: func() bin.Object { return &ReportStoryRequest{} }, - ActivateStoryStealthModeRequestTypeID: func() bin.Object { return &ActivateStoryStealthModeRequest{} }, - GetChatBoostStatusRequestTypeID: func() bin.Object { return &GetChatBoostStatusRequest{} }, - CanBoostChatRequestTypeID: func() bin.Object { return &CanBoostChatRequest{} }, - BoostChatRequestTypeID: func() bin.Object { return &BoostChatRequest{} }, - GetChatBoostLinkRequestTypeID: func() bin.Object { return &GetChatBoostLinkRequest{} }, - GetChatBoostLinkInfoRequestTypeID: func() bin.Object { return &GetChatBoostLinkInfoRequest{} }, - GetChatBoostsRequestTypeID: func() bin.Object { return &GetChatBoostsRequest{} }, - GetAttachmentMenuBotRequestTypeID: func() bin.Object { return &GetAttachmentMenuBotRequest{} }, - ToggleBotIsAddedToAttachmentMenuRequestTypeID: func() bin.Object { return &ToggleBotIsAddedToAttachmentMenuRequest{} }, - GetThemedEmojiStatusesRequestTypeID: func() bin.Object { return &GetThemedEmojiStatusesRequest{} }, - GetRecentEmojiStatusesRequestTypeID: func() bin.Object { return &GetRecentEmojiStatusesRequest{} }, - GetDefaultEmojiStatusesRequestTypeID: func() bin.Object { return &GetDefaultEmojiStatusesRequest{} }, - ClearRecentEmojiStatusesRequestTypeID: func() bin.Object { return &ClearRecentEmojiStatusesRequest{} }, - DownloadFileRequestTypeID: func() bin.Object { return &DownloadFileRequest{} }, - GetFileDownloadedPrefixSizeRequestTypeID: func() bin.Object { return &GetFileDownloadedPrefixSizeRequest{} }, - CancelDownloadFileRequestTypeID: func() bin.Object { return &CancelDownloadFileRequest{} }, - GetSuggestedFileNameRequestTypeID: func() bin.Object { return &GetSuggestedFileNameRequest{} }, - PreliminaryUploadFileRequestTypeID: func() bin.Object { return &PreliminaryUploadFileRequest{} }, - CancelPreliminaryUploadFileRequestTypeID: func() bin.Object { return &CancelPreliminaryUploadFileRequest{} }, - WriteGeneratedFilePartRequestTypeID: func() bin.Object { return &WriteGeneratedFilePartRequest{} }, - SetFileGenerationProgressRequestTypeID: func() bin.Object { return &SetFileGenerationProgressRequest{} }, - FinishFileGenerationRequestTypeID: func() bin.Object { return &FinishFileGenerationRequest{} }, - ReadFilePartRequestTypeID: func() bin.Object { return &ReadFilePartRequest{} }, - DeleteFileRequestTypeID: func() bin.Object { return &DeleteFileRequest{} }, - AddFileToDownloadsRequestTypeID: func() bin.Object { return &AddFileToDownloadsRequest{} }, - ToggleDownloadIsPausedRequestTypeID: func() bin.Object { return &ToggleDownloadIsPausedRequest{} }, - ToggleAllDownloadsArePausedRequestTypeID: func() bin.Object { return &ToggleAllDownloadsArePausedRequest{} }, - RemoveFileFromDownloadsRequestTypeID: func() bin.Object { return &RemoveFileFromDownloadsRequest{} }, - RemoveAllFilesFromDownloadsRequestTypeID: func() bin.Object { return &RemoveAllFilesFromDownloadsRequest{} }, - SearchFileDownloadsRequestTypeID: func() bin.Object { return &SearchFileDownloadsRequest{} }, - GetMessageFileTypeRequestTypeID: func() bin.Object { return &GetMessageFileTypeRequest{} }, - GetMessageImportConfirmationTextRequestTypeID: func() bin.Object { return &GetMessageImportConfirmationTextRequest{} }, - ImportMessagesRequestTypeID: func() bin.Object { return &ImportMessagesRequest{} }, - ReplacePrimaryChatInviteLinkRequestTypeID: func() bin.Object { return &ReplacePrimaryChatInviteLinkRequest{} }, - CreateChatInviteLinkRequestTypeID: func() bin.Object { return &CreateChatInviteLinkRequest{} }, - EditChatInviteLinkRequestTypeID: func() bin.Object { return &EditChatInviteLinkRequest{} }, - GetChatInviteLinkRequestTypeID: func() bin.Object { return &GetChatInviteLinkRequest{} }, - GetChatInviteLinkCountsRequestTypeID: func() bin.Object { return &GetChatInviteLinkCountsRequest{} }, - GetChatInviteLinksRequestTypeID: func() bin.Object { return &GetChatInviteLinksRequest{} }, - GetChatInviteLinkMembersRequestTypeID: func() bin.Object { return &GetChatInviteLinkMembersRequest{} }, - RevokeChatInviteLinkRequestTypeID: func() bin.Object { return &RevokeChatInviteLinkRequest{} }, - DeleteRevokedChatInviteLinkRequestTypeID: func() bin.Object { return &DeleteRevokedChatInviteLinkRequest{} }, - DeleteAllRevokedChatInviteLinksRequestTypeID: func() bin.Object { return &DeleteAllRevokedChatInviteLinksRequest{} }, - CheckChatInviteLinkRequestTypeID: func() bin.Object { return &CheckChatInviteLinkRequest{} }, - JoinChatByInviteLinkRequestTypeID: func() bin.Object { return &JoinChatByInviteLinkRequest{} }, - GetChatJoinRequestsRequestTypeID: func() bin.Object { return &GetChatJoinRequestsRequest{} }, - ProcessChatJoinRequestRequestTypeID: func() bin.Object { return &ProcessChatJoinRequestRequest{} }, - ProcessChatJoinRequestsRequestTypeID: func() bin.Object { return &ProcessChatJoinRequestsRequest{} }, - CreateCallRequestTypeID: func() bin.Object { return &CreateCallRequest{} }, - AcceptCallRequestTypeID: func() bin.Object { return &AcceptCallRequest{} }, - SendCallSignalingDataRequestTypeID: func() bin.Object { return &SendCallSignalingDataRequest{} }, - DiscardCallRequestTypeID: func() bin.Object { return &DiscardCallRequest{} }, - SendCallRatingRequestTypeID: func() bin.Object { return &SendCallRatingRequest{} }, - SendCallDebugInformationRequestTypeID: func() bin.Object { return &SendCallDebugInformationRequest{} }, - SendCallLogRequestTypeID: func() bin.Object { return &SendCallLogRequest{} }, - GetVideoChatAvailableParticipantsRequestTypeID: func() bin.Object { return &GetVideoChatAvailableParticipantsRequest{} }, - SetVideoChatDefaultParticipantRequestTypeID: func() bin.Object { return &SetVideoChatDefaultParticipantRequest{} }, - CreateVideoChatRequestTypeID: func() bin.Object { return &CreateVideoChatRequest{} }, - GetVideoChatRtmpURLRequestTypeID: func() bin.Object { return &GetVideoChatRtmpURLRequest{} }, - ReplaceVideoChatRtmpURLRequestTypeID: func() bin.Object { return &ReplaceVideoChatRtmpURLRequest{} }, - GetGroupCallRequestTypeID: func() bin.Object { return &GetGroupCallRequest{} }, - StartScheduledGroupCallRequestTypeID: func() bin.Object { return &StartScheduledGroupCallRequest{} }, - ToggleGroupCallEnabledStartNotificationRequestTypeID: func() bin.Object { return &ToggleGroupCallEnabledStartNotificationRequest{} }, - JoinGroupCallRequestTypeID: func() bin.Object { return &JoinGroupCallRequest{} }, - StartGroupCallScreenSharingRequestTypeID: func() bin.Object { return &StartGroupCallScreenSharingRequest{} }, - ToggleGroupCallScreenSharingIsPausedRequestTypeID: func() bin.Object { return &ToggleGroupCallScreenSharingIsPausedRequest{} }, - EndGroupCallScreenSharingRequestTypeID: func() bin.Object { return &EndGroupCallScreenSharingRequest{} }, - SetGroupCallTitleRequestTypeID: func() bin.Object { return &SetGroupCallTitleRequest{} }, - ToggleGroupCallMuteNewParticipantsRequestTypeID: func() bin.Object { return &ToggleGroupCallMuteNewParticipantsRequest{} }, - InviteGroupCallParticipantsRequestTypeID: func() bin.Object { return &InviteGroupCallParticipantsRequest{} }, - GetGroupCallInviteLinkRequestTypeID: func() bin.Object { return &GetGroupCallInviteLinkRequest{} }, - RevokeGroupCallInviteLinkRequestTypeID: func() bin.Object { return &RevokeGroupCallInviteLinkRequest{} }, - StartGroupCallRecordingRequestTypeID: func() bin.Object { return &StartGroupCallRecordingRequest{} }, - EndGroupCallRecordingRequestTypeID: func() bin.Object { return &EndGroupCallRecordingRequest{} }, - ToggleGroupCallIsMyVideoPausedRequestTypeID: func() bin.Object { return &ToggleGroupCallIsMyVideoPausedRequest{} }, - ToggleGroupCallIsMyVideoEnabledRequestTypeID: func() bin.Object { return &ToggleGroupCallIsMyVideoEnabledRequest{} }, - SetGroupCallParticipantIsSpeakingRequestTypeID: func() bin.Object { return &SetGroupCallParticipantIsSpeakingRequest{} }, - ToggleGroupCallParticipantIsMutedRequestTypeID: func() bin.Object { return &ToggleGroupCallParticipantIsMutedRequest{} }, - SetGroupCallParticipantVolumeLevelRequestTypeID: func() bin.Object { return &SetGroupCallParticipantVolumeLevelRequest{} }, - ToggleGroupCallParticipantIsHandRaisedRequestTypeID: func() bin.Object { return &ToggleGroupCallParticipantIsHandRaisedRequest{} }, - LoadGroupCallParticipantsRequestTypeID: func() bin.Object { return &LoadGroupCallParticipantsRequest{} }, - LeaveGroupCallRequestTypeID: func() bin.Object { return &LeaveGroupCallRequest{} }, - EndGroupCallRequestTypeID: func() bin.Object { return &EndGroupCallRequest{} }, - GetGroupCallStreamsRequestTypeID: func() bin.Object { return &GetGroupCallStreamsRequest{} }, - GetGroupCallStreamSegmentRequestTypeID: func() bin.Object { return &GetGroupCallStreamSegmentRequest{} }, - SetMessageSenderBlockListRequestTypeID: func() bin.Object { return &SetMessageSenderBlockListRequest{} }, - BlockMessageSenderFromRepliesRequestTypeID: func() bin.Object { return &BlockMessageSenderFromRepliesRequest{} }, - GetBlockedMessageSendersRequestTypeID: func() bin.Object { return &GetBlockedMessageSendersRequest{} }, - AddContactRequestTypeID: func() bin.Object { return &AddContactRequest{} }, - ImportContactsRequestTypeID: func() bin.Object { return &ImportContactsRequest{} }, - GetContactsRequestTypeID: func() bin.Object { return &GetContactsRequest{} }, - SearchContactsRequestTypeID: func() bin.Object { return &SearchContactsRequest{} }, - RemoveContactsRequestTypeID: func() bin.Object { return &RemoveContactsRequest{} }, - GetImportedContactCountRequestTypeID: func() bin.Object { return &GetImportedContactCountRequest{} }, - ChangeImportedContactsRequestTypeID: func() bin.Object { return &ChangeImportedContactsRequest{} }, - ClearImportedContactsRequestTypeID: func() bin.Object { return &ClearImportedContactsRequest{} }, - SetCloseFriendsRequestTypeID: func() bin.Object { return &SetCloseFriendsRequest{} }, - GetCloseFriendsRequestTypeID: func() bin.Object { return &GetCloseFriendsRequest{} }, - SetUserPersonalProfilePhotoRequestTypeID: func() bin.Object { return &SetUserPersonalProfilePhotoRequest{} }, - SuggestUserProfilePhotoRequestTypeID: func() bin.Object { return &SuggestUserProfilePhotoRequest{} }, - SearchUserByPhoneNumberRequestTypeID: func() bin.Object { return &SearchUserByPhoneNumberRequest{} }, - SharePhoneNumberRequestTypeID: func() bin.Object { return &SharePhoneNumberRequest{} }, - GetUserProfilePhotosRequestTypeID: func() bin.Object { return &GetUserProfilePhotosRequest{} }, - GetStickersRequestTypeID: func() bin.Object { return &GetStickersRequest{} }, - GetAllStickerEmojisRequestTypeID: func() bin.Object { return &GetAllStickerEmojisRequest{} }, - SearchStickersRequestTypeID: func() bin.Object { return &SearchStickersRequest{} }, - GetPremiumStickersRequestTypeID: func() bin.Object { return &GetPremiumStickersRequest{} }, - GetInstalledStickerSetsRequestTypeID: func() bin.Object { return &GetInstalledStickerSetsRequest{} }, - GetArchivedStickerSetsRequestTypeID: func() bin.Object { return &GetArchivedStickerSetsRequest{} }, - GetTrendingStickerSetsRequestTypeID: func() bin.Object { return &GetTrendingStickerSetsRequest{} }, - GetAttachedStickerSetsRequestTypeID: func() bin.Object { return &GetAttachedStickerSetsRequest{} }, - GetStickerSetRequestTypeID: func() bin.Object { return &GetStickerSetRequest{} }, - SearchStickerSetRequestTypeID: func() bin.Object { return &SearchStickerSetRequest{} }, - SearchInstalledStickerSetsRequestTypeID: func() bin.Object { return &SearchInstalledStickerSetsRequest{} }, - SearchStickerSetsRequestTypeID: func() bin.Object { return &SearchStickerSetsRequest{} }, - ChangeStickerSetRequestTypeID: func() bin.Object { return &ChangeStickerSetRequest{} }, - ViewTrendingStickerSetsRequestTypeID: func() bin.Object { return &ViewTrendingStickerSetsRequest{} }, - ReorderInstalledStickerSetsRequestTypeID: func() bin.Object { return &ReorderInstalledStickerSetsRequest{} }, - GetRecentStickersRequestTypeID: func() bin.Object { return &GetRecentStickersRequest{} }, - AddRecentStickerRequestTypeID: func() bin.Object { return &AddRecentStickerRequest{} }, - RemoveRecentStickerRequestTypeID: func() bin.Object { return &RemoveRecentStickerRequest{} }, - ClearRecentStickersRequestTypeID: func() bin.Object { return &ClearRecentStickersRequest{} }, - GetFavoriteStickersRequestTypeID: func() bin.Object { return &GetFavoriteStickersRequest{} }, - AddFavoriteStickerRequestTypeID: func() bin.Object { return &AddFavoriteStickerRequest{} }, - RemoveFavoriteStickerRequestTypeID: func() bin.Object { return &RemoveFavoriteStickerRequest{} }, - GetStickerEmojisRequestTypeID: func() bin.Object { return &GetStickerEmojisRequest{} }, - SearchEmojisRequestTypeID: func() bin.Object { return &SearchEmojisRequest{} }, - GetEmojiCategoriesRequestTypeID: func() bin.Object { return &GetEmojiCategoriesRequest{} }, - GetAnimatedEmojiRequestTypeID: func() bin.Object { return &GetAnimatedEmojiRequest{} }, - GetEmojiSuggestionsURLRequestTypeID: func() bin.Object { return &GetEmojiSuggestionsURLRequest{} }, - GetCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetCustomEmojiStickersRequest{} }, - GetDefaultChatPhotoCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetDefaultChatPhotoCustomEmojiStickersRequest{} }, - GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetDefaultProfilePhotoCustomEmojiStickersRequest{} }, - GetSavedAnimationsRequestTypeID: func() bin.Object { return &GetSavedAnimationsRequest{} }, - AddSavedAnimationRequestTypeID: func() bin.Object { return &AddSavedAnimationRequest{} }, - RemoveSavedAnimationRequestTypeID: func() bin.Object { return &RemoveSavedAnimationRequest{} }, - GetRecentInlineBotsRequestTypeID: func() bin.Object { return &GetRecentInlineBotsRequest{} }, - SearchHashtagsRequestTypeID: func() bin.Object { return &SearchHashtagsRequest{} }, - RemoveRecentHashtagRequestTypeID: func() bin.Object { return &RemoveRecentHashtagRequest{} }, - GetWebPagePreviewRequestTypeID: func() bin.Object { return &GetWebPagePreviewRequest{} }, - GetWebPageInstantViewRequestTypeID: func() bin.Object { return &GetWebPageInstantViewRequest{} }, - SetProfilePhotoRequestTypeID: func() bin.Object { return &SetProfilePhotoRequest{} }, - DeleteProfilePhotoRequestTypeID: func() bin.Object { return &DeleteProfilePhotoRequest{} }, - SetNameRequestTypeID: func() bin.Object { return &SetNameRequest{} }, - SetBioRequestTypeID: func() bin.Object { return &SetBioRequest{} }, - SetUsernameRequestTypeID: func() bin.Object { return &SetUsernameRequest{} }, - ToggleUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleUsernameIsActiveRequest{} }, - ReorderActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderActiveUsernamesRequest{} }, - SetEmojiStatusRequestTypeID: func() bin.Object { return &SetEmojiStatusRequest{} }, - SetLocationRequestTypeID: func() bin.Object { return &SetLocationRequest{} }, - ChangePhoneNumberRequestTypeID: func() bin.Object { return &ChangePhoneNumberRequest{} }, - ResendChangePhoneNumberCodeRequestTypeID: func() bin.Object { return &ResendChangePhoneNumberCodeRequest{} }, - CheckChangePhoneNumberCodeRequestTypeID: func() bin.Object { return &CheckChangePhoneNumberCodeRequest{} }, - GetUserLinkRequestTypeID: func() bin.Object { return &GetUserLinkRequest{} }, - SearchUserByTokenRequestTypeID: func() bin.Object { return &SearchUserByTokenRequest{} }, - SetCommandsRequestTypeID: func() bin.Object { return &SetCommandsRequest{} }, - DeleteCommandsRequestTypeID: func() bin.Object { return &DeleteCommandsRequest{} }, - GetCommandsRequestTypeID: func() bin.Object { return &GetCommandsRequest{} }, - SetMenuButtonRequestTypeID: func() bin.Object { return &SetMenuButtonRequest{} }, - GetMenuButtonRequestTypeID: func() bin.Object { return &GetMenuButtonRequest{} }, - SetDefaultGroupAdministratorRightsRequestTypeID: func() bin.Object { return &SetDefaultGroupAdministratorRightsRequest{} }, - SetDefaultChannelAdministratorRightsRequestTypeID: func() bin.Object { return &SetDefaultChannelAdministratorRightsRequest{} }, - CanBotSendMessagesRequestTypeID: func() bin.Object { return &CanBotSendMessagesRequest{} }, - AllowBotToSendMessagesRequestTypeID: func() bin.Object { return &AllowBotToSendMessagesRequest{} }, - SendWebAppCustomRequestRequestTypeID: func() bin.Object { return &SendWebAppCustomRequestRequest{} }, - SetBotNameRequestTypeID: func() bin.Object { return &SetBotNameRequest{} }, - GetBotNameRequestTypeID: func() bin.Object { return &GetBotNameRequest{} }, - SetBotProfilePhotoRequestTypeID: func() bin.Object { return &SetBotProfilePhotoRequest{} }, - ToggleBotUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleBotUsernameIsActiveRequest{} }, - ReorderBotActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderBotActiveUsernamesRequest{} }, - SetBotInfoDescriptionRequestTypeID: func() bin.Object { return &SetBotInfoDescriptionRequest{} }, - GetBotInfoDescriptionRequestTypeID: func() bin.Object { return &GetBotInfoDescriptionRequest{} }, - SetBotInfoShortDescriptionRequestTypeID: func() bin.Object { return &SetBotInfoShortDescriptionRequest{} }, - GetBotInfoShortDescriptionRequestTypeID: func() bin.Object { return &GetBotInfoShortDescriptionRequest{} }, - GetActiveSessionsRequestTypeID: func() bin.Object { return &GetActiveSessionsRequest{} }, - TerminateSessionRequestTypeID: func() bin.Object { return &TerminateSessionRequest{} }, - TerminateAllOtherSessionsRequestTypeID: func() bin.Object { return &TerminateAllOtherSessionsRequest{} }, - ConfirmSessionRequestTypeID: func() bin.Object { return &ConfirmSessionRequest{} }, - ToggleSessionCanAcceptCallsRequestTypeID: func() bin.Object { return &ToggleSessionCanAcceptCallsRequest{} }, - ToggleSessionCanAcceptSecretChatsRequestTypeID: func() bin.Object { return &ToggleSessionCanAcceptSecretChatsRequest{} }, - SetInactiveSessionTTLRequestTypeID: func() bin.Object { return &SetInactiveSessionTTLRequest{} }, - GetConnectedWebsitesRequestTypeID: func() bin.Object { return &GetConnectedWebsitesRequest{} }, - DisconnectWebsiteRequestTypeID: func() bin.Object { return &DisconnectWebsiteRequest{} }, - DisconnectAllWebsitesRequestTypeID: func() bin.Object { return &DisconnectAllWebsitesRequest{} }, - SetSupergroupUsernameRequestTypeID: func() bin.Object { return &SetSupergroupUsernameRequest{} }, - ToggleSupergroupUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleSupergroupUsernameIsActiveRequest{} }, - DisableAllSupergroupUsernamesRequestTypeID: func() bin.Object { return &DisableAllSupergroupUsernamesRequest{} }, - ReorderSupergroupActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderSupergroupActiveUsernamesRequest{} }, - SetSupergroupStickerSetRequestTypeID: func() bin.Object { return &SetSupergroupStickerSetRequest{} }, - ToggleSupergroupSignMessagesRequestTypeID: func() bin.Object { return &ToggleSupergroupSignMessagesRequest{} }, - ToggleSupergroupJoinToSendMessagesRequestTypeID: func() bin.Object { return &ToggleSupergroupJoinToSendMessagesRequest{} }, - ToggleSupergroupJoinByRequestRequestTypeID: func() bin.Object { return &ToggleSupergroupJoinByRequestRequest{} }, - ToggleSupergroupIsAllHistoryAvailableRequestTypeID: func() bin.Object { return &ToggleSupergroupIsAllHistoryAvailableRequest{} }, - ToggleSupergroupHasHiddenMembersRequestTypeID: func() bin.Object { return &ToggleSupergroupHasHiddenMembersRequest{} }, - ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID: func() bin.Object { return &ToggleSupergroupHasAggressiveAntiSpamEnabledRequest{} }, - ToggleSupergroupIsForumRequestTypeID: func() bin.Object { return &ToggleSupergroupIsForumRequest{} }, - ToggleSupergroupIsBroadcastGroupRequestTypeID: func() bin.Object { return &ToggleSupergroupIsBroadcastGroupRequest{} }, - ReportSupergroupSpamRequestTypeID: func() bin.Object { return &ReportSupergroupSpamRequest{} }, - ReportSupergroupAntiSpamFalsePositiveRequestTypeID: func() bin.Object { return &ReportSupergroupAntiSpamFalsePositiveRequest{} }, - GetSupergroupMembersRequestTypeID: func() bin.Object { return &GetSupergroupMembersRequest{} }, - CloseSecretChatRequestTypeID: func() bin.Object { return &CloseSecretChatRequest{} }, - GetChatEventLogRequestTypeID: func() bin.Object { return &GetChatEventLogRequest{} }, - GetPaymentFormRequestTypeID: func() bin.Object { return &GetPaymentFormRequest{} }, - ValidateOrderInfoRequestTypeID: func() bin.Object { return &ValidateOrderInfoRequest{} }, - SendPaymentFormRequestTypeID: func() bin.Object { return &SendPaymentFormRequest{} }, - GetPaymentReceiptRequestTypeID: func() bin.Object { return &GetPaymentReceiptRequest{} }, - GetSavedOrderInfoRequestTypeID: func() bin.Object { return &GetSavedOrderInfoRequest{} }, - DeleteSavedOrderInfoRequestTypeID: func() bin.Object { return &DeleteSavedOrderInfoRequest{} }, - 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{} }, - GetLocalizationTargetInfoRequestTypeID: func() bin.Object { return &GetLocalizationTargetInfoRequest{} }, - GetLanguagePackInfoRequestTypeID: func() bin.Object { return &GetLanguagePackInfoRequest{} }, - GetLanguagePackStringsRequestTypeID: func() bin.Object { return &GetLanguagePackStringsRequest{} }, - SynchronizeLanguagePackRequestTypeID: func() bin.Object { return &SynchronizeLanguagePackRequest{} }, - AddCustomServerLanguagePackRequestTypeID: func() bin.Object { return &AddCustomServerLanguagePackRequest{} }, - SetCustomLanguagePackRequestTypeID: func() bin.Object { return &SetCustomLanguagePackRequest{} }, - EditCustomLanguagePackInfoRequestTypeID: func() bin.Object { return &EditCustomLanguagePackInfoRequest{} }, - SetCustomLanguagePackStringRequestTypeID: func() bin.Object { return &SetCustomLanguagePackStringRequest{} }, - DeleteLanguagePackRequestTypeID: func() bin.Object { return &DeleteLanguagePackRequest{} }, - RegisterDeviceRequestTypeID: func() bin.Object { return &RegisterDeviceRequest{} }, - ProcessPushNotificationRequestTypeID: func() bin.Object { return &ProcessPushNotificationRequest{} }, - GetPushReceiverIDRequestTypeID: func() bin.Object { return &GetPushReceiverIDRequest{} }, - GetRecentlyVisitedTMeURLsRequestTypeID: func() bin.Object { return &GetRecentlyVisitedTMeURLsRequest{} }, - SetUserPrivacySettingRulesRequestTypeID: func() bin.Object { return &SetUserPrivacySettingRulesRequest{} }, - GetUserPrivacySettingRulesRequestTypeID: func() bin.Object { return &GetUserPrivacySettingRulesRequest{} }, - GetOptionRequestTypeID: func() bin.Object { return &GetOptionRequest{} }, - SetOptionRequestTypeID: func() bin.Object { return &SetOptionRequest{} }, - SetAccountTTLRequestTypeID: func() bin.Object { return &SetAccountTTLRequest{} }, - GetAccountTTLRequestTypeID: func() bin.Object { return &GetAccountTTLRequest{} }, - DeleteAccountRequestTypeID: func() bin.Object { return &DeleteAccountRequest{} }, - SetDefaultMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &SetDefaultMessageAutoDeleteTimeRequest{} }, - GetDefaultMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &GetDefaultMessageAutoDeleteTimeRequest{} }, - RemoveChatActionBarRequestTypeID: func() bin.Object { return &RemoveChatActionBarRequest{} }, - ReportChatRequestTypeID: func() bin.Object { return &ReportChatRequest{} }, - ReportChatPhotoRequestTypeID: func() bin.Object { return &ReportChatPhotoRequest{} }, - ReportMessageReactionsRequestTypeID: func() bin.Object { return &ReportMessageReactionsRequest{} }, - GetChatStatisticsRequestTypeID: func() bin.Object { return &GetChatStatisticsRequest{} }, - GetMessageStatisticsRequestTypeID: func() bin.Object { return &GetMessageStatisticsRequest{} }, - GetMessagePublicForwardsRequestTypeID: func() bin.Object { return &GetMessagePublicForwardsRequest{} }, - GetStatisticalGraphRequestTypeID: func() bin.Object { return &GetStatisticalGraphRequest{} }, - GetStorageStatisticsRequestTypeID: func() bin.Object { return &GetStorageStatisticsRequest{} }, - GetStorageStatisticsFastRequestTypeID: func() bin.Object { return &GetStorageStatisticsFastRequest{} }, - GetDatabaseStatisticsRequestTypeID: func() bin.Object { return &GetDatabaseStatisticsRequest{} }, - OptimizeStorageRequestTypeID: func() bin.Object { return &OptimizeStorageRequest{} }, - SetNetworkTypeRequestTypeID: func() bin.Object { return &SetNetworkTypeRequest{} }, - GetNetworkStatisticsRequestTypeID: func() bin.Object { return &GetNetworkStatisticsRequest{} }, - AddNetworkStatisticsRequestTypeID: func() bin.Object { return &AddNetworkStatisticsRequest{} }, - ResetNetworkStatisticsRequestTypeID: func() bin.Object { return &ResetNetworkStatisticsRequest{} }, - GetAutoDownloadSettingsPresetsRequestTypeID: func() bin.Object { return &GetAutoDownloadSettingsPresetsRequest{} }, - SetAutoDownloadSettingsRequestTypeID: func() bin.Object { return &SetAutoDownloadSettingsRequest{} }, - GetAutosaveSettingsRequestTypeID: func() bin.Object { return &GetAutosaveSettingsRequest{} }, - SetAutosaveSettingsRequestTypeID: func() bin.Object { return &SetAutosaveSettingsRequest{} }, - ClearAutosaveSettingsExceptionsRequestTypeID: func() bin.Object { return &ClearAutosaveSettingsExceptionsRequest{} }, - GetBankCardInfoRequestTypeID: func() bin.Object { return &GetBankCardInfoRequest{} }, - GetPassportElementRequestTypeID: func() bin.Object { return &GetPassportElementRequest{} }, - GetAllPassportElementsRequestTypeID: func() bin.Object { return &GetAllPassportElementsRequest{} }, - SetPassportElementRequestTypeID: func() bin.Object { return &SetPassportElementRequest{} }, - DeletePassportElementRequestTypeID: func() bin.Object { return &DeletePassportElementRequest{} }, - SetPassportElementErrorsRequestTypeID: func() bin.Object { return &SetPassportElementErrorsRequest{} }, - GetPreferredCountryLanguageRequestTypeID: func() bin.Object { return &GetPreferredCountryLanguageRequest{} }, - SendPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &SendPhoneNumberVerificationCodeRequest{} }, - ResendPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &ResendPhoneNumberVerificationCodeRequest{} }, - CheckPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &CheckPhoneNumberVerificationCodeRequest{} }, - SendEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &SendEmailAddressVerificationCodeRequest{} }, - ResendEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &ResendEmailAddressVerificationCodeRequest{} }, - CheckEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &CheckEmailAddressVerificationCodeRequest{} }, - GetPassportAuthorizationFormRequestTypeID: func() bin.Object { return &GetPassportAuthorizationFormRequest{} }, - GetPassportAuthorizationFormAvailableElementsRequestTypeID: func() bin.Object { return &GetPassportAuthorizationFormAvailableElementsRequest{} }, - SendPassportAuthorizationFormRequestTypeID: func() bin.Object { return &SendPassportAuthorizationFormRequest{} }, - SendPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &SendPhoneNumberConfirmationCodeRequest{} }, - ResendPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &ResendPhoneNumberConfirmationCodeRequest{} }, - CheckPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &CheckPhoneNumberConfirmationCodeRequest{} }, - SetBotUpdatesStatusRequestTypeID: func() bin.Object { return &SetBotUpdatesStatusRequest{} }, - UploadStickerFileRequestTypeID: func() bin.Object { return &UploadStickerFileRequest{} }, - GetSuggestedStickerSetNameRequestTypeID: func() bin.Object { return &GetSuggestedStickerSetNameRequest{} }, - CheckStickerSetNameRequestTypeID: func() bin.Object { return &CheckStickerSetNameRequest{} }, - CreateNewStickerSetRequestTypeID: func() bin.Object { return &CreateNewStickerSetRequest{} }, - AddStickerToSetRequestTypeID: func() bin.Object { return &AddStickerToSetRequest{} }, - SetStickerSetThumbnailRequestTypeID: func() bin.Object { return &SetStickerSetThumbnailRequest{} }, - SetCustomEmojiStickerSetThumbnailRequestTypeID: func() bin.Object { return &SetCustomEmojiStickerSetThumbnailRequest{} }, - SetStickerSetTitleRequestTypeID: func() bin.Object { return &SetStickerSetTitleRequest{} }, - DeleteStickerSetRequestTypeID: func() bin.Object { return &DeleteStickerSetRequest{} }, - SetStickerPositionInSetRequestTypeID: func() bin.Object { return &SetStickerPositionInSetRequest{} }, - RemoveStickerFromSetRequestTypeID: func() bin.Object { return &RemoveStickerFromSetRequest{} }, - SetStickerEmojisRequestTypeID: func() bin.Object { return &SetStickerEmojisRequest{} }, - SetStickerKeywordsRequestTypeID: func() bin.Object { return &SetStickerKeywordsRequest{} }, - SetStickerMaskPositionRequestTypeID: func() bin.Object { return &SetStickerMaskPositionRequest{} }, - GetMapThumbnailFileRequestTypeID: func() bin.Object { return &GetMapThumbnailFileRequest{} }, - GetPremiumLimitRequestTypeID: func() bin.Object { return &GetPremiumLimitRequest{} }, - GetPremiumFeaturesRequestTypeID: func() bin.Object { return &GetPremiumFeaturesRequest{} }, - GetPremiumStickerExamplesRequestTypeID: func() bin.Object { return &GetPremiumStickerExamplesRequest{} }, - ViewPremiumFeatureRequestTypeID: func() bin.Object { return &ViewPremiumFeatureRequest{} }, - ClickPremiumSubscriptionButtonRequestTypeID: func() bin.Object { return &ClickPremiumSubscriptionButtonRequest{} }, - GetPremiumStateRequestTypeID: func() bin.Object { return &GetPremiumStateRequest{} }, - CanPurchasePremiumRequestTypeID: func() bin.Object { return &CanPurchasePremiumRequest{} }, - AssignAppStoreTransactionRequestTypeID: func() bin.Object { return &AssignAppStoreTransactionRequest{} }, - AssignGooglePlayTransactionRequestTypeID: func() bin.Object { return &AssignGooglePlayTransactionRequest{} }, - AcceptTermsOfServiceRequestTypeID: func() bin.Object { return &AcceptTermsOfServiceRequest{} }, - SearchStringsByPrefixRequestTypeID: func() bin.Object { return &SearchStringsByPrefixRequest{} }, - SendCustomRequestRequestTypeID: func() bin.Object { return &SendCustomRequestRequest{} }, - AnswerCustomQueryRequestTypeID: func() bin.Object { return &AnswerCustomQueryRequest{} }, - SetAlarmRequestTypeID: func() bin.Object { return &SetAlarmRequest{} }, - GetCountriesRequestTypeID: func() bin.Object { return &GetCountriesRequest{} }, - GetCountryCodeRequestTypeID: func() bin.Object { return &GetCountryCodeRequest{} }, - GetPhoneNumberInfoRequestTypeID: func() bin.Object { return &GetPhoneNumberInfoRequest{} }, - 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{} }, - EditProxyRequestTypeID: func() bin.Object { return &EditProxyRequest{} }, - EnableProxyRequestTypeID: func() bin.Object { return &EnableProxyRequest{} }, - DisableProxyRequestTypeID: func() bin.Object { return &DisableProxyRequest{} }, - RemoveProxyRequestTypeID: func() bin.Object { return &RemoveProxyRequest{} }, - GetProxiesRequestTypeID: func() bin.Object { return &GetProxiesRequest{} }, - GetProxyLinkRequestTypeID: func() bin.Object { return &GetProxyLinkRequest{} }, - PingProxyRequestTypeID: func() bin.Object { return &PingProxyRequest{} }, - SetLogStreamRequestTypeID: func() bin.Object { return &SetLogStreamRequest{} }, - GetLogStreamRequestTypeID: func() bin.Object { return &GetLogStreamRequest{} }, - SetLogVerbosityLevelRequestTypeID: func() bin.Object { return &SetLogVerbosityLevelRequest{} }, - GetLogVerbosityLevelRequestTypeID: func() bin.Object { return &GetLogVerbosityLevelRequest{} }, - GetLogTagsRequestTypeID: func() bin.Object { return &GetLogTagsRequest{} }, - SetLogTagVerbosityLevelRequestTypeID: func() bin.Object { return &SetLogTagVerbosityLevelRequest{} }, - GetLogTagVerbosityLevelRequestTypeID: func() bin.Object { return &GetLogTagVerbosityLevelRequest{} }, - AddLogMessageRequestTypeID: func() bin.Object { return &AddLogMessageRequest{} }, - GetUserSupportInfoRequestTypeID: func() bin.Object { return &GetUserSupportInfoRequest{} }, - SetUserSupportInfoRequestTypeID: func() bin.Object { return &SetUserSupportInfoRequest{} }, - GetSupportNameRequestTypeID: func() bin.Object { return &GetSupportNameRequest{} }, - TestCallEmptyRequestTypeID: func() bin.Object { return &TestCallEmptyRequest{} }, - TestCallStringRequestTypeID: func() bin.Object { return &TestCallStringRequest{} }, - TestCallBytesRequestTypeID: func() bin.Object { return &TestCallBytesRequest{} }, - TestCallVectorIntRequestTypeID: func() bin.Object { return &TestCallVectorIntRequest{} }, - TestCallVectorIntObjectRequestTypeID: func() bin.Object { return &TestCallVectorIntObjectRequest{} }, - TestCallVectorStringRequestTypeID: func() bin.Object { return &TestCallVectorStringRequest{} }, - TestCallVectorStringObjectRequestTypeID: func() bin.Object { return &TestCallVectorStringObjectRequest{} }, - TestSquareIntRequestTypeID: func() bin.Object { return &TestSquareIntRequest{} }, - TestNetworkRequestTypeID: func() bin.Object { return &TestNetworkRequest{} }, - TestProxyRequestTypeID: func() bin.Object { return &TestProxyRequest{} }, - TestGetDifferenceRequestTypeID: func() bin.Object { return &TestGetDifferenceRequest{} }, - TestUseUpdateRequestTypeID: func() bin.Object { return &TestUseUpdateRequest{} }, - TestReturnErrorRequestTypeID: func() bin.Object { return &TestReturnErrorRequest{} }, + CountTypeID: func() bin.Object { return &Count{} }, + TextTypeID: func() bin.Object { return &Text{} }, + SecondsTypeID: func() bin.Object { return &Seconds{} }, + FileDownloadedPrefixSizeTypeID: func() bin.Object { return &FileDownloadedPrefixSize{} }, + DeepLinkInfoTypeID: func() bin.Object { return &DeepLinkInfo{} }, + TextParseModeMarkdownTypeID: func() bin.Object { return &TextParseModeMarkdown{} }, + TextParseModeHTMLTypeID: func() bin.Object { return &TextParseModeHTML{} }, + ProxyTypeSocks5TypeID: func() bin.Object { return &ProxyTypeSocks5{} }, + ProxyTypeHTTPTypeID: func() bin.Object { return &ProxyTypeHTTP{} }, + ProxyTypeMtprotoTypeID: func() bin.Object { return &ProxyTypeMtproto{} }, + ProxyTypeID: func() bin.Object { return &Proxy{} }, + ProxiesTypeID: func() bin.Object { return &Proxies{} }, + InputStickerTypeID: func() bin.Object { return &InputSticker{} }, + DateRangeTypeID: func() bin.Object { return &DateRange{} }, + StatisticalValueTypeID: func() bin.Object { return &StatisticalValue{} }, + StatisticalGraphDataTypeID: func() bin.Object { return &StatisticalGraphData{} }, + StatisticalGraphAsyncTypeID: func() bin.Object { return &StatisticalGraphAsync{} }, + StatisticalGraphErrorTypeID: func() bin.Object { return &StatisticalGraphError{} }, + ChatStatisticsMessageInteractionInfoTypeID: func() bin.Object { return &ChatStatisticsMessageInteractionInfo{} }, + ChatStatisticsMessageSenderInfoTypeID: func() bin.Object { return &ChatStatisticsMessageSenderInfo{} }, + ChatStatisticsAdministratorActionsInfoTypeID: func() bin.Object { return &ChatStatisticsAdministratorActionsInfo{} }, + ChatStatisticsInviterInfoTypeID: func() bin.Object { return &ChatStatisticsInviterInfo{} }, + ChatStatisticsSupergroupTypeID: func() bin.Object { return &ChatStatisticsSupergroup{} }, + ChatStatisticsChannelTypeID: func() bin.Object { return &ChatStatisticsChannel{} }, + MessageStatisticsTypeID: func() bin.Object { return &MessageStatistics{} }, + PointTypeID: func() bin.Object { return &Point{} }, + VectorPathCommandLineTypeID: func() bin.Object { return &VectorPathCommandLine{} }, + VectorPathCommandCubicBezierCurveTypeID: func() bin.Object { return &VectorPathCommandCubicBezierCurve{} }, + BotCommandScopeDefaultTypeID: func() bin.Object { return &BotCommandScopeDefault{} }, + BotCommandScopeAllPrivateChatsTypeID: func() bin.Object { return &BotCommandScopeAllPrivateChats{} }, + BotCommandScopeAllGroupChatsTypeID: func() bin.Object { return &BotCommandScopeAllGroupChats{} }, + BotCommandScopeAllChatAdministratorsTypeID: func() bin.Object { return &BotCommandScopeAllChatAdministrators{} }, + BotCommandScopeChatTypeID: func() bin.Object { return &BotCommandScopeChat{} }, + BotCommandScopeChatAdministratorsTypeID: func() bin.Object { return &BotCommandScopeChatAdministrators{} }, + BotCommandScopeChatMemberTypeID: func() bin.Object { return &BotCommandScopeChatMember{} }, + UpdateAuthorizationStateTypeID: func() bin.Object { return &UpdateAuthorizationState{} }, + UpdateNewMessageTypeID: func() bin.Object { return &UpdateNewMessage{} }, + UpdateMessageSendAcknowledgedTypeID: func() bin.Object { return &UpdateMessageSendAcknowledged{} }, + UpdateMessageSendSucceededTypeID: func() bin.Object { return &UpdateMessageSendSucceeded{} }, + UpdateMessageSendFailedTypeID: func() bin.Object { return &UpdateMessageSendFailed{} }, + UpdateMessageContentTypeID: func() bin.Object { return &UpdateMessageContent{} }, + UpdateMessageEditedTypeID: func() bin.Object { return &UpdateMessageEdited{} }, + UpdateMessageIsPinnedTypeID: func() bin.Object { return &UpdateMessageIsPinned{} }, + UpdateMessageInteractionInfoTypeID: func() bin.Object { return &UpdateMessageInteractionInfo{} }, + UpdateMessageContentOpenedTypeID: func() bin.Object { return &UpdateMessageContentOpened{} }, + UpdateMessageMentionReadTypeID: func() bin.Object { return &UpdateMessageMentionRead{} }, + UpdateMessageUnreadReactionsTypeID: func() bin.Object { return &UpdateMessageUnreadReactions{} }, + UpdateMessageLiveLocationViewedTypeID: func() bin.Object { return &UpdateMessageLiveLocationViewed{} }, + 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{} }, + UpdateChatPermissionsTypeID: func() bin.Object { return &UpdateChatPermissions{} }, + UpdateChatLastMessageTypeID: func() bin.Object { return &UpdateChatLastMessage{} }, + UpdateChatPositionTypeID: func() bin.Object { return &UpdateChatPosition{} }, + UpdateChatReadInboxTypeID: func() bin.Object { return &UpdateChatReadInbox{} }, + UpdateChatReadOutboxTypeID: func() bin.Object { return &UpdateChatReadOutbox{} }, + UpdateChatActionBarTypeID: func() bin.Object { return &UpdateChatActionBar{} }, + UpdateChatAvailableReactionsTypeID: func() bin.Object { return &UpdateChatAvailableReactions{} }, + UpdateChatDraftMessageTypeID: func() bin.Object { return &UpdateChatDraftMessage{} }, + UpdateChatMessageSenderTypeID: func() bin.Object { return &UpdateChatMessageSender{} }, + UpdateChatMessageAutoDeleteTimeTypeID: func() bin.Object { return &UpdateChatMessageAutoDeleteTime{} }, + UpdateChatNotificationSettingsTypeID: func() bin.Object { return &UpdateChatNotificationSettings{} }, + UpdateChatPendingJoinRequestsTypeID: func() bin.Object { return &UpdateChatPendingJoinRequests{} }, + UpdateChatReplyMarkupTypeID: func() bin.Object { return &UpdateChatReplyMarkup{} }, + UpdateChatBackgroundTypeID: func() bin.Object { return &UpdateChatBackground{} }, + UpdateChatThemeTypeID: func() bin.Object { return &UpdateChatTheme{} }, + UpdateChatUnreadMentionCountTypeID: func() bin.Object { return &UpdateChatUnreadMentionCount{} }, + UpdateChatUnreadReactionCountTypeID: func() bin.Object { return &UpdateChatUnreadReactionCount{} }, + UpdateChatVideoChatTypeID: func() bin.Object { return &UpdateChatVideoChat{} }, + UpdateChatDefaultDisableNotificationTypeID: func() bin.Object { return &UpdateChatDefaultDisableNotification{} }, + UpdateChatHasProtectedContentTypeID: func() bin.Object { return &UpdateChatHasProtectedContent{} }, + UpdateChatIsTranslatableTypeID: func() bin.Object { return &UpdateChatIsTranslatable{} }, + UpdateChatIsMarkedAsUnreadTypeID: func() bin.Object { return &UpdateChatIsMarkedAsUnread{} }, + UpdateChatBlockListTypeID: func() bin.Object { return &UpdateChatBlockList{} }, + UpdateChatHasScheduledMessagesTypeID: func() bin.Object { return &UpdateChatHasScheduledMessages{} }, + UpdateChatFoldersTypeID: func() bin.Object { return &UpdateChatFolders{} }, + UpdateChatOnlineMemberCountTypeID: func() bin.Object { return &UpdateChatOnlineMemberCount{} }, + UpdateForumTopicInfoTypeID: func() bin.Object { return &UpdateForumTopicInfo{} }, + UpdateScopeNotificationSettingsTypeID: func() bin.Object { return &UpdateScopeNotificationSettings{} }, + UpdateNotificationTypeID: func() bin.Object { return &UpdateNotification{} }, + UpdateNotificationGroupTypeID: func() bin.Object { return &UpdateNotificationGroup{} }, + UpdateActiveNotificationsTypeID: func() bin.Object { return &UpdateActiveNotifications{} }, + UpdateHavePendingNotificationsTypeID: func() bin.Object { return &UpdateHavePendingNotifications{} }, + UpdateDeleteMessagesTypeID: func() bin.Object { return &UpdateDeleteMessages{} }, + UpdateChatActionTypeID: func() bin.Object { return &UpdateChatAction{} }, + UpdateUserStatusTypeID: func() bin.Object { return &UpdateUserStatus{} }, + UpdateUserTypeID: func() bin.Object { return &UpdateUser{} }, + UpdateBasicGroupTypeID: func() bin.Object { return &UpdateBasicGroup{} }, + UpdateSupergroupTypeID: func() bin.Object { return &UpdateSupergroup{} }, + UpdateSecretChatTypeID: func() bin.Object { return &UpdateSecretChat{} }, + UpdateUserFullInfoTypeID: func() bin.Object { return &UpdateUserFullInfo{} }, + UpdateBasicGroupFullInfoTypeID: func() bin.Object { return &UpdateBasicGroupFullInfo{} }, + UpdateSupergroupFullInfoTypeID: func() bin.Object { return &UpdateSupergroupFullInfo{} }, + UpdateServiceNotificationTypeID: func() bin.Object { return &UpdateServiceNotification{} }, + UpdateFileTypeID: func() bin.Object { return &UpdateFile{} }, + UpdateFileGenerationStartTypeID: func() bin.Object { return &UpdateFileGenerationStart{} }, + UpdateFileGenerationStopTypeID: func() bin.Object { return &UpdateFileGenerationStop{} }, + UpdateFileDownloadsTypeID: func() bin.Object { return &UpdateFileDownloads{} }, + UpdateFileAddedToDownloadsTypeID: func() bin.Object { return &UpdateFileAddedToDownloads{} }, + UpdateFileDownloadTypeID: func() bin.Object { return &UpdateFileDownload{} }, + UpdateFileRemovedFromDownloadsTypeID: func() bin.Object { return &UpdateFileRemovedFromDownloads{} }, + UpdateCallTypeID: func() bin.Object { return &UpdateCall{} }, + UpdateGroupCallTypeID: func() bin.Object { return &UpdateGroupCall{} }, + UpdateGroupCallParticipantTypeID: func() bin.Object { return &UpdateGroupCallParticipant{} }, + UpdateNewCallSignalingDataTypeID: func() bin.Object { return &UpdateNewCallSignalingData{} }, + UpdateUserPrivacySettingRulesTypeID: func() bin.Object { return &UpdateUserPrivacySettingRules{} }, + UpdateUnreadMessageCountTypeID: func() bin.Object { return &UpdateUnreadMessageCount{} }, + UpdateUnreadChatCountTypeID: func() bin.Object { return &UpdateUnreadChatCount{} }, + UpdateStoryTypeID: func() bin.Object { return &UpdateStory{} }, + UpdateStoryDeletedTypeID: func() bin.Object { return &UpdateStoryDeleted{} }, + UpdateStorySendSucceededTypeID: func() bin.Object { return &UpdateStorySendSucceeded{} }, + UpdateStorySendFailedTypeID: func() bin.Object { return &UpdateStorySendFailed{} }, + UpdateChatActiveStoriesTypeID: func() bin.Object { return &UpdateChatActiveStories{} }, + UpdateStoryListChatCountTypeID: func() bin.Object { return &UpdateStoryListChatCount{} }, + UpdateStoryStealthModeTypeID: func() bin.Object { return &UpdateStoryStealthMode{} }, + UpdateOptionTypeID: func() bin.Object { return &UpdateOption{} }, + UpdateStickerSetTypeID: func() bin.Object { return &UpdateStickerSet{} }, + UpdateInstalledStickerSetsTypeID: func() bin.Object { return &UpdateInstalledStickerSets{} }, + UpdateTrendingStickerSetsTypeID: func() bin.Object { return &UpdateTrendingStickerSets{} }, + UpdateRecentStickersTypeID: func() bin.Object { return &UpdateRecentStickers{} }, + UpdateFavoriteStickersTypeID: func() bin.Object { return &UpdateFavoriteStickers{} }, + UpdateSavedAnimationsTypeID: func() bin.Object { return &UpdateSavedAnimations{} }, + UpdateSavedNotificationSoundsTypeID: func() bin.Object { return &UpdateSavedNotificationSounds{} }, + UpdateSelectedBackgroundTypeID: func() bin.Object { return &UpdateSelectedBackground{} }, + UpdateChatThemesTypeID: func() bin.Object { return &UpdateChatThemes{} }, + UpdateAccentColorsTypeID: func() bin.Object { return &UpdateAccentColors{} }, + UpdateLanguagePackStringsTypeID: func() bin.Object { return &UpdateLanguagePackStrings{} }, + UpdateConnectionStateTypeID: func() bin.Object { return &UpdateConnectionState{} }, + UpdateTermsOfServiceTypeID: func() bin.Object { return &UpdateTermsOfService{} }, + UpdateUsersNearbyTypeID: func() bin.Object { return &UpdateUsersNearby{} }, + UpdateUnconfirmedSessionTypeID: func() bin.Object { return &UpdateUnconfirmedSession{} }, + UpdateAttachmentMenuBotsTypeID: func() bin.Object { return &UpdateAttachmentMenuBots{} }, + UpdateWebAppMessageSentTypeID: func() bin.Object { return &UpdateWebAppMessageSent{} }, + UpdateActiveEmojiReactionsTypeID: func() bin.Object { return &UpdateActiveEmojiReactions{} }, + UpdateDefaultReactionTypeTypeID: func() bin.Object { return &UpdateDefaultReactionType{} }, + UpdateDiceEmojisTypeID: func() bin.Object { return &UpdateDiceEmojis{} }, + UpdateAnimatedEmojiMessageClickedTypeID: func() bin.Object { return &UpdateAnimatedEmojiMessageClicked{} }, + UpdateAnimationSearchParametersTypeID: func() bin.Object { return &UpdateAnimationSearchParameters{} }, + UpdateSuggestedActionsTypeID: func() bin.Object { return &UpdateSuggestedActions{} }, + UpdateAddChatMembersPrivacyForbiddenTypeID: func() bin.Object { return &UpdateAddChatMembersPrivacyForbidden{} }, + UpdateAutosaveSettingsTypeID: func() bin.Object { return &UpdateAutosaveSettings{} }, + UpdateNewInlineQueryTypeID: func() bin.Object { return &UpdateNewInlineQuery{} }, + UpdateNewChosenInlineResultTypeID: func() bin.Object { return &UpdateNewChosenInlineResult{} }, + UpdateNewCallbackQueryTypeID: func() bin.Object { return &UpdateNewCallbackQuery{} }, + UpdateNewInlineCallbackQueryTypeID: func() bin.Object { return &UpdateNewInlineCallbackQuery{} }, + UpdateNewShippingQueryTypeID: func() bin.Object { return &UpdateNewShippingQuery{} }, + UpdateNewPreCheckoutQueryTypeID: func() bin.Object { return &UpdateNewPreCheckoutQuery{} }, + UpdateNewCustomEventTypeID: func() bin.Object { return &UpdateNewCustomEvent{} }, + UpdateNewCustomQueryTypeID: func() bin.Object { return &UpdateNewCustomQuery{} }, + UpdatePollTypeID: func() bin.Object { return &UpdatePoll{} }, + UpdatePollAnswerTypeID: func() bin.Object { return &UpdatePollAnswer{} }, + UpdateChatMemberTypeID: func() bin.Object { return &UpdateChatMember{} }, + UpdateNewChatJoinRequestTypeID: func() bin.Object { return &UpdateNewChatJoinRequest{} }, + UpdateChatBoostTypeID: func() bin.Object { return &UpdateChatBoost{} }, + UpdatesTypeID: func() bin.Object { return &Updates{} }, + LogStreamDefaultTypeID: func() bin.Object { return &LogStreamDefault{} }, + LogStreamFileTypeID: func() bin.Object { return &LogStreamFile{} }, + LogStreamEmptyTypeID: func() bin.Object { return &LogStreamEmpty{} }, + LogVerbosityLevelTypeID: func() bin.Object { return &LogVerbosityLevel{} }, + LogTagsTypeID: func() bin.Object { return &LogTags{} }, + UserSupportInfoTypeID: func() bin.Object { return &UserSupportInfo{} }, + TestIntTypeID: func() bin.Object { return &TestInt{} }, + TestStringTypeID: func() bin.Object { return &TestString{} }, + TestBytesTypeID: func() bin.Object { return &TestBytes{} }, + TestVectorIntTypeID: func() bin.Object { return &TestVectorInt{} }, + TestVectorIntObjectTypeID: func() bin.Object { return &TestVectorIntObject{} }, + TestVectorStringTypeID: func() bin.Object { return &TestVectorString{} }, + TestVectorStringObjectTypeID: func() bin.Object { return &TestVectorStringObject{} }, + GetAuthorizationStateRequestTypeID: func() bin.Object { return &GetAuthorizationStateRequest{} }, + SetTdlibParametersRequestTypeID: func() bin.Object { return &SetTdlibParametersRequest{} }, + SetAuthenticationPhoneNumberRequestTypeID: func() bin.Object { return &SetAuthenticationPhoneNumberRequest{} }, + SetAuthenticationEmailAddressRequestTypeID: func() bin.Object { return &SetAuthenticationEmailAddressRequest{} }, + ResendAuthenticationCodeRequestTypeID: func() bin.Object { return &ResendAuthenticationCodeRequest{} }, + CheckAuthenticationEmailCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationEmailCodeRequest{} }, + CheckAuthenticationCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationCodeRequest{} }, + RequestQrCodeAuthenticationRequestTypeID: func() bin.Object { return &RequestQrCodeAuthenticationRequest{} }, + RegisterUserRequestTypeID: func() bin.Object { return &RegisterUserRequest{} }, + ResetAuthenticationEmailAddressRequestTypeID: func() bin.Object { return &ResetAuthenticationEmailAddressRequest{} }, + CheckAuthenticationPasswordRequestTypeID: func() bin.Object { return &CheckAuthenticationPasswordRequest{} }, + RequestAuthenticationPasswordRecoveryRequestTypeID: func() bin.Object { return &RequestAuthenticationPasswordRecoveryRequest{} }, + CheckAuthenticationPasswordRecoveryCodeRequestTypeID: func() bin.Object { return &CheckAuthenticationPasswordRecoveryCodeRequest{} }, + RecoverAuthenticationPasswordRequestTypeID: func() bin.Object { return &RecoverAuthenticationPasswordRequest{} }, + SendAuthenticationFirebaseSMSRequestTypeID: func() bin.Object { return &SendAuthenticationFirebaseSMSRequest{} }, + CheckAuthenticationBotTokenRequestTypeID: func() bin.Object { return &CheckAuthenticationBotTokenRequest{} }, + LogOutRequestTypeID: func() bin.Object { return &LogOutRequest{} }, + CloseRequestTypeID: func() bin.Object { return &CloseRequest{} }, + DestroyRequestTypeID: func() bin.Object { return &DestroyRequest{} }, + ConfirmQrCodeAuthenticationRequestTypeID: func() bin.Object { return &ConfirmQrCodeAuthenticationRequest{} }, + GetCurrentStateRequestTypeID: func() bin.Object { return &GetCurrentStateRequest{} }, + SetDatabaseEncryptionKeyRequestTypeID: func() bin.Object { return &SetDatabaseEncryptionKeyRequest{} }, + GetPasswordStateRequestTypeID: func() bin.Object { return &GetPasswordStateRequest{} }, + SetPasswordRequestTypeID: func() bin.Object { return &SetPasswordRequest{} }, + SetLoginEmailAddressRequestTypeID: func() bin.Object { return &SetLoginEmailAddressRequest{} }, + ResendLoginEmailAddressCodeRequestTypeID: func() bin.Object { return &ResendLoginEmailAddressCodeRequest{} }, + CheckLoginEmailAddressCodeRequestTypeID: func() bin.Object { return &CheckLoginEmailAddressCodeRequest{} }, + GetRecoveryEmailAddressRequestTypeID: func() bin.Object { return &GetRecoveryEmailAddressRequest{} }, + SetRecoveryEmailAddressRequestTypeID: func() bin.Object { return &SetRecoveryEmailAddressRequest{} }, + CheckRecoveryEmailAddressCodeRequestTypeID: func() bin.Object { return &CheckRecoveryEmailAddressCodeRequest{} }, + ResendRecoveryEmailAddressCodeRequestTypeID: func() bin.Object { return &ResendRecoveryEmailAddressCodeRequest{} }, + RequestPasswordRecoveryRequestTypeID: func() bin.Object { return &RequestPasswordRecoveryRequest{} }, + CheckPasswordRecoveryCodeRequestTypeID: func() bin.Object { return &CheckPasswordRecoveryCodeRequest{} }, + RecoverPasswordRequestTypeID: func() bin.Object { return &RecoverPasswordRequest{} }, + ResetPasswordRequestTypeID: func() bin.Object { return &ResetPasswordRequest{} }, + CancelPasswordResetRequestTypeID: func() bin.Object { return &CancelPasswordResetRequest{} }, + CreateTemporaryPasswordRequestTypeID: func() bin.Object { return &CreateTemporaryPasswordRequest{} }, + GetTemporaryPasswordStateRequestTypeID: func() bin.Object { return &GetTemporaryPasswordStateRequest{} }, + GetMeRequestTypeID: func() bin.Object { return &GetMeRequest{} }, + GetUserRequestTypeID: func() bin.Object { return &GetUserRequest{} }, + GetUserFullInfoRequestTypeID: func() bin.Object { return &GetUserFullInfoRequest{} }, + GetBasicGroupRequestTypeID: func() bin.Object { return &GetBasicGroupRequest{} }, + GetBasicGroupFullInfoRequestTypeID: func() bin.Object { return &GetBasicGroupFullInfoRequest{} }, + GetSupergroupRequestTypeID: func() bin.Object { return &GetSupergroupRequest{} }, + GetSupergroupFullInfoRequestTypeID: func() bin.Object { return &GetSupergroupFullInfoRequest{} }, + GetSecretChatRequestTypeID: func() bin.Object { return &GetSecretChatRequest{} }, + GetChatRequestTypeID: func() bin.Object { return &GetChatRequest{} }, + GetMessageRequestTypeID: func() bin.Object { return &GetMessageRequest{} }, + GetMessageLocallyRequestTypeID: func() bin.Object { return &GetMessageLocallyRequest{} }, + GetRepliedMessageRequestTypeID: func() bin.Object { return &GetRepliedMessageRequest{} }, + GetChatPinnedMessageRequestTypeID: func() bin.Object { return &GetChatPinnedMessageRequest{} }, + GetCallbackQueryMessageRequestTypeID: func() bin.Object { return &GetCallbackQueryMessageRequest{} }, + GetMessagesRequestTypeID: func() bin.Object { return &GetMessagesRequest{} }, + GetMessageThreadRequestTypeID: func() bin.Object { return &GetMessageThreadRequest{} }, + GetMessageViewersRequestTypeID: func() bin.Object { return &GetMessageViewersRequest{} }, + GetFileRequestTypeID: func() bin.Object { return &GetFileRequest{} }, + GetRemoteFileRequestTypeID: func() bin.Object { return &GetRemoteFileRequest{} }, + LoadChatsRequestTypeID: func() bin.Object { return &LoadChatsRequest{} }, + GetChatsRequestTypeID: func() bin.Object { return &GetChatsRequest{} }, + SearchPublicChatRequestTypeID: func() bin.Object { return &SearchPublicChatRequest{} }, + SearchPublicChatsRequestTypeID: func() bin.Object { return &SearchPublicChatsRequest{} }, + SearchChatsRequestTypeID: func() bin.Object { return &SearchChatsRequest{} }, + SearchChatsOnServerRequestTypeID: func() bin.Object { return &SearchChatsOnServerRequest{} }, + SearchChatsNearbyRequestTypeID: func() bin.Object { return &SearchChatsNearbyRequest{} }, + GetTopChatsRequestTypeID: func() bin.Object { return &GetTopChatsRequest{} }, + RemoveTopChatRequestTypeID: func() bin.Object { return &RemoveTopChatRequest{} }, + SearchRecentlyFoundChatsRequestTypeID: func() bin.Object { return &SearchRecentlyFoundChatsRequest{} }, + AddRecentlyFoundChatRequestTypeID: func() bin.Object { return &AddRecentlyFoundChatRequest{} }, + RemoveRecentlyFoundChatRequestTypeID: func() bin.Object { return &RemoveRecentlyFoundChatRequest{} }, + ClearRecentlyFoundChatsRequestTypeID: func() bin.Object { return &ClearRecentlyFoundChatsRequest{} }, + GetRecentlyOpenedChatsRequestTypeID: func() bin.Object { return &GetRecentlyOpenedChatsRequest{} }, + CheckChatUsernameRequestTypeID: func() bin.Object { return &CheckChatUsernameRequest{} }, + GetCreatedPublicChatsRequestTypeID: func() bin.Object { return &GetCreatedPublicChatsRequest{} }, + CheckCreatedPublicChatsLimitRequestTypeID: func() bin.Object { return &CheckCreatedPublicChatsLimitRequest{} }, + GetSuitableDiscussionChatsRequestTypeID: func() bin.Object { return &GetSuitableDiscussionChatsRequest{} }, + GetInactiveSupergroupChatsRequestTypeID: func() bin.Object { return &GetInactiveSupergroupChatsRequest{} }, + GetGroupsInCommonRequestTypeID: func() bin.Object { return &GetGroupsInCommonRequest{} }, + GetChatHistoryRequestTypeID: func() bin.Object { return &GetChatHistoryRequest{} }, + GetMessageThreadHistoryRequestTypeID: func() bin.Object { return &GetMessageThreadHistoryRequest{} }, + DeleteChatHistoryRequestTypeID: func() bin.Object { return &DeleteChatHistoryRequest{} }, + DeleteChatRequestTypeID: func() bin.Object { return &DeleteChatRequest{} }, + SearchChatMessagesRequestTypeID: func() bin.Object { return &SearchChatMessagesRequest{} }, + SearchMessagesRequestTypeID: func() bin.Object { return &SearchMessagesRequest{} }, + SearchSecretMessagesRequestTypeID: func() bin.Object { return &SearchSecretMessagesRequest{} }, + SearchCallMessagesRequestTypeID: func() bin.Object { return &SearchCallMessagesRequest{} }, + SearchOutgoingDocumentMessagesRequestTypeID: func() bin.Object { return &SearchOutgoingDocumentMessagesRequest{} }, + DeleteAllCallMessagesRequestTypeID: func() bin.Object { return &DeleteAllCallMessagesRequest{} }, + SearchChatRecentLocationMessagesRequestTypeID: func() bin.Object { return &SearchChatRecentLocationMessagesRequest{} }, + GetActiveLiveLocationMessagesRequestTypeID: func() bin.Object { return &GetActiveLiveLocationMessagesRequest{} }, + GetChatMessageByDateRequestTypeID: func() bin.Object { return &GetChatMessageByDateRequest{} }, + GetChatSparseMessagePositionsRequestTypeID: func() bin.Object { return &GetChatSparseMessagePositionsRequest{} }, + GetChatMessageCalendarRequestTypeID: func() bin.Object { return &GetChatMessageCalendarRequest{} }, + GetChatMessageCountRequestTypeID: func() bin.Object { return &GetChatMessageCountRequest{} }, + GetChatMessagePositionRequestTypeID: func() bin.Object { return &GetChatMessagePositionRequest{} }, + GetChatScheduledMessagesRequestTypeID: func() bin.Object { return &GetChatScheduledMessagesRequest{} }, + GetChatSponsoredMessagesRequestTypeID: func() bin.Object { return &GetChatSponsoredMessagesRequest{} }, + ClickChatSponsoredMessageRequestTypeID: func() bin.Object { return &ClickChatSponsoredMessageRequest{} }, + RemoveNotificationRequestTypeID: func() bin.Object { return &RemoveNotificationRequest{} }, + RemoveNotificationGroupRequestTypeID: func() bin.Object { return &RemoveNotificationGroupRequest{} }, + GetMessageLinkRequestTypeID: func() bin.Object { return &GetMessageLinkRequest{} }, + GetMessageEmbeddingCodeRequestTypeID: func() bin.Object { return &GetMessageEmbeddingCodeRequest{} }, + GetMessageLinkInfoRequestTypeID: func() bin.Object { return &GetMessageLinkInfoRequest{} }, + TranslateTextRequestTypeID: func() bin.Object { return &TranslateTextRequest{} }, + TranslateMessageTextRequestTypeID: func() bin.Object { return &TranslateMessageTextRequest{} }, + RecognizeSpeechRequestTypeID: func() bin.Object { return &RecognizeSpeechRequest{} }, + RateSpeechRecognitionRequestTypeID: func() bin.Object { return &RateSpeechRecognitionRequest{} }, + GetChatAvailableMessageSendersRequestTypeID: func() bin.Object { return &GetChatAvailableMessageSendersRequest{} }, + SetChatMessageSenderRequestTypeID: func() bin.Object { return &SetChatMessageSenderRequest{} }, + SendMessageRequestTypeID: func() bin.Object { return &SendMessageRequest{} }, + SendMessageAlbumRequestTypeID: func() bin.Object { return &SendMessageAlbumRequest{} }, + SendBotStartMessageRequestTypeID: func() bin.Object { return &SendBotStartMessageRequest{} }, + SendInlineQueryResultMessageRequestTypeID: func() bin.Object { return &SendInlineQueryResultMessageRequest{} }, + ForwardMessagesRequestTypeID: func() bin.Object { return &ForwardMessagesRequest{} }, + ResendMessagesRequestTypeID: func() bin.Object { return &ResendMessagesRequest{} }, + AddLocalMessageRequestTypeID: func() bin.Object { return &AddLocalMessageRequest{} }, + DeleteMessagesRequestTypeID: func() bin.Object { return &DeleteMessagesRequest{} }, + DeleteChatMessagesBySenderRequestTypeID: func() bin.Object { return &DeleteChatMessagesBySenderRequest{} }, + DeleteChatMessagesByDateRequestTypeID: func() bin.Object { return &DeleteChatMessagesByDateRequest{} }, + EditMessageTextRequestTypeID: func() bin.Object { return &EditMessageTextRequest{} }, + EditMessageLiveLocationRequestTypeID: func() bin.Object { return &EditMessageLiveLocationRequest{} }, + EditMessageMediaRequestTypeID: func() bin.Object { return &EditMessageMediaRequest{} }, + EditMessageCaptionRequestTypeID: func() bin.Object { return &EditMessageCaptionRequest{} }, + EditMessageReplyMarkupRequestTypeID: func() bin.Object { return &EditMessageReplyMarkupRequest{} }, + EditInlineMessageTextRequestTypeID: func() bin.Object { return &EditInlineMessageTextRequest{} }, + EditInlineMessageLiveLocationRequestTypeID: func() bin.Object { return &EditInlineMessageLiveLocationRequest{} }, + EditInlineMessageMediaRequestTypeID: func() bin.Object { return &EditInlineMessageMediaRequest{} }, + EditInlineMessageCaptionRequestTypeID: func() bin.Object { return &EditInlineMessageCaptionRequest{} }, + EditInlineMessageReplyMarkupRequestTypeID: func() bin.Object { return &EditInlineMessageReplyMarkupRequest{} }, + EditMessageSchedulingStateRequestTypeID: func() bin.Object { return &EditMessageSchedulingStateRequest{} }, + GetForumTopicDefaultIconsRequestTypeID: func() bin.Object { return &GetForumTopicDefaultIconsRequest{} }, + CreateForumTopicRequestTypeID: func() bin.Object { return &CreateForumTopicRequest{} }, + EditForumTopicRequestTypeID: func() bin.Object { return &EditForumTopicRequest{} }, + GetForumTopicRequestTypeID: func() bin.Object { return &GetForumTopicRequest{} }, + GetForumTopicLinkRequestTypeID: func() bin.Object { return &GetForumTopicLinkRequest{} }, + GetForumTopicsRequestTypeID: func() bin.Object { return &GetForumTopicsRequest{} }, + SetForumTopicNotificationSettingsRequestTypeID: func() bin.Object { return &SetForumTopicNotificationSettingsRequest{} }, + ToggleForumTopicIsClosedRequestTypeID: func() bin.Object { return &ToggleForumTopicIsClosedRequest{} }, + ToggleGeneralForumTopicIsHiddenRequestTypeID: func() bin.Object { return &ToggleGeneralForumTopicIsHiddenRequest{} }, + ToggleForumTopicIsPinnedRequestTypeID: func() bin.Object { return &ToggleForumTopicIsPinnedRequest{} }, + SetPinnedForumTopicsRequestTypeID: func() bin.Object { return &SetPinnedForumTopicsRequest{} }, + DeleteForumTopicRequestTypeID: func() bin.Object { return &DeleteForumTopicRequest{} }, + GetEmojiReactionRequestTypeID: func() bin.Object { return &GetEmojiReactionRequest{} }, + GetCustomEmojiReactionAnimationsRequestTypeID: func() bin.Object { return &GetCustomEmojiReactionAnimationsRequest{} }, + GetMessageAvailableReactionsRequestTypeID: func() bin.Object { return &GetMessageAvailableReactionsRequest{} }, + ClearRecentReactionsRequestTypeID: func() bin.Object { return &ClearRecentReactionsRequest{} }, + AddMessageReactionRequestTypeID: func() bin.Object { return &AddMessageReactionRequest{} }, + RemoveMessageReactionRequestTypeID: func() bin.Object { return &RemoveMessageReactionRequest{} }, + GetMessageAddedReactionsRequestTypeID: func() bin.Object { return &GetMessageAddedReactionsRequest{} }, + SetDefaultReactionTypeRequestTypeID: func() bin.Object { return &SetDefaultReactionTypeRequest{} }, + SearchQuoteRequestTypeID: func() bin.Object { return &SearchQuoteRequest{} }, + GetTextEntitiesRequestTypeID: func() bin.Object { return &GetTextEntitiesRequest{} }, + ParseTextEntitiesRequestTypeID: func() bin.Object { return &ParseTextEntitiesRequest{} }, + ParseMarkdownRequestTypeID: func() bin.Object { return &ParseMarkdownRequest{} }, + GetMarkdownTextRequestTypeID: func() bin.Object { return &GetMarkdownTextRequest{} }, + GetFileMimeTypeRequestTypeID: func() bin.Object { return &GetFileMimeTypeRequest{} }, + GetFileExtensionRequestTypeID: func() bin.Object { return &GetFileExtensionRequest{} }, + CleanFileNameRequestTypeID: func() bin.Object { return &CleanFileNameRequest{} }, + GetLanguagePackStringRequestTypeID: func() bin.Object { return &GetLanguagePackStringRequest{} }, + GetJSONValueRequestTypeID: func() bin.Object { return &GetJSONValueRequest{} }, + GetJSONStringRequestTypeID: func() bin.Object { return &GetJSONStringRequest{} }, + GetThemeParametersJSONStringRequestTypeID: func() bin.Object { return &GetThemeParametersJSONStringRequest{} }, + SetPollAnswerRequestTypeID: func() bin.Object { return &SetPollAnswerRequest{} }, + GetPollVotersRequestTypeID: func() bin.Object { return &GetPollVotersRequest{} }, + StopPollRequestTypeID: func() bin.Object { return &StopPollRequest{} }, + HideSuggestedActionRequestTypeID: func() bin.Object { return &HideSuggestedActionRequest{} }, + GetLoginURLInfoRequestTypeID: func() bin.Object { return &GetLoginURLInfoRequest{} }, + GetLoginURLRequestTypeID: func() bin.Object { return &GetLoginURLRequest{} }, + ShareUserWithBotRequestTypeID: func() bin.Object { return &ShareUserWithBotRequest{} }, + ShareChatWithBotRequestTypeID: func() bin.Object { return &ShareChatWithBotRequest{} }, + GetInlineQueryResultsRequestTypeID: func() bin.Object { return &GetInlineQueryResultsRequest{} }, + AnswerInlineQueryRequestTypeID: func() bin.Object { return &AnswerInlineQueryRequest{} }, + SearchWebAppRequestTypeID: func() bin.Object { return &SearchWebAppRequest{} }, + GetWebAppLinkURLRequestTypeID: func() bin.Object { return &GetWebAppLinkURLRequest{} }, + GetWebAppURLRequestTypeID: func() bin.Object { return &GetWebAppURLRequest{} }, + SendWebAppDataRequestTypeID: func() bin.Object { return &SendWebAppDataRequest{} }, + OpenWebAppRequestTypeID: func() bin.Object { return &OpenWebAppRequest{} }, + CloseWebAppRequestTypeID: func() bin.Object { return &CloseWebAppRequest{} }, + AnswerWebAppQueryRequestTypeID: func() bin.Object { return &AnswerWebAppQueryRequest{} }, + GetCallbackQueryAnswerRequestTypeID: func() bin.Object { return &GetCallbackQueryAnswerRequest{} }, + AnswerCallbackQueryRequestTypeID: func() bin.Object { return &AnswerCallbackQueryRequest{} }, + AnswerShippingQueryRequestTypeID: func() bin.Object { return &AnswerShippingQueryRequest{} }, + AnswerPreCheckoutQueryRequestTypeID: func() bin.Object { return &AnswerPreCheckoutQueryRequest{} }, + SetGameScoreRequestTypeID: func() bin.Object { return &SetGameScoreRequest{} }, + SetInlineGameScoreRequestTypeID: func() bin.Object { return &SetInlineGameScoreRequest{} }, + GetGameHighScoresRequestTypeID: func() bin.Object { return &GetGameHighScoresRequest{} }, + GetInlineGameHighScoresRequestTypeID: func() bin.Object { return &GetInlineGameHighScoresRequest{} }, + DeleteChatReplyMarkupRequestTypeID: func() bin.Object { return &DeleteChatReplyMarkupRequest{} }, + SendChatActionRequestTypeID: func() bin.Object { return &SendChatActionRequest{} }, + OpenChatRequestTypeID: func() bin.Object { return &OpenChatRequest{} }, + CloseChatRequestTypeID: func() bin.Object { return &CloseChatRequest{} }, + ViewMessagesRequestTypeID: func() bin.Object { return &ViewMessagesRequest{} }, + OpenMessageContentRequestTypeID: func() bin.Object { return &OpenMessageContentRequest{} }, + ClickAnimatedEmojiMessageRequestTypeID: func() bin.Object { return &ClickAnimatedEmojiMessageRequest{} }, + GetInternalLinkRequestTypeID: func() bin.Object { return &GetInternalLinkRequest{} }, + GetInternalLinkTypeRequestTypeID: func() bin.Object { return &GetInternalLinkTypeRequest{} }, + GetExternalLinkInfoRequestTypeID: func() bin.Object { return &GetExternalLinkInfoRequest{} }, + GetExternalLinkRequestTypeID: func() bin.Object { return &GetExternalLinkRequest{} }, + ReadAllChatMentionsRequestTypeID: func() bin.Object { return &ReadAllChatMentionsRequest{} }, + ReadAllMessageThreadMentionsRequestTypeID: func() bin.Object { return &ReadAllMessageThreadMentionsRequest{} }, + ReadAllChatReactionsRequestTypeID: func() bin.Object { return &ReadAllChatReactionsRequest{} }, + ReadAllMessageThreadReactionsRequestTypeID: func() bin.Object { return &ReadAllMessageThreadReactionsRequest{} }, + CreatePrivateChatRequestTypeID: func() bin.Object { return &CreatePrivateChatRequest{} }, + CreateBasicGroupChatRequestTypeID: func() bin.Object { return &CreateBasicGroupChatRequest{} }, + CreateSupergroupChatRequestTypeID: func() bin.Object { return &CreateSupergroupChatRequest{} }, + CreateSecretChatRequestTypeID: func() bin.Object { return &CreateSecretChatRequest{} }, + CreateNewBasicGroupChatRequestTypeID: func() bin.Object { return &CreateNewBasicGroupChatRequest{} }, + CreateNewSupergroupChatRequestTypeID: func() bin.Object { return &CreateNewSupergroupChatRequest{} }, + CreateNewSecretChatRequestTypeID: func() bin.Object { return &CreateNewSecretChatRequest{} }, + UpgradeBasicGroupChatToSupergroupChatRequestTypeID: func() bin.Object { return &UpgradeBasicGroupChatToSupergroupChatRequest{} }, + GetChatListsToAddChatRequestTypeID: func() bin.Object { return &GetChatListsToAddChatRequest{} }, + AddChatToListRequestTypeID: func() bin.Object { return &AddChatToListRequest{} }, + GetChatFolderRequestTypeID: func() bin.Object { return &GetChatFolderRequest{} }, + CreateChatFolderRequestTypeID: func() bin.Object { return &CreateChatFolderRequest{} }, + EditChatFolderRequestTypeID: func() bin.Object { return &EditChatFolderRequest{} }, + DeleteChatFolderRequestTypeID: func() bin.Object { return &DeleteChatFolderRequest{} }, + GetChatFolderChatsToLeaveRequestTypeID: func() bin.Object { return &GetChatFolderChatsToLeaveRequest{} }, + GetChatFolderChatCountRequestTypeID: func() bin.Object { return &GetChatFolderChatCountRequest{} }, + ReorderChatFoldersRequestTypeID: func() bin.Object { return &ReorderChatFoldersRequest{} }, + GetRecommendedChatFoldersRequestTypeID: func() bin.Object { return &GetRecommendedChatFoldersRequest{} }, + GetChatFolderDefaultIconNameRequestTypeID: func() bin.Object { return &GetChatFolderDefaultIconNameRequest{} }, + GetChatsForChatFolderInviteLinkRequestTypeID: func() bin.Object { return &GetChatsForChatFolderInviteLinkRequest{} }, + CreateChatFolderInviteLinkRequestTypeID: func() bin.Object { return &CreateChatFolderInviteLinkRequest{} }, + GetChatFolderInviteLinksRequestTypeID: func() bin.Object { return &GetChatFolderInviteLinksRequest{} }, + EditChatFolderInviteLinkRequestTypeID: func() bin.Object { return &EditChatFolderInviteLinkRequest{} }, + DeleteChatFolderInviteLinkRequestTypeID: func() bin.Object { return &DeleteChatFolderInviteLinkRequest{} }, + CheckChatFolderInviteLinkRequestTypeID: func() bin.Object { return &CheckChatFolderInviteLinkRequest{} }, + AddChatFolderByInviteLinkRequestTypeID: func() bin.Object { return &AddChatFolderByInviteLinkRequest{} }, + GetChatFolderNewChatsRequestTypeID: func() bin.Object { return &GetChatFolderNewChatsRequest{} }, + ProcessChatFolderNewChatsRequestTypeID: func() bin.Object { return &ProcessChatFolderNewChatsRequest{} }, + GetArchiveChatListSettingsRequestTypeID: func() bin.Object { return &GetArchiveChatListSettingsRequest{} }, + SetArchiveChatListSettingsRequestTypeID: func() bin.Object { return &SetArchiveChatListSettingsRequest{} }, + SetChatTitleRequestTypeID: func() bin.Object { return &SetChatTitleRequest{} }, + SetChatPhotoRequestTypeID: func() bin.Object { return &SetChatPhotoRequest{} }, + SetChatAccentColorRequestTypeID: func() bin.Object { return &SetChatAccentColorRequest{} }, + SetChatMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &SetChatMessageAutoDeleteTimeRequest{} }, + SetChatPermissionsRequestTypeID: func() bin.Object { return &SetChatPermissionsRequest{} }, + SetChatBackgroundRequestTypeID: func() bin.Object { return &SetChatBackgroundRequest{} }, + SetChatThemeRequestTypeID: func() bin.Object { return &SetChatThemeRequest{} }, + SetChatDraftMessageRequestTypeID: func() bin.Object { return &SetChatDraftMessageRequest{} }, + SetChatNotificationSettingsRequestTypeID: func() bin.Object { return &SetChatNotificationSettingsRequest{} }, + ToggleChatHasProtectedContentRequestTypeID: func() bin.Object { return &ToggleChatHasProtectedContentRequest{} }, + ToggleChatIsTranslatableRequestTypeID: func() bin.Object { return &ToggleChatIsTranslatableRequest{} }, + ToggleChatIsMarkedAsUnreadRequestTypeID: func() bin.Object { return &ToggleChatIsMarkedAsUnreadRequest{} }, + ToggleChatDefaultDisableNotificationRequestTypeID: func() bin.Object { return &ToggleChatDefaultDisableNotificationRequest{} }, + SetChatAvailableReactionsRequestTypeID: func() bin.Object { return &SetChatAvailableReactionsRequest{} }, + SetChatClientDataRequestTypeID: func() bin.Object { return &SetChatClientDataRequest{} }, + SetChatDescriptionRequestTypeID: func() bin.Object { return &SetChatDescriptionRequest{} }, + SetChatDiscussionGroupRequestTypeID: func() bin.Object { return &SetChatDiscussionGroupRequest{} }, + SetChatLocationRequestTypeID: func() bin.Object { return &SetChatLocationRequest{} }, + SetChatSlowModeDelayRequestTypeID: func() bin.Object { return &SetChatSlowModeDelayRequest{} }, + PinChatMessageRequestTypeID: func() bin.Object { return &PinChatMessageRequest{} }, + UnpinChatMessageRequestTypeID: func() bin.Object { return &UnpinChatMessageRequest{} }, + UnpinAllChatMessagesRequestTypeID: func() bin.Object { return &UnpinAllChatMessagesRequest{} }, + UnpinAllMessageThreadMessagesRequestTypeID: func() bin.Object { return &UnpinAllMessageThreadMessagesRequest{} }, + JoinChatRequestTypeID: func() bin.Object { return &JoinChatRequest{} }, + LeaveChatRequestTypeID: func() bin.Object { return &LeaveChatRequest{} }, + AddChatMemberRequestTypeID: func() bin.Object { return &AddChatMemberRequest{} }, + AddChatMembersRequestTypeID: func() bin.Object { return &AddChatMembersRequest{} }, + SetChatMemberStatusRequestTypeID: func() bin.Object { return &SetChatMemberStatusRequest{} }, + BanChatMemberRequestTypeID: func() bin.Object { return &BanChatMemberRequest{} }, + CanTransferOwnershipRequestTypeID: func() bin.Object { return &CanTransferOwnershipRequest{} }, + TransferChatOwnershipRequestTypeID: func() bin.Object { return &TransferChatOwnershipRequest{} }, + GetChatMemberRequestTypeID: func() bin.Object { return &GetChatMemberRequest{} }, + SearchChatMembersRequestTypeID: func() bin.Object { return &SearchChatMembersRequest{} }, + GetChatAdministratorsRequestTypeID: func() bin.Object { return &GetChatAdministratorsRequest{} }, + ClearAllDraftMessagesRequestTypeID: func() bin.Object { return &ClearAllDraftMessagesRequest{} }, + GetSavedNotificationSoundRequestTypeID: func() bin.Object { return &GetSavedNotificationSoundRequest{} }, + GetSavedNotificationSoundsRequestTypeID: func() bin.Object { return &GetSavedNotificationSoundsRequest{} }, + AddSavedNotificationSoundRequestTypeID: func() bin.Object { return &AddSavedNotificationSoundRequest{} }, + RemoveSavedNotificationSoundRequestTypeID: func() bin.Object { return &RemoveSavedNotificationSoundRequest{} }, + GetChatNotificationSettingsExceptionsRequestTypeID: func() bin.Object { return &GetChatNotificationSettingsExceptionsRequest{} }, + GetScopeNotificationSettingsRequestTypeID: func() bin.Object { return &GetScopeNotificationSettingsRequest{} }, + SetScopeNotificationSettingsRequestTypeID: func() bin.Object { return &SetScopeNotificationSettingsRequest{} }, + ResetAllNotificationSettingsRequestTypeID: func() bin.Object { return &ResetAllNotificationSettingsRequest{} }, + ToggleChatIsPinnedRequestTypeID: func() bin.Object { return &ToggleChatIsPinnedRequest{} }, + SetPinnedChatsRequestTypeID: func() bin.Object { return &SetPinnedChatsRequest{} }, + ReadChatListRequestTypeID: func() bin.Object { return &ReadChatListRequest{} }, + GetStoryRequestTypeID: func() bin.Object { return &GetStoryRequest{} }, + GetChatsToSendStoriesRequestTypeID: func() bin.Object { return &GetChatsToSendStoriesRequest{} }, + CanSendStoryRequestTypeID: func() bin.Object { return &CanSendStoryRequest{} }, + SendStoryRequestTypeID: func() bin.Object { return &SendStoryRequest{} }, + EditStoryRequestTypeID: func() bin.Object { return &EditStoryRequest{} }, + SetStoryPrivacySettingsRequestTypeID: func() bin.Object { return &SetStoryPrivacySettingsRequest{} }, + ToggleStoryIsPinnedRequestTypeID: func() bin.Object { return &ToggleStoryIsPinnedRequest{} }, + DeleteStoryRequestTypeID: func() bin.Object { return &DeleteStoryRequest{} }, + GetStoryNotificationSettingsExceptionsRequestTypeID: func() bin.Object { return &GetStoryNotificationSettingsExceptionsRequest{} }, + LoadActiveStoriesRequestTypeID: func() bin.Object { return &LoadActiveStoriesRequest{} }, + SetChatActiveStoriesListRequestTypeID: func() bin.Object { return &SetChatActiveStoriesListRequest{} }, + GetChatActiveStoriesRequestTypeID: func() bin.Object { return &GetChatActiveStoriesRequest{} }, + GetChatPinnedStoriesRequestTypeID: func() bin.Object { return &GetChatPinnedStoriesRequest{} }, + GetChatArchivedStoriesRequestTypeID: func() bin.Object { return &GetChatArchivedStoriesRequest{} }, + OpenStoryRequestTypeID: func() bin.Object { return &OpenStoryRequest{} }, + CloseStoryRequestTypeID: func() bin.Object { return &CloseStoryRequest{} }, + GetStoryAvailableReactionsRequestTypeID: func() bin.Object { return &GetStoryAvailableReactionsRequest{} }, + SetStoryReactionRequestTypeID: func() bin.Object { return &SetStoryReactionRequest{} }, + GetStoryViewersRequestTypeID: func() bin.Object { return &GetStoryViewersRequest{} }, + ReportStoryRequestTypeID: func() bin.Object { return &ReportStoryRequest{} }, + ActivateStoryStealthModeRequestTypeID: func() bin.Object { return &ActivateStoryStealthModeRequest{} }, + GetAvailableChatBoostSlotsRequestTypeID: func() bin.Object { return &GetAvailableChatBoostSlotsRequest{} }, + GetChatBoostStatusRequestTypeID: func() bin.Object { return &GetChatBoostStatusRequest{} }, + BoostChatRequestTypeID: func() bin.Object { return &BoostChatRequest{} }, + GetChatBoostLinkRequestTypeID: func() bin.Object { return &GetChatBoostLinkRequest{} }, + GetChatBoostLinkInfoRequestTypeID: func() bin.Object { return &GetChatBoostLinkInfoRequest{} }, + GetChatBoostsRequestTypeID: func() bin.Object { return &GetChatBoostsRequest{} }, + GetUserChatBoostsRequestTypeID: func() bin.Object { return &GetUserChatBoostsRequest{} }, + GetAttachmentMenuBotRequestTypeID: func() bin.Object { return &GetAttachmentMenuBotRequest{} }, + ToggleBotIsAddedToAttachmentMenuRequestTypeID: func() bin.Object { return &ToggleBotIsAddedToAttachmentMenuRequest{} }, + GetThemedEmojiStatusesRequestTypeID: func() bin.Object { return &GetThemedEmojiStatusesRequest{} }, + GetRecentEmojiStatusesRequestTypeID: func() bin.Object { return &GetRecentEmojiStatusesRequest{} }, + GetDefaultEmojiStatusesRequestTypeID: func() bin.Object { return &GetDefaultEmojiStatusesRequest{} }, + ClearRecentEmojiStatusesRequestTypeID: func() bin.Object { return &ClearRecentEmojiStatusesRequest{} }, + DownloadFileRequestTypeID: func() bin.Object { return &DownloadFileRequest{} }, + GetFileDownloadedPrefixSizeRequestTypeID: func() bin.Object { return &GetFileDownloadedPrefixSizeRequest{} }, + CancelDownloadFileRequestTypeID: func() bin.Object { return &CancelDownloadFileRequest{} }, + GetSuggestedFileNameRequestTypeID: func() bin.Object { return &GetSuggestedFileNameRequest{} }, + PreliminaryUploadFileRequestTypeID: func() bin.Object { return &PreliminaryUploadFileRequest{} }, + CancelPreliminaryUploadFileRequestTypeID: func() bin.Object { return &CancelPreliminaryUploadFileRequest{} }, + WriteGeneratedFilePartRequestTypeID: func() bin.Object { return &WriteGeneratedFilePartRequest{} }, + SetFileGenerationProgressRequestTypeID: func() bin.Object { return &SetFileGenerationProgressRequest{} }, + FinishFileGenerationRequestTypeID: func() bin.Object { return &FinishFileGenerationRequest{} }, + ReadFilePartRequestTypeID: func() bin.Object { return &ReadFilePartRequest{} }, + DeleteFileRequestTypeID: func() bin.Object { return &DeleteFileRequest{} }, + AddFileToDownloadsRequestTypeID: func() bin.Object { return &AddFileToDownloadsRequest{} }, + ToggleDownloadIsPausedRequestTypeID: func() bin.Object { return &ToggleDownloadIsPausedRequest{} }, + ToggleAllDownloadsArePausedRequestTypeID: func() bin.Object { return &ToggleAllDownloadsArePausedRequest{} }, + RemoveFileFromDownloadsRequestTypeID: func() bin.Object { return &RemoveFileFromDownloadsRequest{} }, + RemoveAllFilesFromDownloadsRequestTypeID: func() bin.Object { return &RemoveAllFilesFromDownloadsRequest{} }, + SearchFileDownloadsRequestTypeID: func() bin.Object { return &SearchFileDownloadsRequest{} }, + GetMessageFileTypeRequestTypeID: func() bin.Object { return &GetMessageFileTypeRequest{} }, + GetMessageImportConfirmationTextRequestTypeID: func() bin.Object { return &GetMessageImportConfirmationTextRequest{} }, + ImportMessagesRequestTypeID: func() bin.Object { return &ImportMessagesRequest{} }, + ReplacePrimaryChatInviteLinkRequestTypeID: func() bin.Object { return &ReplacePrimaryChatInviteLinkRequest{} }, + CreateChatInviteLinkRequestTypeID: func() bin.Object { return &CreateChatInviteLinkRequest{} }, + EditChatInviteLinkRequestTypeID: func() bin.Object { return &EditChatInviteLinkRequest{} }, + GetChatInviteLinkRequestTypeID: func() bin.Object { return &GetChatInviteLinkRequest{} }, + GetChatInviteLinkCountsRequestTypeID: func() bin.Object { return &GetChatInviteLinkCountsRequest{} }, + GetChatInviteLinksRequestTypeID: func() bin.Object { return &GetChatInviteLinksRequest{} }, + GetChatInviteLinkMembersRequestTypeID: func() bin.Object { return &GetChatInviteLinkMembersRequest{} }, + RevokeChatInviteLinkRequestTypeID: func() bin.Object { return &RevokeChatInviteLinkRequest{} }, + DeleteRevokedChatInviteLinkRequestTypeID: func() bin.Object { return &DeleteRevokedChatInviteLinkRequest{} }, + DeleteAllRevokedChatInviteLinksRequestTypeID: func() bin.Object { return &DeleteAllRevokedChatInviteLinksRequest{} }, + CheckChatInviteLinkRequestTypeID: func() bin.Object { return &CheckChatInviteLinkRequest{} }, + JoinChatByInviteLinkRequestTypeID: func() bin.Object { return &JoinChatByInviteLinkRequest{} }, + GetChatJoinRequestsRequestTypeID: func() bin.Object { return &GetChatJoinRequestsRequest{} }, + ProcessChatJoinRequestRequestTypeID: func() bin.Object { return &ProcessChatJoinRequestRequest{} }, + ProcessChatJoinRequestsRequestTypeID: func() bin.Object { return &ProcessChatJoinRequestsRequest{} }, + CreateCallRequestTypeID: func() bin.Object { return &CreateCallRequest{} }, + AcceptCallRequestTypeID: func() bin.Object { return &AcceptCallRequest{} }, + SendCallSignalingDataRequestTypeID: func() bin.Object { return &SendCallSignalingDataRequest{} }, + DiscardCallRequestTypeID: func() bin.Object { return &DiscardCallRequest{} }, + SendCallRatingRequestTypeID: func() bin.Object { return &SendCallRatingRequest{} }, + SendCallDebugInformationRequestTypeID: func() bin.Object { return &SendCallDebugInformationRequest{} }, + SendCallLogRequestTypeID: func() bin.Object { return &SendCallLogRequest{} }, + GetVideoChatAvailableParticipantsRequestTypeID: func() bin.Object { return &GetVideoChatAvailableParticipantsRequest{} }, + SetVideoChatDefaultParticipantRequestTypeID: func() bin.Object { return &SetVideoChatDefaultParticipantRequest{} }, + CreateVideoChatRequestTypeID: func() bin.Object { return &CreateVideoChatRequest{} }, + GetVideoChatRtmpURLRequestTypeID: func() bin.Object { return &GetVideoChatRtmpURLRequest{} }, + ReplaceVideoChatRtmpURLRequestTypeID: func() bin.Object { return &ReplaceVideoChatRtmpURLRequest{} }, + GetGroupCallRequestTypeID: func() bin.Object { return &GetGroupCallRequest{} }, + StartScheduledGroupCallRequestTypeID: func() bin.Object { return &StartScheduledGroupCallRequest{} }, + ToggleGroupCallEnabledStartNotificationRequestTypeID: func() bin.Object { return &ToggleGroupCallEnabledStartNotificationRequest{} }, + JoinGroupCallRequestTypeID: func() bin.Object { return &JoinGroupCallRequest{} }, + StartGroupCallScreenSharingRequestTypeID: func() bin.Object { return &StartGroupCallScreenSharingRequest{} }, + ToggleGroupCallScreenSharingIsPausedRequestTypeID: func() bin.Object { return &ToggleGroupCallScreenSharingIsPausedRequest{} }, + EndGroupCallScreenSharingRequestTypeID: func() bin.Object { return &EndGroupCallScreenSharingRequest{} }, + SetGroupCallTitleRequestTypeID: func() bin.Object { return &SetGroupCallTitleRequest{} }, + ToggleGroupCallMuteNewParticipantsRequestTypeID: func() bin.Object { return &ToggleGroupCallMuteNewParticipantsRequest{} }, + InviteGroupCallParticipantsRequestTypeID: func() bin.Object { return &InviteGroupCallParticipantsRequest{} }, + GetGroupCallInviteLinkRequestTypeID: func() bin.Object { return &GetGroupCallInviteLinkRequest{} }, + RevokeGroupCallInviteLinkRequestTypeID: func() bin.Object { return &RevokeGroupCallInviteLinkRequest{} }, + StartGroupCallRecordingRequestTypeID: func() bin.Object { return &StartGroupCallRecordingRequest{} }, + EndGroupCallRecordingRequestTypeID: func() bin.Object { return &EndGroupCallRecordingRequest{} }, + ToggleGroupCallIsMyVideoPausedRequestTypeID: func() bin.Object { return &ToggleGroupCallIsMyVideoPausedRequest{} }, + ToggleGroupCallIsMyVideoEnabledRequestTypeID: func() bin.Object { return &ToggleGroupCallIsMyVideoEnabledRequest{} }, + SetGroupCallParticipantIsSpeakingRequestTypeID: func() bin.Object { return &SetGroupCallParticipantIsSpeakingRequest{} }, + ToggleGroupCallParticipantIsMutedRequestTypeID: func() bin.Object { return &ToggleGroupCallParticipantIsMutedRequest{} }, + SetGroupCallParticipantVolumeLevelRequestTypeID: func() bin.Object { return &SetGroupCallParticipantVolumeLevelRequest{} }, + ToggleGroupCallParticipantIsHandRaisedRequestTypeID: func() bin.Object { return &ToggleGroupCallParticipantIsHandRaisedRequest{} }, + LoadGroupCallParticipantsRequestTypeID: func() bin.Object { return &LoadGroupCallParticipantsRequest{} }, + LeaveGroupCallRequestTypeID: func() bin.Object { return &LeaveGroupCallRequest{} }, + EndGroupCallRequestTypeID: func() bin.Object { return &EndGroupCallRequest{} }, + GetGroupCallStreamsRequestTypeID: func() bin.Object { return &GetGroupCallStreamsRequest{} }, + GetGroupCallStreamSegmentRequestTypeID: func() bin.Object { return &GetGroupCallStreamSegmentRequest{} }, + SetMessageSenderBlockListRequestTypeID: func() bin.Object { return &SetMessageSenderBlockListRequest{} }, + BlockMessageSenderFromRepliesRequestTypeID: func() bin.Object { return &BlockMessageSenderFromRepliesRequest{} }, + GetBlockedMessageSendersRequestTypeID: func() bin.Object { return &GetBlockedMessageSendersRequest{} }, + AddContactRequestTypeID: func() bin.Object { return &AddContactRequest{} }, + ImportContactsRequestTypeID: func() bin.Object { return &ImportContactsRequest{} }, + GetContactsRequestTypeID: func() bin.Object { return &GetContactsRequest{} }, + SearchContactsRequestTypeID: func() bin.Object { return &SearchContactsRequest{} }, + RemoveContactsRequestTypeID: func() bin.Object { return &RemoveContactsRequest{} }, + GetImportedContactCountRequestTypeID: func() bin.Object { return &GetImportedContactCountRequest{} }, + ChangeImportedContactsRequestTypeID: func() bin.Object { return &ChangeImportedContactsRequest{} }, + ClearImportedContactsRequestTypeID: func() bin.Object { return &ClearImportedContactsRequest{} }, + SetCloseFriendsRequestTypeID: func() bin.Object { return &SetCloseFriendsRequest{} }, + GetCloseFriendsRequestTypeID: func() bin.Object { return &GetCloseFriendsRequest{} }, + SetUserPersonalProfilePhotoRequestTypeID: func() bin.Object { return &SetUserPersonalProfilePhotoRequest{} }, + SuggestUserProfilePhotoRequestTypeID: func() bin.Object { return &SuggestUserProfilePhotoRequest{} }, + SearchUserByPhoneNumberRequestTypeID: func() bin.Object { return &SearchUserByPhoneNumberRequest{} }, + SharePhoneNumberRequestTypeID: func() bin.Object { return &SharePhoneNumberRequest{} }, + GetUserProfilePhotosRequestTypeID: func() bin.Object { return &GetUserProfilePhotosRequest{} }, + GetStickersRequestTypeID: func() bin.Object { return &GetStickersRequest{} }, + GetAllStickerEmojisRequestTypeID: func() bin.Object { return &GetAllStickerEmojisRequest{} }, + SearchStickersRequestTypeID: func() bin.Object { return &SearchStickersRequest{} }, + GetPremiumStickersRequestTypeID: func() bin.Object { return &GetPremiumStickersRequest{} }, + GetInstalledStickerSetsRequestTypeID: func() bin.Object { return &GetInstalledStickerSetsRequest{} }, + GetArchivedStickerSetsRequestTypeID: func() bin.Object { return &GetArchivedStickerSetsRequest{} }, + GetTrendingStickerSetsRequestTypeID: func() bin.Object { return &GetTrendingStickerSetsRequest{} }, + GetAttachedStickerSetsRequestTypeID: func() bin.Object { return &GetAttachedStickerSetsRequest{} }, + GetStickerSetRequestTypeID: func() bin.Object { return &GetStickerSetRequest{} }, + SearchStickerSetRequestTypeID: func() bin.Object { return &SearchStickerSetRequest{} }, + SearchInstalledStickerSetsRequestTypeID: func() bin.Object { return &SearchInstalledStickerSetsRequest{} }, + SearchStickerSetsRequestTypeID: func() bin.Object { return &SearchStickerSetsRequest{} }, + ChangeStickerSetRequestTypeID: func() bin.Object { return &ChangeStickerSetRequest{} }, + ViewTrendingStickerSetsRequestTypeID: func() bin.Object { return &ViewTrendingStickerSetsRequest{} }, + ReorderInstalledStickerSetsRequestTypeID: func() bin.Object { return &ReorderInstalledStickerSetsRequest{} }, + GetRecentStickersRequestTypeID: func() bin.Object { return &GetRecentStickersRequest{} }, + AddRecentStickerRequestTypeID: func() bin.Object { return &AddRecentStickerRequest{} }, + RemoveRecentStickerRequestTypeID: func() bin.Object { return &RemoveRecentStickerRequest{} }, + ClearRecentStickersRequestTypeID: func() bin.Object { return &ClearRecentStickersRequest{} }, + GetFavoriteStickersRequestTypeID: func() bin.Object { return &GetFavoriteStickersRequest{} }, + AddFavoriteStickerRequestTypeID: func() bin.Object { return &AddFavoriteStickerRequest{} }, + RemoveFavoriteStickerRequestTypeID: func() bin.Object { return &RemoveFavoriteStickerRequest{} }, + GetStickerEmojisRequestTypeID: func() bin.Object { return &GetStickerEmojisRequest{} }, + SearchEmojisRequestTypeID: func() bin.Object { return &SearchEmojisRequest{} }, + GetEmojiCategoriesRequestTypeID: func() bin.Object { return &GetEmojiCategoriesRequest{} }, + GetAnimatedEmojiRequestTypeID: func() bin.Object { return &GetAnimatedEmojiRequest{} }, + GetEmojiSuggestionsURLRequestTypeID: func() bin.Object { return &GetEmojiSuggestionsURLRequest{} }, + GetCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetCustomEmojiStickersRequest{} }, + GetDefaultChatPhotoCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetDefaultChatPhotoCustomEmojiStickersRequest{} }, + GetDefaultProfilePhotoCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetDefaultProfilePhotoCustomEmojiStickersRequest{} }, + GetDefaultBackgroundCustomEmojiStickersRequestTypeID: func() bin.Object { return &GetDefaultBackgroundCustomEmojiStickersRequest{} }, + GetSavedAnimationsRequestTypeID: func() bin.Object { return &GetSavedAnimationsRequest{} }, + AddSavedAnimationRequestTypeID: func() bin.Object { return &AddSavedAnimationRequest{} }, + RemoveSavedAnimationRequestTypeID: func() bin.Object { return &RemoveSavedAnimationRequest{} }, + GetRecentInlineBotsRequestTypeID: func() bin.Object { return &GetRecentInlineBotsRequest{} }, + SearchHashtagsRequestTypeID: func() bin.Object { return &SearchHashtagsRequest{} }, + RemoveRecentHashtagRequestTypeID: func() bin.Object { return &RemoveRecentHashtagRequest{} }, + GetWebPagePreviewRequestTypeID: func() bin.Object { return &GetWebPagePreviewRequest{} }, + GetWebPageInstantViewRequestTypeID: func() bin.Object { return &GetWebPageInstantViewRequest{} }, + SetProfilePhotoRequestTypeID: func() bin.Object { return &SetProfilePhotoRequest{} }, + DeleteProfilePhotoRequestTypeID: func() bin.Object { return &DeleteProfilePhotoRequest{} }, + SetAccentColorRequestTypeID: func() bin.Object { return &SetAccentColorRequest{} }, + SetNameRequestTypeID: func() bin.Object { return &SetNameRequest{} }, + SetBioRequestTypeID: func() bin.Object { return &SetBioRequest{} }, + SetUsernameRequestTypeID: func() bin.Object { return &SetUsernameRequest{} }, + ToggleUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleUsernameIsActiveRequest{} }, + ReorderActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderActiveUsernamesRequest{} }, + SetEmojiStatusRequestTypeID: func() bin.Object { return &SetEmojiStatusRequest{} }, + SetLocationRequestTypeID: func() bin.Object { return &SetLocationRequest{} }, + ChangePhoneNumberRequestTypeID: func() bin.Object { return &ChangePhoneNumberRequest{} }, + ResendChangePhoneNumberCodeRequestTypeID: func() bin.Object { return &ResendChangePhoneNumberCodeRequest{} }, + CheckChangePhoneNumberCodeRequestTypeID: func() bin.Object { return &CheckChangePhoneNumberCodeRequest{} }, + GetUserLinkRequestTypeID: func() bin.Object { return &GetUserLinkRequest{} }, + SearchUserByTokenRequestTypeID: func() bin.Object { return &SearchUserByTokenRequest{} }, + SetCommandsRequestTypeID: func() bin.Object { return &SetCommandsRequest{} }, + DeleteCommandsRequestTypeID: func() bin.Object { return &DeleteCommandsRequest{} }, + GetCommandsRequestTypeID: func() bin.Object { return &GetCommandsRequest{} }, + SetMenuButtonRequestTypeID: func() bin.Object { return &SetMenuButtonRequest{} }, + GetMenuButtonRequestTypeID: func() bin.Object { return &GetMenuButtonRequest{} }, + SetDefaultGroupAdministratorRightsRequestTypeID: func() bin.Object { return &SetDefaultGroupAdministratorRightsRequest{} }, + SetDefaultChannelAdministratorRightsRequestTypeID: func() bin.Object { return &SetDefaultChannelAdministratorRightsRequest{} }, + CanBotSendMessagesRequestTypeID: func() bin.Object { return &CanBotSendMessagesRequest{} }, + AllowBotToSendMessagesRequestTypeID: func() bin.Object { return &AllowBotToSendMessagesRequest{} }, + SendWebAppCustomRequestRequestTypeID: func() bin.Object { return &SendWebAppCustomRequestRequest{} }, + SetBotNameRequestTypeID: func() bin.Object { return &SetBotNameRequest{} }, + GetBotNameRequestTypeID: func() bin.Object { return &GetBotNameRequest{} }, + SetBotProfilePhotoRequestTypeID: func() bin.Object { return &SetBotProfilePhotoRequest{} }, + ToggleBotUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleBotUsernameIsActiveRequest{} }, + ReorderBotActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderBotActiveUsernamesRequest{} }, + SetBotInfoDescriptionRequestTypeID: func() bin.Object { return &SetBotInfoDescriptionRequest{} }, + GetBotInfoDescriptionRequestTypeID: func() bin.Object { return &GetBotInfoDescriptionRequest{} }, + SetBotInfoShortDescriptionRequestTypeID: func() bin.Object { return &SetBotInfoShortDescriptionRequest{} }, + GetBotInfoShortDescriptionRequestTypeID: func() bin.Object { return &GetBotInfoShortDescriptionRequest{} }, + GetActiveSessionsRequestTypeID: func() bin.Object { return &GetActiveSessionsRequest{} }, + TerminateSessionRequestTypeID: func() bin.Object { return &TerminateSessionRequest{} }, + TerminateAllOtherSessionsRequestTypeID: func() bin.Object { return &TerminateAllOtherSessionsRequest{} }, + ConfirmSessionRequestTypeID: func() bin.Object { return &ConfirmSessionRequest{} }, + ToggleSessionCanAcceptCallsRequestTypeID: func() bin.Object { return &ToggleSessionCanAcceptCallsRequest{} }, + ToggleSessionCanAcceptSecretChatsRequestTypeID: func() bin.Object { return &ToggleSessionCanAcceptSecretChatsRequest{} }, + SetInactiveSessionTTLRequestTypeID: func() bin.Object { return &SetInactiveSessionTTLRequest{} }, + GetConnectedWebsitesRequestTypeID: func() bin.Object { return &GetConnectedWebsitesRequest{} }, + DisconnectWebsiteRequestTypeID: func() bin.Object { return &DisconnectWebsiteRequest{} }, + DisconnectAllWebsitesRequestTypeID: func() bin.Object { return &DisconnectAllWebsitesRequest{} }, + SetSupergroupUsernameRequestTypeID: func() bin.Object { return &SetSupergroupUsernameRequest{} }, + ToggleSupergroupUsernameIsActiveRequestTypeID: func() bin.Object { return &ToggleSupergroupUsernameIsActiveRequest{} }, + DisableAllSupergroupUsernamesRequestTypeID: func() bin.Object { return &DisableAllSupergroupUsernamesRequest{} }, + ReorderSupergroupActiveUsernamesRequestTypeID: func() bin.Object { return &ReorderSupergroupActiveUsernamesRequest{} }, + SetSupergroupStickerSetRequestTypeID: func() bin.Object { return &SetSupergroupStickerSetRequest{} }, + ToggleSupergroupSignMessagesRequestTypeID: func() bin.Object { return &ToggleSupergroupSignMessagesRequest{} }, + ToggleSupergroupJoinToSendMessagesRequestTypeID: func() bin.Object { return &ToggleSupergroupJoinToSendMessagesRequest{} }, + ToggleSupergroupJoinByRequestRequestTypeID: func() bin.Object { return &ToggleSupergroupJoinByRequestRequest{} }, + ToggleSupergroupIsAllHistoryAvailableRequestTypeID: func() bin.Object { return &ToggleSupergroupIsAllHistoryAvailableRequest{} }, + ToggleSupergroupHasHiddenMembersRequestTypeID: func() bin.Object { return &ToggleSupergroupHasHiddenMembersRequest{} }, + ToggleSupergroupHasAggressiveAntiSpamEnabledRequestTypeID: func() bin.Object { return &ToggleSupergroupHasAggressiveAntiSpamEnabledRequest{} }, + ToggleSupergroupIsForumRequestTypeID: func() bin.Object { return &ToggleSupergroupIsForumRequest{} }, + ToggleSupergroupIsBroadcastGroupRequestTypeID: func() bin.Object { return &ToggleSupergroupIsBroadcastGroupRequest{} }, + ReportSupergroupSpamRequestTypeID: func() bin.Object { return &ReportSupergroupSpamRequest{} }, + ReportSupergroupAntiSpamFalsePositiveRequestTypeID: func() bin.Object { return &ReportSupergroupAntiSpamFalsePositiveRequest{} }, + GetSupergroupMembersRequestTypeID: func() bin.Object { return &GetSupergroupMembersRequest{} }, + CloseSecretChatRequestTypeID: func() bin.Object { return &CloseSecretChatRequest{} }, + GetChatEventLogRequestTypeID: func() bin.Object { return &GetChatEventLogRequest{} }, + GetPaymentFormRequestTypeID: func() bin.Object { return &GetPaymentFormRequest{} }, + ValidateOrderInfoRequestTypeID: func() bin.Object { return &ValidateOrderInfoRequest{} }, + SendPaymentFormRequestTypeID: func() bin.Object { return &SendPaymentFormRequest{} }, + GetPaymentReceiptRequestTypeID: func() bin.Object { return &GetPaymentReceiptRequest{} }, + GetSavedOrderInfoRequestTypeID: func() bin.Object { return &GetSavedOrderInfoRequest{} }, + DeleteSavedOrderInfoRequestTypeID: func() bin.Object { return &DeleteSavedOrderInfoRequest{} }, + 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{} }, + GetLocalizationTargetInfoRequestTypeID: func() bin.Object { return &GetLocalizationTargetInfoRequest{} }, + GetLanguagePackInfoRequestTypeID: func() bin.Object { return &GetLanguagePackInfoRequest{} }, + GetLanguagePackStringsRequestTypeID: func() bin.Object { return &GetLanguagePackStringsRequest{} }, + SynchronizeLanguagePackRequestTypeID: func() bin.Object { return &SynchronizeLanguagePackRequest{} }, + AddCustomServerLanguagePackRequestTypeID: func() bin.Object { return &AddCustomServerLanguagePackRequest{} }, + SetCustomLanguagePackRequestTypeID: func() bin.Object { return &SetCustomLanguagePackRequest{} }, + EditCustomLanguagePackInfoRequestTypeID: func() bin.Object { return &EditCustomLanguagePackInfoRequest{} }, + SetCustomLanguagePackStringRequestTypeID: func() bin.Object { return &SetCustomLanguagePackStringRequest{} }, + DeleteLanguagePackRequestTypeID: func() bin.Object { return &DeleteLanguagePackRequest{} }, + RegisterDeviceRequestTypeID: func() bin.Object { return &RegisterDeviceRequest{} }, + ProcessPushNotificationRequestTypeID: func() bin.Object { return &ProcessPushNotificationRequest{} }, + GetPushReceiverIDRequestTypeID: func() bin.Object { return &GetPushReceiverIDRequest{} }, + GetRecentlyVisitedTMeURLsRequestTypeID: func() bin.Object { return &GetRecentlyVisitedTMeURLsRequest{} }, + SetUserPrivacySettingRulesRequestTypeID: func() bin.Object { return &SetUserPrivacySettingRulesRequest{} }, + GetUserPrivacySettingRulesRequestTypeID: func() bin.Object { return &GetUserPrivacySettingRulesRequest{} }, + GetOptionRequestTypeID: func() bin.Object { return &GetOptionRequest{} }, + SetOptionRequestTypeID: func() bin.Object { return &SetOptionRequest{} }, + SetAccountTTLRequestTypeID: func() bin.Object { return &SetAccountTTLRequest{} }, + GetAccountTTLRequestTypeID: func() bin.Object { return &GetAccountTTLRequest{} }, + DeleteAccountRequestTypeID: func() bin.Object { return &DeleteAccountRequest{} }, + SetDefaultMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &SetDefaultMessageAutoDeleteTimeRequest{} }, + GetDefaultMessageAutoDeleteTimeRequestTypeID: func() bin.Object { return &GetDefaultMessageAutoDeleteTimeRequest{} }, + RemoveChatActionBarRequestTypeID: func() bin.Object { return &RemoveChatActionBarRequest{} }, + ReportChatRequestTypeID: func() bin.Object { return &ReportChatRequest{} }, + ReportChatPhotoRequestTypeID: func() bin.Object { return &ReportChatPhotoRequest{} }, + ReportMessageReactionsRequestTypeID: func() bin.Object { return &ReportMessageReactionsRequest{} }, + GetChatStatisticsRequestTypeID: func() bin.Object { return &GetChatStatisticsRequest{} }, + GetMessageStatisticsRequestTypeID: func() bin.Object { return &GetMessageStatisticsRequest{} }, + GetMessagePublicForwardsRequestTypeID: func() bin.Object { return &GetMessagePublicForwardsRequest{} }, + GetStatisticalGraphRequestTypeID: func() bin.Object { return &GetStatisticalGraphRequest{} }, + GetStorageStatisticsRequestTypeID: func() bin.Object { return &GetStorageStatisticsRequest{} }, + GetStorageStatisticsFastRequestTypeID: func() bin.Object { return &GetStorageStatisticsFastRequest{} }, + GetDatabaseStatisticsRequestTypeID: func() bin.Object { return &GetDatabaseStatisticsRequest{} }, + OptimizeStorageRequestTypeID: func() bin.Object { return &OptimizeStorageRequest{} }, + SetNetworkTypeRequestTypeID: func() bin.Object { return &SetNetworkTypeRequest{} }, + GetNetworkStatisticsRequestTypeID: func() bin.Object { return &GetNetworkStatisticsRequest{} }, + AddNetworkStatisticsRequestTypeID: func() bin.Object { return &AddNetworkStatisticsRequest{} }, + ResetNetworkStatisticsRequestTypeID: func() bin.Object { return &ResetNetworkStatisticsRequest{} }, + GetAutoDownloadSettingsPresetsRequestTypeID: func() bin.Object { return &GetAutoDownloadSettingsPresetsRequest{} }, + SetAutoDownloadSettingsRequestTypeID: func() bin.Object { return &SetAutoDownloadSettingsRequest{} }, + GetAutosaveSettingsRequestTypeID: func() bin.Object { return &GetAutosaveSettingsRequest{} }, + SetAutosaveSettingsRequestTypeID: func() bin.Object { return &SetAutosaveSettingsRequest{} }, + ClearAutosaveSettingsExceptionsRequestTypeID: func() bin.Object { return &ClearAutosaveSettingsExceptionsRequest{} }, + GetBankCardInfoRequestTypeID: func() bin.Object { return &GetBankCardInfoRequest{} }, + GetPassportElementRequestTypeID: func() bin.Object { return &GetPassportElementRequest{} }, + GetAllPassportElementsRequestTypeID: func() bin.Object { return &GetAllPassportElementsRequest{} }, + SetPassportElementRequestTypeID: func() bin.Object { return &SetPassportElementRequest{} }, + DeletePassportElementRequestTypeID: func() bin.Object { return &DeletePassportElementRequest{} }, + SetPassportElementErrorsRequestTypeID: func() bin.Object { return &SetPassportElementErrorsRequest{} }, + GetPreferredCountryLanguageRequestTypeID: func() bin.Object { return &GetPreferredCountryLanguageRequest{} }, + SendPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &SendPhoneNumberVerificationCodeRequest{} }, + ResendPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &ResendPhoneNumberVerificationCodeRequest{} }, + CheckPhoneNumberVerificationCodeRequestTypeID: func() bin.Object { return &CheckPhoneNumberVerificationCodeRequest{} }, + SendEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &SendEmailAddressVerificationCodeRequest{} }, + ResendEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &ResendEmailAddressVerificationCodeRequest{} }, + CheckEmailAddressVerificationCodeRequestTypeID: func() bin.Object { return &CheckEmailAddressVerificationCodeRequest{} }, + GetPassportAuthorizationFormRequestTypeID: func() bin.Object { return &GetPassportAuthorizationFormRequest{} }, + GetPassportAuthorizationFormAvailableElementsRequestTypeID: func() bin.Object { return &GetPassportAuthorizationFormAvailableElementsRequest{} }, + SendPassportAuthorizationFormRequestTypeID: func() bin.Object { return &SendPassportAuthorizationFormRequest{} }, + SendPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &SendPhoneNumberConfirmationCodeRequest{} }, + ResendPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &ResendPhoneNumberConfirmationCodeRequest{} }, + CheckPhoneNumberConfirmationCodeRequestTypeID: func() bin.Object { return &CheckPhoneNumberConfirmationCodeRequest{} }, + SetBotUpdatesStatusRequestTypeID: func() bin.Object { return &SetBotUpdatesStatusRequest{} }, + UploadStickerFileRequestTypeID: func() bin.Object { return &UploadStickerFileRequest{} }, + GetSuggestedStickerSetNameRequestTypeID: func() bin.Object { return &GetSuggestedStickerSetNameRequest{} }, + CheckStickerSetNameRequestTypeID: func() bin.Object { return &CheckStickerSetNameRequest{} }, + CreateNewStickerSetRequestTypeID: func() bin.Object { return &CreateNewStickerSetRequest{} }, + AddStickerToSetRequestTypeID: func() bin.Object { return &AddStickerToSetRequest{} }, + SetStickerSetThumbnailRequestTypeID: func() bin.Object { return &SetStickerSetThumbnailRequest{} }, + SetCustomEmojiStickerSetThumbnailRequestTypeID: func() bin.Object { return &SetCustomEmojiStickerSetThumbnailRequest{} }, + SetStickerSetTitleRequestTypeID: func() bin.Object { return &SetStickerSetTitleRequest{} }, + DeleteStickerSetRequestTypeID: func() bin.Object { return &DeleteStickerSetRequest{} }, + SetStickerPositionInSetRequestTypeID: func() bin.Object { return &SetStickerPositionInSetRequest{} }, + RemoveStickerFromSetRequestTypeID: func() bin.Object { return &RemoveStickerFromSetRequest{} }, + SetStickerEmojisRequestTypeID: func() bin.Object { return &SetStickerEmojisRequest{} }, + SetStickerKeywordsRequestTypeID: func() bin.Object { return &SetStickerKeywordsRequest{} }, + SetStickerMaskPositionRequestTypeID: func() bin.Object { return &SetStickerMaskPositionRequest{} }, + GetMapThumbnailFileRequestTypeID: func() bin.Object { return &GetMapThumbnailFileRequest{} }, + GetPremiumLimitRequestTypeID: func() bin.Object { return &GetPremiumLimitRequest{} }, + GetPremiumFeaturesRequestTypeID: func() bin.Object { return &GetPremiumFeaturesRequest{} }, + GetPremiumStickerExamplesRequestTypeID: func() bin.Object { return &GetPremiumStickerExamplesRequest{} }, + ViewPremiumFeatureRequestTypeID: func() bin.Object { return &ViewPremiumFeatureRequest{} }, + ClickPremiumSubscriptionButtonRequestTypeID: func() bin.Object { return &ClickPremiumSubscriptionButtonRequest{} }, + GetPremiumStateRequestTypeID: func() bin.Object { return &GetPremiumStateRequest{} }, + GetPremiumGiftCodePaymentOptionsRequestTypeID: func() bin.Object { return &GetPremiumGiftCodePaymentOptionsRequest{} }, + CheckPremiumGiftCodeRequestTypeID: func() bin.Object { return &CheckPremiumGiftCodeRequest{} }, + ApplyPremiumGiftCodeRequestTypeID: func() bin.Object { return &ApplyPremiumGiftCodeRequest{} }, + LaunchPrepaidPremiumGiveawayRequestTypeID: func() bin.Object { return &LaunchPrepaidPremiumGiveawayRequest{} }, + GetPremiumGiveawayInfoRequestTypeID: func() bin.Object { return &GetPremiumGiveawayInfoRequest{} }, + CanPurchasePremiumRequestTypeID: func() bin.Object { return &CanPurchasePremiumRequest{} }, + AssignAppStoreTransactionRequestTypeID: func() bin.Object { return &AssignAppStoreTransactionRequest{} }, + AssignGooglePlayTransactionRequestTypeID: func() bin.Object { return &AssignGooglePlayTransactionRequest{} }, + AcceptTermsOfServiceRequestTypeID: func() bin.Object { return &AcceptTermsOfServiceRequest{} }, + SearchStringsByPrefixRequestTypeID: func() bin.Object { return &SearchStringsByPrefixRequest{} }, + SendCustomRequestRequestTypeID: func() bin.Object { return &SendCustomRequestRequest{} }, + AnswerCustomQueryRequestTypeID: func() bin.Object { return &AnswerCustomQueryRequest{} }, + SetAlarmRequestTypeID: func() bin.Object { return &SetAlarmRequest{} }, + GetCountriesRequestTypeID: func() bin.Object { return &GetCountriesRequest{} }, + GetCountryCodeRequestTypeID: func() bin.Object { return &GetCountryCodeRequest{} }, + GetPhoneNumberInfoRequestTypeID: func() bin.Object { return &GetPhoneNumberInfoRequest{} }, + 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{} }, + EditProxyRequestTypeID: func() bin.Object { return &EditProxyRequest{} }, + EnableProxyRequestTypeID: func() bin.Object { return &EnableProxyRequest{} }, + DisableProxyRequestTypeID: func() bin.Object { return &DisableProxyRequest{} }, + RemoveProxyRequestTypeID: func() bin.Object { return &RemoveProxyRequest{} }, + GetProxiesRequestTypeID: func() bin.Object { return &GetProxiesRequest{} }, + GetProxyLinkRequestTypeID: func() bin.Object { return &GetProxyLinkRequest{} }, + PingProxyRequestTypeID: func() bin.Object { return &PingProxyRequest{} }, + SetLogStreamRequestTypeID: func() bin.Object { return &SetLogStreamRequest{} }, + GetLogStreamRequestTypeID: func() bin.Object { return &GetLogStreamRequest{} }, + SetLogVerbosityLevelRequestTypeID: func() bin.Object { return &SetLogVerbosityLevelRequest{} }, + GetLogVerbosityLevelRequestTypeID: func() bin.Object { return &GetLogVerbosityLevelRequest{} }, + GetLogTagsRequestTypeID: func() bin.Object { return &GetLogTagsRequest{} }, + SetLogTagVerbosityLevelRequestTypeID: func() bin.Object { return &SetLogTagVerbosityLevelRequest{} }, + GetLogTagVerbosityLevelRequestTypeID: func() bin.Object { return &GetLogTagVerbosityLevelRequest{} }, + AddLogMessageRequestTypeID: func() bin.Object { return &AddLogMessageRequest{} }, + GetUserSupportInfoRequestTypeID: func() bin.Object { return &GetUserSupportInfoRequest{} }, + SetUserSupportInfoRequestTypeID: func() bin.Object { return &SetUserSupportInfoRequest{} }, + GetSupportNameRequestTypeID: func() bin.Object { return &GetSupportNameRequest{} }, + TestCallEmptyRequestTypeID: func() bin.Object { return &TestCallEmptyRequest{} }, + TestCallStringRequestTypeID: func() bin.Object { return &TestCallStringRequest{} }, + TestCallBytesRequestTypeID: func() bin.Object { return &TestCallBytesRequest{} }, + TestCallVectorIntRequestTypeID: func() bin.Object { return &TestCallVectorIntRequest{} }, + TestCallVectorIntObjectRequestTypeID: func() bin.Object { return &TestCallVectorIntObjectRequest{} }, + TestCallVectorStringRequestTypeID: func() bin.Object { return &TestCallVectorStringRequest{} }, + TestCallVectorStringObjectRequestTypeID: func() bin.Object { return &TestCallVectorStringObjectRequest{} }, + TestSquareIntRequestTypeID: func() bin.Object { return &TestSquareIntRequest{} }, + TestNetworkRequestTypeID: func() bin.Object { return &TestNetworkRequest{} }, + TestProxyRequestTypeID: func() bin.Object { return &TestProxyRequest{} }, + TestGetDifferenceRequestTypeID: func() bin.Object { return &TestGetDifferenceRequest{} }, + TestUseUpdateRequestTypeID: func() bin.Object { return &TestUseUpdateRequest{} }, + TestReturnErrorRequestTypeID: func() bin.Object { return &TestReturnErrorRequest{} }, } } @@ -5982,14 +6117,6 @@ func ClassConstructorsMap() map[string][]uint32 { CallbackQueryPayloadDataWithPasswordTypeID, CallbackQueryPayloadGameTypeID, }, - CanBoostChatResultClassName: { - CanBoostChatResultOkTypeID, - CanBoostChatResultInvalidChatTypeID, - CanBoostChatResultAlreadyBoostedTypeID, - CanBoostChatResultPremiumNeededTypeID, - CanBoostChatResultPremiumSubscriptionNeededTypeID, - CanBoostChatResultWaitNeededTypeID, - }, CanSendStoryResultClassName: { CanSendStoryResultOkTypeID, CanSendStoryResultPremiumNeededTypeID, @@ -6034,6 +6161,11 @@ func ClassConstructorsMap() map[string][]uint32 { ChatAvailableReactionsAllTypeID, ChatAvailableReactionsSomeTypeID, }, + ChatBoostSourceClassName: { + ChatBoostSourceGiftCodeTypeID, + ChatBoostSourceGiveawayTypeID, + ChatBoostSourcePremiumTypeID, + }, ChatEventActionClassName: { ChatEventMessageEditedTypeID, ChatEventMessageDeletedTypeID, @@ -6059,6 +6191,8 @@ func ClassConstructorsMap() map[string][]uint32 { ChatEventTitleChangedTypeID, ChatEventUsernameChangedTypeID, ChatEventActiveUsernamesChangedTypeID, + ChatEventAccentColorChangedTypeID, + ChatEventBackgroundCustomEmojiChangedTypeID, ChatEventHasProtectedContentToggledTypeID, ChatEventInvitesToggledTypeID, ChatEventIsAllHistoryAvailableToggledTypeID, @@ -6271,6 +6405,7 @@ func ClassConstructorsMap() map[string][]uint32 { InputInvoiceClassName: { InputInvoiceMessageTypeID, InputInvoiceNameTypeID, + InputInvoiceTelegramTypeID, }, InputMessageContentClassName: { InputMessageTextTypeID, @@ -6292,6 +6427,10 @@ func ClassConstructorsMap() map[string][]uint32 { InputMessageStoryTypeID, InputMessageForwardedTypeID, }, + InputMessageReplyToClassName: { + InputMessageReplyToMessageTypeID, + InputMessageReplyToStoryTypeID, + }, InputPassportElementClassName: { InputPassportElementPersonalDetailsTypeID, InputPassportElementPassportTypeID, @@ -6353,6 +6492,7 @@ func ClassConstructorsMap() map[string][]uint32 { InternalLinkTypePassportDataRequestTypeID, InternalLinkTypePhoneNumberConfirmationTypeID, InternalLinkTypePremiumFeaturesTypeID, + InternalLinkTypePremiumGiftCodeTypeID, InternalLinkTypePrivacyAndSecuritySettingsTypeID, InternalLinkTypeProxyTypeID, InternalLinkTypePublicChatTypeID, @@ -6465,6 +6605,9 @@ func ClassConstructorsMap() map[string][]uint32 { MessagePaymentSuccessfulTypeID, MessagePaymentSuccessfulBotTypeID, MessageGiftedPremiumTypeID, + MessagePremiumGiftCodeTypeID, + MessagePremiumGiveawayCreatedTypeID, + MessagePremiumGiveawayTypeID, MessageContactRegisteredTypeID, MessageUserSharedTypeID, MessageChatSharedTypeID, @@ -6487,11 +6630,11 @@ func ClassConstructorsMap() map[string][]uint32 { MessageFileTypeGroupTypeID, MessageFileTypeUnknownTypeID, }, - MessageForwardOriginClassName: { - MessageForwardOriginUserTypeID, - MessageForwardOriginChatTypeID, - MessageForwardOriginHiddenUserTypeID, - MessageForwardOriginChannelTypeID, + MessageOriginClassName: { + MessageOriginUserTypeID, + MessageOriginHiddenUserTypeID, + MessageOriginChatTypeID, + MessageOriginChannelTypeID, }, MessageReplyToClassName: { MessageReplyToMessageTypeID, @@ -6674,6 +6817,18 @@ func ClassConstructorsMap() map[string][]uint32 { PremiumFeatureRealTimeChatTranslationTypeID, PremiumFeatureUpgradedStoriesTypeID, PremiumFeatureChatBoostTypeID, + PremiumFeatureAccentColorTypeID, + }, + PremiumGiveawayInfoClassName: { + PremiumGiveawayInfoOngoingTypeID, + PremiumGiveawayInfoCompletedTypeID, + }, + PremiumGiveawayParticipantStatusClassName: { + PremiumGiveawayParticipantStatusEligibleTypeID, + PremiumGiveawayParticipantStatusParticipatingTypeID, + PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID, + PremiumGiveawayParticipantStatusAdministratorTypeID, + PremiumGiveawayParticipantStatusDisallowedCountryTypeID, }, PremiumLimitTypeClassName: { PremiumLimitTypeSupergroupCountTypeID, @@ -6731,6 +6886,8 @@ func ClassConstructorsMap() map[string][]uint32 { PushMessageContentLocationTypeID, PushMessageContentPhotoTypeID, PushMessageContentPollTypeID, + PushMessageContentPremiumGiftCodeTypeID, + PushMessageContentPremiumGiveawayTypeID, PushMessageContentScreenshotTakenTypeID, PushMessageContentStickerTypeID, PushMessageContentStoryTypeID, @@ -6869,6 +7026,8 @@ func ClassConstructorsMap() map[string][]uint32 { StorePaymentPurposeClassName: { StorePaymentPurposePremiumSubscriptionTypeID, StorePaymentPurposeGiftedPremiumTypeID, + StorePaymentPurposePremiumGiftCodesTypeID, + StorePaymentPurposePremiumGiveawayTypeID, }, StoryAreaTypeClassName: { StoryAreaTypeLocationTypeID, @@ -6922,6 +7081,10 @@ func ClassConstructorsMap() map[string][]uint32 { TargetChatChosenTypeID, TargetChatInternalLinkTypeID, }, + TelegramPaymentPurposeClassName: { + TelegramPaymentPurposePremiumGiftCodesTypeID, + TelegramPaymentPurposePremiumGiveawayTypeID, + }, TextEntityTypeClassName: { TextEntityTypeMentionTypeID, TextEntityTypeHashtagTypeID, @@ -6939,6 +7102,7 @@ func ClassConstructorsMap() map[string][]uint32 { TextEntityTypeCodeTypeID, TextEntityTypePreTypeID, TextEntityTypePreCodeTypeID, + TextEntityTypeBlockQuoteTypeID, TextEntityTypeTextURLTypeID, TextEntityTypeMentionNameTypeID, TextEntityTypeCustomEmojiTypeID, @@ -6983,6 +7147,8 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateNewChatTypeID, UpdateChatTitleTypeID, UpdateChatPhotoTypeID, + UpdateChatAccentColorTypeID, + UpdateChatBackgroundCustomEmojiTypeID, UpdateChatPermissionsTypeID, UpdateChatLastMessageTypeID, UpdateChatPositionTypeID, @@ -7057,6 +7223,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateSavedNotificationSoundsTypeID, UpdateSelectedBackgroundTypeID, UpdateChatThemesTypeID, + UpdateAccentColorsTypeID, UpdateLanguagePackStringsTypeID, UpdateConnectionStateTypeID, UpdateTermsOfServiceTypeID, @@ -7084,6 +7251,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdatePollAnswerTypeID, UpdateChatMemberTypeID, UpdateNewChatJoinRequestTypeID, + UpdateChatBoostTypeID, }, UserPrivacySettingClassName: { UserPrivacySettingShowStatusTypeID, diff --git a/tdapi/tl_resend_messages_gen.go b/tdapi/tl_resend_messages_gen.go index cdc30cc21f..dbca843686 100644 --- a/tdapi/tl_resend_messages_gen.go +++ b/tdapi/tl_resend_messages_gen.go @@ -31,17 +31,21 @@ var ( _ = tdjson.Encoder{} ) -// ResendMessagesRequest represents TL type `resendMessages#60d350b8`. +// ResendMessagesRequest represents TL type `resendMessages#4a0c68af`. type ResendMessagesRequest struct { // Identifier of the chat to send messages ChatID int64 // Identifiers of the messages to resend. Message identifiers must be in a strictly // increasing order MessageIDs []int64 + // New manually chosen quote from the message to be replied; pass null if none. Ignored + // if more than one message is re-sent, or if messageSendingStateFailed + // need_another_reply_quote == false + Quote FormattedText } // ResendMessagesRequestTypeID is TL type id of ResendMessagesRequest. -const ResendMessagesRequestTypeID = 0x60d350b8 +const ResendMessagesRequestTypeID = 0x4a0c68af // Ensuring interfaces in compile-time for ResendMessagesRequest. var ( @@ -61,6 +65,9 @@ func (r *ResendMessagesRequest) Zero() bool { if !(r.MessageIDs == nil) { return false } + if !(r.Quote.Zero()) { + return false + } return true } @@ -105,6 +112,10 @@ func (r *ResendMessagesRequest) TypeInfo() tdp.Type { Name: "MessageIDs", SchemaName: "message_ids", }, + { + Name: "Quote", + SchemaName: "quote", + }, } return typ } @@ -112,7 +123,7 @@ func (r *ResendMessagesRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *ResendMessagesRequest) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode resendMessages#60d350b8 as nil") + return fmt.Errorf("can't encode resendMessages#4a0c68af as nil") } b.PutID(ResendMessagesRequestTypeID) return r.EncodeBare(b) @@ -121,23 +132,26 @@ func (r *ResendMessagesRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *ResendMessagesRequest) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode resendMessages#60d350b8 as nil") + return fmt.Errorf("can't encode resendMessages#4a0c68af as nil") } b.PutInt53(r.ChatID) b.PutInt(len(r.MessageIDs)) for _, v := range r.MessageIDs { b.PutInt53(v) } + if err := r.Quote.Encode(b); err != nil { + return fmt.Errorf("unable to encode resendMessages#4a0c68af: field quote: %w", err) + } return nil } // Decode implements bin.Decoder. func (r *ResendMessagesRequest) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode resendMessages#60d350b8 to nil") + return fmt.Errorf("can't decode resendMessages#4a0c68af to nil") } if err := b.ConsumeID(ResendMessagesRequestTypeID); err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: %w", err) } return r.DecodeBare(b) } @@ -145,19 +159,19 @@ func (r *ResendMessagesRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *ResendMessagesRequest) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode resendMessages#60d350b8 to nil") + return fmt.Errorf("can't decode resendMessages#4a0c68af to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field chat_id: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field chat_id: %w", err) } r.ChatID = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field message_ids: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field message_ids: %w", err) } if headerLen > 0 { @@ -166,18 +180,23 @@ func (r *ResendMessagesRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field message_ids: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field message_ids: %w", err) } r.MessageIDs = append(r.MessageIDs, value) } } + { + if err := r.Quote.Decode(b); err != nil { + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field quote: %w", err) + } + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (r *ResendMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if r == nil { - return fmt.Errorf("can't encode resendMessages#60d350b8 as nil") + return fmt.Errorf("can't encode resendMessages#4a0c68af as nil") } b.ObjStart() b.PutID("resendMessages") @@ -194,6 +213,11 @@ func (r *ResendMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("quote") + if err := r.Quote.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode resendMessages#4a0c68af: field quote: %w", err) + } + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -202,31 +226,35 @@ func (r *ResendMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (r *ResendMessagesRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if r == nil { - return fmt.Errorf("can't decode resendMessages#60d350b8 to nil") + return fmt.Errorf("can't decode resendMessages#4a0c68af to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("resendMessages"); err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field chat_id: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field chat_id: %w", err) } r.ChatID = value case "message_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field message_ids: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field message_ids: %w", err) } r.MessageIDs = append(r.MessageIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode resendMessages#60d350b8: field message_ids: %w", err) + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field message_ids: %w", err) + } + case "quote": + if err := r.Quote.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode resendMessages#4a0c68af: field quote: %w", err) } default: return b.Skip() @@ -251,7 +279,15 @@ func (r *ResendMessagesRequest) GetMessageIDs() (value []int64) { return r.MessageIDs } -// ResendMessages invokes method resendMessages#60d350b8 returning error if any. +// GetQuote returns value of Quote field. +func (r *ResendMessagesRequest) GetQuote() (value FormattedText) { + if r == nil { + return + } + return r.Quote +} + +// ResendMessages invokes method resendMessages#4a0c68af returning error if any. func (c *Client) ResendMessages(ctx context.Context, request *ResendMessagesRequest) (*Messages, error) { var result Messages diff --git a/tdapi/tl_search_quote_gen.go b/tdapi/tl_search_quote_gen.go new file mode 100644 index 0000000000..db0523069b --- /dev/null +++ b/tdapi/tl_search_quote_gen.go @@ -0,0 +1,271 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// SearchQuoteRequest represents TL type `searchQuote#6864011f`. +type SearchQuoteRequest struct { + // Text in which to search for the quote + Text FormattedText + // Quote to search for + Quote FormattedText + // Approximate quote position in UTF-16 code units + QuotePosition int32 +} + +// SearchQuoteRequestTypeID is TL type id of SearchQuoteRequest. +const SearchQuoteRequestTypeID = 0x6864011f + +// Ensuring interfaces in compile-time for SearchQuoteRequest. +var ( + _ bin.Encoder = &SearchQuoteRequest{} + _ bin.Decoder = &SearchQuoteRequest{} + _ bin.BareEncoder = &SearchQuoteRequest{} + _ bin.BareDecoder = &SearchQuoteRequest{} +) + +func (s *SearchQuoteRequest) Zero() bool { + if s == nil { + return true + } + if !(s.Text.Zero()) { + return false + } + if !(s.Quote.Zero()) { + return false + } + if !(s.QuotePosition == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SearchQuoteRequest) String() string { + if s == nil { + return "SearchQuoteRequest(nil)" + } + type Alias SearchQuoteRequest + return fmt.Sprintf("SearchQuoteRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SearchQuoteRequest) TypeID() uint32 { + return SearchQuoteRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SearchQuoteRequest) TypeName() string { + return "searchQuote" +} + +// TypeInfo returns info about TL type. +func (s *SearchQuoteRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "searchQuote", + ID: SearchQuoteRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Text", + SchemaName: "text", + }, + { + Name: "Quote", + SchemaName: "quote", + }, + { + Name: "QuotePosition", + SchemaName: "quote_position", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SearchQuoteRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode searchQuote#6864011f as nil") + } + b.PutID(SearchQuoteRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SearchQuoteRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode searchQuote#6864011f as nil") + } + if err := s.Text.Encode(b); err != nil { + return fmt.Errorf("unable to encode searchQuote#6864011f: field text: %w", err) + } + if err := s.Quote.Encode(b); err != nil { + return fmt.Errorf("unable to encode searchQuote#6864011f: field quote: %w", err) + } + b.PutInt32(s.QuotePosition) + return nil +} + +// Decode implements bin.Decoder. +func (s *SearchQuoteRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode searchQuote#6864011f to nil") + } + if err := b.ConsumeID(SearchQuoteRequestTypeID); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SearchQuoteRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode searchQuote#6864011f to nil") + } + { + if err := s.Text.Decode(b); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field text: %w", err) + } + } + { + if err := s.Quote.Decode(b); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field quote: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field quote_position: %w", err) + } + s.QuotePosition = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SearchQuoteRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode searchQuote#6864011f as nil") + } + b.ObjStart() + b.PutID("searchQuote") + b.Comma() + b.FieldStart("text") + if err := s.Text.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode searchQuote#6864011f: field text: %w", err) + } + b.Comma() + b.FieldStart("quote") + if err := s.Quote.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode searchQuote#6864011f: field quote: %w", err) + } + b.Comma() + b.FieldStart("quote_position") + b.PutInt32(s.QuotePosition) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SearchQuoteRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode searchQuote#6864011f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("searchQuote"); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: %w", err) + } + case "text": + if err := s.Text.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field text: %w", err) + } + case "quote": + if err := s.Quote.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field quote: %w", err) + } + case "quote_position": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode searchQuote#6864011f: field quote_position: %w", err) + } + s.QuotePosition = value + default: + return b.Skip() + } + return nil + }) +} + +// GetText returns value of Text field. +func (s *SearchQuoteRequest) GetText() (value FormattedText) { + if s == nil { + return + } + return s.Text +} + +// GetQuote returns value of Quote field. +func (s *SearchQuoteRequest) GetQuote() (value FormattedText) { + if s == nil { + return + } + return s.Quote +} + +// GetQuotePosition returns value of QuotePosition field. +func (s *SearchQuoteRequest) GetQuotePosition() (value int32) { + if s == nil { + return + } + return s.QuotePosition +} + +// SearchQuote invokes method searchQuote#6864011f returning error if any. +func (c *Client) SearchQuote(ctx context.Context, request *SearchQuoteRequest) (*FoundPosition, error) { + var result FoundPosition + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_send_inline_query_result_message_gen.go b/tdapi/tl_send_inline_query_result_message_gen.go index 96521ada2f..25cbe2f4d3 100644 --- a/tdapi/tl_send_inline_query_result_message_gen.go +++ b/tdapi/tl_send_inline_query_result_message_gen.go @@ -31,14 +31,14 @@ var ( _ = tdjson.Encoder{} ) -// SendInlineQueryResultMessageRequest represents TL type `sendInlineQueryResultMessage#9d4807e9`. +// SendInlineQueryResultMessageRequest represents TL type `sendInlineQueryResultMessage#467c5478`. type SendInlineQueryResultMessageRequest struct { // Target chat ChatID int64 // If not 0, a message thread identifier in which the message will be sent MessageThreadID int64 - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyToClass + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyToClass // Options to be used to send the message; pass null to use default options Options MessageSendOptions // Identifier of the inline query @@ -52,7 +52,7 @@ type SendInlineQueryResultMessageRequest struct { } // SendInlineQueryResultMessageRequestTypeID is TL type id of SendInlineQueryResultMessageRequest. -const SendInlineQueryResultMessageRequestTypeID = 0x9d4807e9 +const SendInlineQueryResultMessageRequestTypeID = 0x467c5478 // Ensuring interfaces in compile-time for SendInlineQueryResultMessageRequest. var ( @@ -158,7 +158,7 @@ func (s *SendInlineQueryResultMessageRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *SendInlineQueryResultMessageRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendInlineQueryResultMessage#9d4807e9 as nil") + return fmt.Errorf("can't encode sendInlineQueryResultMessage#467c5478 as nil") } b.PutID(SendInlineQueryResultMessageRequestTypeID) return s.EncodeBare(b) @@ -167,18 +167,18 @@ func (s *SendInlineQueryResultMessageRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SendInlineQueryResultMessageRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendInlineQueryResultMessage#9d4807e9 as nil") + return fmt.Errorf("can't encode sendInlineQueryResultMessage#467c5478 as nil") } b.PutInt53(s.ChatID) b.PutInt53(s.MessageThreadID) if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field reply_to is nil") + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field reply_to is nil") } if err := s.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field reply_to: %w", err) } if err := s.Options.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field options: %w", err) + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field options: %w", err) } b.PutLong(s.QueryID) b.PutString(s.ResultID) @@ -189,10 +189,10 @@ func (s *SendInlineQueryResultMessageRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *SendInlineQueryResultMessageRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendInlineQueryResultMessage#9d4807e9 to nil") + return fmt.Errorf("can't decode sendInlineQueryResultMessage#467c5478 to nil") } if err := b.ConsumeID(SendInlineQueryResultMessageRequestTypeID); err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: %w", err) } return s.DecodeBare(b) } @@ -200,52 +200,52 @@ func (s *SendInlineQueryResultMessageRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SendInlineQueryResultMessageRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendInlineQueryResultMessage#9d4807e9 to nil") + return fmt.Errorf("can't decode sendInlineQueryResultMessage#467c5478 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field chat_id: %w", err) } s.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field message_thread_id: %w", err) } s.MessageThreadID = value } { - value, err := DecodeMessageReplyTo(b) + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field reply_to: %w", err) } s.ReplyTo = value } { if err := s.Options.Decode(b); err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field options: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field options: %w", err) } } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field query_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field query_id: %w", err) } s.QueryID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field result_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field result_id: %w", err) } s.ResultID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field hide_via_bot: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field hide_via_bot: %w", err) } s.HideViaBot = value } @@ -255,7 +255,7 @@ func (s *SendInlineQueryResultMessageRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *SendInlineQueryResultMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode sendInlineQueryResultMessage#9d4807e9 as nil") + return fmt.Errorf("can't encode sendInlineQueryResultMessage#467c5478 as nil") } b.ObjStart() b.PutID("sendInlineQueryResultMessage") @@ -268,15 +268,15 @@ func (s *SendInlineQueryResultMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) b.Comma() b.FieldStart("reply_to") if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field reply_to is nil") + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field reply_to is nil") } if err := s.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field reply_to: %w", err) } b.Comma() b.FieldStart("options") if err := s.Options.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendInlineQueryResultMessage#9d4807e9: field options: %w", err) + return fmt.Errorf("unable to encode sendInlineQueryResultMessage#467c5478: field options: %w", err) } b.Comma() b.FieldStart("query_id") @@ -296,53 +296,53 @@ func (s *SendInlineQueryResultMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *SendInlineQueryResultMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode sendInlineQueryResultMessage#9d4807e9 to nil") + return fmt.Errorf("can't decode sendInlineQueryResultMessage#467c5478 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("sendInlineQueryResultMessage"); err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field chat_id: %w", err) } s.ChatID = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field message_thread_id: %w", err) } s.MessageThreadID = value case "reply_to": - value, err := DecodeTDLibJSONMessageReplyTo(b) + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field reply_to: %w", err) } s.ReplyTo = value case "options": if err := s.Options.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field options: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field options: %w", err) } case "query_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field query_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field query_id: %w", err) } s.QueryID = value case "result_id": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field result_id: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field result_id: %w", err) } s.ResultID = value case "hide_via_bot": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendInlineQueryResultMessage#9d4807e9: field hide_via_bot: %w", err) + return fmt.Errorf("unable to decode sendInlineQueryResultMessage#467c5478: field hide_via_bot: %w", err) } s.HideViaBot = value default: @@ -369,7 +369,7 @@ func (s *SendInlineQueryResultMessageRequest) GetMessageThreadID() (value int64) } // GetReplyTo returns value of ReplyTo field. -func (s *SendInlineQueryResultMessageRequest) GetReplyTo() (value MessageReplyToClass) { +func (s *SendInlineQueryResultMessageRequest) GetReplyTo() (value InputMessageReplyToClass) { if s == nil { return } @@ -408,7 +408,7 @@ func (s *SendInlineQueryResultMessageRequest) GetHideViaBot() (value bool) { return s.HideViaBot } -// SendInlineQueryResultMessage invokes method sendInlineQueryResultMessage#9d4807e9 returning error if any. +// SendInlineQueryResultMessage invokes method sendInlineQueryResultMessage#467c5478 returning error if any. func (c *Client) SendInlineQueryResultMessage(ctx context.Context, request *SendInlineQueryResultMessageRequest) (*Message, error) { var result Message diff --git a/tdapi/tl_send_message_album_gen.go b/tdapi/tl_send_message_album_gen.go index f98e94a2ed..65f451569b 100644 --- a/tdapi/tl_send_message_album_gen.go +++ b/tdapi/tl_send_message_album_gen.go @@ -31,24 +31,22 @@ var ( _ = tdjson.Encoder{} ) -// SendMessageAlbumRequest represents TL type `sendMessageAlbum#c765936`. +// SendMessageAlbumRequest represents TL type `sendMessageAlbum#74bcdacf`. type SendMessageAlbumRequest struct { // Target chat ChatID int64 // If not 0, a message thread identifier in which the messages will be sent MessageThreadID int64 - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyToClass + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyToClass // Options to be used to send the messages; pass null to use default options Options MessageSendOptions // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContentClass - // Pass true to get fake messages instead of actually sending them - OnlyPreview bool } // SendMessageAlbumRequestTypeID is TL type id of SendMessageAlbumRequest. -const SendMessageAlbumRequestTypeID = 0xc765936 +const SendMessageAlbumRequestTypeID = 0x74bcdacf // Ensuring interfaces in compile-time for SendMessageAlbumRequest. var ( @@ -77,9 +75,6 @@ func (s *SendMessageAlbumRequest) Zero() bool { if !(s.InputMessageContents == nil) { return false } - if !(s.OnlyPreview == false) { - return false - } return true } @@ -136,10 +131,6 @@ func (s *SendMessageAlbumRequest) TypeInfo() tdp.Type { Name: "InputMessageContents", SchemaName: "input_message_contents", }, - { - Name: "OnlyPreview", - SchemaName: "only_preview", - }, } return typ } @@ -147,7 +138,7 @@ func (s *SendMessageAlbumRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *SendMessageAlbumRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendMessageAlbum#c765936 as nil") + return fmt.Errorf("can't encode sendMessageAlbum#74bcdacf as nil") } b.PutID(SendMessageAlbumRequestTypeID) return s.EncodeBare(b) @@ -156,39 +147,38 @@ func (s *SendMessageAlbumRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SendMessageAlbumRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendMessageAlbum#c765936 as nil") + return fmt.Errorf("can't encode sendMessageAlbum#74bcdacf as nil") } b.PutInt53(s.ChatID) b.PutInt53(s.MessageThreadID) if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field reply_to is nil") + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field reply_to is nil") } if err := s.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field reply_to: %w", err) } if err := s.Options.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field options: %w", err) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field options: %w", err) } b.PutInt(len(s.InputMessageContents)) for idx, v := range s.InputMessageContents { if v == nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field input_message_contents element with index %d is nil", idx) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field input_message_contents element with index %d is nil", idx) } if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare sendMessageAlbum#c765936: field input_message_contents element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare sendMessageAlbum#74bcdacf: field input_message_contents element with index %d: %w", idx, err) } } - b.PutBool(s.OnlyPreview) return nil } // Decode implements bin.Decoder. func (s *SendMessageAlbumRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendMessageAlbum#c765936 to nil") + return fmt.Errorf("can't decode sendMessageAlbum#74bcdacf to nil") } if err := b.ConsumeID(SendMessageAlbumRequestTypeID); err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: %w", err) } return s.DecodeBare(b) } @@ -196,38 +186,38 @@ func (s *SendMessageAlbumRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SendMessageAlbumRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendMessageAlbum#c765936 to nil") + return fmt.Errorf("can't decode sendMessageAlbum#74bcdacf to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field chat_id: %w", err) } s.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field message_thread_id: %w", err) } s.MessageThreadID = value } { - value, err := DecodeMessageReplyTo(b) + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field reply_to: %w", err) } s.ReplyTo = value } { if err := s.Options.Decode(b); err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field options: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field options: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field input_message_contents: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field input_message_contents: %w", err) } if headerLen > 0 { @@ -236,25 +226,18 @@ func (s *SendMessageAlbumRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field input_message_contents: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field input_message_contents: %w", err) } s.InputMessageContents = append(s.InputMessageContents, value) } } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field only_preview: %w", err) - } - s.OnlyPreview = value - } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *SendMessageAlbumRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode sendMessageAlbum#c765936 as nil") + return fmt.Errorf("can't encode sendMessageAlbum#74bcdacf as nil") } b.ObjStart() b.PutID("sendMessageAlbum") @@ -267,34 +250,31 @@ func (s *SendMessageAlbumRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("reply_to") if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field reply_to is nil") + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field reply_to is nil") } if err := s.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field reply_to: %w", err) } b.Comma() b.FieldStart("options") if err := s.Options.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field options: %w", err) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field options: %w", err) } b.Comma() b.FieldStart("input_message_contents") b.ArrStart() for idx, v := range s.InputMessageContents { if v == nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field input_message_contents element with index %d is nil", idx) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field input_message_contents element with index %d is nil", idx) } if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessageAlbum#c765936: field input_message_contents element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode sendMessageAlbum#74bcdacf: field input_message_contents element with index %d: %w", idx, err) } b.Comma() } b.StripComma() b.ArrEnd() b.Comma() - b.FieldStart("only_preview") - b.PutBool(s.OnlyPreview) - b.Comma() b.StripComma() b.ObjEnd() return nil @@ -303,54 +283,48 @@ func (s *SendMessageAlbumRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *SendMessageAlbumRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode sendMessageAlbum#c765936 to nil") + return fmt.Errorf("can't decode sendMessageAlbum#74bcdacf to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("sendMessageAlbum"); err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field chat_id: %w", err) } s.ChatID = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field message_thread_id: %w", err) } s.MessageThreadID = value case "reply_to": - value, err := DecodeTDLibJSONMessageReplyTo(b) + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field reply_to: %w", err) } s.ReplyTo = value case "options": if err := s.Options.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field options: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field options: %w", err) } case "input_message_contents": if err := b.Arr(func(b tdjson.Decoder) error { value, err := DecodeTDLibJSONInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field input_message_contents: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field input_message_contents: %w", err) } s.InputMessageContents = append(s.InputMessageContents, value) return nil }); err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field input_message_contents: %w", err) - } - case "only_preview": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode sendMessageAlbum#c765936: field only_preview: %w", err) + return fmt.Errorf("unable to decode sendMessageAlbum#74bcdacf: field input_message_contents: %w", err) } - s.OnlyPreview = value default: return b.Skip() } @@ -375,7 +349,7 @@ func (s *SendMessageAlbumRequest) GetMessageThreadID() (value int64) { } // GetReplyTo returns value of ReplyTo field. -func (s *SendMessageAlbumRequest) GetReplyTo() (value MessageReplyToClass) { +func (s *SendMessageAlbumRequest) GetReplyTo() (value InputMessageReplyToClass) { if s == nil { return } @@ -398,15 +372,7 @@ func (s *SendMessageAlbumRequest) GetInputMessageContents() (value []InputMessag return s.InputMessageContents } -// GetOnlyPreview returns value of OnlyPreview field. -func (s *SendMessageAlbumRequest) GetOnlyPreview() (value bool) { - if s == nil { - return - } - return s.OnlyPreview -} - -// SendMessageAlbum invokes method sendMessageAlbum#c765936 returning error if any. +// SendMessageAlbum invokes method sendMessageAlbum#74bcdacf returning error if any. func (c *Client) SendMessageAlbum(ctx context.Context, request *SendMessageAlbumRequest) (*Messages, error) { var result Messages diff --git a/tdapi/tl_send_message_gen.go b/tdapi/tl_send_message_gen.go index a66184127e..ada196dc8e 100644 --- a/tdapi/tl_send_message_gen.go +++ b/tdapi/tl_send_message_gen.go @@ -31,14 +31,14 @@ var ( _ = tdjson.Encoder{} ) -// SendMessageRequest represents TL type `sendMessage#171a006f`. +// SendMessageRequest represents TL type `sendMessage#e02d01e9`. type SendMessageRequest struct { // Target chat ChatID int64 // If not 0, a message thread identifier in which the message will be sent MessageThreadID int64 - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyToClass + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyToClass // Options to be used to send the message; pass null to use default options Options MessageSendOptions // Markup for replying to the message; pass null if none; for bots only @@ -48,7 +48,7 @@ type SendMessageRequest struct { } // SendMessageRequestTypeID is TL type id of SendMessageRequest. -const SendMessageRequestTypeID = 0x171a006f +const SendMessageRequestTypeID = 0xe02d01e9 // Ensuring interfaces in compile-time for SendMessageRequest. var ( @@ -147,7 +147,7 @@ func (s *SendMessageRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *SendMessageRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendMessage#171a006f as nil") + return fmt.Errorf("can't encode sendMessage#e02d01e9 as nil") } b.PutID(SendMessageRequestTypeID) return s.EncodeBare(b) @@ -156,30 +156,30 @@ func (s *SendMessageRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SendMessageRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendMessage#171a006f as nil") + return fmt.Errorf("can't encode sendMessage#e02d01e9 as nil") } b.PutInt53(s.ChatID) b.PutInt53(s.MessageThreadID) if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_to is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_to is nil") } if err := s.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_to: %w", err) } if err := s.Options.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field options: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field options: %w", err) } if s.ReplyMarkup == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_markup is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_markup is nil") } if err := s.ReplyMarkup.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_markup: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_markup: %w", err) } if s.InputMessageContent == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field input_message_content is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field input_message_content is nil") } if err := s.InputMessageContent.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field input_message_content: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field input_message_content: %w", err) } return nil } @@ -187,10 +187,10 @@ func (s *SendMessageRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *SendMessageRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendMessage#171a006f to nil") + return fmt.Errorf("can't decode sendMessage#e02d01e9 to nil") } if err := b.ConsumeID(SendMessageRequestTypeID); err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: %w", err) } return s.DecodeBare(b) } @@ -198,45 +198,45 @@ func (s *SendMessageRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SendMessageRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendMessage#171a006f to nil") + return fmt.Errorf("can't decode sendMessage#e02d01e9 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field chat_id: %w", err) } s.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field message_thread_id: %w", err) } s.MessageThreadID = value } { - value, err := DecodeMessageReplyTo(b) + value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field reply_to: %w", err) } s.ReplyTo = value } { if err := s.Options.Decode(b); err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field options: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field options: %w", err) } } { value, err := DecodeReplyMarkup(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field reply_markup: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field reply_markup: %w", err) } s.ReplyMarkup = value } { value, err := DecodeInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field input_message_content: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field input_message_content: %w", err) } s.InputMessageContent = value } @@ -246,7 +246,7 @@ func (s *SendMessageRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *SendMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode sendMessage#171a006f as nil") + return fmt.Errorf("can't encode sendMessage#e02d01e9 as nil") } b.ObjStart() b.PutID("sendMessage") @@ -259,31 +259,31 @@ func (s *SendMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("reply_to") if s.ReplyTo == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_to is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_to is nil") } if err := s.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_to: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_to: %w", err) } b.Comma() b.FieldStart("options") if err := s.Options.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field options: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field options: %w", err) } b.Comma() b.FieldStart("reply_markup") if s.ReplyMarkup == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_markup is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_markup is nil") } if err := s.ReplyMarkup.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field reply_markup: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field reply_markup: %w", err) } b.Comma() b.FieldStart("input_message_content") if s.InputMessageContent == nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field input_message_content is nil") + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field input_message_content is nil") } if err := s.InputMessageContent.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendMessage#171a006f: field input_message_content: %w", err) + return fmt.Errorf("unable to encode sendMessage#e02d01e9: field input_message_content: %w", err) } b.Comma() b.StripComma() @@ -294,47 +294,47 @@ func (s *SendMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *SendMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode sendMessage#171a006f to nil") + return fmt.Errorf("can't decode sendMessage#e02d01e9 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("sendMessage"); err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field chat_id: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field chat_id: %w", err) } s.ChatID = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field message_thread_id: %w", err) } s.MessageThreadID = value case "reply_to": - value, err := DecodeTDLibJSONMessageReplyTo(b) + value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field reply_to: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field reply_to: %w", err) } s.ReplyTo = value case "options": if err := s.Options.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field options: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field options: %w", err) } case "reply_markup": value, err := DecodeTDLibJSONReplyMarkup(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field reply_markup: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field reply_markup: %w", err) } s.ReplyMarkup = value case "input_message_content": value, err := DecodeTDLibJSONInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode sendMessage#171a006f: field input_message_content: %w", err) + return fmt.Errorf("unable to decode sendMessage#e02d01e9: field input_message_content: %w", err) } s.InputMessageContent = value default: @@ -361,7 +361,7 @@ func (s *SendMessageRequest) GetMessageThreadID() (value int64) { } // GetReplyTo returns value of ReplyTo field. -func (s *SendMessageRequest) GetReplyTo() (value MessageReplyToClass) { +func (s *SendMessageRequest) GetReplyTo() (value InputMessageReplyToClass) { if s == nil { return } @@ -392,7 +392,7 @@ func (s *SendMessageRequest) GetInputMessageContent() (value InputMessageContent return s.InputMessageContent } -// SendMessage invokes method sendMessage#171a006f returning error if any. +// SendMessage invokes method sendMessage#e02d01e9 returning error if any. func (c *Client) SendMessage(ctx context.Context, request *SendMessageRequest) (*Message, error) { var result Message diff --git a/tdapi/tl_set_accent_color_gen.go b/tdapi/tl_set_accent_color_gen.go new file mode 100644 index 0000000000..583aac52c0 --- /dev/null +++ b/tdapi/tl_set_accent_color_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{} +) + +// SetAccentColorRequest represents TL type `setAccentColor#6389cb39`. +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 + BackgroundCustomEmojiID int64 +} + +// SetAccentColorRequestTypeID is TL type id of SetAccentColorRequest. +const SetAccentColorRequestTypeID = 0x6389cb39 + +// Ensuring interfaces in compile-time for SetAccentColorRequest. +var ( + _ bin.Encoder = &SetAccentColorRequest{} + _ bin.Decoder = &SetAccentColorRequest{} + _ bin.BareEncoder = &SetAccentColorRequest{} + _ bin.BareDecoder = &SetAccentColorRequest{} +) + +func (s *SetAccentColorRequest) Zero() bool { + if s == nil { + return true + } + if !(s.AccentColorID == 0) { + return false + } + if !(s.BackgroundCustomEmojiID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetAccentColorRequest) String() string { + if s == nil { + return "SetAccentColorRequest(nil)" + } + type Alias SetAccentColorRequest + return fmt.Sprintf("SetAccentColorRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetAccentColorRequest) TypeID() uint32 { + return SetAccentColorRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetAccentColorRequest) TypeName() string { + return "setAccentColor" +} + +// TypeInfo returns info about TL type. +func (s *SetAccentColorRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setAccentColor", + ID: SetAccentColorRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, + { + Name: "BackgroundCustomEmojiID", + SchemaName: "background_custom_emoji_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetAccentColorRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setAccentColor#6389cb39 as nil") + } + b.PutID(SetAccentColorRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetAccentColorRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setAccentColor#6389cb39 as nil") + } + b.PutInt32(s.AccentColorID) + b.PutLong(s.BackgroundCustomEmojiID) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetAccentColorRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setAccentColor#6389cb39 to nil") + } + if err := b.ConsumeID(SetAccentColorRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetAccentColorRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setAccentColor#6389cb39 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: field accent_color_id: %w", err) + } + s.AccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: field background_custom_emoji_id: %w", err) + } + s.BackgroundCustomEmojiID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetAccentColorRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setAccentColor#6389cb39 as nil") + } + b.ObjStart() + b.PutID("setAccentColor") + b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(s.AccentColorID) + b.Comma() + b.FieldStart("background_custom_emoji_id") + b.PutLong(s.BackgroundCustomEmojiID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetAccentColorRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setAccentColor#6389cb39 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setAccentColor"); err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: %w", err) + } + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: field accent_color_id: %w", err) + } + s.AccentColorID = value + case "background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setAccentColor#6389cb39: field background_custom_emoji_id: %w", err) + } + s.BackgroundCustomEmojiID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetAccentColorID returns value of AccentColorID field. +func (s *SetAccentColorRequest) GetAccentColorID() (value int32) { + if s == nil { + return + } + return s.AccentColorID +} + +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (s *SetAccentColorRequest) GetBackgroundCustomEmojiID() (value int64) { + if s == nil { + return + } + return s.BackgroundCustomEmojiID +} + +// SetAccentColor invokes method setAccentColor#6389cb39 returning error if any. +func (c *Client) SetAccentColor(ctx context.Context, request *SetAccentColorRequest) 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_accent_color_gen.go b/tdapi/tl_set_chat_accent_color_gen.go new file mode 100644 index 0000000000..fa2d816d1f --- /dev/null +++ b/tdapi/tl_set_chat_accent_color_gen.go @@ -0,0 +1,271 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// SetChatAccentColorRequest represents TL type `setChatAccentColor#349f57ca`. +type SetChatAccentColorRequest struct { + // Chat identifier + ChatID int64 + // 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 + BackgroundCustomEmojiID int64 +} + +// SetChatAccentColorRequestTypeID is TL type id of SetChatAccentColorRequest. +const SetChatAccentColorRequestTypeID = 0x349f57ca + +// Ensuring interfaces in compile-time for SetChatAccentColorRequest. +var ( + _ bin.Encoder = &SetChatAccentColorRequest{} + _ bin.Decoder = &SetChatAccentColorRequest{} + _ bin.BareEncoder = &SetChatAccentColorRequest{} + _ bin.BareDecoder = &SetChatAccentColorRequest{} +) + +func (s *SetChatAccentColorRequest) Zero() bool { + if s == nil { + return true + } + if !(s.ChatID == 0) { + return false + } + if !(s.AccentColorID == 0) { + return false + } + if !(s.BackgroundCustomEmojiID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetChatAccentColorRequest) String() string { + if s == nil { + return "SetChatAccentColorRequest(nil)" + } + type Alias SetChatAccentColorRequest + return fmt.Sprintf("SetChatAccentColorRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetChatAccentColorRequest) TypeID() uint32 { + return SetChatAccentColorRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetChatAccentColorRequest) TypeName() string { + return "setChatAccentColor" +} + +// TypeInfo returns info about TL type. +func (s *SetChatAccentColorRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setChatAccentColor", + ID: SetChatAccentColorRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, + { + Name: "BackgroundCustomEmojiID", + SchemaName: "background_custom_emoji_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetChatAccentColorRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatAccentColor#349f57ca as nil") + } + b.PutID(SetChatAccentColorRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetChatAccentColorRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setChatAccentColor#349f57ca as nil") + } + b.PutInt53(s.ChatID) + b.PutInt32(s.AccentColorID) + b.PutLong(s.BackgroundCustomEmojiID) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetChatAccentColorRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatAccentColor#349f57ca to nil") + } + if err := b.ConsumeID(SetChatAccentColorRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetChatAccentColorRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setChatAccentColor#349f57ca to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field chat_id: %w", err) + } + s.ChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field accent_color_id: %w", err) + } + s.AccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field background_custom_emoji_id: %w", err) + } + s.BackgroundCustomEmojiID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetChatAccentColorRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setChatAccentColor#349f57ca as nil") + } + b.ObjStart() + b.PutID("setChatAccentColor") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(s.ChatID) + b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(s.AccentColorID) + b.Comma() + b.FieldStart("background_custom_emoji_id") + b.PutLong(s.BackgroundCustomEmojiID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetChatAccentColorRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setChatAccentColor#349f57ca to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setChatAccentColor"); err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: %w", err) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field chat_id: %w", err) + } + s.ChatID = value + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field accent_color_id: %w", err) + } + s.AccentColorID = value + case "background_custom_emoji_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode setChatAccentColor#349f57ca: field background_custom_emoji_id: %w", err) + } + s.BackgroundCustomEmojiID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (s *SetChatAccentColorRequest) GetChatID() (value int64) { + if s == nil { + return + } + return s.ChatID +} + +// GetAccentColorID returns value of AccentColorID field. +func (s *SetChatAccentColorRequest) GetAccentColorID() (value int32) { + if s == nil { + return + } + return s.AccentColorID +} + +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (s *SetChatAccentColorRequest) GetBackgroundCustomEmojiID() (value int64) { + if s == nil { + return + } + return s.BackgroundCustomEmojiID +} + +// SetChatAccentColor invokes method setChatAccentColor#349f57ca returning error if any. +func (c *Client) SetChatAccentColor(ctx context.Context, request *SetChatAccentColorRequest) 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 31f9d73cbf..89797b5957 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#2e5aef95`. +// StickerSet represents TL type `stickerSet#ac3cff8b`. type StickerSet struct { // Identifier of the sticker set ID int64 @@ -56,6 +56,9 @@ type StickerSet struct { StickerFormat StickerFormatClass // Type of the stickers in the set StickerType StickerTypeClass + // True, if stickers in the sticker set are custom emoji that must be repainted; for + // custom emoji sticker sets only + NeedsRepainting bool // True for already viewed trending sticker sets IsViewed bool // List of stickers in this set @@ -67,7 +70,7 @@ type StickerSet struct { } // StickerSetTypeID is TL type id of StickerSet. -const StickerSetTypeID = 0x2e5aef95 +const StickerSetTypeID = 0xac3cff8b // Ensuring interfaces in compile-time for StickerSet. var ( @@ -111,6 +114,9 @@ func (s *StickerSet) Zero() bool { if !(s.StickerType == nil) { return false } + if !(s.NeedsRepainting == false) { + return false + } if !(s.IsViewed == false) { return false } @@ -196,6 +202,10 @@ func (s *StickerSet) TypeInfo() tdp.Type { Name: "StickerType", SchemaName: "sticker_type", }, + { + Name: "NeedsRepainting", + SchemaName: "needs_repainting", + }, { Name: "IsViewed", SchemaName: "is_viewed", @@ -215,7 +225,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#2e5aef95 as nil") + return fmt.Errorf("can't encode stickerSet#ac3cff8b as nil") } b.PutID(StickerSetTypeID) return s.EncodeBare(b) @@ -224,46 +234,47 @@ 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#2e5aef95 as nil") + return fmt.Errorf("can't encode stickerSet#ac3cff8b 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#2e5aef95: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: 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#2e5aef95: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#ac3cff8b: 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#2e5aef95: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format is nil") } if err := s.StickerFormat.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format: %w", err) } if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type: %w", err) } + b.PutBool(s.NeedsRepainting) 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#2e5aef95: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#ac3cff8b: 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#2e5aef95: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#ac3cff8b: field emojis element with index %d: %w", idx, err) } } return nil @@ -272,10 +283,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#2e5aef95 to nil") + return fmt.Errorf("can't decode stickerSet#ac3cff8b to nil") } if err := b.ConsumeID(StickerSetTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: %w", err) } return s.DecodeBare(b) } @@ -283,38 +294,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#2e5aef95 to nil") + return fmt.Errorf("can't decode stickerSet#ac3cff8b to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail_outline: %w", err) } if headerLen > 0 { @@ -323,7 +334,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#2e5aef95: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#ac3cff8b: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) } @@ -331,49 +342,56 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_format: %w", err) } s.StickerFormat = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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) } s.IsViewed = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field stickers: %w", err) } if headerLen > 0 { @@ -382,7 +400,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#2e5aef95: field stickers: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#ac3cff8b: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) } @@ -390,7 +408,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field emojis: %w", err) } if headerLen > 0 { @@ -399,7 +417,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#2e5aef95: field emojis: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#ac3cff8b: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) } @@ -410,7 +428,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#2e5aef95 as nil") + return fmt.Errorf("can't encode stickerSet#ac3cff8b as nil") } b.ObjStart() b.PutID("stickerSet") @@ -426,14 +444,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#2e5aef95: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: 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#2e5aef95: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field thumbnail_outline element with index %d: %w", idx, err) } b.Comma() } @@ -451,20 +469,23 @@ 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#2e5aef95: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format is nil") } if err := s.StickerFormat.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_format: %w", err) } b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#2e5aef95: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field sticker_type: %w", err) } b.Comma() + b.FieldStart("needs_repainting") + b.PutBool(s.NeedsRepainting) + b.Comma() b.FieldStart("is_viewed") b.PutBool(s.IsViewed) b.Comma() @@ -472,7 +493,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#2e5aef95: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field stickers element with index %d: %w", idx, err) } b.Comma() } @@ -483,7 +504,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#2e5aef95: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#ac3cff8b: field emojis element with index %d: %w", idx, err) } b.Comma() } @@ -498,105 +519,111 @@ 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#2e5aef95 to nil") + return fmt.Errorf("can't decode stickerSet#ac3cff8b 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#2e5aef95: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field thumbnail_outline: %w", err) } case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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) + } + s.NeedsRepainting = value case "is_viewed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: 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#2e5aef95: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#2e5aef95: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#ac3cff8b: field emojis: %w", err) } default: return b.Skip() @@ -685,6 +712,14 @@ func (s *StickerSet) GetStickerType() (value StickerTypeClass) { return s.StickerType } +// GetNeedsRepainting returns value of NeedsRepainting field. +func (s *StickerSet) GetNeedsRepainting() (value bool) { + if s == nil { + return + } + return s.NeedsRepainting +} + // 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 c93b87eaa0..ecbc4b640e 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#bdeedde0`. +// StickerSetInfo represents TL type `stickerSetInfo#cbbbedfd`. type StickerSetInfo struct { // Identifier of the sticker set ID int64 @@ -56,6 +56,9 @@ type StickerSetInfo struct { StickerFormat StickerFormatClass // Type of the stickers in the set StickerType StickerTypeClass + // True, if stickers in the sticker set are custom emoji that must be repainted; for + // custom emoji sticker sets only + NeedsRepainting bool // True for already viewed trending sticker sets IsViewed bool // Total number of stickers in the set @@ -66,7 +69,7 @@ type StickerSetInfo struct { } // StickerSetInfoTypeID is TL type id of StickerSetInfo. -const StickerSetInfoTypeID = 0xbdeedde0 +const StickerSetInfoTypeID = 0xcbbbedfd // Ensuring interfaces in compile-time for StickerSetInfo. var ( @@ -110,6 +113,9 @@ func (s *StickerSetInfo) Zero() bool { if !(s.StickerType == nil) { return false } + if !(s.NeedsRepainting == false) { + return false + } if !(s.IsViewed == false) { return false } @@ -195,6 +201,10 @@ func (s *StickerSetInfo) TypeInfo() tdp.Type { Name: "StickerType", SchemaName: "sticker_type", }, + { + Name: "NeedsRepainting", + SchemaName: "needs_repainting", + }, { Name: "IsViewed", SchemaName: "is_viewed", @@ -214,7 +224,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#bdeedde0 as nil") + return fmt.Errorf("can't encode stickerSetInfo#cbbbedfd as nil") } b.PutID(StickerSetInfoTypeID) return s.EncodeBare(b) @@ -223,41 +233,42 @@ 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#bdeedde0 as nil") + return fmt.Errorf("can't encode stickerSetInfo#cbbbedfd 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#bdeedde0: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: 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#bdeedde0: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSetInfo#cbbbedfd: 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#bdeedde0: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format is nil") } if err := s.StickerFormat.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) } if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) } + b.PutBool(s.NeedsRepainting) 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#bdeedde0: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSetInfo#cbbbedfd: field covers element with index %d: %w", idx, err) } } return nil @@ -266,10 +277,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#bdeedde0 to nil") + return fmt.Errorf("can't decode stickerSetInfo#cbbbedfd to nil") } if err := b.ConsumeID(StickerSetInfoTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: %w", err) } return s.DecodeBare(b) } @@ -277,38 +288,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#bdeedde0 to nil") + return fmt.Errorf("can't decode stickerSetInfo#cbbbedfd to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) } if headerLen > 0 { @@ -317,7 +328,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#bdeedde0: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode bare stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) } @@ -325,56 +336,63 @@ func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) } s.StickerFormat = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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) } s.IsViewed = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field size: %w", err) } s.Size = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field covers: %w", err) } if headerLen > 0 { @@ -383,7 +401,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#bdeedde0: field covers: %w", err) + return fmt.Errorf("unable to decode bare stickerSetInfo#cbbbedfd: field covers: %w", err) } s.Covers = append(s.Covers, value) } @@ -394,7 +412,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#bdeedde0 as nil") + return fmt.Errorf("can't encode stickerSetInfo#cbbbedfd as nil") } b.ObjStart() b.PutID("stickerSetInfo") @@ -410,14 +428,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#bdeedde0: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: 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#bdeedde0: field thumbnail_outline element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field thumbnail_outline element with index %d: %w", idx, err) } b.Comma() } @@ -435,20 +453,23 @@ 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#bdeedde0: field sticker_format is nil") + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format is nil") } if err := s.StickerFormat.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_format: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_format: %w", err) } b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#bdeedde0: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field sticker_type: %w", err) } b.Comma() + b.FieldStart("needs_repainting") + b.PutBool(s.NeedsRepainting) + b.Comma() b.FieldStart("is_viewed") b.PutBool(s.IsViewed) b.Comma() @@ -459,7 +480,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#bdeedde0: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSetInfo#cbbbedfd: field covers element with index %d: %w", idx, err) } b.Comma() } @@ -474,100 +495,106 @@ 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#bdeedde0 to nil") + return fmt.Errorf("can't decode stickerSetInfo#cbbbedfd 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#bdeedde0: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) } s.ThumbnailOutline = append(s.ThumbnailOutline, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field thumbnail_outline: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field thumbnail_outline: %w", err) } case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field sticker_format: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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) + } + s.NeedsRepainting = value case "is_viewed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field is_viewed: %w", err) } s.IsViewed = value case "size": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: 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#bdeedde0: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field covers: %w", err) } s.Covers = append(s.Covers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#bdeedde0: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#cbbbedfd: field covers: %w", err) } default: return b.Skip() @@ -656,6 +683,14 @@ func (s *StickerSetInfo) GetStickerType() (value StickerTypeClass) { return s.StickerType } +// GetNeedsRepainting returns value of NeedsRepainting field. +func (s *StickerSetInfo) GetNeedsRepainting() (value bool) { + if s == nil { + return + } + return s.NeedsRepainting +} + // GetIsViewed returns value of IsViewed field. func (s *StickerSetInfo) GetIsViewed() (value bool) { if s == nil { diff --git a/tdapi/tl_store_payment_purpose_gen.go b/tdapi/tl_store_payment_purpose_gen.go index 5f1258a0e0..ed92a5c08a 100644 --- a/tdapi/tl_store_payment_purpose_gen.go +++ b/tdapi/tl_store_payment_purpose_gen.go @@ -234,7 +234,7 @@ func (s *StorePaymentPurposePremiumSubscription) GetIsUpgrade() (value bool) { // StorePaymentPurposeGiftedPremium represents TL type `storePaymentPurposeGiftedPremium#7240c0d1`. type StorePaymentPurposeGiftedPremium struct { - // Identifier of the user for which Premium was gifted + // Identifier of the user to which Premium was gifted UserID int64 // ISO 4217 currency code of the payment currency Currency string @@ -466,6 +466,533 @@ func (s *StorePaymentPurposeGiftedPremium) GetAmount() (value int64) { return s.Amount } +// StorePaymentPurposePremiumGiftCodes represents TL type `storePaymentPurposePremiumGiftCodes#9e11cf42`. +type StorePaymentPurposePremiumGiftCodes struct { + // Identifier of the channel chat, which will be automatically boosted by the users for + // duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatID int64 + // ISO 4217 currency code of the payment currency + Currency string + // Paid amount, in the smallest units of the currency + Amount int64 + // Identifiers of the users which can activate the gift codes + UserIDs []int64 +} + +// StorePaymentPurposePremiumGiftCodesTypeID is TL type id of StorePaymentPurposePremiumGiftCodes. +const StorePaymentPurposePremiumGiftCodesTypeID = 0x9e11cf42 + +// construct implements constructor of StorePaymentPurposeClass. +func (s StorePaymentPurposePremiumGiftCodes) construct() StorePaymentPurposeClass { return &s } + +// Ensuring interfaces in compile-time for StorePaymentPurposePremiumGiftCodes. +var ( + _ bin.Encoder = &StorePaymentPurposePremiumGiftCodes{} + _ bin.Decoder = &StorePaymentPurposePremiumGiftCodes{} + _ bin.BareEncoder = &StorePaymentPurposePremiumGiftCodes{} + _ bin.BareDecoder = &StorePaymentPurposePremiumGiftCodes{} + + _ StorePaymentPurposeClass = &StorePaymentPurposePremiumGiftCodes{} +) + +func (s *StorePaymentPurposePremiumGiftCodes) Zero() bool { + if s == nil { + return true + } + if !(s.BoostedChatID == 0) { + return false + } + if !(s.Currency == "") { + return false + } + if !(s.Amount == 0) { + return false + } + if !(s.UserIDs == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StorePaymentPurposePremiumGiftCodes) String() string { + if s == nil { + return "StorePaymentPurposePremiumGiftCodes(nil)" + } + type Alias StorePaymentPurposePremiumGiftCodes + return fmt.Sprintf("StorePaymentPurposePremiumGiftCodes%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StorePaymentPurposePremiumGiftCodes) TypeID() uint32 { + return StorePaymentPurposePremiumGiftCodesTypeID +} + +// TypeName returns name of type in TL schema. +func (*StorePaymentPurposePremiumGiftCodes) TypeName() string { + return "storePaymentPurposePremiumGiftCodes" +} + +// TypeInfo returns info about TL type. +func (s *StorePaymentPurposePremiumGiftCodes) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storePaymentPurposePremiumGiftCodes", + ID: StorePaymentPurposePremiumGiftCodesTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BoostedChatID", + SchemaName: "boosted_chat_id", + }, + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + { + Name: "UserIDs", + SchemaName: "user_ids", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StorePaymentPurposePremiumGiftCodes) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiftCodes#9e11cf42 as nil") + } + b.PutID(StorePaymentPurposePremiumGiftCodesTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StorePaymentPurposePremiumGiftCodes) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiftCodes#9e11cf42 as nil") + } + b.PutInt53(s.BoostedChatID) + b.PutString(s.Currency) + b.PutInt53(s.Amount) + b.PutInt(len(s.UserIDs)) + for _, v := range s.UserIDs { + b.PutInt53(v) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StorePaymentPurposePremiumGiftCodes) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiftCodes#9e11cf42 to nil") + } + if err := b.ConsumeID(StorePaymentPurposePremiumGiftCodesTypeID); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StorePaymentPurposePremiumGiftCodes) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiftCodes#9e11cf42 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field boosted_chat_id: %w", err) + } + s.BoostedChatID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field currency: %w", err) + } + s.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field amount: %w", err) + } + s.Amount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field user_ids: %w", err) + } + + if headerLen > 0 { + s.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 storePaymentPurposePremiumGiftCodes#9e11cf42: field user_ids: %w", err) + } + s.UserIDs = append(s.UserIDs, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StorePaymentPurposePremiumGiftCodes) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiftCodes#9e11cf42 as nil") + } + b.ObjStart() + b.PutID("storePaymentPurposePremiumGiftCodes") + b.Comma() + b.FieldStart("boosted_chat_id") + b.PutInt53(s.BoostedChatID) + b.Comma() + b.FieldStart("currency") + b.PutString(s.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(s.Amount) + b.Comma() + b.FieldStart("user_ids") + b.ArrStart() + for _, v := range s.UserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StorePaymentPurposePremiumGiftCodes) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiftCodes#9e11cf42 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storePaymentPurposePremiumGiftCodes"); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: %w", err) + } + case "boosted_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field boosted_chat_id: %w", err) + } + s.BoostedChatID = value + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field currency: %w", err) + } + s.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field amount: %w", err) + } + s.Amount = value + 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 storePaymentPurposePremiumGiftCodes#9e11cf42: field user_ids: %w", err) + } + s.UserIDs = append(s.UserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiftCodes#9e11cf42: field user_ids: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetBoostedChatID returns value of BoostedChatID field. +func (s *StorePaymentPurposePremiumGiftCodes) GetBoostedChatID() (value int64) { + if s == nil { + return + } + return s.BoostedChatID +} + +// GetCurrency returns value of Currency field. +func (s *StorePaymentPurposePremiumGiftCodes) GetCurrency() (value string) { + if s == nil { + return + } + return s.Currency +} + +// GetAmount returns value of Amount field. +func (s *StorePaymentPurposePremiumGiftCodes) GetAmount() (value int64) { + if s == nil { + return + } + return s.Amount +} + +// GetUserIDs returns value of UserIDs field. +func (s *StorePaymentPurposePremiumGiftCodes) GetUserIDs() (value []int64) { + if s == nil { + return + } + return s.UserIDs +} + +// StorePaymentPurposePremiumGiveaway represents TL type `storePaymentPurposePremiumGiveaway#504790d9`. +type StorePaymentPurposePremiumGiveaway struct { + // Giveaway parameters + Parameters PremiumGiveawayParameters + // ISO 4217 currency code of the payment currency + Currency string + // Paid amount, in the smallest units of the currency + Amount int64 +} + +// StorePaymentPurposePremiumGiveawayTypeID is TL type id of StorePaymentPurposePremiumGiveaway. +const StorePaymentPurposePremiumGiveawayTypeID = 0x504790d9 + +// construct implements constructor of StorePaymentPurposeClass. +func (s StorePaymentPurposePremiumGiveaway) construct() StorePaymentPurposeClass { return &s } + +// Ensuring interfaces in compile-time for StorePaymentPurposePremiumGiveaway. +var ( + _ bin.Encoder = &StorePaymentPurposePremiumGiveaway{} + _ bin.Decoder = &StorePaymentPurposePremiumGiveaway{} + _ bin.BareEncoder = &StorePaymentPurposePremiumGiveaway{} + _ bin.BareDecoder = &StorePaymentPurposePremiumGiveaway{} + + _ StorePaymentPurposeClass = &StorePaymentPurposePremiumGiveaway{} +) + +func (s *StorePaymentPurposePremiumGiveaway) Zero() bool { + if s == nil { + return true + } + if !(s.Parameters.Zero()) { + return false + } + if !(s.Currency == "") { + return false + } + if !(s.Amount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StorePaymentPurposePremiumGiveaway) String() string { + if s == nil { + return "StorePaymentPurposePremiumGiveaway(nil)" + } + type Alias StorePaymentPurposePremiumGiveaway + return fmt.Sprintf("StorePaymentPurposePremiumGiveaway%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StorePaymentPurposePremiumGiveaway) TypeID() uint32 { + return StorePaymentPurposePremiumGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*StorePaymentPurposePremiumGiveaway) TypeName() string { + return "storePaymentPurposePremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (s *StorePaymentPurposePremiumGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storePaymentPurposePremiumGiveaway", + ID: StorePaymentPurposePremiumGiveawayTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Parameters", + SchemaName: "parameters", + }, + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StorePaymentPurposePremiumGiveaway) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiveaway#504790d9 as nil") + } + b.PutID(StorePaymentPurposePremiumGiveawayTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StorePaymentPurposePremiumGiveaway) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiveaway#504790d9 as nil") + } + if err := s.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode storePaymentPurposePremiumGiveaway#504790d9: field parameters: %w", err) + } + b.PutString(s.Currency) + b.PutInt53(s.Amount) + return nil +} + +// Decode implements bin.Decoder. +func (s *StorePaymentPurposePremiumGiveaway) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiveaway#504790d9 to nil") + } + if err := b.ConsumeID(StorePaymentPurposePremiumGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StorePaymentPurposePremiumGiveaway) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiveaway#504790d9 to nil") + } + { + if err := s.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field parameters: %w", err) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field currency: %w", err) + } + s.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field amount: %w", err) + } + s.Amount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StorePaymentPurposePremiumGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storePaymentPurposePremiumGiveaway#504790d9 as nil") + } + b.ObjStart() + b.PutID("storePaymentPurposePremiumGiveaway") + b.Comma() + b.FieldStart("parameters") + if err := s.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storePaymentPurposePremiumGiveaway#504790d9: field parameters: %w", err) + } + b.Comma() + b.FieldStart("currency") + b.PutString(s.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(s.Amount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StorePaymentPurposePremiumGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storePaymentPurposePremiumGiveaway#504790d9 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storePaymentPurposePremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: %w", err) + } + case "parameters": + if err := s.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field parameters: %w", err) + } + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field currency: %w", err) + } + s.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storePaymentPurposePremiumGiveaway#504790d9: field amount: %w", err) + } + s.Amount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetParameters returns value of Parameters field. +func (s *StorePaymentPurposePremiumGiveaway) GetParameters() (value PremiumGiveawayParameters) { + if s == nil { + return + } + return s.Parameters +} + +// GetCurrency returns value of Currency field. +func (s *StorePaymentPurposePremiumGiveaway) GetCurrency() (value string) { + if s == nil { + return + } + return s.Currency +} + +// GetAmount returns value of Amount field. +func (s *StorePaymentPurposePremiumGiveaway) GetAmount() (value int64) { + if s == nil { + return + } + return s.Amount +} + // StorePaymentPurposeClassName is schema name of StorePaymentPurposeClass. const StorePaymentPurposeClassName = "StorePaymentPurpose" @@ -480,6 +1007,8 @@ const StorePaymentPurposeClassName = "StorePaymentPurpose" // switch v := g.(type) { // case *tdapi.StorePaymentPurposePremiumSubscription: // storePaymentPurposePremiumSubscription#4b558114 // case *tdapi.StorePaymentPurposeGiftedPremium: // storePaymentPurposeGiftedPremium#7240c0d1 +// case *tdapi.StorePaymentPurposePremiumGiftCodes: // storePaymentPurposePremiumGiftCodes#9e11cf42 +// case *tdapi.StorePaymentPurposePremiumGiveaway: // storePaymentPurposePremiumGiveaway#504790d9 // default: panic(v) // } type StorePaymentPurposeClass interface { @@ -525,6 +1054,20 @@ func DecodeStorePaymentPurpose(buf *bin.Buffer) (StorePaymentPurposeClass, error return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) } return &v, nil + case StorePaymentPurposePremiumGiftCodesTypeID: + // Decoding storePaymentPurposePremiumGiftCodes#9e11cf42. + v := StorePaymentPurposePremiumGiftCodes{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) + } + return &v, nil + case StorePaymentPurposePremiumGiveawayTypeID: + // Decoding storePaymentPurposePremiumGiveaway#504790d9. + v := StorePaymentPurposePremiumGiveaway{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", bin.NewUnexpectedID(id)) } @@ -551,6 +1094,20 @@ func DecodeTDLibJSONStorePaymentPurpose(buf tdjson.Decoder) (StorePaymentPurpose return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) } return &v, nil + case "storePaymentPurposePremiumGiftCodes": + // Decoding storePaymentPurposePremiumGiftCodes#9e11cf42. + v := StorePaymentPurposePremiumGiftCodes{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) + } + return &v, nil + case "storePaymentPurposePremiumGiveaway": + // Decoding storePaymentPurposePremiumGiveaway#504790d9. + v := StorePaymentPurposePremiumGiveaway{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode StorePaymentPurposeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_telegram_payment_purpose_gen.go b/tdapi/tl_telegram_payment_purpose_gen.go new file mode 100644 index 0000000000..8c9406b4fd --- /dev/null +++ b/tdapi/tl_telegram_payment_purpose_gen.go @@ -0,0 +1,805 @@ +// 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{} +) + +// TelegramPaymentPurposePremiumGiftCodes represents TL type `telegramPaymentPurposePremiumGiftCodes#91009cc`. +type TelegramPaymentPurposePremiumGiftCodes struct { + // Identifier of the channel chat, which will be automatically boosted by the users for + // duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatID int64 + // ISO 4217 currency code of the payment currency + Currency string + // Paid amount, in the smallest units of the currency + 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 + MonthCount int32 +} + +// TelegramPaymentPurposePremiumGiftCodesTypeID is TL type id of TelegramPaymentPurposePremiumGiftCodes. +const TelegramPaymentPurposePremiumGiftCodesTypeID = 0x91009cc + +// construct implements constructor of TelegramPaymentPurposeClass. +func (t TelegramPaymentPurposePremiumGiftCodes) construct() TelegramPaymentPurposeClass { return &t } + +// Ensuring interfaces in compile-time for TelegramPaymentPurposePremiumGiftCodes. +var ( + _ bin.Encoder = &TelegramPaymentPurposePremiumGiftCodes{} + _ bin.Decoder = &TelegramPaymentPurposePremiumGiftCodes{} + _ bin.BareEncoder = &TelegramPaymentPurposePremiumGiftCodes{} + _ bin.BareDecoder = &TelegramPaymentPurposePremiumGiftCodes{} + + _ TelegramPaymentPurposeClass = &TelegramPaymentPurposePremiumGiftCodes{} +) + +func (t *TelegramPaymentPurposePremiumGiftCodes) Zero() bool { + if t == nil { + return true + } + if !(t.BoostedChatID == 0) { + return false + } + if !(t.Currency == "") { + return false + } + if !(t.Amount == 0) { + return false + } + if !(t.UserIDs == nil) { + return false + } + if !(t.MonthCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *TelegramPaymentPurposePremiumGiftCodes) String() string { + if t == nil { + return "TelegramPaymentPurposePremiumGiftCodes(nil)" + } + type Alias TelegramPaymentPurposePremiumGiftCodes + return fmt.Sprintf("TelegramPaymentPurposePremiumGiftCodes%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*TelegramPaymentPurposePremiumGiftCodes) TypeID() uint32 { + return TelegramPaymentPurposePremiumGiftCodesTypeID +} + +// TypeName returns name of type in TL schema. +func (*TelegramPaymentPurposePremiumGiftCodes) TypeName() string { + return "telegramPaymentPurposePremiumGiftCodes" +} + +// TypeInfo returns info about TL type. +func (t *TelegramPaymentPurposePremiumGiftCodes) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "telegramPaymentPurposePremiumGiftCodes", + ID: TelegramPaymentPurposePremiumGiftCodesTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BoostedChatID", + SchemaName: "boosted_chat_id", + }, + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + { + Name: "UserIDs", + SchemaName: "user_ids", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiftCodes#91009cc as nil") + } + b.PutID(TelegramPaymentPurposePremiumGiftCodesTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiftCodes#91009cc as nil") + } + b.PutInt53(t.BoostedChatID) + b.PutString(t.Currency) + b.PutInt53(t.Amount) + b.PutInt(len(t.UserIDs)) + for _, v := range t.UserIDs { + b.PutInt53(v) + } + b.PutInt32(t.MonthCount) + return nil +} + +// Decode implements bin.Decoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiftCodes#91009cc to nil") + } + if err := b.ConsumeID(TelegramPaymentPurposePremiumGiftCodesTypeID); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiftCodes#91009cc to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field boosted_chat_id: %w", err) + } + t.BoostedChatID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field currency: %w", err) + } + t.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field amount: %w", err) + } + t.Amount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field user_ids: %w", err) + } + + if headerLen > 0 { + t.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 telegramPaymentPurposePremiumGiftCodes#91009cc: field user_ids: %w", err) + } + t.UserIDs = append(t.UserIDs, value) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field month_count: %w", err) + } + t.MonthCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiftCodes#91009cc as nil") + } + b.ObjStart() + b.PutID("telegramPaymentPurposePremiumGiftCodes") + b.Comma() + b.FieldStart("boosted_chat_id") + b.PutInt53(t.BoostedChatID) + b.Comma() + b.FieldStart("currency") + b.PutString(t.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(t.Amount) + b.Comma() + b.FieldStart("user_ids") + b.ArrStart() + for _, v := range t.UserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("month_count") + b.PutInt32(t.MonthCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *TelegramPaymentPurposePremiumGiftCodes) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiftCodes#91009cc to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("telegramPaymentPurposePremiumGiftCodes"); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: %w", err) + } + case "boosted_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field boosted_chat_id: %w", err) + } + t.BoostedChatID = value + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field currency: %w", err) + } + t.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field amount: %w", err) + } + t.Amount = value + 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 telegramPaymentPurposePremiumGiftCodes#91009cc: field user_ids: %w", err) + } + t.UserIDs = append(t.UserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field user_ids: %w", err) + } + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiftCodes#91009cc: field month_count: %w", err) + } + t.MonthCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBoostedChatID returns value of BoostedChatID field. +func (t *TelegramPaymentPurposePremiumGiftCodes) GetBoostedChatID() (value int64) { + if t == nil { + return + } + return t.BoostedChatID +} + +// GetCurrency returns value of Currency field. +func (t *TelegramPaymentPurposePremiumGiftCodes) GetCurrency() (value string) { + if t == nil { + return + } + return t.Currency +} + +// GetAmount returns value of Amount field. +func (t *TelegramPaymentPurposePremiumGiftCodes) GetAmount() (value int64) { + if t == nil { + return + } + return t.Amount +} + +// GetUserIDs returns value of UserIDs field. +func (t *TelegramPaymentPurposePremiumGiftCodes) GetUserIDs() (value []int64) { + if t == nil { + return + } + return t.UserIDs +} + +// GetMonthCount returns value of MonthCount field. +func (t *TelegramPaymentPurposePremiumGiftCodes) GetMonthCount() (value int32) { + if t == nil { + return + } + return t.MonthCount +} + +// TelegramPaymentPurposePremiumGiveaway represents TL type `telegramPaymentPurposePremiumGiveaway#bfd4a227`. +type TelegramPaymentPurposePremiumGiveaway struct { + // Giveaway parameters + Parameters PremiumGiveawayParameters + // ISO 4217 currency code of the payment currency + Currency string + // Paid amount, in the smallest units of the currency + 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 + MonthCount int32 +} + +// TelegramPaymentPurposePremiumGiveawayTypeID is TL type id of TelegramPaymentPurposePremiumGiveaway. +const TelegramPaymentPurposePremiumGiveawayTypeID = 0xbfd4a227 + +// construct implements constructor of TelegramPaymentPurposeClass. +func (t TelegramPaymentPurposePremiumGiveaway) construct() TelegramPaymentPurposeClass { return &t } + +// Ensuring interfaces in compile-time for TelegramPaymentPurposePremiumGiveaway. +var ( + _ bin.Encoder = &TelegramPaymentPurposePremiumGiveaway{} + _ bin.Decoder = &TelegramPaymentPurposePremiumGiveaway{} + _ bin.BareEncoder = &TelegramPaymentPurposePremiumGiveaway{} + _ bin.BareDecoder = &TelegramPaymentPurposePremiumGiveaway{} + + _ TelegramPaymentPurposeClass = &TelegramPaymentPurposePremiumGiveaway{} +) + +func (t *TelegramPaymentPurposePremiumGiveaway) Zero() bool { + if t == nil { + return true + } + if !(t.Parameters.Zero()) { + return false + } + if !(t.Currency == "") { + return false + } + if !(t.Amount == 0) { + return false + } + if !(t.WinnerCount == 0) { + return false + } + if !(t.MonthCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *TelegramPaymentPurposePremiumGiveaway) String() string { + if t == nil { + return "TelegramPaymentPurposePremiumGiveaway(nil)" + } + type Alias TelegramPaymentPurposePremiumGiveaway + return fmt.Sprintf("TelegramPaymentPurposePremiumGiveaway%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*TelegramPaymentPurposePremiumGiveaway) TypeID() uint32 { + return TelegramPaymentPurposePremiumGiveawayTypeID +} + +// TypeName returns name of type in TL schema. +func (*TelegramPaymentPurposePremiumGiveaway) TypeName() string { + return "telegramPaymentPurposePremiumGiveaway" +} + +// TypeInfo returns info about TL type. +func (t *TelegramPaymentPurposePremiumGiveaway) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "telegramPaymentPurposePremiumGiveaway", + ID: TelegramPaymentPurposePremiumGiveawayTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Parameters", + SchemaName: "parameters", + }, + { + Name: "Currency", + SchemaName: "currency", + }, + { + Name: "Amount", + SchemaName: "amount", + }, + { + Name: "WinnerCount", + SchemaName: "winner_count", + }, + { + Name: "MonthCount", + SchemaName: "month_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *TelegramPaymentPurposePremiumGiveaway) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiveaway#bfd4a227 as nil") + } + b.PutID(TelegramPaymentPurposePremiumGiveawayTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *TelegramPaymentPurposePremiumGiveaway) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiveaway#bfd4a227 as nil") + } + if err := t.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode telegramPaymentPurposePremiumGiveaway#bfd4a227: field parameters: %w", err) + } + b.PutString(t.Currency) + b.PutInt53(t.Amount) + b.PutInt32(t.WinnerCount) + b.PutInt32(t.MonthCount) + return nil +} + +// Decode implements bin.Decoder. +func (t *TelegramPaymentPurposePremiumGiveaway) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiveaway#bfd4a227 to nil") + } + if err := b.ConsumeID(TelegramPaymentPurposePremiumGiveawayTypeID); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *TelegramPaymentPurposePremiumGiveaway) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiveaway#bfd4a227 to nil") + } + { + if err := t.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field parameters: %w", err) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field currency: %w", err) + } + t.Currency = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field amount: %w", err) + } + t.Amount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field winner_count: %w", err) + } + t.WinnerCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field month_count: %w", err) + } + t.MonthCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *TelegramPaymentPurposePremiumGiveaway) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode telegramPaymentPurposePremiumGiveaway#bfd4a227 as nil") + } + b.ObjStart() + b.PutID("telegramPaymentPurposePremiumGiveaway") + b.Comma() + b.FieldStart("parameters") + if err := t.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode telegramPaymentPurposePremiumGiveaway#bfd4a227: field parameters: %w", err) + } + b.Comma() + b.FieldStart("currency") + b.PutString(t.Currency) + b.Comma() + b.FieldStart("amount") + b.PutInt53(t.Amount) + b.Comma() + b.FieldStart("winner_count") + b.PutInt32(t.WinnerCount) + b.Comma() + b.FieldStart("month_count") + b.PutInt32(t.MonthCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *TelegramPaymentPurposePremiumGiveaway) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode telegramPaymentPurposePremiumGiveaway#bfd4a227 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("telegramPaymentPurposePremiumGiveaway"); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: %w", err) + } + case "parameters": + if err := t.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field parameters: %w", err) + } + case "currency": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field currency: %w", err) + } + t.Currency = value + case "amount": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field amount: %w", err) + } + t.Amount = value + case "winner_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field winner_count: %w", err) + } + t.WinnerCount = value + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode telegramPaymentPurposePremiumGiveaway#bfd4a227: field month_count: %w", err) + } + t.MonthCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetParameters returns value of Parameters field. +func (t *TelegramPaymentPurposePremiumGiveaway) GetParameters() (value PremiumGiveawayParameters) { + if t == nil { + return + } + return t.Parameters +} + +// GetCurrency returns value of Currency field. +func (t *TelegramPaymentPurposePremiumGiveaway) GetCurrency() (value string) { + if t == nil { + return + } + return t.Currency +} + +// GetAmount returns value of Amount field. +func (t *TelegramPaymentPurposePremiumGiveaway) GetAmount() (value int64) { + if t == nil { + return + } + return t.Amount +} + +// GetWinnerCount returns value of WinnerCount field. +func (t *TelegramPaymentPurposePremiumGiveaway) GetWinnerCount() (value int32) { + if t == nil { + return + } + return t.WinnerCount +} + +// GetMonthCount returns value of MonthCount field. +func (t *TelegramPaymentPurposePremiumGiveaway) GetMonthCount() (value int32) { + if t == nil { + return + } + return t.MonthCount +} + +// TelegramPaymentPurposeClassName is schema name of TelegramPaymentPurposeClass. +const TelegramPaymentPurposeClassName = "TelegramPaymentPurpose" + +// TelegramPaymentPurposeClass represents TelegramPaymentPurpose generic type. +// +// Example: +// +// g, err := tdapi.DecodeTelegramPaymentPurpose(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.TelegramPaymentPurposePremiumGiftCodes: // telegramPaymentPurposePremiumGiftCodes#91009cc +// case *tdapi.TelegramPaymentPurposePremiumGiveaway: // telegramPaymentPurposePremiumGiveaway#bfd4a227 +// default: panic(v) +// } +type TelegramPaymentPurposeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() TelegramPaymentPurposeClass + + // 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 + + // ISO 4217 currency code of the payment currency + 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 + GetMonthCount() (value int32) +} + +// DecodeTelegramPaymentPurpose implements binary de-serialization for TelegramPaymentPurposeClass. +func DecodeTelegramPaymentPurpose(buf *bin.Buffer) (TelegramPaymentPurposeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case TelegramPaymentPurposePremiumGiftCodesTypeID: + // Decoding telegramPaymentPurposePremiumGiftCodes#91009cc. + v := TelegramPaymentPurposePremiumGiftCodes{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", err) + } + return &v, nil + case TelegramPaymentPurposePremiumGiveawayTypeID: + // Decoding telegramPaymentPurposePremiumGiveaway#bfd4a227. + v := TelegramPaymentPurposePremiumGiveaway{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONTelegramPaymentPurpose implements binary de-serialization for TelegramPaymentPurposeClass. +func DecodeTDLibJSONTelegramPaymentPurpose(buf tdjson.Decoder) (TelegramPaymentPurposeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "telegramPaymentPurposePremiumGiftCodes": + // Decoding telegramPaymentPurposePremiumGiftCodes#91009cc. + v := TelegramPaymentPurposePremiumGiftCodes{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", err) + } + return &v, nil + case "telegramPaymentPurposePremiumGiveaway": + // Decoding telegramPaymentPurposePremiumGiveaway#bfd4a227. + v := TelegramPaymentPurposePremiumGiveaway{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode TelegramPaymentPurposeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// TelegramPaymentPurpose boxes the TelegramPaymentPurposeClass providing a helper. +type TelegramPaymentPurposeBox struct { + TelegramPaymentPurpose TelegramPaymentPurposeClass +} + +// Decode implements bin.Decoder for TelegramPaymentPurposeBox. +func (b *TelegramPaymentPurposeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode TelegramPaymentPurposeBox to nil") + } + v, err := DecodeTelegramPaymentPurpose(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.TelegramPaymentPurpose = v + return nil +} + +// Encode implements bin.Encode for TelegramPaymentPurposeBox. +func (b *TelegramPaymentPurposeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.TelegramPaymentPurpose == nil { + return fmt.Errorf("unable to encode TelegramPaymentPurposeClass as nil") + } + return b.TelegramPaymentPurpose.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for TelegramPaymentPurposeBox. +func (b *TelegramPaymentPurposeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode TelegramPaymentPurposeBox to nil") + } + v, err := DecodeTDLibJSONTelegramPaymentPurpose(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.TelegramPaymentPurpose = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for TelegramPaymentPurposeBox. +func (b *TelegramPaymentPurposeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.TelegramPaymentPurpose == nil { + return fmt.Errorf("unable to encode TelegramPaymentPurposeClass as nil") + } + return b.TelegramPaymentPurpose.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_text_entity_type_gen.go b/tdapi/tl_text_entity_type_gen.go index baa88b584f..07d3d32724 100644 --- a/tdapi/tl_text_entity_type_gen.go +++ b/tdapi/tl_text_entity_type_gen.go @@ -2162,6 +2162,137 @@ func (t *TextEntityTypePreCode) GetLanguage() (value string) { return t.Language } +// TextEntityTypeBlockQuote represents TL type `textEntityTypeBlockQuote#c42830c8`. +type TextEntityTypeBlockQuote struct { +} + +// TextEntityTypeBlockQuoteTypeID is TL type id of TextEntityTypeBlockQuote. +const TextEntityTypeBlockQuoteTypeID = 0xc42830c8 + +// construct implements constructor of TextEntityTypeClass. +func (t TextEntityTypeBlockQuote) construct() TextEntityTypeClass { return &t } + +// Ensuring interfaces in compile-time for TextEntityTypeBlockQuote. +var ( + _ bin.Encoder = &TextEntityTypeBlockQuote{} + _ bin.Decoder = &TextEntityTypeBlockQuote{} + _ bin.BareEncoder = &TextEntityTypeBlockQuote{} + _ bin.BareDecoder = &TextEntityTypeBlockQuote{} + + _ TextEntityTypeClass = &TextEntityTypeBlockQuote{} +) + +func (t *TextEntityTypeBlockQuote) Zero() bool { + if t == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (t *TextEntityTypeBlockQuote) String() string { + if t == nil { + return "TextEntityTypeBlockQuote(nil)" + } + type Alias TextEntityTypeBlockQuote + return fmt.Sprintf("TextEntityTypeBlockQuote%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*TextEntityTypeBlockQuote) TypeID() uint32 { + return TextEntityTypeBlockQuoteTypeID +} + +// TypeName returns name of type in TL schema. +func (*TextEntityTypeBlockQuote) TypeName() string { + return "textEntityTypeBlockQuote" +} + +// TypeInfo returns info about TL type. +func (t *TextEntityTypeBlockQuote) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "textEntityTypeBlockQuote", + ID: TextEntityTypeBlockQuoteTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (t *TextEntityTypeBlockQuote) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode textEntityTypeBlockQuote#c42830c8 as nil") + } + b.PutID(TextEntityTypeBlockQuoteTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *TextEntityTypeBlockQuote) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode textEntityTypeBlockQuote#c42830c8 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (t *TextEntityTypeBlockQuote) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode textEntityTypeBlockQuote#c42830c8 to nil") + } + if err := b.ConsumeID(TextEntityTypeBlockQuoteTypeID); err != nil { + return fmt.Errorf("unable to decode textEntityTypeBlockQuote#c42830c8: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *TextEntityTypeBlockQuote) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode textEntityTypeBlockQuote#c42830c8 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *TextEntityTypeBlockQuote) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode textEntityTypeBlockQuote#c42830c8 as nil") + } + b.ObjStart() + b.PutID("textEntityTypeBlockQuote") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *TextEntityTypeBlockQuote) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode textEntityTypeBlockQuote#c42830c8 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("textEntityTypeBlockQuote"); err != nil { + return fmt.Errorf("unable to decode textEntityTypeBlockQuote#c42830c8: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // TextEntityTypeTextURL represents TL type `textEntityTypeTextUrl#1a912463`. type TextEntityTypeTextURL struct { // HTTP or tg:// URL to be opened when the link is clicked @@ -2856,6 +2987,7 @@ const TextEntityTypeClassName = "TextEntityType" // case *tdapi.TextEntityTypeCode: // textEntityTypeCode#c5e9c94a // case *tdapi.TextEntityTypePre: // textEntityTypePre#62491c8e // case *tdapi.TextEntityTypePreCode: // textEntityTypePreCode#c7a77aab +// case *tdapi.TextEntityTypeBlockQuote: // textEntityTypeBlockQuote#c42830c8 // case *tdapi.TextEntityTypeTextURL: // textEntityTypeTextUrl#1a912463 // case *tdapi.TextEntityTypeMentionName: // textEntityTypeMentionName#a25cd5af // case *tdapi.TextEntityTypeCustomEmoji: // textEntityTypeCustomEmoji#66ceacc5 @@ -3003,6 +3135,13 @@ func DecodeTextEntityType(buf *bin.Buffer) (TextEntityTypeClass, error) { return nil, fmt.Errorf("unable to decode TextEntityTypeClass: %w", err) } return &v, nil + case TextEntityTypeBlockQuoteTypeID: + // Decoding textEntityTypeBlockQuote#c42830c8. + v := TextEntityTypeBlockQuote{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode TextEntityTypeClass: %w", err) + } + return &v, nil case TextEntityTypeTextURLTypeID: // Decoding textEntityTypeTextUrl#1a912463. v := TextEntityTypeTextURL{} @@ -3155,6 +3294,13 @@ func DecodeTDLibJSONTextEntityType(buf tdjson.Decoder) (TextEntityTypeClass, err return nil, fmt.Errorf("unable to decode TextEntityTypeClass: %w", err) } return &v, nil + case "textEntityTypeBlockQuote": + // Decoding textEntityTypeBlockQuote#c42830c8. + v := TextEntityTypeBlockQuote{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode TextEntityTypeClass: %w", err) + } + return &v, nil case "textEntityTypeTextUrl": // Decoding textEntityTypeTextUrl#1a912463. v := TextEntityTypeTextURL{} diff --git a/tdapi/tl_theme_parameters_gen.go b/tdapi/tl_theme_parameters_gen.go index 4952422aab..7c821d84a7 100644 --- a/tdapi/tl_theme_parameters_gen.go +++ b/tdapi/tl_theme_parameters_gen.go @@ -31,14 +31,26 @@ var ( _ = tdjson.Encoder{} ) -// ThemeParameters represents TL type `themeParameters#d990fe6e`. +// ThemeParameters represents TL type `themeParameters#af3f42fc`. type ThemeParameters struct { // A color of the background in the RGB24 format BackgroundColor int32 // A secondary color for the background in the RGB24 format SecondaryBackgroundColor int32 + // A color of the header background in the RGB24 format + HeaderBackgroundColor int32 + // A color of the section background in the RGB24 format + SectionBackgroundColor int32 // A color of text in the RGB24 format TextColor int32 + // An accent color of the text in the RGB24 format + AccentTextColor int32 + // A color of text on the section headers in the RGB24 format + SectionHeaderTextColor int32 + // A color of the subtitle text in the RGB24 format + SubtitleTextColor int32 + // A color of the text for destructive actions in the RGB24 format + DestructiveTextColor int32 // A color of hints in the RGB24 format HintColor int32 // A color of links in the RGB24 format @@ -50,7 +62,7 @@ type ThemeParameters struct { } // ThemeParametersTypeID is TL type id of ThemeParameters. -const ThemeParametersTypeID = 0xd990fe6e +const ThemeParametersTypeID = 0xaf3f42fc // Ensuring interfaces in compile-time for ThemeParameters. var ( @@ -70,9 +82,27 @@ func (t *ThemeParameters) Zero() bool { if !(t.SecondaryBackgroundColor == 0) { return false } + if !(t.HeaderBackgroundColor == 0) { + return false + } + if !(t.SectionBackgroundColor == 0) { + return false + } if !(t.TextColor == 0) { return false } + if !(t.AccentTextColor == 0) { + return false + } + if !(t.SectionHeaderTextColor == 0) { + return false + } + if !(t.SubtitleTextColor == 0) { + return false + } + if !(t.DestructiveTextColor == 0) { + return false + } if !(t.HintColor == 0) { return false } @@ -129,10 +159,34 @@ func (t *ThemeParameters) TypeInfo() tdp.Type { Name: "SecondaryBackgroundColor", SchemaName: "secondary_background_color", }, + { + Name: "HeaderBackgroundColor", + SchemaName: "header_background_color", + }, + { + Name: "SectionBackgroundColor", + SchemaName: "section_background_color", + }, { Name: "TextColor", SchemaName: "text_color", }, + { + Name: "AccentTextColor", + SchemaName: "accent_text_color", + }, + { + Name: "SectionHeaderTextColor", + SchemaName: "section_header_text_color", + }, + { + Name: "SubtitleTextColor", + SchemaName: "subtitle_text_color", + }, + { + Name: "DestructiveTextColor", + SchemaName: "destructive_text_color", + }, { Name: "HintColor", SchemaName: "hint_color", @@ -156,7 +210,7 @@ func (t *ThemeParameters) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (t *ThemeParameters) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#d990fe6e as nil") + return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") } b.PutID(ThemeParametersTypeID) return t.EncodeBare(b) @@ -165,11 +219,17 @@ func (t *ThemeParameters) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *ThemeParameters) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#d990fe6e as nil") + return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") } b.PutInt32(t.BackgroundColor) b.PutInt32(t.SecondaryBackgroundColor) + b.PutInt32(t.HeaderBackgroundColor) + b.PutInt32(t.SectionBackgroundColor) b.PutInt32(t.TextColor) + b.PutInt32(t.AccentTextColor) + b.PutInt32(t.SectionHeaderTextColor) + b.PutInt32(t.SubtitleTextColor) + b.PutInt32(t.DestructiveTextColor) b.PutInt32(t.HintColor) b.PutInt32(t.LinkColor) b.PutInt32(t.ButtonColor) @@ -180,10 +240,10 @@ func (t *ThemeParameters) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (t *ThemeParameters) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#d990fe6e to nil") + return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") } if err := b.ConsumeID(ThemeParametersTypeID); err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: %w", err) } return t.DecodeBare(b) } @@ -191,54 +251,96 @@ func (t *ThemeParameters) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *ThemeParameters) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#d990fe6e to nil") + return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field background_color: %w", err) } t.BackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field secondary_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field secondary_background_color: %w", err) } t.SecondaryBackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field header_background_color: %w", err) + } + t.HeaderBackgroundColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_background_color: %w", err) + } + t.SectionBackgroundColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field text_color: %w", err) } t.TextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field hint_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field accent_text_color: %w", err) + } + t.AccentTextColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_header_text_color: %w", err) + } + t.SectionHeaderTextColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field subtitle_text_color: %w", err) + } + t.SubtitleTextColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field destructive_text_color: %w", err) + } + t.DestructiveTextColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field hint_color: %w", err) } t.HintColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field link_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field link_color: %w", err) } t.LinkColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field button_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_color: %w", err) } t.ButtonColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field button_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_text_color: %w", err) } t.ButtonTextColor = value } @@ -248,7 +350,7 @@ func (t *ThemeParameters) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#d990fe6e as nil") + return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") } b.ObjStart() b.PutID("themeParameters") @@ -259,9 +361,27 @@ func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("secondary_background_color") b.PutInt32(t.SecondaryBackgroundColor) b.Comma() + b.FieldStart("header_background_color") + b.PutInt32(t.HeaderBackgroundColor) + b.Comma() + b.FieldStart("section_background_color") + b.PutInt32(t.SectionBackgroundColor) + b.Comma() b.FieldStart("text_color") b.PutInt32(t.TextColor) b.Comma() + b.FieldStart("accent_text_color") + b.PutInt32(t.AccentTextColor) + b.Comma() + b.FieldStart("section_header_text_color") + b.PutInt32(t.SectionHeaderTextColor) + b.Comma() + b.FieldStart("subtitle_text_color") + b.PutInt32(t.SubtitleTextColor) + b.Comma() + b.FieldStart("destructive_text_color") + b.PutInt32(t.DestructiveTextColor) + b.Comma() b.FieldStart("hint_color") b.PutInt32(t.HintColor) b.Comma() @@ -282,55 +402,91 @@ func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (t *ThemeParameters) DecodeTDLibJSON(b tdjson.Decoder) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#d990fe6e to nil") + return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("themeParameters"); err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: %w", err) } case "background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field background_color: %w", err) } t.BackgroundColor = value case "secondary_background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field secondary_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field secondary_background_color: %w", err) } t.SecondaryBackgroundColor = value + case "header_background_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field header_background_color: %w", err) + } + t.HeaderBackgroundColor = value + case "section_background_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_background_color: %w", err) + } + t.SectionBackgroundColor = value case "text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field text_color: %w", err) } t.TextColor = value + case "accent_text_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field accent_text_color: %w", err) + } + t.AccentTextColor = value + case "section_header_text_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_header_text_color: %w", err) + } + t.SectionHeaderTextColor = value + case "subtitle_text_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field subtitle_text_color: %w", err) + } + t.SubtitleTextColor = value + case "destructive_text_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field destructive_text_color: %w", err) + } + t.DestructiveTextColor = value case "hint_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field hint_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field hint_color: %w", err) } t.HintColor = value case "link_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field link_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field link_color: %w", err) } t.LinkColor = value case "button_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field button_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_color: %w", err) } t.ButtonColor = value case "button_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#d990fe6e: field button_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_text_color: %w", err) } t.ButtonTextColor = value default: @@ -356,6 +512,22 @@ func (t *ThemeParameters) GetSecondaryBackgroundColor() (value int32) { return t.SecondaryBackgroundColor } +// GetHeaderBackgroundColor returns value of HeaderBackgroundColor field. +func (t *ThemeParameters) GetHeaderBackgroundColor() (value int32) { + if t == nil { + return + } + return t.HeaderBackgroundColor +} + +// GetSectionBackgroundColor returns value of SectionBackgroundColor field. +func (t *ThemeParameters) GetSectionBackgroundColor() (value int32) { + if t == nil { + return + } + return t.SectionBackgroundColor +} + // GetTextColor returns value of TextColor field. func (t *ThemeParameters) GetTextColor() (value int32) { if t == nil { @@ -364,6 +536,38 @@ func (t *ThemeParameters) GetTextColor() (value int32) { return t.TextColor } +// GetAccentTextColor returns value of AccentTextColor field. +func (t *ThemeParameters) GetAccentTextColor() (value int32) { + if t == nil { + return + } + return t.AccentTextColor +} + +// GetSectionHeaderTextColor returns value of SectionHeaderTextColor field. +func (t *ThemeParameters) GetSectionHeaderTextColor() (value int32) { + if t == nil { + return + } + return t.SectionHeaderTextColor +} + +// GetSubtitleTextColor returns value of SubtitleTextColor field. +func (t *ThemeParameters) GetSubtitleTextColor() (value int32) { + if t == nil { + return + } + return t.SubtitleTextColor +} + +// GetDestructiveTextColor returns value of DestructiveTextColor field. +func (t *ThemeParameters) GetDestructiveTextColor() (value int32) { + if t == nil { + return + } + return t.DestructiveTextColor +} + // GetHintColor returns value of HintColor field. func (t *ThemeParameters) GetHintColor() (value int32) { if t == nil { diff --git a/tdapi/tl_update_gen.go b/tdapi/tl_update_gen.go index 36817845da..7fabfae00c 100644 --- a/tdapi/tl_update_gen.go +++ b/tdapi/tl_update_gen.go @@ -3494,6 +3494,406 @@ func (u *UpdateChatPhoto) GetPhoto() (value ChatPhotoInfo) { return u.Photo } +// UpdateChatAccentColor represents TL type `updateChatAccentColor#fc111634`. +type UpdateChatAccentColor struct { + // Chat identifier + ChatID int64 + // The new chat accent color identifier + AccentColorID int32 +} + +// UpdateChatAccentColorTypeID is TL type id of UpdateChatAccentColor. +const UpdateChatAccentColorTypeID = 0xfc111634 + +// construct implements constructor of UpdateClass. +func (u UpdateChatAccentColor) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateChatAccentColor. +var ( + _ bin.Encoder = &UpdateChatAccentColor{} + _ bin.Decoder = &UpdateChatAccentColor{} + _ bin.BareEncoder = &UpdateChatAccentColor{} + _ bin.BareDecoder = &UpdateChatAccentColor{} + + _ UpdateClass = &UpdateChatAccentColor{} +) + +func (u *UpdateChatAccentColor) Zero() bool { + if u == nil { + return true + } + if !(u.ChatID == 0) { + return false + } + if !(u.AccentColorID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateChatAccentColor) String() string { + if u == nil { + return "UpdateChatAccentColor(nil)" + } + type Alias UpdateChatAccentColor + return fmt.Sprintf("UpdateChatAccentColor%+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 +} + +// TypeName returns name of type in TL schema. +func (*UpdateChatAccentColor) TypeName() string { + return "updateChatAccentColor" +} + +// TypeInfo returns info about TL type. +func (u *UpdateChatAccentColor) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateChatAccentColor", + ID: UpdateChatAccentColorTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatID", + SchemaName: "chat_id", + }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateChatAccentColor) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + } + b.PutID(UpdateChatAccentColorTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateChatAccentColor) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + } + b.PutInt53(u.ChatID) + b.PutInt32(u.AccentColorID) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateChatAccentColor) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatAccentColor#fc111634 to nil") + } + if err := b.ConsumeID(UpdateChatAccentColorTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateChatAccentColor) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatAccentColor#fc111634 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: 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) + } + u.AccentColorID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateChatAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateChatAccentColor#fc111634 as nil") + } + b.ObjStart() + b.PutID("updateChatAccentColor") + b.Comma() + b.FieldStart("chat_id") + b.PutInt53(u.ChatID) + b.Comma() + b.FieldStart("accent_color_id") + b.PutInt32(u.AccentColorID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateChatAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateChatAccentColor#fc111634 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) + } + case "chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode updateChatAccentColor#fc111634: 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) + } + u.AccentColorID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetChatID returns value of ChatID field. +func (u *UpdateChatAccentColor) GetChatID() (value int64) { + if u == nil { + return + } + return u.ChatID +} + +// GetAccentColorID returns value of AccentColorID field. +func (u *UpdateChatAccentColor) 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 tdentifier of a custom emoji to be shown on the reply header background + 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 { + if u == nil { + return fmt.Errorf("can't decode updateChatBackgroundCustomEmoji#dcbad97a to nil") + } + + 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 + }) +} + +// GetChatID returns value of ChatID field. +func (u *UpdateChatBackgroundCustomEmoji) GetChatID() (value int64) { + if u == nil { + return + } + return u.ChatID +} + +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (u *UpdateChatBackgroundCustomEmoji) GetBackgroundCustomEmojiID() (value int64) { + if u == nil { + return + } + return u.BackgroundCustomEmojiID +} + // UpdateChatPermissions represents TL type `updateChatPermissions#9f52176d`. type UpdateChatPermissions struct { // Chat identifier @@ -3698,7 +4098,9 @@ func (u *UpdateChatPermissions) GetPermissions() (value ChatPermissions) { type UpdateChatLastMessage struct { // Chat identifier ChatID int64 - // The new last message in the chat; may be null + // The new last message in the chat; may be null if the last message became unknown. + // While the last message is unknown, new messages can be added to the chat without + // corresponding updateNewMessage update LastMessage Message // The new chat positions in the chat lists Positions []ChatPosition @@ -18935,31 +19337,232 @@ func (u *UpdateChatThemes) Zero() bool { } // String implements fmt.Stringer. -func (u *UpdateChatThemes) String() string { +func (u *UpdateChatThemes) String() string { + if u == nil { + return "UpdateChatThemes(nil)" + } + type Alias UpdateChatThemes + return fmt.Sprintf("UpdateChatThemes%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateChatThemes) TypeID() uint32 { + return UpdateChatThemesTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateChatThemes) TypeName() string { + return "updateChatThemes" +} + +// TypeInfo returns info about TL type. +func (u *UpdateChatThemes) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateChatThemes", + ID: UpdateChatThemesTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChatThemes", + SchemaName: "chat_themes", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateChatThemes) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + } + b.PutID(UpdateChatThemesTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateChatThemes) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + } + b.PutInt(len(u.ChatThemes)) + for idx, v := range u.ChatThemes { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare updateChatThemes#98dc58d5: field chat_themes element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateChatThemes) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + } + if err := b.ConsumeID(UpdateChatThemesTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateChatThemes) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + } + + if headerLen > 0 { + u.ChatThemes = make([]ChatTheme, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ChatTheme + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare updateChatThemes#98dc58d5: field chat_themes: %w", err) + } + u.ChatThemes = append(u.ChatThemes, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateChatThemes) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + } + b.ObjStart() + b.PutID("updateChatThemes") + b.Comma() + b.FieldStart("chat_themes") + b.ArrStart() + for idx, v := range u.ChatThemes { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateChatThemes#98dc58d5: field chat_themes 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 (u *UpdateChatThemes) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateChatThemes"); err != nil { + return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: %w", err) + } + case "chat_themes": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ChatTheme + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + } + u.ChatThemes = append(u.ChatThemes, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetChatThemes returns value of ChatThemes field. +func (u *UpdateChatThemes) GetChatThemes() (value []ChatTheme) { + if u == nil { + return + } + return u.ChatThemes +} + +// UpdateAccentColors represents TL type `updateAccentColors#1316555e`. +type UpdateAccentColors struct { + // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 + // (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported + Colors []AccentColor + // The list of accent color identifiers, which can be set through setAccentColor and + // setChatAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIDs []int32 +} + +// UpdateAccentColorsTypeID is TL type id of UpdateAccentColors. +const UpdateAccentColorsTypeID = 0x1316555e + +// construct implements constructor of UpdateClass. +func (u UpdateAccentColors) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateAccentColors. +var ( + _ bin.Encoder = &UpdateAccentColors{} + _ bin.Decoder = &UpdateAccentColors{} + _ bin.BareEncoder = &UpdateAccentColors{} + _ bin.BareDecoder = &UpdateAccentColors{} + + _ UpdateClass = &UpdateAccentColors{} +) + +func (u *UpdateAccentColors) Zero() bool { + if u == nil { + return true + } + if !(u.Colors == nil) { + return false + } + if !(u.AvailableAccentColorIDs == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateAccentColors) String() string { if u == nil { - return "UpdateChatThemes(nil)" + return "UpdateAccentColors(nil)" } - type Alias UpdateChatThemes - return fmt.Sprintf("UpdateChatThemes%+v", Alias(*u)) + type Alias UpdateAccentColors + return fmt.Sprintf("UpdateAccentColors%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatThemes) TypeID() uint32 { - return UpdateChatThemesTypeID +func (*UpdateAccentColors) TypeID() uint32 { + return UpdateAccentColorsTypeID } // TypeName returns name of type in TL schema. -func (*UpdateChatThemes) TypeName() string { - return "updateChatThemes" +func (*UpdateAccentColors) TypeName() string { + return "updateAccentColors" } // TypeInfo returns info about TL type. -func (u *UpdateChatThemes) TypeInfo() tdp.Type { +func (u *UpdateAccentColors) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateChatThemes", - ID: UpdateChatThemesTypeID, + Name: "updateAccentColors", + ID: UpdateAccentColorsTypeID, } if u == nil { typ.Null = true @@ -18967,118 +19570,163 @@ func (u *UpdateChatThemes) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "ChatThemes", - SchemaName: "chat_themes", + Name: "Colors", + SchemaName: "colors", + }, + { + Name: "AvailableAccentColorIDs", + SchemaName: "available_accent_color_ids", }, } return typ } // Encode implements bin.Encoder. -func (u *UpdateChatThemes) Encode(b *bin.Buffer) error { +func (u *UpdateAccentColors) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + return fmt.Errorf("can't encode updateAccentColors#1316555e as nil") } - b.PutID(UpdateChatThemesTypeID) + b.PutID(UpdateAccentColorsTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateChatThemes) EncodeBare(b *bin.Buffer) error { +func (u *UpdateAccentColors) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + return fmt.Errorf("can't encode updateAccentColors#1316555e as nil") } - b.PutInt(len(u.ChatThemes)) - for idx, v := range u.ChatThemes { + b.PutInt(len(u.Colors)) + for idx, v := range u.Colors { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare updateChatThemes#98dc58d5: field chat_themes element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare updateAccentColors#1316555e: field colors element with index %d: %w", idx, err) } } + b.PutInt(len(u.AvailableAccentColorIDs)) + for _, v := range u.AvailableAccentColorIDs { + b.PutInt32(v) + } return nil } // Decode implements bin.Decoder. -func (u *UpdateChatThemes) Decode(b *bin.Buffer) error { +func (u *UpdateAccentColors) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + return fmt.Errorf("can't decode updateAccentColors#1316555e to nil") } - if err := b.ConsumeID(UpdateChatThemesTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: %w", err) + if err := b.ConsumeID(UpdateAccentColorsTypeID); err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateChatThemes) DecodeBare(b *bin.Buffer) error { +func (u *UpdateAccentColors) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + return fmt.Errorf("can't decode updateAccentColors#1316555e to nil") } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field colors: %w", err) } if headerLen > 0 { - u.ChatThemes = make([]ChatTheme, 0, headerLen%bin.PreallocateLimit) + u.Colors = make([]AccentColor, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - var value ChatTheme + var value AccentColor if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare updateChatThemes#98dc58d5: field chat_themes: %w", err) + return fmt.Errorf("unable to decode bare updateAccentColors#1316555e: field colors: %w", err) } - u.ChatThemes = append(u.ChatThemes, value) + u.Colors = append(u.Colors, value) + } + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field available_accent_color_ids: %w", err) + } + + if headerLen > 0 { + u.AvailableAccentColorIDs = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field available_accent_color_ids: %w", err) + } + u.AvailableAccentColorIDs = append(u.AvailableAccentColorIDs, value) } } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatThemes) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateAccentColors) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateChatThemes#98dc58d5 as nil") + return fmt.Errorf("can't encode updateAccentColors#1316555e as nil") } b.ObjStart() - b.PutID("updateChatThemes") + b.PutID("updateAccentColors") b.Comma() - b.FieldStart("chat_themes") + b.FieldStart("colors") b.ArrStart() - for idx, v := range u.ChatThemes { + for idx, v := range u.Colors { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode updateChatThemes#98dc58d5: field chat_themes element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode updateAccentColors#1316555e: field colors element with index %d: %w", idx, err) } b.Comma() } b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("available_accent_color_ids") + b.ArrStart() + for _, v := range u.AvailableAccentColorIDs { + b.PutInt32(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() b.StripComma() b.ObjEnd() return nil } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatThemes) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateAccentColors) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateChatThemes#98dc58d5 to nil") + return fmt.Errorf("can't decode updateAccentColors#1316555e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateChatThemes"); err != nil { - return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: %w", err) + if err := b.ConsumeID("updateAccentColors"); err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: %w", err) } - case "chat_themes": + case "colors": if err := b.Arr(func(b tdjson.Decoder) error { - var value ChatTheme + var value AccentColor if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field colors: %w", err) } - u.ChatThemes = append(u.ChatThemes, value) + u.Colors = append(u.Colors, value) return nil }); err != nil { - return fmt.Errorf("unable to decode updateChatThemes#98dc58d5: field chat_themes: %w", err) + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field colors: %w", err) + } + case "available_accent_color_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field available_accent_color_ids: %w", err) + } + u.AvailableAccentColorIDs = append(u.AvailableAccentColorIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode updateAccentColors#1316555e: field available_accent_color_ids: %w", err) } default: return b.Skip() @@ -19087,12 +19735,20 @@ func (u *UpdateChatThemes) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetChatThemes returns value of ChatThemes field. -func (u *UpdateChatThemes) GetChatThemes() (value []ChatTheme) { +// GetColors returns value of Colors field. +func (u *UpdateAccentColors) GetColors() (value []AccentColor) { if u == nil { return } - return u.ChatThemes + return u.Colors +} + +// GetAvailableAccentColorIDs returns value of AvailableAccentColorIDs field. +func (u *UpdateAccentColors) GetAvailableAccentColorIDs() (value []int32) { + if u == nil { + return + } + return u.AvailableAccentColorIDs } // UpdateLanguagePackStrings represents TL type `updateLanguagePackStrings#af87919f`. @@ -25585,6 +26241,206 @@ func (u *UpdateNewChatJoinRequest) GetInviteLink() (value ChatInviteLink) { 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 +} + // UpdateClassName is schema name of UpdateClass. const UpdateClassName = "Update" @@ -25613,6 +26469,8 @@ 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.UpdateChatPermissions: // updateChatPermissions#9f52176d // case *tdapi.UpdateChatLastMessage: // updateChatLastMessage#f10cab1d // case *tdapi.UpdateChatPosition: // updateChatPosition#ff76fa77 @@ -25687,6 +26545,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateSavedNotificationSounds: // updateSavedNotificationSounds#5a6653b4 // case *tdapi.UpdateSelectedBackground: // updateSelectedBackground#99bd205d // case *tdapi.UpdateChatThemes: // updateChatThemes#98dc58d5 +// case *tdapi.UpdateAccentColors: // updateAccentColors#1316555e // case *tdapi.UpdateLanguagePackStrings: // updateLanguagePackStrings#af87919f // case *tdapi.UpdateConnectionState: // updateConnectionState#57939e2e // case *tdapi.UpdateTermsOfService: // updateTermsOfService#b23cc55e @@ -25714,6 +26573,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdatePollAnswer: // updatePollAnswer#b67ac547 // case *tdapi.UpdateChatMember: // updateChatMember#6000e29c // case *tdapi.UpdateNewChatJoinRequest: // updateNewChatJoinRequest#7e48b843 +// case *tdapi.UpdateChatBoost: // updateChatBoost#50727e24 // default: panic(v) // } type UpdateClass interface { @@ -25857,6 +26717,20 @@ 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{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case UpdateChatPermissionsTypeID: // Decoding updateChatPermissions#9f52176d. v := UpdateChatPermissions{} @@ -26375,6 +27249,13 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateAccentColorsTypeID: + // Decoding updateAccentColors#1316555e. + v := UpdateAccentColors{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case UpdateLanguagePackStringsTypeID: // Decoding updateLanguagePackStrings#af87919f. v := UpdateLanguagePackStrings{} @@ -26564,6 +27445,13 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateChatBoostTypeID: + // Decoding updateChatBoost#50727e24. + v := UpdateChatBoost{} + 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)) } @@ -26688,6 +27576,20 @@ 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{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case "updateChatPermissions": // Decoding updateChatPermissions#9f52176d. v := UpdateChatPermissions{} @@ -27206,6 +28108,13 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateAccentColors": + // Decoding updateAccentColors#1316555e. + v := UpdateAccentColors{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case "updateLanguagePackStrings": // Decoding updateLanguagePackStrings#af87919f. v := UpdateLanguagePackStrings{} @@ -27395,6 +28304,13 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateChatBoost": + // Decoding updateChatBoost#50727e24. + v := UpdateChatBoost{} + 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 0713771a76..30132d2752 100644 --- a/tdapi/tl_user_gen.go +++ b/tdapi/tl_user_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// User represents TL type `user#956ad2d2`. +// User represents TL type `user#e39ad80a`. type User struct { // User identifier ID int64 @@ -47,6 +47,12 @@ type User struct { Status UserStatusClass // Profile photo of the user; may be null ProfilePhoto ProfilePhoto + // Identifier of the accent color for name, and backgrounds of profile photo, reply + // header, and link preview + AccentColorID int32 + // Identifier of a custom emoji to be shown on the reply header background; 0 if none. + // For Telegram Premium users only + BackgroundCustomEmojiID int64 // Emoji status to be shown instead of the default Telegram Premium badge; may be null. // For Telegram Premium users only EmojiStatus EmojiStatus @@ -86,7 +92,7 @@ type User struct { } // UserTypeID is TL type id of User. -const UserTypeID = 0x956ad2d2 +const UserTypeID = 0xe39ad80a // Ensuring interfaces in compile-time for User. var ( @@ -121,6 +127,12 @@ func (u *User) Zero() bool { if !(u.ProfilePhoto.Zero()) { return false } + if !(u.AccentColorID == 0) { + return false + } + if !(u.BackgroundCustomEmojiID == 0) { + return false + } if !(u.EmojiStatus.Zero()) { return false } @@ -233,6 +245,14 @@ func (u *User) TypeInfo() tdp.Type { Name: "ProfilePhoto", SchemaName: "profile_photo", }, + { + Name: "AccentColorID", + SchemaName: "accent_color_id", + }, + { + Name: "BackgroundCustomEmojiID", + SchemaName: "background_custom_emoji_id", + }, { Name: "EmojiStatus", SchemaName: "emoji_status", @@ -304,7 +324,7 @@ func (u *User) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *User) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#956ad2d2 as nil") + return fmt.Errorf("can't encode user#e39ad80a as nil") } b.PutID(UserTypeID) return u.EncodeBare(b) @@ -313,26 +333,28 @@ func (u *User) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *User) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#956ad2d2 as nil") + return fmt.Errorf("can't encode user#e39ad80a as nil") } b.PutInt53(u.ID) b.PutString(u.FirstName) b.PutString(u.LastName) if err := u.Usernames.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field usernames: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field usernames: %w", err) } b.PutString(u.PhoneNumber) if u.Status == nil { - return fmt.Errorf("unable to encode user#956ad2d2: field status is nil") + return fmt.Errorf("unable to encode user#e39ad80a: field status is nil") } if err := u.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field status: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field status: %w", err) } if err := u.ProfilePhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field profile_photo: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field profile_photo: %w", err) } + b.PutInt32(u.AccentColorID) + b.PutLong(u.BackgroundCustomEmojiID) if err := u.EmojiStatus.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field emoji_status: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field emoji_status: %w", err) } b.PutBool(u.IsContact) b.PutBool(u.IsMutualContact) @@ -347,10 +369,10 @@ func (u *User) EncodeBare(b *bin.Buffer) error { b.PutBool(u.HasUnreadActiveStories) b.PutBool(u.HaveAccess) if u.Type == nil { - return fmt.Errorf("unable to encode user#956ad2d2: field type is nil") + return fmt.Errorf("unable to encode user#e39ad80a: field type is nil") } if err := u.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field type: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field type: %w", err) } b.PutString(u.LanguageCode) b.PutBool(u.AddedToAttachmentMenu) @@ -360,10 +382,10 @@ func (u *User) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *User) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#956ad2d2 to nil") + return fmt.Errorf("can't decode user#e39ad80a to nil") } if err := b.ConsumeID(UserTypeID); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: %w", err) } return u.DecodeBare(b) } @@ -371,160 +393,174 @@ func (u *User) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *User) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#956ad2d2 to nil") + return fmt.Errorf("can't decode user#e39ad80a to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field id: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field id: %w", err) } u.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field first_name: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field first_name: %w", err) } u.FirstName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field last_name: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field last_name: %w", err) } u.LastName = value } { if err := u.Usernames.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field usernames: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field usernames: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field phone_number: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field phone_number: %w", err) } u.PhoneNumber = value } { value, err := DecodeUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field status: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field status: %w", err) } u.Status = value } { if err := u.ProfilePhoto.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field profile_photo: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field profile_photo: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode user#e39ad80a: field accent_color_id: %w", err) + } + u.AccentColorID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode user#e39ad80a: field background_custom_emoji_id: %w", err) } + u.BackgroundCustomEmojiID = value } { if err := u.EmojiStatus.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field emoji_status: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field emoji_status: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_contact: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_contact: %w", err) } u.IsContact = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_mutual_contact: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_mutual_contact: %w", err) } u.IsMutualContact = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_close_friend: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_close_friend: %w", err) } u.IsCloseFriend = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_verified: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_verified: %w", err) } u.IsVerified = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_premium: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_premium: %w", err) } u.IsPremium = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_support: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_support: %w", err) } u.IsSupport = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field restriction_reason: %w", err) } u.RestrictionReason = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_scam: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_scam: %w", err) } u.IsScam = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_fake: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_fake: %w", err) } u.IsFake = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field has_active_stories: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field has_active_stories: %w", err) } u.HasActiveStories = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field has_unread_active_stories: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field has_unread_active_stories: %w", err) } u.HasUnreadActiveStories = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field have_access: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field have_access: %w", err) } u.HaveAccess = value } { value, err := DecodeUserType(b) if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field type: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field type: %w", err) } u.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field language_code: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field language_code: %w", err) } u.LanguageCode = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field added_to_attachment_menu: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field added_to_attachment_menu: %w", err) } u.AddedToAttachmentMenu = value } @@ -534,7 +570,7 @@ func (u *User) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (u *User) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode user#956ad2d2 as nil") + return fmt.Errorf("can't encode user#e39ad80a as nil") } b.ObjStart() b.PutID("user") @@ -550,7 +586,7 @@ func (u *User) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("usernames") if err := u.Usernames.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field usernames: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field usernames: %w", err) } b.Comma() b.FieldStart("phone_number") @@ -558,20 +594,26 @@ func (u *User) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("status") if u.Status == nil { - return fmt.Errorf("unable to encode user#956ad2d2: field status is nil") + return fmt.Errorf("unable to encode user#e39ad80a: field status is nil") } if err := u.Status.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field status: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field status: %w", err) } b.Comma() b.FieldStart("profile_photo") if err := u.ProfilePhoto.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field profile_photo: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field profile_photo: %w", err) } b.Comma() + 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("emoji_status") if err := u.EmojiStatus.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field emoji_status: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field emoji_status: %w", err) } b.Comma() b.FieldStart("is_contact") @@ -612,10 +654,10 @@ func (u *User) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("type") if u.Type == nil { - return fmt.Errorf("unable to encode user#956ad2d2: field type is nil") + return fmt.Errorf("unable to encode user#e39ad80a: field type is nil") } if err := u.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode user#956ad2d2: field type: %w", err) + return fmt.Errorf("unable to encode user#e39ad80a: field type: %w", err) } b.Comma() b.FieldStart("language_code") @@ -632,145 +674,157 @@ func (u *User) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (u *User) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode user#956ad2d2 to nil") + return fmt.Errorf("can't decode user#e39ad80a to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("user"); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field id: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field id: %w", err) } u.ID = value case "first_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field first_name: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field first_name: %w", err) } u.FirstName = value case "last_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field last_name: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field last_name: %w", err) } u.LastName = value case "usernames": if err := u.Usernames.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field usernames: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field usernames: %w", err) } case "phone_number": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field phone_number: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field phone_number: %w", err) } u.PhoneNumber = value case "status": value, err := DecodeTDLibJSONUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field status: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field status: %w", err) } u.Status = value case "profile_photo": if err := u.ProfilePhoto.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field profile_photo: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field profile_photo: %w", err) + } + case "accent_color_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode user#e39ad80a: 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 user#e39ad80a: field background_custom_emoji_id: %w", err) + } + u.BackgroundCustomEmojiID = value case "emoji_status": if err := u.EmojiStatus.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field emoji_status: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field emoji_status: %w", err) } case "is_contact": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_contact: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_contact: %w", err) } u.IsContact = value case "is_mutual_contact": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_mutual_contact: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_mutual_contact: %w", err) } u.IsMutualContact = value case "is_close_friend": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_close_friend: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_close_friend: %w", err) } u.IsCloseFriend = value case "is_verified": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_verified: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_verified: %w", err) } u.IsVerified = value case "is_premium": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_premium: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_premium: %w", err) } u.IsPremium = value case "is_support": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_support: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_support: %w", err) } u.IsSupport = value case "restriction_reason": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field restriction_reason: %w", err) } u.RestrictionReason = value case "is_scam": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_scam: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_scam: %w", err) } u.IsScam = value case "is_fake": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field is_fake: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field is_fake: %w", err) } u.IsFake = value case "has_active_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field has_active_stories: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field has_active_stories: %w", err) } u.HasActiveStories = value case "has_unread_active_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field has_unread_active_stories: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field has_unread_active_stories: %w", err) } u.HasUnreadActiveStories = value case "have_access": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field have_access: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field have_access: %w", err) } u.HaveAccess = value case "type": value, err := DecodeTDLibJSONUserType(b) if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field type: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field type: %w", err) } u.Type = value case "language_code": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field language_code: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field language_code: %w", err) } u.LanguageCode = value case "added_to_attachment_menu": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode user#956ad2d2: field added_to_attachment_menu: %w", err) + return fmt.Errorf("unable to decode user#e39ad80a: field added_to_attachment_menu: %w", err) } u.AddedToAttachmentMenu = value default: @@ -836,6 +890,22 @@ func (u *User) GetProfilePhoto() (value ProfilePhoto) { return u.ProfilePhoto } +// GetAccentColorID returns value of AccentColorID field. +func (u *User) GetAccentColorID() (value int32) { + if u == nil { + return + } + return u.AccentColorID +} + +// GetBackgroundCustomEmojiID returns value of BackgroundCustomEmojiID field. +func (u *User) GetBackgroundCustomEmojiID() (value int64) { + if u == nil { + return + } + return u.BackgroundCustomEmojiID +} + // GetEmojiStatus returns value of EmojiStatus field. func (u *User) GetEmojiStatus() (value EmojiStatus) { if u == nil { diff --git a/tdapi/tl_web_page_gen.go b/tdapi/tl_web_page_gen.go index 0009f01d5a..db474d4c5f 100644 --- a/tdapi/tl_web_page_gen.go +++ b/tdapi/tl_web_page_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// WebPage represents TL type `webPage#1ab72e80`. +// WebPage represents TL type `webPage#dafbc3a4`. type WebPage struct { // Original URL of the link URL string @@ -44,7 +44,7 @@ type WebPage struct { SiteName string // Title of the content Title string - // Describes a web page preview + // Describes a link preview Description FormattedText // Image representing the content; may be null Photo Photo @@ -60,6 +60,16 @@ type WebPage struct { Duration int32 // Author of the content Author string + // True, if the preview has large media and its appearance can be changed + HasLargeMedia bool + // True, if large media preview must be shown + ShowLargeMedia bool + // True, if there is no need to show an ordinary open URL confirmation, when opening the + // URL from the preview, because the URL is shown in the message text in clear + SkipConfirmation bool + // True, if the link preview must be shown above message text; otherwise, the link + // preview must be shown below the message text + ShowAboveText bool // Preview of the content as an animation, if available; may be null Animation Animation // Preview of the content as an audio file, if available; may be null @@ -83,7 +93,7 @@ type WebPage struct { } // WebPageTypeID is TL type id of WebPage. -const WebPageTypeID = 0x1ab72e80 +const WebPageTypeID = 0xdafbc3a4 // Ensuring interfaces in compile-time for WebPage. var ( @@ -136,6 +146,18 @@ func (w *WebPage) Zero() bool { if !(w.Author == "") { return false } + if !(w.HasLargeMedia == false) { + return false + } + if !(w.ShowLargeMedia == false) { + return false + } + if !(w.SkipConfirmation == false) { + return false + } + if !(w.ShowAboveText == false) { + return false + } if !(w.Animation.Zero()) { return false } @@ -254,6 +276,22 @@ func (w *WebPage) TypeInfo() tdp.Type { Name: "Author", SchemaName: "author", }, + { + Name: "HasLargeMedia", + SchemaName: "has_large_media", + }, + { + Name: "ShowLargeMedia", + SchemaName: "show_large_media", + }, + { + Name: "SkipConfirmation", + SchemaName: "skip_confirmation", + }, + { + Name: "ShowAboveText", + SchemaName: "show_above_text", + }, { Name: "Animation", SchemaName: "animation", @@ -301,7 +339,7 @@ func (w *WebPage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (w *WebPage) Encode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode webPage#1ab72e80 as nil") + return fmt.Errorf("can't encode webPage#dafbc3a4 as nil") } b.PutID(WebPageTypeID) return w.EncodeBare(b) @@ -310,7 +348,7 @@ func (w *WebPage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (w *WebPage) EncodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode webPage#1ab72e80 as nil") + return fmt.Errorf("can't encode webPage#dafbc3a4 as nil") } b.PutString(w.URL) b.PutString(w.DisplayURL) @@ -318,10 +356,10 @@ func (w *WebPage) EncodeBare(b *bin.Buffer) error { b.PutString(w.SiteName) b.PutString(w.Title) if err := w.Description.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field description: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field description: %w", err) } if err := w.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field photo: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field photo: %w", err) } b.PutString(w.EmbedURL) b.PutString(w.EmbedType) @@ -329,26 +367,30 @@ func (w *WebPage) EncodeBare(b *bin.Buffer) error { b.PutInt32(w.EmbedHeight) b.PutInt32(w.Duration) b.PutString(w.Author) + b.PutBool(w.HasLargeMedia) + b.PutBool(w.ShowLargeMedia) + b.PutBool(w.SkipConfirmation) + b.PutBool(w.ShowAboveText) if err := w.Animation.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field animation: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field animation: %w", err) } if err := w.Audio.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field audio: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field audio: %w", err) } if err := w.Document.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field document: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field document: %w", err) } if err := w.Sticker.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field sticker: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field sticker: %w", err) } if err := w.Video.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field video: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field video: %w", err) } if err := w.VideoNote.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field video_note: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field video_note: %w", err) } if err := w.VoiceNote.Encode(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field voice_note: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field voice_note: %w", err) } b.PutInt53(w.StorySenderChatID) b.PutInt32(w.StoryID) @@ -359,10 +401,10 @@ func (w *WebPage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (w *WebPage) Decode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode webPage#1ab72e80 to nil") + return fmt.Errorf("can't decode webPage#dafbc3a4 to nil") } if err := b.ConsumeID(WebPageTypeID); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: %w", err) } return w.DecodeBare(b) } @@ -370,148 +412,176 @@ func (w *WebPage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (w *WebPage) DecodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode webPage#1ab72e80 to nil") + return fmt.Errorf("can't decode webPage#dafbc3a4 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field url: %w", err) } w.URL = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field display_url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field display_url: %w", err) } w.DisplayURL = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field type: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field type: %w", err) } w.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field site_name: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field site_name: %w", err) } w.SiteName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field title: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field title: %w", err) } w.Title = value } { if err := w.Description.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field description: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field description: %w", err) } } { if err := w.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field photo: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field photo: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_url: %w", err) } w.EmbedURL = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_type: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_type: %w", err) } w.EmbedType = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_width: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_width: %w", err) } w.EmbedWidth = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_height: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_height: %w", err) } w.EmbedHeight = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field duration: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field duration: %w", err) } w.Duration = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field author: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field author: %w", err) } w.Author = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field has_large_media: %w", err) + } + w.HasLargeMedia = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field show_large_media: %w", err) + } + w.ShowLargeMedia = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field skip_confirmation: %w", err) + } + w.SkipConfirmation = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field show_above_text: %w", err) + } + w.ShowAboveText = value + } { if err := w.Animation.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field animation: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field animation: %w", err) } } { if err := w.Audio.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field audio: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field audio: %w", err) } } { if err := w.Document.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field document: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field document: %w", err) } } { if err := w.Sticker.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field sticker: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field sticker: %w", err) } } { if err := w.Video.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field video: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field video: %w", err) } } { if err := w.VideoNote.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field video_note: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field video_note: %w", err) } } { if err := w.VoiceNote.Decode(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field voice_note: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field voice_note: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field story_sender_chat_id: %w", err) } w.StorySenderChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field story_id: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field story_id: %w", err) } w.StoryID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field instant_view_version: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field instant_view_version: %w", err) } w.InstantViewVersion = value } @@ -521,7 +591,7 @@ func (w *WebPage) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (w *WebPage) EncodeTDLibJSON(b tdjson.Encoder) error { if w == nil { - return fmt.Errorf("can't encode webPage#1ab72e80 as nil") + return fmt.Errorf("can't encode webPage#dafbc3a4 as nil") } b.ObjStart() b.PutID("webPage") @@ -543,12 +613,12 @@ func (w *WebPage) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("description") if err := w.Description.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field description: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field description: %w", err) } b.Comma() b.FieldStart("photo") if err := w.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field photo: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field photo: %w", err) } b.Comma() b.FieldStart("embed_url") @@ -569,39 +639,51 @@ func (w *WebPage) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("author") b.PutString(w.Author) b.Comma() + b.FieldStart("has_large_media") + b.PutBool(w.HasLargeMedia) + b.Comma() + b.FieldStart("show_large_media") + b.PutBool(w.ShowLargeMedia) + b.Comma() + b.FieldStart("skip_confirmation") + b.PutBool(w.SkipConfirmation) + b.Comma() + b.FieldStart("show_above_text") + b.PutBool(w.ShowAboveText) + b.Comma() b.FieldStart("animation") if err := w.Animation.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field animation: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field animation: %w", err) } b.Comma() b.FieldStart("audio") if err := w.Audio.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field audio: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field audio: %w", err) } b.Comma() b.FieldStart("document") if err := w.Document.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field document: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field document: %w", err) } b.Comma() b.FieldStart("sticker") if err := w.Sticker.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field sticker: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field sticker: %w", err) } b.Comma() b.FieldStart("video") if err := w.Video.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field video: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field video: %w", err) } b.Comma() b.FieldStart("video_note") if err := w.VideoNote.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field video_note: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field video_note: %w", err) } b.Comma() b.FieldStart("voice_note") if err := w.VoiceNote.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode webPage#1ab72e80: field voice_note: %w", err) + return fmt.Errorf("unable to encode webPage#dafbc3a4: field voice_note: %w", err) } b.Comma() b.FieldStart("story_sender_chat_id") @@ -621,133 +703,157 @@ func (w *WebPage) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (w *WebPage) DecodeTDLibJSON(b tdjson.Decoder) error { if w == nil { - return fmt.Errorf("can't decode webPage#1ab72e80 to nil") + return fmt.Errorf("can't decode webPage#dafbc3a4 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("webPage"); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: %w", err) } case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field url: %w", err) } w.URL = value case "display_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field display_url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field display_url: %w", err) } w.DisplayURL = value case "type": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field type: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field type: %w", err) } w.Type = value case "site_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field site_name: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field site_name: %w", err) } w.SiteName = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field title: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field title: %w", err) } w.Title = value case "description": if err := w.Description.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field description: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field description: %w", err) } case "photo": if err := w.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field photo: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field photo: %w", err) } case "embed_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_url: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_url: %w", err) } w.EmbedURL = value case "embed_type": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_type: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_type: %w", err) } w.EmbedType = value case "embed_width": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_width: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_width: %w", err) } w.EmbedWidth = value case "embed_height": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field embed_height: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field embed_height: %w", err) } w.EmbedHeight = value case "duration": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field duration: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field duration: %w", err) } w.Duration = value case "author": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field author: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field author: %w", err) } w.Author = value + case "has_large_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field has_large_media: %w", err) + } + w.HasLargeMedia = value + case "show_large_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field show_large_media: %w", err) + } + w.ShowLargeMedia = value + case "skip_confirmation": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field skip_confirmation: %w", err) + } + w.SkipConfirmation = value + case "show_above_text": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode webPage#dafbc3a4: field show_above_text: %w", err) + } + w.ShowAboveText = value case "animation": if err := w.Animation.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field animation: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field animation: %w", err) } case "audio": if err := w.Audio.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field audio: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field audio: %w", err) } case "document": if err := w.Document.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field document: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field document: %w", err) } case "sticker": if err := w.Sticker.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field sticker: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field sticker: %w", err) } case "video": if err := w.Video.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field video: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field video: %w", err) } case "video_note": if err := w.VideoNote.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field video_note: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field video_note: %w", err) } case "voice_note": if err := w.VoiceNote.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field voice_note: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field voice_note: %w", err) } case "story_sender_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field story_sender_chat_id: %w", err) } w.StorySenderChatID = value case "story_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field story_id: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field story_id: %w", err) } w.StoryID = value case "instant_view_version": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode webPage#1ab72e80: field instant_view_version: %w", err) + return fmt.Errorf("unable to decode webPage#dafbc3a4: field instant_view_version: %w", err) } w.InstantViewVersion = value default: @@ -861,6 +967,38 @@ func (w *WebPage) GetAuthor() (value string) { return w.Author } +// GetHasLargeMedia returns value of HasLargeMedia field. +func (w *WebPage) GetHasLargeMedia() (value bool) { + if w == nil { + return + } + return w.HasLargeMedia +} + +// GetShowLargeMedia returns value of ShowLargeMedia field. +func (w *WebPage) GetShowLargeMedia() (value bool) { + if w == nil { + return + } + return w.ShowLargeMedia +} + +// GetSkipConfirmation returns value of SkipConfirmation field. +func (w *WebPage) GetSkipConfirmation() (value bool) { + if w == nil { + return + } + return w.SkipConfirmation +} + +// GetShowAboveText returns value of ShowAboveText field. +func (w *WebPage) GetShowAboveText() (value bool) { + if w == nil { + return + } + return w.ShowAboveText +} + // GetAnimation returns value of Animation field. func (w *WebPage) GetAnimation() (value Animation) { if w == nil {