diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index 329af326e8..4d20242725 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: 8fd45e3a3d99f858697314f8abb51f3cbd8299025d8167db44ea786364638811 +// SHA256: f1df4936ee32ce2a28d871595f8f5c16745b15048326fbc02f283b8e679ffaee double#2210c154 ? = Double; @@ -259,7 +259,7 @@ minithumbnail#ec6addaa width:int32 height:int32 data:bytes = Minithumbnail; //@description The thumbnail is in JPEG format thumbnailFormatJpeg#d90c5488 = ThumbnailFormat; -//@description The thumbnail is in static GIF format. It will be used only for some bot inline results +//@description The thumbnail is in static GIF format. It will be used only for some bot inline query results thumbnailFormatGif#4aa3258a = ThumbnailFormat; //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos @@ -749,7 +749,7 @@ botInfo#bfdb89a short_description:string description:string photo:photo animatio //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. //@photo User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. //@public_photo User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. -//@is_blocked True, if the user is blocked by the current user +//@block_list Block list to which the user is added; may be null if none //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings @@ -761,7 +761,7 @@ botInfo#bfdb89a short_description:string description:string photo:photo animatio //@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user //@bot_info For bots, information about the bot; may be null if the user isn't a bot -userFullInfo#bf73d22c personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +userFullInfo#a53c620b personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; //@description Represents a list of users //@total_count Approximate total number of users found @@ -1521,10 +1521,10 @@ videoChat#ae158d28 group_call_id:int32 has_participants:Bool default_participant //@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists //@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender +//@block_list Block list to which the chat is added; may be null if none //@has_protected_content True, if chat content can't be saved locally, forwarded, or copied //@is_translatable True, if translation of all messages in the chat must be suggested to the user //@is_marked_as_unread True, if the chat is marked as unread -//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received //@has_scheduled_messages True, if the chat has scheduled messages //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users @@ -1546,7 +1546,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#d71735a8 id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool is_blocked: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#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; //@description Represents a list of chats //@total_count Approximate total number of chats found @@ -1583,7 +1583,7 @@ chatActionBarReportUnrelatedLocation#2d30d701 = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited chatActionBarInviteMembers#76557c70 = ChatActionBar; -//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, +//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings //@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users chatActionBarReportAddBlock#c9832bed can_unarchive:Bool distance:int32 = ChatActionBar; @@ -4326,6 +4326,15 @@ premiumLimitTypeShareableChatFolderCount#601eb4c7 = PremiumLimitType; //@description The maximum number of active stories premiumLimitTypeActiveStoryCount#8d2c269c = PremiumLimitType; +//@description The maximum number of stories sent per week +premiumLimitTypeWeeklySentStoryCount#269c34b = PremiumLimitType; + +//@description The maximum number of stories sent per month +premiumLimitTypeMonthlySentStoryCount#30d84b83 = PremiumLimitType; + +//@description The maximum length of captions of sent stories +premiumLimitTypeStoryCaptionLength#bed53302 = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users //@description Increased limits @@ -4358,7 +4367,7 @@ premiumFeatureAdvancedChatManagement#2f774d1a = PremiumFeature; //@description A badge in the user's profile premiumFeatureProfileBadge#ded30c2 = PremiumFeature; -//@description A emoji status shown along with the user's name +//@description An emoji status shown along with the user's name premiumFeatureEmojiStatus#fdd2cce1 = PremiumFeature; //@description Profile photo animation on message and chat screens @@ -4373,6 +4382,29 @@ premiumFeatureAppIcons#5e79f489 = PremiumFeature; //@description Allowed to translate chat messages real-time premiumFeatureRealTimeChatTranslation#bbd80280 = PremiumFeature; +//@description Allowed to use many additional features for stories +premiumFeatureUpgradedStories#9008051b = PremiumFeature; + +//@class PremiumStoryFeature @description Describes a story feature available to Premium users + +//@description User stories are displayed before stories of non-premium contacts +premiumStoryFeaturePriorityOrder#8ff172c7 = PremiumStoryFeature; + +//@description The ability to hide the fact that the user viewed other's stories +premiumStoryFeatureStealthMode#47343da4 = PremiumStoryFeature; + +//@description The ability to check who opened the current user's stories after they expire +premiumStoryFeaturePermanentViewsHistory#c2a047a0 = PremiumStoryFeature; + +//@description The ability to set custom expiration duration for stories +premiumStoryFeatureCustomExpirationDuration#dca40a96 = PremiumStoryFeature; + +//@description The ability to save other's unprotected stories +premiumStoryFeatureSaveStories#a6842fbd = PremiumStoryFeature; + +//@description The ability to use links and formatting in story caption +premiumStoryFeatureLinksAndFormatting#dae383f7 = PremiumStoryFeature; + //@description Contains information about a limit, increased for Premium users //@type The type of the limit //@default_value Default value of the limit @@ -4395,6 +4427,10 @@ premiumSourceLimitExceeded#85ae8702 limit_type:PremiumLimitType = PremiumSource; //@feature The used feature premiumSourceFeature#1a929325 feature:PremiumFeature = PremiumSource; +//@description A user tried to use a Premium story feature +//@feature The used feature +premiumSourceStoryFeature#c290316c feature:PremiumStoryFeature = PremiumSource; + //@description A user opened an internal link of the type internalLinkTypePremiumFeatures //@referrer The referrer from the link premiumSourceLink#7f42999c referrer:string = PremiumSource; @@ -4553,6 +4589,25 @@ chatTheme#f9406c39 name:string light_settings:themeSettings dark_settings:themeS //@hashtags A list of hashtags hashtags#6c2c0ae1 hashtags:vector = Hashtags; +//@class CanSendStoryResult @description Represents result of checking whether the current user can send a story + +//@description A story can be sent +canSendStoryResultOk#503cf0fd = CanSendStoryResult; + +//@description The user must subscribe to Telegram Premium to be able to post stories +canSendStoryResultPremiumNeeded#567fde69 = CanSendStoryResult; + +//@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire +canSendStoryResultActiveStoryLimitExceeded#afd9aad6 = CanSendStoryResult; + +//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +//@retry_after Time left before the user can send the next story +canSendStoryResultWeeklyLimitExceeded#1341a0b8 retry_after:int32 = CanSendStoryResult; + +//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +//@retry_after Time left before the user can send the next story +canSendStoryResultMonthlyLimitExceeded#dd8242d5 retry_after:int32 = CanSendStoryResult; + //@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 @@ -4894,17 +4949,18 @@ jsonValueObject#c67bff40 members:vector = JsonValue; //@class StoryPrivacySettings @description Describes privacy settings of a story //@description The story can be viewed by everyone -storyPrivacySettingsEveryone#a8204874 = StoryPrivacySettings; +//@except_user_ids Identifiers of the users that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsEveryone#22d1053a except_user_ids:vector = StoryPrivacySettings; //@description The story can be viewed by all contacts except chosen users -//@except_user_ids User identifiers of the contacts that can't see the story; always empty for non-owned stories +//@except_user_ids User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories storyPrivacySettingsContacts#35515d71 except_user_ids:vector = StoryPrivacySettings; //@description The story can be viewed by all close friends storyPrivacySettingsCloseFriends#7cff8b60 = StoryPrivacySettings; //@description The story can be viewed by certain specified users -//@user_ids Identifiers of the users; always empty for non-owned stories +//@user_ids Identifiers of the users; always unknown and empty for non-owned stories storyPrivacySettingsSelectedContacts#25401fc7 user_ids:vector = StoryPrivacySettings; //@class UserPrivacySettingRule @description Represents a single rule for managing user privacy settings @@ -5307,6 +5363,67 @@ messageLink#af4a3aa6 link:string is_public:Bool = MessageLink; //@for_album True, if the whole media album to which the message belongs is linked messageLinkInfo#2b96fb50 is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +//@description Represents a viewer of a story +//@user_id User identifier of the viewer +//@view_date Approximate point in time (Unix timestamp) when the story was viewed +//@block_list Block list to which the user is added; may be null if none +//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none +storyViewer#cf0fb132 user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer; + +//@description Represents a list of story viewers +//@total_count Approximate total number of story viewers found +//@viewers List of story viewers +//@next_offset The offset for the next request. If empty, there are no more results +storyViewers#b9fed56b total_count:int32 viewers:vector next_offset:string = StoryViewers; + +//@description Describes position of a clickable rectangle area on a story media +//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width +//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height +//@width_percentage The width of the rectangle, as a percentage of the media width +//@height_percentage The ordinate of the rectangle's center, as a percentage of the media height +//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 +storyAreaPosition#6389679 x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition; + +//@class StoryAreaType @description Describes type of a clickable rectangle area on a story media + +//@description An area pointing to a location +//@location The location +storyAreaTypeLocation#9ebe1186 location:location = StoryAreaType; + +//@description An area pointing to a venue +//@venue Information about the venue +storyAreaTypeVenue#18ae4d06 venue:venue = StoryAreaType; + +//@description Describes a clickable rectangle area on a story media +//@position Position of the area +//@type Type of the area +storyArea#c9ff075e position:storyAreaPosition type:StoryAreaType = StoryArea; + +//@class InputStoryAreaType @description Describes type of a clickable rectangle area on a story media to be added + +//@description An area pointing to a location +//@location The location +inputStoryAreaTypeLocation#6849d762 location:location = InputStoryAreaType; + +//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username") +//@query_id Identifier of the inline query, used to found the venue +//@result_id Identifier of the inline query result +inputStoryAreaTypeFoundVenue#accda496 query_id:int64 result_id:string = InputStoryAreaType; + +//@description An area pointing to a venue already added to the story +//@venue_provider Provider of the venue +//@venue_id Identifier of the venue in the provider database +inputStoryAreaTypePreviousVenue#6e124e0c venue_provider:string venue_id:string = InputStoryAreaType; + +//@description Describes a clickable rectangle area on a story media to be added +//@position Position of the area +//@type Type of the area +inputStoryArea#752ae7f position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; + +//@description Contains a list of story areas to be added +//@areas List of 0-10 input story areas +inputStoryAreas#b8ba29fe areas:vector = InputStoryAreas; + //@description Describes a video file sent in a story //@duration Duration of the video, in seconds //@width Video width @@ -5357,13 +5474,15 @@ storyListArchive#fd80a741 = StoryList; //@description Contains information about interactions with a story //@view_count Number of times the story was viewed +//@reaction_count Number of reactions added to the story //@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story -storyInteractionInfo#853472cf view_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; +storyInteractionInfo#e5109256 view_count:int32 reaction_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; //@description Represents a story //@id Unique story identifier among stories of the given sender //@sender_chat_id Identifier of the chat that posted the story //@date Point in time (Unix timestamp) when the story was published +//@is_being_sent True, if the story is being sent by the current user //@is_being_edited True, if the story is being edited by the current user //@is_edited True, if the story was edited //@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration @@ -5373,10 +5492,12 @@ storyInteractionInfo#853472cf view_count:int32 recent_viewer_user_ids:vector caption:formattedText = Story; //@description Represents a list of stories //@total_count Approximate total number of stories found @@ -5397,6 +5518,14 @@ 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 BlockList @description Describes a type of a block list + +//@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +blockListMain#50a4137c = BlockList; + +//@description The block list that disallows viewing of stories of the current user +blockListStories#628965c = BlockList; + //@description Contains a part of a file //@data File bytes filePart#36594c36 data:bytes = FilePart; @@ -6086,8 +6215,8 @@ updateChatIsMarkedAsUnread#57853334 chat_id:int53 is_marked_as_unread:Bool = Upd //@description A chat was blocked or unblocked //@chat_id Chat identifier -//@is_blocked New value of is_blocked -updateChatIsBlocked#88da7e40 chat_id:int53 is_blocked:Bool = Update; +//@block_list Block list to which the chat is added; may be null if none +updateChatBlockList#872af48e chat_id:int53 block_list:BlockList = Update; //@description A chat's has_scheduled_messages field has changed //@chat_id Chat identifier @@ -6279,6 +6408,18 @@ updateStory#1906572f story:story = Update; //@story_id Story identifier updateStoryDeleted#7007eb9d story_sender_chat_id:int53 story_id:int32 = Update; +//@description A story has been successfully sent +//@story The sent story +//@old_story_id The previous temporary story identifier +updateStorySendSucceeded#b9269e57 story:story old_story_id:int32 = Update; + +//@description A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +//@story The failed to send story +//@error The cause of the failure; may be null if unknown +//@error_code An error code +//@error_message Error message +updateStorySendFailed#4418bca2 story:story error:CanSendStoryResult error_code:int32 error_message:string = Update; + //@description The list of active stories posted by a specific chat has changed //@active_stories The new list of active stories updateChatActiveStories#79786c2c active_stories:chatActiveStories = Update; @@ -6288,6 +6429,11 @@ updateChatActiveStories#79786c2c active_stories:chatActiveStories = Update; //@chat_count Approximate total number of chats with active stories in the list updateStoryListChatCount#8833cd3f story_list:StoryList chat_count:int32 = Update; +//@description Story stealth mode settings have changed +//@active_until_date Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled +//@cooldown_until_date Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown +updateStoryStealthMode#6ff7bd1a active_until_date:int32 cooldown_until_date:int32 = Update; + //@description An option changed its value //@name The option name //@value The new option value @@ -7102,7 +7248,7 @@ sendBotStartMessage#aa6a3eee bot_user_id:int53 chat_id:int53 parameter:string = //@reply_to Identifier of the replied message or story; 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 result +//@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; @@ -7438,7 +7584,7 @@ shareChatWithBot#a6530ae2 chat_id:int53 message_id:int53 button_id:int32 shared_ //@chat_id Identifier of the chat where the query was sent //@user_location Location of the user; pass null if unknown or the bot doesn't need user's location //@query Text of the query -//@offset Offset of the first entry to return +//@offset Offset of the first entry to return; use empty string to get the first chunk of results getInlineQueryResults#79dcf86c bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults; //@description Sets the result of an inline query; for bots only @@ -7991,20 +8137,25 @@ readChatList#bd6498aa chat_list:ChatList = Ok; //@only_local Pass true to get only locally available information without sending network requests getStory#717b1c78 story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; -//@description Sends a new story. Returns a temporary story with identifier 0 +//@description Checks whether the current user can send a story +canSendStory#ede53a66 = CanSendStoryResult; + +//@description Sends a new story. Returns a temporary story //@content Content of the story +//@areas Clickable rectangle areas to be shown on the story media; pass null if none //@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters //@privacy_settings The privacy settings for the story -//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, 2 * 86400, 3 * 86400, or 7 * 86400 for Telegram Premium users, and 86400 otherwise +//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise //@is_pinned Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting -sendStory#4dbecb6a content:InputStoryContent caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; +sendStory#40b9f838 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; //@description Changes content and caption of a previously sent story //@story_id Identifier of the story to edit //@content New content of the story; pass null to keep the current content +//@areas New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed //@caption New story caption; pass null to keep the current caption -editStory#ca87df56 story_id:int32 content:InputStoryContent caption:formattedText = Ok; +editStory#aa2c3e86 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; //@description Changes privacy settings of a previously sent story //@story_id Identifier of the story @@ -8057,11 +8208,25 @@ openStory#ceda7c7d story_sender_chat_id:int53 story_id:int32 = Ok; //@story_id The identifier of the story closeStory#443d0f55 story_sender_chat_id:int53 story_id:int32 = Ok; -//@description Returns viewers of a recent outgoing story. The method can be called if story.can_get_viewers == true. The views are returned in a reverse chronological order (i.e., in order of decreasing view_date) +//@description Returns reactions, which can be chosen for a story +//@row_size Number of reaction per row, 5-25 +getStoryAvailableReactions#23854d3b row_size:int32 = AvailableReactions; + +//@description Changes chosen reaction on a story +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story +//@reaction_type Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users +//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions +setStoryReaction#ac8b4fa7 story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; + +//@description Returns viewers of a story. The method can be called if story.can_get_viewers == true //@story_id Story identifier -//@offset_viewer A viewer from which to return next viewers; pass null to get results from the beginning +//@query Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers +//@only_contacts Pass true to get only contacts; pass false to get all relevant viewers +//@prefer_with_reaction Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of story viewers to return -getStoryViewers#ab175e7b story_id:int32 offset_viewer:messageViewer limit:int32 = MessageViewers; +getStoryViewers#40df8dba story_id:int32 query:string only_contacts:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryViewers; //@description Reports a story to the Telegram moderators //@story_sender_chat_id The identifier of the sender of the story to report @@ -8070,6 +8235,9 @@ getStoryViewers#ab175e7b story_id:int32 offset_viewer:messageViewer limit:int32 //@text Additional report details; 0-1024 characters reportStory#9b5f709b story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:string = Ok; +//@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 information about a bot that can be added to attachment menu //@bot_user_id Bot's user identifier getAttachmentMenuBot#3da561fb bot_user_id:int53 = AttachmentMenuBot; @@ -8487,10 +8655,10 @@ getGroupCallStreams#9f7c9164 group_call_id:int32 = GroupCallStreams; //@video_quality Video quality as received from tgcalls; pass null to get the worst available quality getGroupCallStreamSegment#8424daa5 group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = FilePart; -//@description Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked +//@description Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked //@sender_id Identifier of a message sender to block/unblock -//@is_blocked New value of is_blocked -toggleMessageSenderIsBlocked#884f0ed5 sender_id:MessageSender is_blocked:Bool = Ok; +//@block_list New block list for the message sender; pass null to unblock the message sender +setMessageSenderBlockList#898b5c91 sender_id:MessageSender block_list:BlockList = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat @@ -8500,9 +8668,10 @@ toggleMessageSenderIsBlocked#884f0ed5 sender_id:MessageSender is_blocked:Bool = blockMessageSenderFromReplies#b79df58b message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok; //@description Returns users and chats that were blocked by the current user +//@block_list Block list from which to return users //@offset Number of users and chats to skip in the result; must be non-negative //@limit The maximum number of users and chats to return; up to 100 -getBlockedMessageSenders#740e1460 offset:int32 limit:int32 = MessageSenders; +getBlockedMessageSenders#8ce52f16 block_list:BlockList offset:int32 limit:int32 = MessageSenders; //@description Adds a user to the contact list or edits an existing contact by their user identifier //@contact The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored diff --git a/tdapi/tl_activate_story_stealth_mode_gen.go b/tdapi/tl_activate_story_stealth_mode_gen.go new file mode 100644 index 0000000000..63e9f087c7 --- /dev/null +++ b/tdapi/tl_activate_story_stealth_mode_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{} +) + +// ActivateStoryStealthModeRequest represents TL type `activateStoryStealthMode#c3db8491`. +type ActivateStoryStealthModeRequest struct { +} + +// ActivateStoryStealthModeRequestTypeID is TL type id of ActivateStoryStealthModeRequest. +const ActivateStoryStealthModeRequestTypeID = 0xc3db8491 + +// Ensuring interfaces in compile-time for ActivateStoryStealthModeRequest. +var ( + _ bin.Encoder = &ActivateStoryStealthModeRequest{} + _ bin.Decoder = &ActivateStoryStealthModeRequest{} + _ bin.BareEncoder = &ActivateStoryStealthModeRequest{} + _ bin.BareDecoder = &ActivateStoryStealthModeRequest{} +) + +func (a *ActivateStoryStealthModeRequest) Zero() bool { + if a == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (a *ActivateStoryStealthModeRequest) String() string { + if a == nil { + return "ActivateStoryStealthModeRequest(nil)" + } + type Alias ActivateStoryStealthModeRequest + return fmt.Sprintf("ActivateStoryStealthModeRequest%+v", Alias(*a)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ActivateStoryStealthModeRequest) TypeID() uint32 { + return ActivateStoryStealthModeRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ActivateStoryStealthModeRequest) TypeName() string { + return "activateStoryStealthMode" +} + +// TypeInfo returns info about TL type. +func (a *ActivateStoryStealthModeRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "activateStoryStealthMode", + ID: ActivateStoryStealthModeRequestTypeID, + } + if a == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (a *ActivateStoryStealthModeRequest) Encode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil") + } + b.PutID(ActivateStoryStealthModeRequestTypeID) + return a.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (a *ActivateStoryStealthModeRequest) EncodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (a *ActivateStoryStealthModeRequest) Decode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil") + } + if err := b.ConsumeID(ActivateStoryStealthModeRequestTypeID); err != nil { + return fmt.Errorf("unable to decode activateStoryStealthMode#c3db8491: %w", err) + } + return a.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (a *ActivateStoryStealthModeRequest) DecodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (a *ActivateStoryStealthModeRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if a == nil { + return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil") + } + b.ObjStart() + b.PutID("activateStoryStealthMode") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (a *ActivateStoryStealthModeRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if a == nil { + return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("activateStoryStealthMode"); err != nil { + return fmt.Errorf("unable to decode activateStoryStealthMode#c3db8491: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// ActivateStoryStealthMode invokes method activateStoryStealthMode#c3db8491 returning error if any. +func (c *Client) ActivateStoryStealthMode(ctx context.Context) error { + var ok Ok + + request := &ActivateStoryStealthModeRequest{} + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_block_list_gen.go b/tdapi/tl_block_list_gen.go new file mode 100644 index 0000000000..8080800464 --- /dev/null +++ b/tdapi/tl_block_list_gen.go @@ -0,0 +1,431 @@ +// 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{} +) + +// BlockListMain represents TL type `blockListMain#50a4137c`. +type BlockListMain struct { +} + +// BlockListMainTypeID is TL type id of BlockListMain. +const BlockListMainTypeID = 0x50a4137c + +// construct implements constructor of BlockListClass. +func (b BlockListMain) construct() BlockListClass { return &b } + +// Ensuring interfaces in compile-time for BlockListMain. +var ( + _ bin.Encoder = &BlockListMain{} + _ bin.Decoder = &BlockListMain{} + _ bin.BareEncoder = &BlockListMain{} + _ bin.BareDecoder = &BlockListMain{} + + _ BlockListClass = &BlockListMain{} +) + +func (b *BlockListMain) Zero() bool { + if b == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (b *BlockListMain) String() string { + if b == nil { + return "BlockListMain(nil)" + } + type Alias BlockListMain + return fmt.Sprintf("BlockListMain%+v", Alias(*b)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*BlockListMain) TypeID() uint32 { + return BlockListMainTypeID +} + +// TypeName returns name of type in TL schema. +func (*BlockListMain) TypeName() string { + return "blockListMain" +} + +// TypeInfo returns info about TL type. +func (b *BlockListMain) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "blockListMain", + ID: BlockListMainTypeID, + } + if b == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (b *BlockListMain) Encode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode blockListMain#50a4137c as nil") + } + buf.PutID(BlockListMainTypeID) + return b.EncodeBare(buf) +} + +// EncodeBare implements bin.BareEncoder. +func (b *BlockListMain) EncodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode blockListMain#50a4137c as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (b *BlockListMain) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode blockListMain#50a4137c to nil") + } + if err := buf.ConsumeID(BlockListMainTypeID); err != nil { + return fmt.Errorf("unable to decode blockListMain#50a4137c: %w", err) + } + return b.DecodeBare(buf) +} + +// DecodeBare implements bin.BareDecoder. +func (b *BlockListMain) DecodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode blockListMain#50a4137c to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (b *BlockListMain) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil { + return fmt.Errorf("can't encode blockListMain#50a4137c as nil") + } + buf.ObjStart() + buf.PutID("blockListMain") + buf.Comma() + buf.StripComma() + buf.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (b *BlockListMain) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("can't decode blockListMain#50a4137c to nil") + } + + return buf.Obj(func(buf tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := buf.ConsumeID("blockListMain"); err != nil { + return fmt.Errorf("unable to decode blockListMain#50a4137c: %w", err) + } + default: + return buf.Skip() + } + return nil + }) +} + +// BlockListStories represents TL type `blockListStories#628965c`. +type BlockListStories struct { +} + +// BlockListStoriesTypeID is TL type id of BlockListStories. +const BlockListStoriesTypeID = 0x628965c + +// construct implements constructor of BlockListClass. +func (b BlockListStories) construct() BlockListClass { return &b } + +// Ensuring interfaces in compile-time for BlockListStories. +var ( + _ bin.Encoder = &BlockListStories{} + _ bin.Decoder = &BlockListStories{} + _ bin.BareEncoder = &BlockListStories{} + _ bin.BareDecoder = &BlockListStories{} + + _ BlockListClass = &BlockListStories{} +) + +func (b *BlockListStories) Zero() bool { + if b == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (b *BlockListStories) String() string { + if b == nil { + return "BlockListStories(nil)" + } + type Alias BlockListStories + return fmt.Sprintf("BlockListStories%+v", Alias(*b)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*BlockListStories) TypeID() uint32 { + return BlockListStoriesTypeID +} + +// TypeName returns name of type in TL schema. +func (*BlockListStories) TypeName() string { + return "blockListStories" +} + +// TypeInfo returns info about TL type. +func (b *BlockListStories) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "blockListStories", + ID: BlockListStoriesTypeID, + } + if b == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (b *BlockListStories) Encode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode blockListStories#628965c as nil") + } + buf.PutID(BlockListStoriesTypeID) + return b.EncodeBare(buf) +} + +// EncodeBare implements bin.BareEncoder. +func (b *BlockListStories) EncodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode blockListStories#628965c as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (b *BlockListStories) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode blockListStories#628965c to nil") + } + if err := buf.ConsumeID(BlockListStoriesTypeID); err != nil { + return fmt.Errorf("unable to decode blockListStories#628965c: %w", err) + } + return b.DecodeBare(buf) +} + +// DecodeBare implements bin.BareDecoder. +func (b *BlockListStories) DecodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode blockListStories#628965c to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (b *BlockListStories) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil { + return fmt.Errorf("can't encode blockListStories#628965c as nil") + } + buf.ObjStart() + buf.PutID("blockListStories") + buf.Comma() + buf.StripComma() + buf.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (b *BlockListStories) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("can't decode blockListStories#628965c to nil") + } + + return buf.Obj(func(buf tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := buf.ConsumeID("blockListStories"); err != nil { + return fmt.Errorf("unable to decode blockListStories#628965c: %w", err) + } + default: + return buf.Skip() + } + return nil + }) +} + +// BlockListClassName is schema name of BlockListClass. +const BlockListClassName = "BlockList" + +// BlockListClass represents BlockList generic type. +// +// Example: +// +// g, err := tdapi.DecodeBlockList(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.BlockListMain: // blockListMain#50a4137c +// case *tdapi.BlockListStories: // blockListStories#628965c +// default: panic(v) +// } +type BlockListClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() BlockListClass + + // 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 +} + +// DecodeBlockList implements binary de-serialization for BlockListClass. +func DecodeBlockList(buf *bin.Buffer) (BlockListClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case BlockListMainTypeID: + // Decoding blockListMain#50a4137c. + v := BlockListMain{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode BlockListClass: %w", err) + } + return &v, nil + case BlockListStoriesTypeID: + // Decoding blockListStories#628965c. + v := BlockListStories{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode BlockListClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode BlockListClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONBlockList implements binary de-serialization for BlockListClass. +func DecodeTDLibJSONBlockList(buf tdjson.Decoder) (BlockListClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "blockListMain": + // Decoding blockListMain#50a4137c. + v := BlockListMain{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode BlockListClass: %w", err) + } + return &v, nil + case "blockListStories": + // Decoding blockListStories#628965c. + v := BlockListStories{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode BlockListClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode BlockListClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// BlockList boxes the BlockListClass providing a helper. +type BlockListBox struct { + BlockList BlockListClass +} + +// Decode implements bin.Decoder for BlockListBox. +func (b *BlockListBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode BlockListBox to nil") + } + v, err := DecodeBlockList(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.BlockList = v + return nil +} + +// Encode implements bin.Encode for BlockListBox. +func (b *BlockListBox) Encode(buf *bin.Buffer) error { + if b == nil || b.BlockList == nil { + return fmt.Errorf("unable to encode BlockListClass as nil") + } + return b.BlockList.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for BlockListBox. +func (b *BlockListBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode BlockListBox to nil") + } + v, err := DecodeTDLibJSONBlockList(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.BlockList = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for BlockListBox. +func (b *BlockListBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.BlockList == nil { + return fmt.Errorf("unable to encode BlockListClass as nil") + } + return b.BlockList.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_can_send_story_gen.go b/tdapi/tl_can_send_story_gen.go new file mode 100644 index 0000000000..3084a3fd9e --- /dev/null +++ b/tdapi/tl_can_send_story_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{} +) + +// CanSendStoryRequest represents TL type `canSendStory#ede53a66`. +type CanSendStoryRequest struct { +} + +// CanSendStoryRequestTypeID is TL type id of CanSendStoryRequest. +const CanSendStoryRequestTypeID = 0xede53a66 + +// Ensuring interfaces in compile-time for CanSendStoryRequest. +var ( + _ bin.Encoder = &CanSendStoryRequest{} + _ bin.Decoder = &CanSendStoryRequest{} + _ bin.BareEncoder = &CanSendStoryRequest{} + _ bin.BareDecoder = &CanSendStoryRequest{} +) + +func (c *CanSendStoryRequest) Zero() bool { + if c == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryRequest) String() string { + if c == nil { + return "CanSendStoryRequest(nil)" + } + type Alias CanSendStoryRequest + return fmt.Sprintf("CanSendStoryRequest%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryRequest) TypeID() uint32 { + return CanSendStoryRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryRequest) TypeName() string { + return "canSendStory" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStory", + ID: CanSendStoryRequestTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (c *CanSendStoryRequest) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStory#ede53a66 as nil") + } + b.PutID(CanSendStoryRequestTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryRequest) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStory#ede53a66 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryRequest) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStory#ede53a66 to nil") + } + if err := b.ConsumeID(CanSendStoryRequestTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStory#ede53a66: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryRequest) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStory#ede53a66 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStory#ede53a66 as nil") + } + b.ObjStart() + b.PutID("canSendStory") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStory#ede53a66 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStory"); err != nil { + return fmt.Errorf("unable to decode canSendStory#ede53a66: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// CanSendStory invokes method canSendStory#ede53a66 returning error if any. +func (c *Client) CanSendStory(ctx context.Context) (CanSendStoryResultClass, error) { + var result CanSendStoryResultBox + + request := &CanSendStoryRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.CanSendStoryResult, nil +} diff --git a/tdapi/tl_can_send_story_result_gen.go b/tdapi/tl_can_send_story_result_gen.go new file mode 100644 index 0000000000..feaa317857 --- /dev/null +++ b/tdapi/tl_can_send_story_result_gen.go @@ -0,0 +1,939 @@ +// 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{} +) + +// CanSendStoryResultOk represents TL type `canSendStoryResultOk#503cf0fd`. +type CanSendStoryResultOk struct { +} + +// CanSendStoryResultOkTypeID is TL type id of CanSendStoryResultOk. +const CanSendStoryResultOkTypeID = 0x503cf0fd + +// construct implements constructor of CanSendStoryResultClass. +func (c CanSendStoryResultOk) construct() CanSendStoryResultClass { return &c } + +// Ensuring interfaces in compile-time for CanSendStoryResultOk. +var ( + _ bin.Encoder = &CanSendStoryResultOk{} + _ bin.Decoder = &CanSendStoryResultOk{} + _ bin.BareEncoder = &CanSendStoryResultOk{} + _ bin.BareDecoder = &CanSendStoryResultOk{} + + _ CanSendStoryResultClass = &CanSendStoryResultOk{} +) + +func (c *CanSendStoryResultOk) Zero() bool { + if c == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryResultOk) String() string { + if c == nil { + return "CanSendStoryResultOk(nil)" + } + type Alias CanSendStoryResultOk + return fmt.Sprintf("CanSendStoryResultOk%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryResultOk) TypeID() uint32 { + return CanSendStoryResultOkTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryResultOk) TypeName() string { + return "canSendStoryResultOk" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryResultOk) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStoryResultOk", + ID: CanSendStoryResultOkTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (c *CanSendStoryResultOk) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultOk#503cf0fd as nil") + } + b.PutID(CanSendStoryResultOkTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryResultOk) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultOk#503cf0fd as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryResultOk) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultOk#503cf0fd to nil") + } + if err := b.ConsumeID(CanSendStoryResultOkTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultOk#503cf0fd: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryResultOk) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultOk#503cf0fd to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryResultOk) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultOk#503cf0fd as nil") + } + b.ObjStart() + b.PutID("canSendStoryResultOk") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryResultOk) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultOk#503cf0fd to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStoryResultOk"); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultOk#503cf0fd: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// CanSendStoryResultPremiumNeeded represents TL type `canSendStoryResultPremiumNeeded#567fde69`. +type CanSendStoryResultPremiumNeeded struct { +} + +// CanSendStoryResultPremiumNeededTypeID is TL type id of CanSendStoryResultPremiumNeeded. +const CanSendStoryResultPremiumNeededTypeID = 0x567fde69 + +// construct implements constructor of CanSendStoryResultClass. +func (c CanSendStoryResultPremiumNeeded) construct() CanSendStoryResultClass { return &c } + +// Ensuring interfaces in compile-time for CanSendStoryResultPremiumNeeded. +var ( + _ bin.Encoder = &CanSendStoryResultPremiumNeeded{} + _ bin.Decoder = &CanSendStoryResultPremiumNeeded{} + _ bin.BareEncoder = &CanSendStoryResultPremiumNeeded{} + _ bin.BareDecoder = &CanSendStoryResultPremiumNeeded{} + + _ CanSendStoryResultClass = &CanSendStoryResultPremiumNeeded{} +) + +func (c *CanSendStoryResultPremiumNeeded) Zero() bool { + if c == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryResultPremiumNeeded) String() string { + if c == nil { + return "CanSendStoryResultPremiumNeeded(nil)" + } + type Alias CanSendStoryResultPremiumNeeded + return fmt.Sprintf("CanSendStoryResultPremiumNeeded%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryResultPremiumNeeded) TypeID() uint32 { + return CanSendStoryResultPremiumNeededTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryResultPremiumNeeded) TypeName() string { + return "canSendStoryResultPremiumNeeded" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryResultPremiumNeeded) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStoryResultPremiumNeeded", + ID: CanSendStoryResultPremiumNeededTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (c *CanSendStoryResultPremiumNeeded) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultPremiumNeeded#567fde69 as nil") + } + b.PutID(CanSendStoryResultPremiumNeededTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryResultPremiumNeeded) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultPremiumNeeded#567fde69 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryResultPremiumNeeded) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultPremiumNeeded#567fde69 to nil") + } + if err := b.ConsumeID(CanSendStoryResultPremiumNeededTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultPremiumNeeded#567fde69: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryResultPremiumNeeded) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultPremiumNeeded#567fde69 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryResultPremiumNeeded) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultPremiumNeeded#567fde69 as nil") + } + b.ObjStart() + b.PutID("canSendStoryResultPremiumNeeded") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryResultPremiumNeeded) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultPremiumNeeded#567fde69 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStoryResultPremiumNeeded"); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultPremiumNeeded#567fde69: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// CanSendStoryResultActiveStoryLimitExceeded represents TL type `canSendStoryResultActiveStoryLimitExceeded#afd9aad6`. +type CanSendStoryResultActiveStoryLimitExceeded struct { +} + +// CanSendStoryResultActiveStoryLimitExceededTypeID is TL type id of CanSendStoryResultActiveStoryLimitExceeded. +const CanSendStoryResultActiveStoryLimitExceededTypeID = 0xafd9aad6 + +// construct implements constructor of CanSendStoryResultClass. +func (c CanSendStoryResultActiveStoryLimitExceeded) construct() CanSendStoryResultClass { return &c } + +// Ensuring interfaces in compile-time for CanSendStoryResultActiveStoryLimitExceeded. +var ( + _ bin.Encoder = &CanSendStoryResultActiveStoryLimitExceeded{} + _ bin.Decoder = &CanSendStoryResultActiveStoryLimitExceeded{} + _ bin.BareEncoder = &CanSendStoryResultActiveStoryLimitExceeded{} + _ bin.BareDecoder = &CanSendStoryResultActiveStoryLimitExceeded{} + + _ CanSendStoryResultClass = &CanSendStoryResultActiveStoryLimitExceeded{} +) + +func (c *CanSendStoryResultActiveStoryLimitExceeded) Zero() bool { + if c == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryResultActiveStoryLimitExceeded) String() string { + if c == nil { + return "CanSendStoryResultActiveStoryLimitExceeded(nil)" + } + type Alias CanSendStoryResultActiveStoryLimitExceeded + return fmt.Sprintf("CanSendStoryResultActiveStoryLimitExceeded%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryResultActiveStoryLimitExceeded) TypeID() uint32 { + return CanSendStoryResultActiveStoryLimitExceededTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryResultActiveStoryLimitExceeded) TypeName() string { + return "canSendStoryResultActiveStoryLimitExceeded" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryResultActiveStoryLimitExceeded) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStoryResultActiveStoryLimitExceeded", + ID: CanSendStoryResultActiveStoryLimitExceededTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 as nil") + } + b.PutID(CanSendStoryResultActiveStoryLimitExceededTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 to nil") + } + if err := b.ConsumeID(CanSendStoryResultActiveStoryLimitExceededTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultActiveStoryLimitExceeded#afd9aad6: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 as nil") + } + b.ObjStart() + b.PutID("canSendStoryResultActiveStoryLimitExceeded") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryResultActiveStoryLimitExceeded) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultActiveStoryLimitExceeded#afd9aad6 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStoryResultActiveStoryLimitExceeded"); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultActiveStoryLimitExceeded#afd9aad6: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// CanSendStoryResultWeeklyLimitExceeded represents TL type `canSendStoryResultWeeklyLimitExceeded#1341a0b8`. +type CanSendStoryResultWeeklyLimitExceeded struct { + // Time left before the user can send the next story + RetryAfter int32 +} + +// CanSendStoryResultWeeklyLimitExceededTypeID is TL type id of CanSendStoryResultWeeklyLimitExceeded. +const CanSendStoryResultWeeklyLimitExceededTypeID = 0x1341a0b8 + +// construct implements constructor of CanSendStoryResultClass. +func (c CanSendStoryResultWeeklyLimitExceeded) construct() CanSendStoryResultClass { return &c } + +// Ensuring interfaces in compile-time for CanSendStoryResultWeeklyLimitExceeded. +var ( + _ bin.Encoder = &CanSendStoryResultWeeklyLimitExceeded{} + _ bin.Decoder = &CanSendStoryResultWeeklyLimitExceeded{} + _ bin.BareEncoder = &CanSendStoryResultWeeklyLimitExceeded{} + _ bin.BareDecoder = &CanSendStoryResultWeeklyLimitExceeded{} + + _ CanSendStoryResultClass = &CanSendStoryResultWeeklyLimitExceeded{} +) + +func (c *CanSendStoryResultWeeklyLimitExceeded) Zero() bool { + if c == nil { + return true + } + if !(c.RetryAfter == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryResultWeeklyLimitExceeded) String() string { + if c == nil { + return "CanSendStoryResultWeeklyLimitExceeded(nil)" + } + type Alias CanSendStoryResultWeeklyLimitExceeded + return fmt.Sprintf("CanSendStoryResultWeeklyLimitExceeded%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryResultWeeklyLimitExceeded) TypeID() uint32 { + return CanSendStoryResultWeeklyLimitExceededTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryResultWeeklyLimitExceeded) TypeName() string { + return "canSendStoryResultWeeklyLimitExceeded" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryResultWeeklyLimitExceeded) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStoryResultWeeklyLimitExceeded", + ID: CanSendStoryResultWeeklyLimitExceededTypeID, + } + 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 *CanSendStoryResultWeeklyLimitExceeded) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultWeeklyLimitExceeded#1341a0b8 as nil") + } + b.PutID(CanSendStoryResultWeeklyLimitExceededTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryResultWeeklyLimitExceeded) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultWeeklyLimitExceeded#1341a0b8 as nil") + } + b.PutInt32(c.RetryAfter) + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryResultWeeklyLimitExceeded) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultWeeklyLimitExceeded#1341a0b8 to nil") + } + if err := b.ConsumeID(CanSendStoryResultWeeklyLimitExceededTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultWeeklyLimitExceeded#1341a0b8: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryResultWeeklyLimitExceeded) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultWeeklyLimitExceeded#1341a0b8 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode canSendStoryResultWeeklyLimitExceeded#1341a0b8: field retry_after: %w", err) + } + c.RetryAfter = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryResultWeeklyLimitExceeded) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultWeeklyLimitExceeded#1341a0b8 as nil") + } + b.ObjStart() + b.PutID("canSendStoryResultWeeklyLimitExceeded") + b.Comma() + b.FieldStart("retry_after") + b.PutInt32(c.RetryAfter) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryResultWeeklyLimitExceeded) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultWeeklyLimitExceeded#1341a0b8 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStoryResultWeeklyLimitExceeded"); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultWeeklyLimitExceeded#1341a0b8: %w", err) + } + case "retry_after": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode canSendStoryResultWeeklyLimitExceeded#1341a0b8: field retry_after: %w", err) + } + c.RetryAfter = value + default: + return b.Skip() + } + return nil + }) +} + +// GetRetryAfter returns value of RetryAfter field. +func (c *CanSendStoryResultWeeklyLimitExceeded) GetRetryAfter() (value int32) { + if c == nil { + return + } + return c.RetryAfter +} + +// CanSendStoryResultMonthlyLimitExceeded represents TL type `canSendStoryResultMonthlyLimitExceeded#dd8242d5`. +type CanSendStoryResultMonthlyLimitExceeded struct { + // Time left before the user can send the next story + RetryAfter int32 +} + +// CanSendStoryResultMonthlyLimitExceededTypeID is TL type id of CanSendStoryResultMonthlyLimitExceeded. +const CanSendStoryResultMonthlyLimitExceededTypeID = 0xdd8242d5 + +// construct implements constructor of CanSendStoryResultClass. +func (c CanSendStoryResultMonthlyLimitExceeded) construct() CanSendStoryResultClass { return &c } + +// Ensuring interfaces in compile-time for CanSendStoryResultMonthlyLimitExceeded. +var ( + _ bin.Encoder = &CanSendStoryResultMonthlyLimitExceeded{} + _ bin.Decoder = &CanSendStoryResultMonthlyLimitExceeded{} + _ bin.BareEncoder = &CanSendStoryResultMonthlyLimitExceeded{} + _ bin.BareDecoder = &CanSendStoryResultMonthlyLimitExceeded{} + + _ CanSendStoryResultClass = &CanSendStoryResultMonthlyLimitExceeded{} +) + +func (c *CanSendStoryResultMonthlyLimitExceeded) Zero() bool { + if c == nil { + return true + } + if !(c.RetryAfter == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *CanSendStoryResultMonthlyLimitExceeded) String() string { + if c == nil { + return "CanSendStoryResultMonthlyLimitExceeded(nil)" + } + type Alias CanSendStoryResultMonthlyLimitExceeded + return fmt.Sprintf("CanSendStoryResultMonthlyLimitExceeded%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CanSendStoryResultMonthlyLimitExceeded) TypeID() uint32 { + return CanSendStoryResultMonthlyLimitExceededTypeID +} + +// TypeName returns name of type in TL schema. +func (*CanSendStoryResultMonthlyLimitExceeded) TypeName() string { + return "canSendStoryResultMonthlyLimitExceeded" +} + +// TypeInfo returns info about TL type. +func (c *CanSendStoryResultMonthlyLimitExceeded) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "canSendStoryResultMonthlyLimitExceeded", + ID: CanSendStoryResultMonthlyLimitExceededTypeID, + } + 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 *CanSendStoryResultMonthlyLimitExceeded) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultMonthlyLimitExceeded#dd8242d5 as nil") + } + b.PutID(CanSendStoryResultMonthlyLimitExceededTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CanSendStoryResultMonthlyLimitExceeded) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultMonthlyLimitExceeded#dd8242d5 as nil") + } + b.PutInt32(c.RetryAfter) + return nil +} + +// Decode implements bin.Decoder. +func (c *CanSendStoryResultMonthlyLimitExceeded) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultMonthlyLimitExceeded#dd8242d5 to nil") + } + if err := b.ConsumeID(CanSendStoryResultMonthlyLimitExceededTypeID); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultMonthlyLimitExceeded#dd8242d5: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CanSendStoryResultMonthlyLimitExceeded) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultMonthlyLimitExceeded#dd8242d5 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode canSendStoryResultMonthlyLimitExceeded#dd8242d5: field retry_after: %w", err) + } + c.RetryAfter = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CanSendStoryResultMonthlyLimitExceeded) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode canSendStoryResultMonthlyLimitExceeded#dd8242d5 as nil") + } + b.ObjStart() + b.PutID("canSendStoryResultMonthlyLimitExceeded") + b.Comma() + b.FieldStart("retry_after") + b.PutInt32(c.RetryAfter) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CanSendStoryResultMonthlyLimitExceeded) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode canSendStoryResultMonthlyLimitExceeded#dd8242d5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("canSendStoryResultMonthlyLimitExceeded"); err != nil { + return fmt.Errorf("unable to decode canSendStoryResultMonthlyLimitExceeded#dd8242d5: %w", err) + } + case "retry_after": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode canSendStoryResultMonthlyLimitExceeded#dd8242d5: field retry_after: %w", err) + } + c.RetryAfter = value + default: + return b.Skip() + } + return nil + }) +} + +// GetRetryAfter returns value of RetryAfter field. +func (c *CanSendStoryResultMonthlyLimitExceeded) GetRetryAfter() (value int32) { + if c == nil { + return + } + return c.RetryAfter +} + +// CanSendStoryResultClassName is schema name of CanSendStoryResultClass. +const CanSendStoryResultClassName = "CanSendStoryResult" + +// CanSendStoryResultClass represents CanSendStoryResult generic type. +// +// Example: +// +// g, err := tdapi.DecodeCanSendStoryResult(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.CanSendStoryResultOk: // canSendStoryResultOk#503cf0fd +// case *tdapi.CanSendStoryResultPremiumNeeded: // canSendStoryResultPremiumNeeded#567fde69 +// case *tdapi.CanSendStoryResultActiveStoryLimitExceeded: // canSendStoryResultActiveStoryLimitExceeded#afd9aad6 +// case *tdapi.CanSendStoryResultWeeklyLimitExceeded: // canSendStoryResultWeeklyLimitExceeded#1341a0b8 +// case *tdapi.CanSendStoryResultMonthlyLimitExceeded: // canSendStoryResultMonthlyLimitExceeded#dd8242d5 +// default: panic(v) +// } +type CanSendStoryResultClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() CanSendStoryResultClass + + // 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 +} + +// DecodeCanSendStoryResult implements binary de-serialization for CanSendStoryResultClass. +func DecodeCanSendStoryResult(buf *bin.Buffer) (CanSendStoryResultClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case CanSendStoryResultOkTypeID: + // Decoding canSendStoryResultOk#503cf0fd. + v := CanSendStoryResultOk{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case CanSendStoryResultPremiumNeededTypeID: + // Decoding canSendStoryResultPremiumNeeded#567fde69. + v := CanSendStoryResultPremiumNeeded{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case CanSendStoryResultActiveStoryLimitExceededTypeID: + // Decoding canSendStoryResultActiveStoryLimitExceeded#afd9aad6. + v := CanSendStoryResultActiveStoryLimitExceeded{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case CanSendStoryResultWeeklyLimitExceededTypeID: + // Decoding canSendStoryResultWeeklyLimitExceeded#1341a0b8. + v := CanSendStoryResultWeeklyLimitExceeded{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case CanSendStoryResultMonthlyLimitExceededTypeID: + // Decoding canSendStoryResultMonthlyLimitExceeded#dd8242d5. + v := CanSendStoryResultMonthlyLimitExceeded{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONCanSendStoryResult implements binary de-serialization for CanSendStoryResultClass. +func DecodeTDLibJSONCanSendStoryResult(buf tdjson.Decoder) (CanSendStoryResultClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "canSendStoryResultOk": + // Decoding canSendStoryResultOk#503cf0fd. + v := CanSendStoryResultOk{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case "canSendStoryResultPremiumNeeded": + // Decoding canSendStoryResultPremiumNeeded#567fde69. + v := CanSendStoryResultPremiumNeeded{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case "canSendStoryResultActiveStoryLimitExceeded": + // Decoding canSendStoryResultActiveStoryLimitExceeded#afd9aad6. + v := CanSendStoryResultActiveStoryLimitExceeded{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case "canSendStoryResultWeeklyLimitExceeded": + // Decoding canSendStoryResultWeeklyLimitExceeded#1341a0b8. + v := CanSendStoryResultWeeklyLimitExceeded{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + case "canSendStoryResultMonthlyLimitExceeded": + // Decoding canSendStoryResultMonthlyLimitExceeded#dd8242d5. + v := CanSendStoryResultMonthlyLimitExceeded{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode CanSendStoryResultClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// CanSendStoryResult boxes the CanSendStoryResultClass providing a helper. +type CanSendStoryResultBox struct { + CanSendStoryResult CanSendStoryResultClass +} + +// Decode implements bin.Decoder for CanSendStoryResultBox. +func (b *CanSendStoryResultBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode CanSendStoryResultBox to nil") + } + v, err := DecodeCanSendStoryResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.CanSendStoryResult = v + return nil +} + +// Encode implements bin.Encode for CanSendStoryResultBox. +func (b *CanSendStoryResultBox) Encode(buf *bin.Buffer) error { + if b == nil || b.CanSendStoryResult == nil { + return fmt.Errorf("unable to encode CanSendStoryResultClass as nil") + } + return b.CanSendStoryResult.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for CanSendStoryResultBox. +func (b *CanSendStoryResultBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode CanSendStoryResultBox to nil") + } + v, err := DecodeTDLibJSONCanSendStoryResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.CanSendStoryResult = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for CanSendStoryResultBox. +func (b *CanSendStoryResultBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.CanSendStoryResult == nil { + return fmt.Errorf("unable to encode CanSendStoryResultClass as nil") + } + return b.CanSendStoryResult.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_chat_gen.go b/tdapi/tl_chat_gen.go index 9d34444e4a..f24008072f 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#d71735a8`. +// Chat represents TL type `chat#3f50a728`. type Chat struct { // Chat unique identifier ID int64 @@ -50,15 +50,14 @@ type Chat struct { // Identifier of a user or chat that is selected to send messages in the chat; may be // null if the user can't change message sender MessageSenderID MessageSenderClass + // Block list to which the chat is added; may be null if none + BlockList BlockListClass // True, if chat content can't be saved locally, forwarded, or copied HasProtectedContent bool // True, if translation of all messages in the chat must be suggested to the user IsTranslatable bool // True, if the chat is marked as unread IsMarkedAsUnread bool - // True, if the chat is blocked by the current user and private messages from the chat - // can't be received - IsBlocked bool // True, if the chat has scheduled messages HasScheduledMessages bool // True, if the chat messages can be deleted only for the current user while other users @@ -113,7 +112,7 @@ type Chat struct { } // ChatTypeID is TL type id of Chat. -const ChatTypeID = 0xd71735a8 +const ChatTypeID = 0x3f50a728 // Ensuring interfaces in compile-time for Chat. var ( @@ -151,6 +150,9 @@ func (c *Chat) Zero() bool { if !(c.MessageSenderID == nil) { return false } + if !(c.BlockList == nil) { + return false + } if !(c.HasProtectedContent == false) { return false } @@ -160,9 +162,6 @@ func (c *Chat) Zero() bool { if !(c.IsMarkedAsUnread == false) { return false } - if !(c.IsBlocked == false) { - return false - } if !(c.HasScheduledMessages == false) { return false } @@ -294,6 +293,10 @@ func (c *Chat) TypeInfo() tdp.Type { Name: "MessageSenderID", SchemaName: "message_sender_id", }, + { + Name: "BlockList", + SchemaName: "block_list", + }, { Name: "HasProtectedContent", SchemaName: "has_protected_content", @@ -306,10 +309,6 @@ func (c *Chat) TypeInfo() tdp.Type { Name: "IsMarkedAsUnread", SchemaName: "is_marked_as_unread", }, - { - Name: "IsBlocked", - SchemaName: "is_blocked", - }, { Name: "HasScheduledMessages", SchemaName: "has_scheduled_messages", @@ -401,7 +400,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#d71735a8 as nil") + return fmt.Errorf("can't encode chat#3f50a728 as nil") } b.PutID(ChatTypeID) return c.EncodeBare(b) @@ -410,41 +409,46 @@ func (c *Chat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Chat) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chat#d71735a8 as nil") + return fmt.Errorf("can't encode chat#3f50a728 as nil") } b.PutInt53(c.ID) if c.Type == nil { - return fmt.Errorf("unable to encode chat#d71735a8: field type is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field type is nil") } if err := c.Type.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field type: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field type: %w", err) } b.PutString(c.Title) if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field photo: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field photo: %w", err) } if err := c.Permissions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field permissions: %w", err) } if err := c.LastMessage.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare chat#3f50a728: field positions element with index %d: %w", idx, err) } } if c.MessageSenderID == nil { - return fmt.Errorf("unable to encode chat#d71735a8: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id is nil") } if err := c.MessageSenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id: %w", err) + } + if c.BlockList == nil { + return fmt.Errorf("unable to encode chat#3f50a728: 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) } b.PutBool(c.HasProtectedContent) b.PutBool(c.IsTranslatable) b.PutBool(c.IsMarkedAsUnread) - b.PutBool(c.IsBlocked) b.PutBool(c.HasScheduledMessages) b.PutBool(c.CanBeDeletedOnlyForSelf) b.PutBool(c.CanBeDeletedForAllUsers) @@ -456,34 +460,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#d71735a8: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field notification_settings: %w", err) } if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#d71735a8: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions is nil") } if err := c.AvailableReactions.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions: %w", err) } b.PutInt32(c.MessageAutoDeleteTime) if err := c.Background.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field background: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field background: %w", err) } b.PutString(c.ThemeName) if c.ActionBar == nil { - return fmt.Errorf("unable to encode chat#d71735a8: field action_bar is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field action_bar is nil") } if err := c.ActionBar.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field action_bar: %w", err) } if err := c.VideoChat.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field video_chat: %w", err) } if err := c.PendingJoinRequests.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field draft_message: %w", err) } b.PutString(c.ClientData) return nil @@ -492,10 +496,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#d71735a8 to nil") + return fmt.Errorf("can't decode chat#3f50a728 to nil") } if err := b.ConsumeID(ChatTypeID); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: %w", err) } return c.DecodeBare(b) } @@ -503,48 +507,48 @@ 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#d71735a8 to nil") + return fmt.Errorf("can't decode chat#3f50a728 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field id: %w", err) } c.ID = value } { value, err := DecodeChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field type: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field type: %w", err) } c.Type = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field title: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field title: %w", err) } c.Title = value } { if err := c.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field photo: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field photo: %w", err) } } { if err := c.Permissions.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field permissions: %w", err) } } { if err := c.LastMessage.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field last_message: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field positions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field positions: %w", err) } if headerLen > 0 { @@ -553,7 +557,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#d71735a8: field positions: %w", err) + return fmt.Errorf("unable to decode bare chat#3f50a728: field positions: %w", err) } c.Positions = append(c.Positions, value) } @@ -561,172 +565,172 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { { value, err := DecodeMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field message_sender_id: %w", err) } c.MessageSenderID = value } { - value, err := b.Bool() + value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field block_list: %w", err) } - c.HasProtectedContent = value + c.BlockList = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field has_protected_content: %w", err) } - c.IsTranslatable = value + c.HasProtectedContent = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field is_translatable: %w", err) } - c.IsMarkedAsUnread = value + c.IsTranslatable = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field is_blocked: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field is_marked_as_unread: %w", err) } - c.IsBlocked = value + c.IsMarkedAsUnread = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field has_scheduled_messages: %w", err) } c.HasScheduledMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field can_be_reported: %w", err) } c.CanBeReported = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field default_disable_notification: %w", err) } c.DefaultDisableNotification = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field unread_count: %w", err) } c.UnreadCount = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field unread_mention_count: %w", err) } c.UnreadMentionCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field unread_reaction_count: %w", err) } c.UnreadReactionCount = value } { if err := c.NotificationSettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field notification_settings: %w", err) } } { value, err := DecodeChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field available_reactions: %w", err) } c.AvailableReactions = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field background: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field background: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field theme_name: %w", err) } c.ThemeName = value } { value, err := DecodeChatActionBar(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field action_bar: %w", err) } c.ActionBar = value } { if err := c.VideoChat.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field video_chat: %w", err) } } { if err := c.PendingJoinRequests.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field pending_join_requests: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field draft_message: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field client_data: %w", err) } c.ClientData = value } @@ -736,7 +740,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#d71735a8 as nil") + return fmt.Errorf("can't encode chat#3f50a728 as nil") } b.ObjStart() b.PutID("chat") @@ -746,10 +750,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#d71735a8: field type is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field type is nil") } if err := c.Type.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field type: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field type: %w", err) } b.Comma() b.FieldStart("title") @@ -757,24 +761,24 @@ 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#d71735a8: field photo: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field photo: %w", err) } b.Comma() b.FieldStart("permissions") if err := c.Permissions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field permissions: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field last_message: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field positions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode chat#3f50a728: field positions element with index %d: %w", idx, err) } b.Comma() } @@ -783,10 +787,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#d71735a8: field message_sender_id is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field message_sender_id is nil") } if err := c.MessageSenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field message_sender_id: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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") + } + if err := c.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode chat#3f50a728: field block_list: %w", err) } b.Comma() b.FieldStart("has_protected_content") @@ -798,9 +810,6 @@ func (c *Chat) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("is_marked_as_unread") b.PutBool(c.IsMarkedAsUnread) b.Comma() - b.FieldStart("is_blocked") - b.PutBool(c.IsBlocked) - b.Comma() b.FieldStart("has_scheduled_messages") b.PutBool(c.HasScheduledMessages) b.Comma() @@ -833,15 +842,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#d71735a8: field notification_settings: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field notification_settings: %w", err) } b.Comma() b.FieldStart("available_reactions") if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode chat#d71735a8: field available_reactions is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions is nil") } if err := c.AvailableReactions.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field available_reactions: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field available_reactions: %w", err) } b.Comma() b.FieldStart("message_auto_delete_time") @@ -849,7 +858,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#d71735a8: field background: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field background: %w", err) } b.Comma() b.FieldStart("theme_name") @@ -857,20 +866,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#d71735a8: field action_bar is nil") + return fmt.Errorf("unable to encode chat#3f50a728: field action_bar is nil") } if err := c.ActionBar.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode chat#d71735a8: field action_bar: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field video_chat: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: 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#d71735a8: field pending_join_requests: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field pending_join_requests: %w", err) } b.Comma() b.FieldStart("reply_markup_message_id") @@ -878,7 +887,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#d71735a8: field draft_message: %w", err) + return fmt.Errorf("unable to encode chat#3f50a728: field draft_message: %w", err) } b.Comma() b.FieldStart("client_data") @@ -892,200 +901,200 @@ 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#d71735a8 to nil") + return fmt.Errorf("can't decode chat#3f50a728 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#d71735a8: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: %w", err) } case "id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field id: %w", err) } c.ID = value case "type": value, err := DecodeTDLibJSONChatType(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field type: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field type: %w", err) } c.Type = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field title: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field title: %w", err) } c.Title = value case "photo": if err := c.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field photo: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field photo: %w", err) } case "permissions": if err := c.Permissions.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field permissions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field permissions: %w", err) } case "last_message": if err := c.LastMessage.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field last_message: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field positions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field positions: %w", err) } c.Positions = append(c.Positions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field positions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field positions: %w", err) } case "message_sender_id": value, err := DecodeTDLibJSONMessageSender(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field message_sender_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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) + } + c.BlockList = value case "has_protected_content": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field has_protected_content: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field is_translatable: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field is_marked_as_unread: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field is_marked_as_unread: %w", err) } c.IsMarkedAsUnread = value - case "is_blocked": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field is_blocked: %w", err) - } - c.IsBlocked = value case "has_scheduled_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field has_scheduled_messages: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field can_be_deleted_only_for_self: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field can_be_deleted_for_all_users: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field can_be_reported: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field default_disable_notification: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field unread_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field last_read_inbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field last_read_outbox_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field unread_mention_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field unread_reaction_count: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field notification_settings: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field notification_settings: %w", err) } case "available_reactions": value, err := DecodeTDLibJSONChatAvailableReactions(b) if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field available_reactions: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field message_auto_delete_time: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field background: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field background: %w", err) } case "theme_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field theme_name: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field action_bar: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field video_chat: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field video_chat: %w", err) } case "pending_join_requests": if err := c.PendingJoinRequests.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field pending_join_requests: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field reply_markup_message_id: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: 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#d71735a8: field draft_message: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field draft_message: %w", err) } case "client_data": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#d71735a8: field client_data: %w", err) + return fmt.Errorf("unable to decode chat#3f50a728: field client_data: %w", err) } c.ClientData = value default: @@ -1159,6 +1168,14 @@ func (c *Chat) GetMessageSenderID() (value MessageSenderClass) { return c.MessageSenderID } +// GetBlockList returns value of BlockList field. +func (c *Chat) GetBlockList() (value BlockListClass) { + if c == nil { + return + } + return c.BlockList +} + // GetHasProtectedContent returns value of HasProtectedContent field. func (c *Chat) GetHasProtectedContent() (value bool) { if c == nil { @@ -1183,14 +1200,6 @@ func (c *Chat) GetIsMarkedAsUnread() (value bool) { return c.IsMarkedAsUnread } -// GetIsBlocked returns value of IsBlocked field. -func (c *Chat) GetIsBlocked() (value bool) { - if c == nil { - return - } - return c.IsBlocked -} - // GetHasScheduledMessages returns value of HasScheduledMessages field. func (c *Chat) GetHasScheduledMessages() (value bool) { if c == nil { diff --git a/tdapi/tl_edit_story_gen.go b/tdapi/tl_edit_story_gen.go index acbbd6cf2f..dcb274d6f9 100644 --- a/tdapi/tl_edit_story_gen.go +++ b/tdapi/tl_edit_story_gen.go @@ -31,18 +31,21 @@ var ( _ = tdjson.Encoder{} ) -// EditStoryRequest represents TL type `editStory#ca87df56`. +// EditStoryRequest represents TL type `editStory#aa2c3e86`. type EditStoryRequest struct { // Identifier of the story to edit StoryID int32 // New content of the story; pass null to keep the current content Content InputStoryContentClass + // New clickable rectangle areas to be shown on the story media; pass null to keep the + // current areas. Areas can't be edited if story content isn't changed + Areas InputStoryAreas // New story caption; pass null to keep the current caption Caption FormattedText } // EditStoryRequestTypeID is TL type id of EditStoryRequest. -const EditStoryRequestTypeID = 0xca87df56 +const EditStoryRequestTypeID = 0xaa2c3e86 // Ensuring interfaces in compile-time for EditStoryRequest. var ( @@ -62,6 +65,9 @@ func (e *EditStoryRequest) Zero() bool { if !(e.Content == nil) { return false } + if !(e.Areas.Zero()) { + return false + } if !(e.Caption.Zero()) { return false } @@ -109,6 +115,10 @@ func (e *EditStoryRequest) TypeInfo() tdp.Type { Name: "Content", SchemaName: "content", }, + { + Name: "Areas", + SchemaName: "areas", + }, { Name: "Caption", SchemaName: "caption", @@ -120,7 +130,7 @@ func (e *EditStoryRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *EditStoryRequest) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode editStory#ca87df56 as nil") + return fmt.Errorf("can't encode editStory#aa2c3e86 as nil") } b.PutID(EditStoryRequestTypeID) return e.EncodeBare(b) @@ -129,17 +139,20 @@ func (e *EditStoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *EditStoryRequest) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode editStory#ca87df56 as nil") + return fmt.Errorf("can't encode editStory#aa2c3e86 as nil") } b.PutInt32(e.StoryID) if e.Content == nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field content is nil") + return fmt.Errorf("unable to encode editStory#aa2c3e86: field content is nil") } if err := e.Content.Encode(b); err != nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field content: %w", err) + return fmt.Errorf("unable to encode editStory#aa2c3e86: field content: %w", err) + } + if err := e.Areas.Encode(b); err != nil { + return fmt.Errorf("unable to encode editStory#aa2c3e86: field areas: %w", err) } if err := e.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field caption: %w", err) + return fmt.Errorf("unable to encode editStory#aa2c3e86: field caption: %w", err) } return nil } @@ -147,10 +160,10 @@ func (e *EditStoryRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *EditStoryRequest) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode editStory#ca87df56 to nil") + return fmt.Errorf("can't decode editStory#aa2c3e86 to nil") } if err := b.ConsumeID(EditStoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: %w", err) } return e.DecodeBare(b) } @@ -158,25 +171,30 @@ func (e *EditStoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *EditStoryRequest) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode editStory#ca87df56 to nil") + return fmt.Errorf("can't decode editStory#aa2c3e86 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field story_id: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field story_id: %w", err) } e.StoryID = value } { value, err := DecodeInputStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field content: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field content: %w", err) } e.Content = value } + { + if err := e.Areas.Decode(b); err != nil { + return fmt.Errorf("unable to decode editStory#aa2c3e86: field areas: %w", err) + } + } { if err := e.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field caption: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field caption: %w", err) } } return nil @@ -185,7 +203,7 @@ func (e *EditStoryRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (e *EditStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if e == nil { - return fmt.Errorf("can't encode editStory#ca87df56 as nil") + return fmt.Errorf("can't encode editStory#aa2c3e86 as nil") } b.ObjStart() b.PutID("editStory") @@ -195,15 +213,20 @@ func (e *EditStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("content") if e.Content == nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field content is nil") + return fmt.Errorf("unable to encode editStory#aa2c3e86: field content is nil") } if err := e.Content.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field content: %w", err) + return fmt.Errorf("unable to encode editStory#aa2c3e86: field content: %w", err) + } + b.Comma() + b.FieldStart("areas") + if err := e.Areas.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode editStory#aa2c3e86: field areas: %w", err) } b.Comma() b.FieldStart("caption") if err := e.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode editStory#ca87df56: field caption: %w", err) + return fmt.Errorf("unable to encode editStory#aa2c3e86: field caption: %w", err) } b.Comma() b.StripComma() @@ -214,30 +237,34 @@ func (e *EditStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (e *EditStoryRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if e == nil { - return fmt.Errorf("can't decode editStory#ca87df56 to nil") + return fmt.Errorf("can't decode editStory#aa2c3e86 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("editStory"); err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: %w", err) } case "story_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field story_id: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field story_id: %w", err) } e.StoryID = value case "content": value, err := DecodeTDLibJSONInputStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field content: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field content: %w", err) } e.Content = value + case "areas": + if err := e.Areas.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode editStory#aa2c3e86: field areas: %w", err) + } case "caption": if err := e.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode editStory#ca87df56: field caption: %w", err) + return fmt.Errorf("unable to decode editStory#aa2c3e86: field caption: %w", err) } default: return b.Skip() @@ -262,6 +289,14 @@ func (e *EditStoryRequest) GetContent() (value InputStoryContentClass) { return e.Content } +// GetAreas returns value of Areas field. +func (e *EditStoryRequest) GetAreas() (value InputStoryAreas) { + if e == nil { + return + } + return e.Areas +} + // GetCaption returns value of Caption field. func (e *EditStoryRequest) GetCaption() (value FormattedText) { if e == nil { @@ -270,7 +305,7 @@ func (e *EditStoryRequest) GetCaption() (value FormattedText) { return e.Caption } -// EditStory invokes method editStory#ca87df56 returning error if any. +// EditStory invokes method editStory#aa2c3e86 returning error if any. func (c *Client) EditStory(ctx context.Context, request *EditStoryRequest) error { var ok Ok diff --git a/tdapi/tl_get_blocked_message_senders_gen.go b/tdapi/tl_get_blocked_message_senders_gen.go index 7615097662..df7908e3f4 100644 --- a/tdapi/tl_get_blocked_message_senders_gen.go +++ b/tdapi/tl_get_blocked_message_senders_gen.go @@ -31,8 +31,10 @@ var ( _ = tdjson.Encoder{} ) -// GetBlockedMessageSendersRequest represents TL type `getBlockedMessageSenders#740e1460`. +// GetBlockedMessageSendersRequest represents TL type `getBlockedMessageSenders#8ce52f16`. type GetBlockedMessageSendersRequest struct { + // Block list from which to return users + BlockList BlockListClass // Number of users and chats to skip in the result; must be non-negative Offset int32 // The maximum number of users and chats to return; up to 100 @@ -40,7 +42,7 @@ type GetBlockedMessageSendersRequest struct { } // GetBlockedMessageSendersRequestTypeID is TL type id of GetBlockedMessageSendersRequest. -const GetBlockedMessageSendersRequestTypeID = 0x740e1460 +const GetBlockedMessageSendersRequestTypeID = 0x8ce52f16 // Ensuring interfaces in compile-time for GetBlockedMessageSendersRequest. var ( @@ -54,6 +56,9 @@ func (g *GetBlockedMessageSendersRequest) Zero() bool { if g == nil { return true } + if !(g.BlockList == nil) { + return false + } if !(g.Offset == 0) { return false } @@ -96,6 +101,10 @@ func (g *GetBlockedMessageSendersRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "BlockList", + SchemaName: "block_list", + }, { Name: "Offset", SchemaName: "offset", @@ -111,7 +120,7 @@ func (g *GetBlockedMessageSendersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetBlockedMessageSendersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getBlockedMessageSenders#740e1460 as nil") + return fmt.Errorf("can't encode getBlockedMessageSenders#8ce52f16 as nil") } b.PutID(GetBlockedMessageSendersRequestTypeID) return g.EncodeBare(b) @@ -120,7 +129,13 @@ func (g *GetBlockedMessageSendersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetBlockedMessageSendersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getBlockedMessageSenders#740e1460 as nil") + return fmt.Errorf("can't encode getBlockedMessageSenders#8ce52f16 as nil") + } + if g.BlockList == nil { + return fmt.Errorf("unable to encode getBlockedMessageSenders#8ce52f16: field block_list is nil") + } + if err := g.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode getBlockedMessageSenders#8ce52f16: field block_list: %w", err) } b.PutInt32(g.Offset) b.PutInt32(g.Limit) @@ -130,10 +145,10 @@ func (g *GetBlockedMessageSendersRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetBlockedMessageSendersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getBlockedMessageSenders#740e1460 to nil") + return fmt.Errorf("can't decode getBlockedMessageSenders#8ce52f16 to nil") } if err := b.ConsumeID(GetBlockedMessageSendersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: %w", err) } return g.DecodeBare(b) } @@ -141,19 +156,26 @@ func (g *GetBlockedMessageSendersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetBlockedMessageSendersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getBlockedMessageSenders#740e1460 to nil") + return fmt.Errorf("can't decode getBlockedMessageSenders#8ce52f16 to nil") + } + { + value, err := DecodeBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field block_list: %w", err) + } + g.BlockList = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: field offset: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field offset: %w", err) } g.Offset = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: field limit: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field limit: %w", err) } g.Limit = value } @@ -163,11 +185,19 @@ func (g *GetBlockedMessageSendersRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetBlockedMessageSendersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getBlockedMessageSenders#740e1460 as nil") + return fmt.Errorf("can't encode getBlockedMessageSenders#8ce52f16 as nil") } b.ObjStart() b.PutID("getBlockedMessageSenders") b.Comma() + b.FieldStart("block_list") + if g.BlockList == nil { + return fmt.Errorf("unable to encode getBlockedMessageSenders#8ce52f16: field block_list is nil") + } + if err := g.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getBlockedMessageSenders#8ce52f16: field block_list: %w", err) + } + b.Comma() b.FieldStart("offset") b.PutInt32(g.Offset) b.Comma() @@ -182,25 +212,31 @@ func (g *GetBlockedMessageSendersRequest) EncodeTDLibJSON(b tdjson.Encoder) erro // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetBlockedMessageSendersRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getBlockedMessageSenders#740e1460 to nil") + return fmt.Errorf("can't decode getBlockedMessageSenders#8ce52f16 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getBlockedMessageSenders"); err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: %w", err) + } + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field block_list: %w", err) } + g.BlockList = value case "offset": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: field offset: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field offset: %w", err) } g.Offset = value case "limit": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getBlockedMessageSenders#740e1460: field limit: %w", err) + return fmt.Errorf("unable to decode getBlockedMessageSenders#8ce52f16: field limit: %w", err) } g.Limit = value default: @@ -210,6 +246,14 @@ func (g *GetBlockedMessageSendersRequest) DecodeTDLibJSON(b tdjson.Decoder) erro }) } +// GetBlockList returns value of BlockList field. +func (g *GetBlockedMessageSendersRequest) GetBlockList() (value BlockListClass) { + if g == nil { + return + } + return g.BlockList +} + // GetOffset returns value of Offset field. func (g *GetBlockedMessageSendersRequest) GetOffset() (value int32) { if g == nil { @@ -226,7 +270,7 @@ func (g *GetBlockedMessageSendersRequest) GetLimit() (value int32) { return g.Limit } -// GetBlockedMessageSenders invokes method getBlockedMessageSenders#740e1460 returning error if any. +// GetBlockedMessageSenders invokes method getBlockedMessageSenders#8ce52f16 returning error if any. func (c *Client) GetBlockedMessageSenders(ctx context.Context, request *GetBlockedMessageSendersRequest) (*MessageSenders, error) { var result MessageSenders diff --git a/tdapi/tl_get_inline_query_results_gen.go b/tdapi/tl_get_inline_query_results_gen.go index a1da64df34..b3638a0ddd 100644 --- a/tdapi/tl_get_inline_query_results_gen.go +++ b/tdapi/tl_get_inline_query_results_gen.go @@ -41,7 +41,8 @@ type GetInlineQueryResultsRequest struct { UserLocation Location // Text of the query Query string - // Offset of the first entry to return + // Offset of the first entry to return; use empty string to get the first chunk of + // results Offset string } diff --git a/tdapi/tl_get_story_available_reactions_gen.go b/tdapi/tl_get_story_available_reactions_gen.go new file mode 100644 index 0000000000..57c8d06af6 --- /dev/null +++ b/tdapi/tl_get_story_available_reactions_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{} +) + +// GetStoryAvailableReactionsRequest represents TL type `getStoryAvailableReactions#23854d3b`. +type GetStoryAvailableReactionsRequest struct { + // Number of reaction per row, 5-25 + RowSize int32 +} + +// GetStoryAvailableReactionsRequestTypeID is TL type id of GetStoryAvailableReactionsRequest. +const GetStoryAvailableReactionsRequestTypeID = 0x23854d3b + +// Ensuring interfaces in compile-time for GetStoryAvailableReactionsRequest. +var ( + _ bin.Encoder = &GetStoryAvailableReactionsRequest{} + _ bin.Decoder = &GetStoryAvailableReactionsRequest{} + _ bin.BareEncoder = &GetStoryAvailableReactionsRequest{} + _ bin.BareDecoder = &GetStoryAvailableReactionsRequest{} +) + +func (g *GetStoryAvailableReactionsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.RowSize == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetStoryAvailableReactionsRequest) String() string { + if g == nil { + return "GetStoryAvailableReactionsRequest(nil)" + } + type Alias GetStoryAvailableReactionsRequest + return fmt.Sprintf("GetStoryAvailableReactionsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetStoryAvailableReactionsRequest) TypeID() uint32 { + return GetStoryAvailableReactionsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetStoryAvailableReactionsRequest) TypeName() string { + return "getStoryAvailableReactions" +} + +// TypeInfo returns info about TL type. +func (g *GetStoryAvailableReactionsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getStoryAvailableReactions", + ID: GetStoryAvailableReactionsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "RowSize", + SchemaName: "row_size", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetStoryAvailableReactionsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStoryAvailableReactions#23854d3b as nil") + } + b.PutID(GetStoryAvailableReactionsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetStoryAvailableReactionsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStoryAvailableReactions#23854d3b as nil") + } + b.PutInt32(g.RowSize) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetStoryAvailableReactionsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStoryAvailableReactions#23854d3b to nil") + } + if err := b.ConsumeID(GetStoryAvailableReactionsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getStoryAvailableReactions#23854d3b: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetStoryAvailableReactionsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStoryAvailableReactions#23854d3b to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryAvailableReactions#23854d3b: field row_size: %w", err) + } + g.RowSize = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetStoryAvailableReactionsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getStoryAvailableReactions#23854d3b as nil") + } + b.ObjStart() + b.PutID("getStoryAvailableReactions") + b.Comma() + b.FieldStart("row_size") + b.PutInt32(g.RowSize) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetStoryAvailableReactionsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getStoryAvailableReactions#23854d3b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getStoryAvailableReactions"); err != nil { + return fmt.Errorf("unable to decode getStoryAvailableReactions#23854d3b: %w", err) + } + case "row_size": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStoryAvailableReactions#23854d3b: field row_size: %w", err) + } + g.RowSize = value + default: + return b.Skip() + } + return nil + }) +} + +// GetRowSize returns value of RowSize field. +func (g *GetStoryAvailableReactionsRequest) GetRowSize() (value int32) { + if g == nil { + return + } + return g.RowSize +} + +// GetStoryAvailableReactions invokes method getStoryAvailableReactions#23854d3b returning error if any. +func (c *Client) GetStoryAvailableReactions(ctx context.Context, rowsize int32) (*AvailableReactions, error) { + var result AvailableReactions + + request := &GetStoryAvailableReactionsRequest{ + RowSize: rowsize, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_story_viewers_gen.go b/tdapi/tl_get_story_viewers_gen.go index 0bfeb56167..89bbf83364 100644 --- a/tdapi/tl_get_story_viewers_gen.go +++ b/tdapi/tl_get_story_viewers_gen.go @@ -31,19 +31,27 @@ var ( _ = tdjson.Encoder{} ) -// GetStoryViewersRequest represents TL type `getStoryViewers#ab175e7b`. +// GetStoryViewersRequest represents TL type `getStoryViewers#40df8dba`. type GetStoryViewersRequest struct { // Story identifier StoryID int32 - // A viewer from which to return next viewers; pass null to get results from the - // beginning - OffsetViewer MessageViewer + // Query to search for in names and usernames of the viewers; may be empty to get all + // relevant viewers + Query string + // Pass true to get only contacts; pass false to get all relevant viewers + OnlyContacts bool + // Pass true to get viewers with reaction first; pass false to get viewers sorted just by + // view_date + PreferWithReaction bool + // Offset of the first entry to return as received from the previous request; use empty + // string to get the first chunk of results + Offset string // The maximum number of story viewers to return Limit int32 } // GetStoryViewersRequestTypeID is TL type id of GetStoryViewersRequest. -const GetStoryViewersRequestTypeID = 0xab175e7b +const GetStoryViewersRequestTypeID = 0x40df8dba // Ensuring interfaces in compile-time for GetStoryViewersRequest. var ( @@ -60,7 +68,16 @@ func (g *GetStoryViewersRequest) Zero() bool { if !(g.StoryID == 0) { return false } - if !(g.OffsetViewer.Zero()) { + if !(g.Query == "") { + return false + } + if !(g.OnlyContacts == false) { + return false + } + if !(g.PreferWithReaction == false) { + return false + } + if !(g.Offset == "") { return false } if !(g.Limit == 0) { @@ -107,8 +124,20 @@ func (g *GetStoryViewersRequest) TypeInfo() tdp.Type { SchemaName: "story_id", }, { - Name: "OffsetViewer", - SchemaName: "offset_viewer", + Name: "Query", + SchemaName: "query", + }, + { + Name: "OnlyContacts", + SchemaName: "only_contacts", + }, + { + Name: "PreferWithReaction", + SchemaName: "prefer_with_reaction", + }, + { + Name: "Offset", + SchemaName: "offset", }, { Name: "Limit", @@ -121,7 +150,7 @@ func (g *GetStoryViewersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetStoryViewersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getStoryViewers#ab175e7b as nil") + return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") } b.PutID(GetStoryViewersRequestTypeID) return g.EncodeBare(b) @@ -130,12 +159,13 @@ func (g *GetStoryViewersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetStoryViewersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getStoryViewers#ab175e7b as nil") + return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") } b.PutInt32(g.StoryID) - if err := g.OffsetViewer.Encode(b); err != nil { - return fmt.Errorf("unable to encode getStoryViewers#ab175e7b: field offset_viewer: %w", err) - } + b.PutString(g.Query) + b.PutBool(g.OnlyContacts) + b.PutBool(g.PreferWithReaction) + b.PutString(g.Offset) b.PutInt32(g.Limit) return nil } @@ -143,10 +173,10 @@ func (g *GetStoryViewersRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *GetStoryViewersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getStoryViewers#ab175e7b to nil") + return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") } if err := b.ConsumeID(GetStoryViewersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: %w", err) } return g.DecodeBare(b) } @@ -154,24 +184,47 @@ func (g *GetStoryViewersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetStoryViewersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getStoryViewers#ab175e7b to nil") + return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field story_id: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field story_id: %w", err) } g.StoryID = value } { - if err := g.OffsetViewer.Decode(b); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field offset_viewer: %w", err) + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field query: %w", err) + } + g.Query = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field only_contacts: %w", err) + } + g.OnlyContacts = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field prefer_with_reaction: %w", err) + } + g.PreferWithReaction = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field offset: %w", err) } + g.Offset = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field limit: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field limit: %w", err) } g.Limit = value } @@ -181,7 +234,7 @@ func (g *GetStoryViewersRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetStoryViewersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getStoryViewers#ab175e7b as nil") + return fmt.Errorf("can't encode getStoryViewers#40df8dba as nil") } b.ObjStart() b.PutID("getStoryViewers") @@ -189,10 +242,17 @@ func (g *GetStoryViewersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("story_id") b.PutInt32(g.StoryID) b.Comma() - b.FieldStart("offset_viewer") - if err := g.OffsetViewer.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode getStoryViewers#ab175e7b: field offset_viewer: %w", err) - } + b.FieldStart("query") + b.PutString(g.Query) + b.Comma() + b.FieldStart("only_contacts") + b.PutBool(g.OnlyContacts) + b.Comma() + b.FieldStart("prefer_with_reaction") + b.PutBool(g.PreferWithReaction) + b.Comma() + b.FieldStart("offset") + b.PutString(g.Offset) b.Comma() b.FieldStart("limit") b.PutInt32(g.Limit) @@ -205,29 +265,49 @@ func (g *GetStoryViewersRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetStoryViewersRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getStoryViewers#ab175e7b to nil") + return fmt.Errorf("can't decode getStoryViewers#40df8dba to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getStoryViewers"); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: %w", err) } case "story_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field story_id: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field story_id: %w", err) } g.StoryID = value - case "offset_viewer": - if err := g.OffsetViewer.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field offset_viewer: %w", err) + case "query": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field query: %w", err) + } + g.Query = value + case "only_contacts": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field only_contacts: %w", err) } + g.OnlyContacts = value + case "prefer_with_reaction": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field prefer_with_reaction: %w", err) + } + g.PreferWithReaction = value + case "offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field offset: %w", err) + } + g.Offset = value case "limit": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode getStoryViewers#ab175e7b: field limit: %w", err) + return fmt.Errorf("unable to decode getStoryViewers#40df8dba: field limit: %w", err) } g.Limit = value default: @@ -245,12 +325,36 @@ func (g *GetStoryViewersRequest) GetStoryID() (value int32) { return g.StoryID } -// GetOffsetViewer returns value of OffsetViewer field. -func (g *GetStoryViewersRequest) GetOffsetViewer() (value MessageViewer) { +// GetQuery returns value of Query field. +func (g *GetStoryViewersRequest) GetQuery() (value string) { + if g == nil { + return + } + return g.Query +} + +// GetOnlyContacts returns value of OnlyContacts field. +func (g *GetStoryViewersRequest) GetOnlyContacts() (value bool) { + if g == nil { + return + } + return g.OnlyContacts +} + +// GetPreferWithReaction returns value of PreferWithReaction field. +func (g *GetStoryViewersRequest) GetPreferWithReaction() (value bool) { + if g == nil { + return + } + return g.PreferWithReaction +} + +// GetOffset returns value of Offset field. +func (g *GetStoryViewersRequest) GetOffset() (value string) { if g == nil { return } - return g.OffsetViewer + return g.Offset } // GetLimit returns value of Limit field. @@ -261,9 +365,9 @@ func (g *GetStoryViewersRequest) GetLimit() (value int32) { return g.Limit } -// GetStoryViewers invokes method getStoryViewers#ab175e7b returning error if any. -func (c *Client) GetStoryViewers(ctx context.Context, request *GetStoryViewersRequest) (*MessageViewers, error) { - var result MessageViewers +// GetStoryViewers invokes method getStoryViewers#40df8dba returning error if any. +func (c *Client) GetStoryViewers(ctx context.Context, request *GetStoryViewersRequest) (*StoryViewers, error) { + var result StoryViewers if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err diff --git a/tdapi/tl_input_story_area_gen.go b/tdapi/tl_input_story_area_gen.go new file mode 100644 index 0000000000..da3d57e744 --- /dev/null +++ b/tdapi/tl_input_story_area_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{} +) + +// InputStoryArea represents TL type `inputStoryArea#752ae7f`. +type InputStoryArea struct { + // Position of the area + Position StoryAreaPosition + // Type of the area + Type InputStoryAreaTypeClass +} + +// InputStoryAreaTypeID is TL type id of InputStoryArea. +const InputStoryAreaTypeID = 0x752ae7f + +// Ensuring interfaces in compile-time for InputStoryArea. +var ( + _ bin.Encoder = &InputStoryArea{} + _ bin.Decoder = &InputStoryArea{} + _ bin.BareEncoder = &InputStoryArea{} + _ bin.BareDecoder = &InputStoryArea{} +) + +func (i *InputStoryArea) Zero() bool { + if i == nil { + return true + } + if !(i.Position.Zero()) { + return false + } + if !(i.Type == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryArea) String() string { + if i == nil { + return "InputStoryArea(nil)" + } + type Alias InputStoryArea + return fmt.Sprintf("InputStoryArea%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryArea) TypeID() uint32 { + return InputStoryAreaTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryArea) TypeName() string { + return "inputStoryArea" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryArea) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryArea", + ID: InputStoryAreaTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Position", + SchemaName: "position", + }, + { + Name: "Type", + SchemaName: "type", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryArea) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryArea#752ae7f as nil") + } + b.PutID(InputStoryAreaTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryArea) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryArea#752ae7f as nil") + } + if err := i.Position.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field position: %w", err) + } + if i.Type == nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field type is nil") + } + if err := i.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field type: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryArea) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryArea#752ae7f to nil") + } + if err := b.ConsumeID(InputStoryAreaTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryArea) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryArea#752ae7f to nil") + } + { + if err := i.Position.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: field position: %w", err) + } + } + { + value, err := DecodeInputStoryAreaType(b) + if err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: field type: %w", err) + } + i.Type = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryArea) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryArea#752ae7f as nil") + } + b.ObjStart() + b.PutID("inputStoryArea") + b.Comma() + b.FieldStart("position") + if err := i.Position.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field position: %w", err) + } + b.Comma() + b.FieldStart("type") + if i.Type == nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field type is nil") + } + if err := i.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputStoryArea#752ae7f: field type: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputStoryArea) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryArea#752ae7f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryArea"); err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: %w", err) + } + case "position": + if err := i.Position.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: field position: %w", err) + } + case "type": + value, err := DecodeTDLibJSONInputStoryAreaType(b) + if err != nil { + return fmt.Errorf("unable to decode inputStoryArea#752ae7f: field type: %w", err) + } + i.Type = value + default: + return b.Skip() + } + return nil + }) +} + +// GetPosition returns value of Position field. +func (i *InputStoryArea) GetPosition() (value StoryAreaPosition) { + if i == nil { + return + } + return i.Position +} + +// GetType returns value of Type field. +func (i *InputStoryArea) GetType() (value InputStoryAreaTypeClass) { + if i == nil { + return + } + return i.Type +} diff --git a/tdapi/tl_input_story_area_type_gen.go b/tdapi/tl_input_story_area_type_gen.go new file mode 100644 index 0000000000..79fcbab458 --- /dev/null +++ b/tdapi/tl_input_story_area_type_gen.go @@ -0,0 +1,750 @@ +// 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{} +) + +// InputStoryAreaTypeLocation represents TL type `inputStoryAreaTypeLocation#6849d762`. +type InputStoryAreaTypeLocation struct { + // The location + Location Location +} + +// InputStoryAreaTypeLocationTypeID is TL type id of InputStoryAreaTypeLocation. +const InputStoryAreaTypeLocationTypeID = 0x6849d762 + +// construct implements constructor of InputStoryAreaTypeClass. +func (i InputStoryAreaTypeLocation) construct() InputStoryAreaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputStoryAreaTypeLocation. +var ( + _ bin.Encoder = &InputStoryAreaTypeLocation{} + _ bin.Decoder = &InputStoryAreaTypeLocation{} + _ bin.BareEncoder = &InputStoryAreaTypeLocation{} + _ bin.BareDecoder = &InputStoryAreaTypeLocation{} + + _ InputStoryAreaTypeClass = &InputStoryAreaTypeLocation{} +) + +func (i *InputStoryAreaTypeLocation) Zero() bool { + if i == nil { + return true + } + if !(i.Location.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryAreaTypeLocation) String() string { + if i == nil { + return "InputStoryAreaTypeLocation(nil)" + } + type Alias InputStoryAreaTypeLocation + return fmt.Sprintf("InputStoryAreaTypeLocation%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryAreaTypeLocation) TypeID() uint32 { + return InputStoryAreaTypeLocationTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryAreaTypeLocation) TypeName() string { + return "inputStoryAreaTypeLocation" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryAreaTypeLocation) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryAreaTypeLocation", + ID: InputStoryAreaTypeLocationTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Location", + SchemaName: "location", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryAreaTypeLocation) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeLocation#6849d762 as nil") + } + b.PutID(InputStoryAreaTypeLocationTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryAreaTypeLocation) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeLocation#6849d762 as nil") + } + if err := i.Location.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputStoryAreaTypeLocation#6849d762: field location: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryAreaTypeLocation) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeLocation#6849d762 to nil") + } + if err := b.ConsumeID(InputStoryAreaTypeLocationTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeLocation#6849d762: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryAreaTypeLocation) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeLocation#6849d762 to nil") + } + { + if err := i.Location.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeLocation#6849d762: field location: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryAreaTypeLocation) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeLocation#6849d762 as nil") + } + b.ObjStart() + b.PutID("inputStoryAreaTypeLocation") + b.Comma() + b.FieldStart("location") + if err := i.Location.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputStoryAreaTypeLocation#6849d762: field location: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputStoryAreaTypeLocation) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeLocation#6849d762 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryAreaTypeLocation"); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeLocation#6849d762: %w", err) + } + case "location": + if err := i.Location.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeLocation#6849d762: field location: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetLocation returns value of Location field. +func (i *InputStoryAreaTypeLocation) GetLocation() (value Location) { + if i == nil { + return + } + return i.Location +} + +// InputStoryAreaTypeFoundVenue represents TL type `inputStoryAreaTypeFoundVenue#accda496`. +type InputStoryAreaTypeFoundVenue struct { + // Identifier of the inline query, used to found the venue + QueryID int64 + // Identifier of the inline query result + ResultID string +} + +// InputStoryAreaTypeFoundVenueTypeID is TL type id of InputStoryAreaTypeFoundVenue. +const InputStoryAreaTypeFoundVenueTypeID = 0xaccda496 + +// construct implements constructor of InputStoryAreaTypeClass. +func (i InputStoryAreaTypeFoundVenue) construct() InputStoryAreaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputStoryAreaTypeFoundVenue. +var ( + _ bin.Encoder = &InputStoryAreaTypeFoundVenue{} + _ bin.Decoder = &InputStoryAreaTypeFoundVenue{} + _ bin.BareEncoder = &InputStoryAreaTypeFoundVenue{} + _ bin.BareDecoder = &InputStoryAreaTypeFoundVenue{} + + _ InputStoryAreaTypeClass = &InputStoryAreaTypeFoundVenue{} +) + +func (i *InputStoryAreaTypeFoundVenue) Zero() bool { + if i == nil { + return true + } + if !(i.QueryID == 0) { + return false + } + if !(i.ResultID == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryAreaTypeFoundVenue) String() string { + if i == nil { + return "InputStoryAreaTypeFoundVenue(nil)" + } + type Alias InputStoryAreaTypeFoundVenue + return fmt.Sprintf("InputStoryAreaTypeFoundVenue%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryAreaTypeFoundVenue) TypeID() uint32 { + return InputStoryAreaTypeFoundVenueTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryAreaTypeFoundVenue) TypeName() string { + return "inputStoryAreaTypeFoundVenue" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryAreaTypeFoundVenue) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryAreaTypeFoundVenue", + ID: InputStoryAreaTypeFoundVenueTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "QueryID", + SchemaName: "query_id", + }, + { + Name: "ResultID", + SchemaName: "result_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryAreaTypeFoundVenue) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeFoundVenue#accda496 as nil") + } + b.PutID(InputStoryAreaTypeFoundVenueTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryAreaTypeFoundVenue) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeFoundVenue#accda496 as nil") + } + b.PutLong(i.QueryID) + b.PutString(i.ResultID) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryAreaTypeFoundVenue) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeFoundVenue#accda496 to nil") + } + if err := b.ConsumeID(InputStoryAreaTypeFoundVenueTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryAreaTypeFoundVenue) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeFoundVenue#accda496 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: field query_id: %w", err) + } + i.QueryID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: field result_id: %w", err) + } + i.ResultID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryAreaTypeFoundVenue) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypeFoundVenue#accda496 as nil") + } + b.ObjStart() + b.PutID("inputStoryAreaTypeFoundVenue") + b.Comma() + b.FieldStart("query_id") + b.PutLong(i.QueryID) + b.Comma() + b.FieldStart("result_id") + b.PutString(i.ResultID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputStoryAreaTypeFoundVenue) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypeFoundVenue#accda496 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryAreaTypeFoundVenue"); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: %w", err) + } + case "query_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: field query_id: %w", err) + } + i.QueryID = value + case "result_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypeFoundVenue#accda496: field result_id: %w", err) + } + i.ResultID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetQueryID returns value of QueryID field. +func (i *InputStoryAreaTypeFoundVenue) GetQueryID() (value int64) { + if i == nil { + return + } + return i.QueryID +} + +// GetResultID returns value of ResultID field. +func (i *InputStoryAreaTypeFoundVenue) GetResultID() (value string) { + if i == nil { + return + } + return i.ResultID +} + +// InputStoryAreaTypePreviousVenue represents TL type `inputStoryAreaTypePreviousVenue#6e124e0c`. +type InputStoryAreaTypePreviousVenue struct { + // Provider of the venue + VenueProvider string + // Identifier of the venue in the provider database + VenueID string +} + +// InputStoryAreaTypePreviousVenueTypeID is TL type id of InputStoryAreaTypePreviousVenue. +const InputStoryAreaTypePreviousVenueTypeID = 0x6e124e0c + +// construct implements constructor of InputStoryAreaTypeClass. +func (i InputStoryAreaTypePreviousVenue) construct() InputStoryAreaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputStoryAreaTypePreviousVenue. +var ( + _ bin.Encoder = &InputStoryAreaTypePreviousVenue{} + _ bin.Decoder = &InputStoryAreaTypePreviousVenue{} + _ bin.BareEncoder = &InputStoryAreaTypePreviousVenue{} + _ bin.BareDecoder = &InputStoryAreaTypePreviousVenue{} + + _ InputStoryAreaTypeClass = &InputStoryAreaTypePreviousVenue{} +) + +func (i *InputStoryAreaTypePreviousVenue) Zero() bool { + if i == nil { + return true + } + if !(i.VenueProvider == "") { + return false + } + if !(i.VenueID == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryAreaTypePreviousVenue) String() string { + if i == nil { + return "InputStoryAreaTypePreviousVenue(nil)" + } + type Alias InputStoryAreaTypePreviousVenue + return fmt.Sprintf("InputStoryAreaTypePreviousVenue%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryAreaTypePreviousVenue) TypeID() uint32 { + return InputStoryAreaTypePreviousVenueTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryAreaTypePreviousVenue) TypeName() string { + return "inputStoryAreaTypePreviousVenue" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryAreaTypePreviousVenue) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryAreaTypePreviousVenue", + ID: InputStoryAreaTypePreviousVenueTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "VenueProvider", + SchemaName: "venue_provider", + }, + { + Name: "VenueID", + SchemaName: "venue_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryAreaTypePreviousVenue) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypePreviousVenue#6e124e0c as nil") + } + b.PutID(InputStoryAreaTypePreviousVenueTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryAreaTypePreviousVenue) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypePreviousVenue#6e124e0c as nil") + } + b.PutString(i.VenueProvider) + b.PutString(i.VenueID) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryAreaTypePreviousVenue) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypePreviousVenue#6e124e0c to nil") + } + if err := b.ConsumeID(InputStoryAreaTypePreviousVenueTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryAreaTypePreviousVenue) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypePreviousVenue#6e124e0c to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: field venue_provider: %w", err) + } + i.VenueProvider = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: field venue_id: %w", err) + } + i.VenueID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryAreaTypePreviousVenue) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreaTypePreviousVenue#6e124e0c as nil") + } + b.ObjStart() + b.PutID("inputStoryAreaTypePreviousVenue") + b.Comma() + b.FieldStart("venue_provider") + b.PutString(i.VenueProvider) + b.Comma() + b.FieldStart("venue_id") + b.PutString(i.VenueID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputStoryAreaTypePreviousVenue) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreaTypePreviousVenue#6e124e0c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryAreaTypePreviousVenue"); err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: %w", err) + } + case "venue_provider": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: field venue_provider: %w", err) + } + i.VenueProvider = value + case "venue_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreaTypePreviousVenue#6e124e0c: field venue_id: %w", err) + } + i.VenueID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetVenueProvider returns value of VenueProvider field. +func (i *InputStoryAreaTypePreviousVenue) GetVenueProvider() (value string) { + if i == nil { + return + } + return i.VenueProvider +} + +// GetVenueID returns value of VenueID field. +func (i *InputStoryAreaTypePreviousVenue) GetVenueID() (value string) { + if i == nil { + return + } + return i.VenueID +} + +// InputStoryAreaTypeClassName is schema name of InputStoryAreaTypeClass. +const InputStoryAreaTypeClassName = "InputStoryAreaType" + +// InputStoryAreaTypeClass represents InputStoryAreaType generic type. +// +// Example: +// +// g, err := tdapi.DecodeInputStoryAreaType(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.InputStoryAreaTypeLocation: // inputStoryAreaTypeLocation#6849d762 +// case *tdapi.InputStoryAreaTypeFoundVenue: // inputStoryAreaTypeFoundVenue#accda496 +// case *tdapi.InputStoryAreaTypePreviousVenue: // inputStoryAreaTypePreviousVenue#6e124e0c +// default: panic(v) +// } +type InputStoryAreaTypeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() InputStoryAreaTypeClass + + // 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 +} + +// DecodeInputStoryAreaType implements binary de-serialization for InputStoryAreaTypeClass. +func DecodeInputStoryAreaType(buf *bin.Buffer) (InputStoryAreaTypeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case InputStoryAreaTypeLocationTypeID: + // Decoding inputStoryAreaTypeLocation#6849d762. + v := InputStoryAreaTypeLocation{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + case InputStoryAreaTypeFoundVenueTypeID: + // Decoding inputStoryAreaTypeFoundVenue#accda496. + v := InputStoryAreaTypeFoundVenue{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + case InputStoryAreaTypePreviousVenueTypeID: + // Decoding inputStoryAreaTypePreviousVenue#6e124e0c. + v := InputStoryAreaTypePreviousVenue{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONInputStoryAreaType implements binary de-serialization for InputStoryAreaTypeClass. +func DecodeTDLibJSONInputStoryAreaType(buf tdjson.Decoder) (InputStoryAreaTypeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "inputStoryAreaTypeLocation": + // Decoding inputStoryAreaTypeLocation#6849d762. + v := InputStoryAreaTypeLocation{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + case "inputStoryAreaTypeFoundVenue": + // Decoding inputStoryAreaTypeFoundVenue#accda496. + v := InputStoryAreaTypeFoundVenue{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + case "inputStoryAreaTypePreviousVenue": + // Decoding inputStoryAreaTypePreviousVenue#6e124e0c. + v := InputStoryAreaTypePreviousVenue{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputStoryAreaTypeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// InputStoryAreaType boxes the InputStoryAreaTypeClass providing a helper. +type InputStoryAreaTypeBox struct { + InputStoryAreaType InputStoryAreaTypeClass +} + +// Decode implements bin.Decoder for InputStoryAreaTypeBox. +func (b *InputStoryAreaTypeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode InputStoryAreaTypeBox to nil") + } + v, err := DecodeInputStoryAreaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputStoryAreaType = v + return nil +} + +// Encode implements bin.Encode for InputStoryAreaTypeBox. +func (b *InputStoryAreaTypeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.InputStoryAreaType == nil { + return fmt.Errorf("unable to encode InputStoryAreaTypeClass as nil") + } + return b.InputStoryAreaType.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for InputStoryAreaTypeBox. +func (b *InputStoryAreaTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode InputStoryAreaTypeBox to nil") + } + v, err := DecodeTDLibJSONInputStoryAreaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputStoryAreaType = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for InputStoryAreaTypeBox. +func (b *InputStoryAreaTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.InputStoryAreaType == nil { + return fmt.Errorf("unable to encode InputStoryAreaTypeClass as nil") + } + return b.InputStoryAreaType.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_input_story_areas_gen.go b/tdapi/tl_input_story_areas_gen.go new file mode 100644 index 0000000000..c4d5a7edb5 --- /dev/null +++ b/tdapi/tl_input_story_areas_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{} +) + +// InputStoryAreas represents TL type `inputStoryAreas#b8ba29fe`. +type InputStoryAreas struct { + // List of 0-10 input story areas + Areas []InputStoryArea +} + +// InputStoryAreasTypeID is TL type id of InputStoryAreas. +const InputStoryAreasTypeID = 0xb8ba29fe + +// Ensuring interfaces in compile-time for InputStoryAreas. +var ( + _ bin.Encoder = &InputStoryAreas{} + _ bin.Decoder = &InputStoryAreas{} + _ bin.BareEncoder = &InputStoryAreas{} + _ bin.BareDecoder = &InputStoryAreas{} +) + +func (i *InputStoryAreas) Zero() bool { + if i == nil { + return true + } + if !(i.Areas == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStoryAreas) String() string { + if i == nil { + return "InputStoryAreas(nil)" + } + type Alias InputStoryAreas + return fmt.Sprintf("InputStoryAreas%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStoryAreas) TypeID() uint32 { + return InputStoryAreasTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStoryAreas) TypeName() string { + return "inputStoryAreas" +} + +// TypeInfo returns info about TL type. +func (i *InputStoryAreas) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStoryAreas", + ID: InputStoryAreasTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Areas", + SchemaName: "areas", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStoryAreas) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreas#b8ba29fe as nil") + } + b.PutID(InputStoryAreasTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStoryAreas) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreas#b8ba29fe as nil") + } + b.PutInt(len(i.Areas)) + for idx, v := range i.Areas { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare inputStoryAreas#b8ba29fe: field areas element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStoryAreas) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreas#b8ba29fe to nil") + } + if err := b.ConsumeID(InputStoryAreasTypeID); err != nil { + return fmt.Errorf("unable to decode inputStoryAreas#b8ba29fe: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStoryAreas) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreas#b8ba29fe to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputStoryAreas#b8ba29fe: field areas: %w", err) + } + + if headerLen > 0 { + i.Areas = make([]InputStoryArea, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value InputStoryArea + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare inputStoryAreas#b8ba29fe: field areas: %w", err) + } + i.Areas = append(i.Areas, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputStoryAreas) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputStoryAreas#b8ba29fe as nil") + } + b.ObjStart() + b.PutID("inputStoryAreas") + b.Comma() + b.FieldStart("areas") + b.ArrStart() + for idx, v := range i.Areas { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputStoryAreas#b8ba29fe: field areas 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 (i *InputStoryAreas) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputStoryAreas#b8ba29fe to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputStoryAreas"); err != nil { + return fmt.Errorf("unable to decode inputStoryAreas#b8ba29fe: %w", err) + } + case "areas": + if err := b.Arr(func(b tdjson.Decoder) error { + var value InputStoryArea + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputStoryAreas#b8ba29fe: field areas: %w", err) + } + i.Areas = append(i.Areas, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode inputStoryAreas#b8ba29fe: field areas: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetAreas returns value of Areas field. +func (i *InputStoryAreas) GetAreas() (value []InputStoryArea) { + if i == nil { + return + } + return i.Areas +} diff --git a/tdapi/tl_premium_feature_gen.go b/tdapi/tl_premium_feature_gen.go index 10d9419acb..713b56ae40 100644 --- a/tdapi/tl_premium_feature_gen.go +++ b/tdapi/tl_premium_feature_gen.go @@ -1996,6 +1996,137 @@ func (p *PremiumFeatureRealTimeChatTranslation) DecodeTDLibJSON(b tdjson.Decoder }) } +// PremiumFeatureUpgradedStories represents TL type `premiumFeatureUpgradedStories#9008051b`. +type PremiumFeatureUpgradedStories struct { +} + +// PremiumFeatureUpgradedStoriesTypeID is TL type id of PremiumFeatureUpgradedStories. +const PremiumFeatureUpgradedStoriesTypeID = 0x9008051b + +// construct implements constructor of PremiumFeatureClass. +func (p PremiumFeatureUpgradedStories) construct() PremiumFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumFeatureUpgradedStories. +var ( + _ bin.Encoder = &PremiumFeatureUpgradedStories{} + _ bin.Decoder = &PremiumFeatureUpgradedStories{} + _ bin.BareEncoder = &PremiumFeatureUpgradedStories{} + _ bin.BareDecoder = &PremiumFeatureUpgradedStories{} + + _ PremiumFeatureClass = &PremiumFeatureUpgradedStories{} +) + +func (p *PremiumFeatureUpgradedStories) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumFeatureUpgradedStories) String() string { + if p == nil { + return "PremiumFeatureUpgradedStories(nil)" + } + type Alias PremiumFeatureUpgradedStories + return fmt.Sprintf("PremiumFeatureUpgradedStories%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumFeatureUpgradedStories) TypeID() uint32 { + return PremiumFeatureUpgradedStoriesTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumFeatureUpgradedStories) TypeName() string { + return "premiumFeatureUpgradedStories" +} + +// TypeInfo returns info about TL type. +func (p *PremiumFeatureUpgradedStories) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumFeatureUpgradedStories", + ID: PremiumFeatureUpgradedStoriesTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumFeatureUpgradedStories) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil") + } + b.PutID(PremiumFeatureUpgradedStoriesTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumFeatureUpgradedStories) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumFeatureUpgradedStories) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil") + } + if err := b.ConsumeID(PremiumFeatureUpgradedStoriesTypeID); err != nil { + return fmt.Errorf("unable to decode premiumFeatureUpgradedStories#9008051b: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumFeatureUpgradedStories) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumFeatureUpgradedStories) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil") + } + b.ObjStart() + b.PutID("premiumFeatureUpgradedStories") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumFeatureUpgradedStories) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumFeatureUpgradedStories"); err != nil { + return fmt.Errorf("unable to decode premiumFeatureUpgradedStories#9008051b: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // PremiumFeatureClassName is schema name of PremiumFeatureClass. const PremiumFeatureClassName = "PremiumFeature" @@ -2023,6 +2154,7 @@ const PremiumFeatureClassName = "PremiumFeature" // case *tdapi.PremiumFeatureForumTopicIcon: // premiumFeatureForumTopicIcon#ceef6342 // case *tdapi.PremiumFeatureAppIcons: // premiumFeatureAppIcons#5e79f489 // case *tdapi.PremiumFeatureRealTimeChatTranslation: // premiumFeatureRealTimeChatTranslation#bbd80280 +// case *tdapi.PremiumFeatureUpgradedStories: // premiumFeatureUpgradedStories#9008051b // default: panic(v) // } type PremiumFeatureClass interface { @@ -2159,6 +2291,13 @@ func DecodePremiumFeature(buf *bin.Buffer) (PremiumFeatureClass, error) { return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case PremiumFeatureUpgradedStoriesTypeID: + // Decoding premiumFeatureUpgradedStories#9008051b. + v := PremiumFeatureUpgradedStories{} + 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)) } @@ -2276,6 +2415,13 @@ func DecodeTDLibJSONPremiumFeature(buf tdjson.Decoder) (PremiumFeatureClass, err return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case "premiumFeatureUpgradedStories": + // Decoding premiumFeatureUpgradedStories#9008051b. + v := PremiumFeatureUpgradedStories{} + 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_limit_type_gen.go b/tdapi/tl_premium_limit_type_gen.go index 77dccc96f3..142bb1b6be 100644 --- a/tdapi/tl_premium_limit_type_gen.go +++ b/tdapi/tl_premium_limit_type_gen.go @@ -1734,6 +1734,399 @@ func (p *PremiumLimitTypeActiveStoryCount) DecodeTDLibJSON(b tdjson.Decoder) err }) } +// PremiumLimitTypeWeeklySentStoryCount represents TL type `premiumLimitTypeWeeklySentStoryCount#269c34b`. +type PremiumLimitTypeWeeklySentStoryCount struct { +} + +// PremiumLimitTypeWeeklySentStoryCountTypeID is TL type id of PremiumLimitTypeWeeklySentStoryCount. +const PremiumLimitTypeWeeklySentStoryCountTypeID = 0x269c34b + +// construct implements constructor of PremiumLimitTypeClass. +func (p PremiumLimitTypeWeeklySentStoryCount) construct() PremiumLimitTypeClass { return &p } + +// Ensuring interfaces in compile-time for PremiumLimitTypeWeeklySentStoryCount. +var ( + _ bin.Encoder = &PremiumLimitTypeWeeklySentStoryCount{} + _ bin.Decoder = &PremiumLimitTypeWeeklySentStoryCount{} + _ bin.BareEncoder = &PremiumLimitTypeWeeklySentStoryCount{} + _ bin.BareDecoder = &PremiumLimitTypeWeeklySentStoryCount{} + + _ PremiumLimitTypeClass = &PremiumLimitTypeWeeklySentStoryCount{} +) + +func (p *PremiumLimitTypeWeeklySentStoryCount) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumLimitTypeWeeklySentStoryCount) String() string { + if p == nil { + return "PremiumLimitTypeWeeklySentStoryCount(nil)" + } + type Alias PremiumLimitTypeWeeklySentStoryCount + return fmt.Sprintf("PremiumLimitTypeWeeklySentStoryCount%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumLimitTypeWeeklySentStoryCount) TypeID() uint32 { + return PremiumLimitTypeWeeklySentStoryCountTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumLimitTypeWeeklySentStoryCount) TypeName() string { + return "premiumLimitTypeWeeklySentStoryCount" +} + +// TypeInfo returns info about TL type. +func (p *PremiumLimitTypeWeeklySentStoryCount) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumLimitTypeWeeklySentStoryCount", + ID: PremiumLimitTypeWeeklySentStoryCountTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeWeeklySentStoryCount#269c34b as nil") + } + b.PutID(PremiumLimitTypeWeeklySentStoryCountTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeWeeklySentStoryCount#269c34b as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeWeeklySentStoryCount#269c34b to nil") + } + if err := b.ConsumeID(PremiumLimitTypeWeeklySentStoryCountTypeID); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeWeeklySentStoryCount#269c34b: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeWeeklySentStoryCount#269c34b to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeWeeklySentStoryCount#269c34b as nil") + } + b.ObjStart() + b.PutID("premiumLimitTypeWeeklySentStoryCount") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumLimitTypeWeeklySentStoryCount) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeWeeklySentStoryCount#269c34b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumLimitTypeWeeklySentStoryCount"); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeWeeklySentStoryCount#269c34b: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumLimitTypeMonthlySentStoryCount represents TL type `premiumLimitTypeMonthlySentStoryCount#30d84b83`. +type PremiumLimitTypeMonthlySentStoryCount struct { +} + +// PremiumLimitTypeMonthlySentStoryCountTypeID is TL type id of PremiumLimitTypeMonthlySentStoryCount. +const PremiumLimitTypeMonthlySentStoryCountTypeID = 0x30d84b83 + +// construct implements constructor of PremiumLimitTypeClass. +func (p PremiumLimitTypeMonthlySentStoryCount) construct() PremiumLimitTypeClass { return &p } + +// Ensuring interfaces in compile-time for PremiumLimitTypeMonthlySentStoryCount. +var ( + _ bin.Encoder = &PremiumLimitTypeMonthlySentStoryCount{} + _ bin.Decoder = &PremiumLimitTypeMonthlySentStoryCount{} + _ bin.BareEncoder = &PremiumLimitTypeMonthlySentStoryCount{} + _ bin.BareDecoder = &PremiumLimitTypeMonthlySentStoryCount{} + + _ PremiumLimitTypeClass = &PremiumLimitTypeMonthlySentStoryCount{} +) + +func (p *PremiumLimitTypeMonthlySentStoryCount) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumLimitTypeMonthlySentStoryCount) String() string { + if p == nil { + return "PremiumLimitTypeMonthlySentStoryCount(nil)" + } + type Alias PremiumLimitTypeMonthlySentStoryCount + return fmt.Sprintf("PremiumLimitTypeMonthlySentStoryCount%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumLimitTypeMonthlySentStoryCount) TypeID() uint32 { + return PremiumLimitTypeMonthlySentStoryCountTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumLimitTypeMonthlySentStoryCount) TypeName() string { + return "premiumLimitTypeMonthlySentStoryCount" +} + +// TypeInfo returns info about TL type. +func (p *PremiumLimitTypeMonthlySentStoryCount) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumLimitTypeMonthlySentStoryCount", + ID: PremiumLimitTypeMonthlySentStoryCountTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeMonthlySentStoryCount#30d84b83 as nil") + } + b.PutID(PremiumLimitTypeMonthlySentStoryCountTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeMonthlySentStoryCount#30d84b83 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeMonthlySentStoryCount#30d84b83 to nil") + } + if err := b.ConsumeID(PremiumLimitTypeMonthlySentStoryCountTypeID); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeMonthlySentStoryCount#30d84b83: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeMonthlySentStoryCount#30d84b83 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeMonthlySentStoryCount#30d84b83 as nil") + } + b.ObjStart() + b.PutID("premiumLimitTypeMonthlySentStoryCount") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumLimitTypeMonthlySentStoryCount) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeMonthlySentStoryCount#30d84b83 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumLimitTypeMonthlySentStoryCount"); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeMonthlySentStoryCount#30d84b83: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumLimitTypeStoryCaptionLength represents TL type `premiumLimitTypeStoryCaptionLength#bed53302`. +type PremiumLimitTypeStoryCaptionLength struct { +} + +// PremiumLimitTypeStoryCaptionLengthTypeID is TL type id of PremiumLimitTypeStoryCaptionLength. +const PremiumLimitTypeStoryCaptionLengthTypeID = 0xbed53302 + +// construct implements constructor of PremiumLimitTypeClass. +func (p PremiumLimitTypeStoryCaptionLength) construct() PremiumLimitTypeClass { return &p } + +// Ensuring interfaces in compile-time for PremiumLimitTypeStoryCaptionLength. +var ( + _ bin.Encoder = &PremiumLimitTypeStoryCaptionLength{} + _ bin.Decoder = &PremiumLimitTypeStoryCaptionLength{} + _ bin.BareEncoder = &PremiumLimitTypeStoryCaptionLength{} + _ bin.BareDecoder = &PremiumLimitTypeStoryCaptionLength{} + + _ PremiumLimitTypeClass = &PremiumLimitTypeStoryCaptionLength{} +) + +func (p *PremiumLimitTypeStoryCaptionLength) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumLimitTypeStoryCaptionLength) String() string { + if p == nil { + return "PremiumLimitTypeStoryCaptionLength(nil)" + } + type Alias PremiumLimitTypeStoryCaptionLength + return fmt.Sprintf("PremiumLimitTypeStoryCaptionLength%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumLimitTypeStoryCaptionLength) TypeID() uint32 { + return PremiumLimitTypeStoryCaptionLengthTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumLimitTypeStoryCaptionLength) TypeName() string { + return "premiumLimitTypeStoryCaptionLength" +} + +// TypeInfo returns info about TL type. +func (p *PremiumLimitTypeStoryCaptionLength) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumLimitTypeStoryCaptionLength", + ID: PremiumLimitTypeStoryCaptionLengthTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumLimitTypeStoryCaptionLength) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeStoryCaptionLength#bed53302 as nil") + } + b.PutID(PremiumLimitTypeStoryCaptionLengthTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumLimitTypeStoryCaptionLength) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeStoryCaptionLength#bed53302 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumLimitTypeStoryCaptionLength) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeStoryCaptionLength#bed53302 to nil") + } + if err := b.ConsumeID(PremiumLimitTypeStoryCaptionLengthTypeID); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeStoryCaptionLength#bed53302: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumLimitTypeStoryCaptionLength) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeStoryCaptionLength#bed53302 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumLimitTypeStoryCaptionLength) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumLimitTypeStoryCaptionLength#bed53302 as nil") + } + b.ObjStart() + b.PutID("premiumLimitTypeStoryCaptionLength") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumLimitTypeStoryCaptionLength) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumLimitTypeStoryCaptionLength#bed53302 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumLimitTypeStoryCaptionLength"); err != nil { + return fmt.Errorf("unable to decode premiumLimitTypeStoryCaptionLength#bed53302: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // PremiumLimitTypeClassName is schema name of PremiumLimitTypeClass. const PremiumLimitTypeClassName = "PremiumLimitType" @@ -1759,6 +2152,9 @@ const PremiumLimitTypeClassName = "PremiumLimitType" // case *tdapi.PremiumLimitTypeChatFolderInviteLinkCount: // premiumLimitTypeChatFolderInviteLinkCount#f854261a // case *tdapi.PremiumLimitTypeShareableChatFolderCount: // premiumLimitTypeShareableChatFolderCount#601eb4c7 // case *tdapi.PremiumLimitTypeActiveStoryCount: // premiumLimitTypeActiveStoryCount#8d2c269c +// case *tdapi.PremiumLimitTypeWeeklySentStoryCount: // premiumLimitTypeWeeklySentStoryCount#269c34b +// case *tdapi.PremiumLimitTypeMonthlySentStoryCount: // premiumLimitTypeMonthlySentStoryCount#30d84b83 +// case *tdapi.PremiumLimitTypeStoryCaptionLength: // premiumLimitTypeStoryCaptionLength#bed53302 // default: panic(v) // } type PremiumLimitTypeClass interface { @@ -1881,6 +2277,27 @@ func DecodePremiumLimitType(buf *bin.Buffer) (PremiumLimitTypeClass, error) { return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) } return &v, nil + case PremiumLimitTypeWeeklySentStoryCountTypeID: + // Decoding premiumLimitTypeWeeklySentStoryCount#269c34b. + v := PremiumLimitTypeWeeklySentStoryCount{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil + case PremiumLimitTypeMonthlySentStoryCountTypeID: + // Decoding premiumLimitTypeMonthlySentStoryCount#30d84b83. + v := PremiumLimitTypeMonthlySentStoryCount{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil + case PremiumLimitTypeStoryCaptionLengthTypeID: + // Decoding premiumLimitTypeStoryCaptionLength#bed53302. + v := PremiumLimitTypeStoryCaptionLength{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -1984,6 +2401,27 @@ func DecodeTDLibJSONPremiumLimitType(buf tdjson.Decoder) (PremiumLimitTypeClass, return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) } return &v, nil + case "premiumLimitTypeWeeklySentStoryCount": + // Decoding premiumLimitTypeWeeklySentStoryCount#269c34b. + v := PremiumLimitTypeWeeklySentStoryCount{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil + case "premiumLimitTypeMonthlySentStoryCount": + // Decoding premiumLimitTypeMonthlySentStoryCount#30d84b83. + v := PremiumLimitTypeMonthlySentStoryCount{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil + case "premiumLimitTypeStoryCaptionLength": + // Decoding premiumLimitTypeStoryCaptionLength#bed53302. + v := PremiumLimitTypeStoryCaptionLength{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumLimitTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_premium_source_gen.go b/tdapi/tl_premium_source_gen.go index 7e5f3d0f22..ff53484e5e 100644 --- a/tdapi/tl_premium_source_gen.go +++ b/tdapi/tl_premium_source_gen.go @@ -383,6 +383,182 @@ func (p *PremiumSourceFeature) GetFeature() (value PremiumFeatureClass) { return p.Feature } +// PremiumSourceStoryFeature represents TL type `premiumSourceStoryFeature#c290316c`. +type PremiumSourceStoryFeature struct { + // The used feature + Feature PremiumStoryFeatureClass +} + +// PremiumSourceStoryFeatureTypeID is TL type id of PremiumSourceStoryFeature. +const PremiumSourceStoryFeatureTypeID = 0xc290316c + +// construct implements constructor of PremiumSourceClass. +func (p PremiumSourceStoryFeature) construct() PremiumSourceClass { return &p } + +// Ensuring interfaces in compile-time for PremiumSourceStoryFeature. +var ( + _ bin.Encoder = &PremiumSourceStoryFeature{} + _ bin.Decoder = &PremiumSourceStoryFeature{} + _ bin.BareEncoder = &PremiumSourceStoryFeature{} + _ bin.BareDecoder = &PremiumSourceStoryFeature{} + + _ PremiumSourceClass = &PremiumSourceStoryFeature{} +) + +func (p *PremiumSourceStoryFeature) Zero() bool { + if p == nil { + return true + } + if !(p.Feature == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumSourceStoryFeature) String() string { + if p == nil { + return "PremiumSourceStoryFeature(nil)" + } + type Alias PremiumSourceStoryFeature + return fmt.Sprintf("PremiumSourceStoryFeature%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumSourceStoryFeature) TypeID() uint32 { + return PremiumSourceStoryFeatureTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumSourceStoryFeature) TypeName() string { + return "premiumSourceStoryFeature" +} + +// TypeInfo returns info about TL type. +func (p *PremiumSourceStoryFeature) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumSourceStoryFeature", + ID: PremiumSourceStoryFeatureTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Feature", + SchemaName: "feature", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumSourceStoryFeature) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumSourceStoryFeature#c290316c as nil") + } + b.PutID(PremiumSourceStoryFeatureTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumSourceStoryFeature) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumSourceStoryFeature#c290316c as nil") + } + if p.Feature == nil { + return fmt.Errorf("unable to encode premiumSourceStoryFeature#c290316c: field feature is nil") + } + if err := p.Feature.Encode(b); err != nil { + return fmt.Errorf("unable to encode premiumSourceStoryFeature#c290316c: field feature: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumSourceStoryFeature) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumSourceStoryFeature#c290316c to nil") + } + if err := b.ConsumeID(PremiumSourceStoryFeatureTypeID); err != nil { + return fmt.Errorf("unable to decode premiumSourceStoryFeature#c290316c: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumSourceStoryFeature) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumSourceStoryFeature#c290316c to nil") + } + { + value, err := DecodePremiumStoryFeature(b) + if err != nil { + return fmt.Errorf("unable to decode premiumSourceStoryFeature#c290316c: field feature: %w", err) + } + p.Feature = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumSourceStoryFeature) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumSourceStoryFeature#c290316c as nil") + } + b.ObjStart() + b.PutID("premiumSourceStoryFeature") + b.Comma() + b.FieldStart("feature") + if p.Feature == nil { + return fmt.Errorf("unable to encode premiumSourceStoryFeature#c290316c: field feature is nil") + } + if err := p.Feature.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode premiumSourceStoryFeature#c290316c: field feature: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumSourceStoryFeature) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumSourceStoryFeature#c290316c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumSourceStoryFeature"); err != nil { + return fmt.Errorf("unable to decode premiumSourceStoryFeature#c290316c: %w", err) + } + case "feature": + value, err := DecodeTDLibJSONPremiumStoryFeature(b) + if err != nil { + return fmt.Errorf("unable to decode premiumSourceStoryFeature#c290316c: field feature: %w", err) + } + p.Feature = value + default: + return b.Skip() + } + return nil + }) +} + +// GetFeature returns value of Feature field. +func (p *PremiumSourceStoryFeature) GetFeature() (value PremiumStoryFeatureClass) { + if p == nil { + return + } + return p.Feature +} + // PremiumSourceLink represents TL type `premiumSourceLink#7f42999c`. type PremiumSourceLink struct { // The referrer from the link @@ -694,6 +870,7 @@ const PremiumSourceClassName = "PremiumSource" // switch v := g.(type) { // case *tdapi.PremiumSourceLimitExceeded: // premiumSourceLimitExceeded#85ae8702 // case *tdapi.PremiumSourceFeature: // premiumSourceFeature#1a929325 +// case *tdapi.PremiumSourceStoryFeature: // premiumSourceStoryFeature#c290316c // case *tdapi.PremiumSourceLink: // premiumSourceLink#7f42999c // case *tdapi.PremiumSourceSettings: // premiumSourceSettings#eef88535 // default: panic(v) @@ -741,6 +918,13 @@ func DecodePremiumSource(buf *bin.Buffer) (PremiumSourceClass, error) { return nil, fmt.Errorf("unable to decode PremiumSourceClass: %w", err) } return &v, nil + case PremiumSourceStoryFeatureTypeID: + // Decoding premiumSourceStoryFeature#c290316c. + v := PremiumSourceStoryFeature{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumSourceClass: %w", err) + } + return &v, nil case PremiumSourceLinkTypeID: // Decoding premiumSourceLink#7f42999c. v := PremiumSourceLink{} @@ -781,6 +965,13 @@ func DecodeTDLibJSONPremiumSource(buf tdjson.Decoder) (PremiumSourceClass, error return nil, fmt.Errorf("unable to decode PremiumSourceClass: %w", err) } return &v, nil + case "premiumSourceStoryFeature": + // Decoding premiumSourceStoryFeature#c290316c. + v := PremiumSourceStoryFeature{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumSourceClass: %w", err) + } + return &v, nil case "premiumSourceLink": // Decoding premiumSourceLink#7f42999c. v := PremiumSourceLink{} diff --git a/tdapi/tl_premium_story_feature_gen.go b/tdapi/tl_premium_story_feature_gen.go new file mode 100644 index 0000000000..8bef0c744e --- /dev/null +++ b/tdapi/tl_premium_story_feature_gen.go @@ -0,0 +1,1015 @@ +// 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{} +) + +// PremiumStoryFeaturePriorityOrder represents TL type `premiumStoryFeaturePriorityOrder#8ff172c7`. +type PremiumStoryFeaturePriorityOrder struct { +} + +// PremiumStoryFeaturePriorityOrderTypeID is TL type id of PremiumStoryFeaturePriorityOrder. +const PremiumStoryFeaturePriorityOrderTypeID = 0x8ff172c7 + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeaturePriorityOrder) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeaturePriorityOrder. +var ( + _ bin.Encoder = &PremiumStoryFeaturePriorityOrder{} + _ bin.Decoder = &PremiumStoryFeaturePriorityOrder{} + _ bin.BareEncoder = &PremiumStoryFeaturePriorityOrder{} + _ bin.BareDecoder = &PremiumStoryFeaturePriorityOrder{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeaturePriorityOrder{} +) + +func (p *PremiumStoryFeaturePriorityOrder) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeaturePriorityOrder) String() string { + if p == nil { + return "PremiumStoryFeaturePriorityOrder(nil)" + } + type Alias PremiumStoryFeaturePriorityOrder + return fmt.Sprintf("PremiumStoryFeaturePriorityOrder%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeaturePriorityOrder) TypeID() uint32 { + return PremiumStoryFeaturePriorityOrderTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeaturePriorityOrder) TypeName() string { + return "premiumStoryFeaturePriorityOrder" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeaturePriorityOrder) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeaturePriorityOrder", + ID: PremiumStoryFeaturePriorityOrderTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeaturePriorityOrder) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePriorityOrder#8ff172c7 as nil") + } + b.PutID(PremiumStoryFeaturePriorityOrderTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeaturePriorityOrder) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePriorityOrder#8ff172c7 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeaturePriorityOrder) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePriorityOrder#8ff172c7 to nil") + } + if err := b.ConsumeID(PremiumStoryFeaturePriorityOrderTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeaturePriorityOrder#8ff172c7: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeaturePriorityOrder) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePriorityOrder#8ff172c7 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeaturePriorityOrder) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePriorityOrder#8ff172c7 as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeaturePriorityOrder") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeaturePriorityOrder) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePriorityOrder#8ff172c7 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeaturePriorityOrder"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeaturePriorityOrder#8ff172c7: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeatureStealthMode represents TL type `premiumStoryFeatureStealthMode#47343da4`. +type PremiumStoryFeatureStealthMode struct { +} + +// PremiumStoryFeatureStealthModeTypeID is TL type id of PremiumStoryFeatureStealthMode. +const PremiumStoryFeatureStealthModeTypeID = 0x47343da4 + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeatureStealthMode) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeatureStealthMode. +var ( + _ bin.Encoder = &PremiumStoryFeatureStealthMode{} + _ bin.Decoder = &PremiumStoryFeatureStealthMode{} + _ bin.BareEncoder = &PremiumStoryFeatureStealthMode{} + _ bin.BareDecoder = &PremiumStoryFeatureStealthMode{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeatureStealthMode{} +) + +func (p *PremiumStoryFeatureStealthMode) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeatureStealthMode) String() string { + if p == nil { + return "PremiumStoryFeatureStealthMode(nil)" + } + type Alias PremiumStoryFeatureStealthMode + return fmt.Sprintf("PremiumStoryFeatureStealthMode%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeatureStealthMode) TypeID() uint32 { + return PremiumStoryFeatureStealthModeTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeatureStealthMode) TypeName() string { + return "premiumStoryFeatureStealthMode" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeatureStealthMode) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeatureStealthMode", + ID: PremiumStoryFeatureStealthModeTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeatureStealthMode) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureStealthMode#47343da4 as nil") + } + b.PutID(PremiumStoryFeatureStealthModeTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeatureStealthMode) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureStealthMode#47343da4 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeatureStealthMode) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureStealthMode#47343da4 to nil") + } + if err := b.ConsumeID(PremiumStoryFeatureStealthModeTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureStealthMode#47343da4: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeatureStealthMode) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureStealthMode#47343da4 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeatureStealthMode) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureStealthMode#47343da4 as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeatureStealthMode") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeatureStealthMode) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureStealthMode#47343da4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeatureStealthMode"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureStealthMode#47343da4: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeaturePermanentViewsHistory represents TL type `premiumStoryFeaturePermanentViewsHistory#c2a047a0`. +type PremiumStoryFeaturePermanentViewsHistory struct { +} + +// PremiumStoryFeaturePermanentViewsHistoryTypeID is TL type id of PremiumStoryFeaturePermanentViewsHistory. +const PremiumStoryFeaturePermanentViewsHistoryTypeID = 0xc2a047a0 + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeaturePermanentViewsHistory) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeaturePermanentViewsHistory. +var ( + _ bin.Encoder = &PremiumStoryFeaturePermanentViewsHistory{} + _ bin.Decoder = &PremiumStoryFeaturePermanentViewsHistory{} + _ bin.BareEncoder = &PremiumStoryFeaturePermanentViewsHistory{} + _ bin.BareDecoder = &PremiumStoryFeaturePermanentViewsHistory{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeaturePermanentViewsHistory{} +) + +func (p *PremiumStoryFeaturePermanentViewsHistory) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeaturePermanentViewsHistory) String() string { + if p == nil { + return "PremiumStoryFeaturePermanentViewsHistory(nil)" + } + type Alias PremiumStoryFeaturePermanentViewsHistory + return fmt.Sprintf("PremiumStoryFeaturePermanentViewsHistory%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeaturePermanentViewsHistory) TypeID() uint32 { + return PremiumStoryFeaturePermanentViewsHistoryTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeaturePermanentViewsHistory) TypeName() string { + return "premiumStoryFeaturePermanentViewsHistory" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeaturePermanentViewsHistory) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeaturePermanentViewsHistory", + ID: PremiumStoryFeaturePermanentViewsHistoryTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePermanentViewsHistory#c2a047a0 as nil") + } + b.PutID(PremiumStoryFeaturePermanentViewsHistoryTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePermanentViewsHistory#c2a047a0 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePermanentViewsHistory#c2a047a0 to nil") + } + if err := b.ConsumeID(PremiumStoryFeaturePermanentViewsHistoryTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeaturePermanentViewsHistory#c2a047a0: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePermanentViewsHistory#c2a047a0 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeaturePermanentViewsHistory#c2a047a0 as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeaturePermanentViewsHistory") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeaturePermanentViewsHistory) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeaturePermanentViewsHistory#c2a047a0 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeaturePermanentViewsHistory"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeaturePermanentViewsHistory#c2a047a0: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeatureCustomExpirationDuration represents TL type `premiumStoryFeatureCustomExpirationDuration#dca40a96`. +type PremiumStoryFeatureCustomExpirationDuration struct { +} + +// PremiumStoryFeatureCustomExpirationDurationTypeID is TL type id of PremiumStoryFeatureCustomExpirationDuration. +const PremiumStoryFeatureCustomExpirationDurationTypeID = 0xdca40a96 + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeatureCustomExpirationDuration) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeatureCustomExpirationDuration. +var ( + _ bin.Encoder = &PremiumStoryFeatureCustomExpirationDuration{} + _ bin.Decoder = &PremiumStoryFeatureCustomExpirationDuration{} + _ bin.BareEncoder = &PremiumStoryFeatureCustomExpirationDuration{} + _ bin.BareDecoder = &PremiumStoryFeatureCustomExpirationDuration{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeatureCustomExpirationDuration{} +) + +func (p *PremiumStoryFeatureCustomExpirationDuration) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeatureCustomExpirationDuration) String() string { + if p == nil { + return "PremiumStoryFeatureCustomExpirationDuration(nil)" + } + type Alias PremiumStoryFeatureCustomExpirationDuration + return fmt.Sprintf("PremiumStoryFeatureCustomExpirationDuration%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeatureCustomExpirationDuration) TypeID() uint32 { + return PremiumStoryFeatureCustomExpirationDurationTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeatureCustomExpirationDuration) TypeName() string { + return "premiumStoryFeatureCustomExpirationDuration" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeatureCustomExpirationDuration) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeatureCustomExpirationDuration", + ID: PremiumStoryFeatureCustomExpirationDurationTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureCustomExpirationDuration#dca40a96 as nil") + } + b.PutID(PremiumStoryFeatureCustomExpirationDurationTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureCustomExpirationDuration#dca40a96 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureCustomExpirationDuration#dca40a96 to nil") + } + if err := b.ConsumeID(PremiumStoryFeatureCustomExpirationDurationTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureCustomExpirationDuration#dca40a96: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureCustomExpirationDuration#dca40a96 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureCustomExpirationDuration#dca40a96 as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeatureCustomExpirationDuration") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeatureCustomExpirationDuration) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureCustomExpirationDuration#dca40a96 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeatureCustomExpirationDuration"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureCustomExpirationDuration#dca40a96: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeatureSaveStories represents TL type `premiumStoryFeatureSaveStories#a6842fbd`. +type PremiumStoryFeatureSaveStories struct { +} + +// PremiumStoryFeatureSaveStoriesTypeID is TL type id of PremiumStoryFeatureSaveStories. +const PremiumStoryFeatureSaveStoriesTypeID = 0xa6842fbd + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeatureSaveStories) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeatureSaveStories. +var ( + _ bin.Encoder = &PremiumStoryFeatureSaveStories{} + _ bin.Decoder = &PremiumStoryFeatureSaveStories{} + _ bin.BareEncoder = &PremiumStoryFeatureSaveStories{} + _ bin.BareDecoder = &PremiumStoryFeatureSaveStories{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeatureSaveStories{} +) + +func (p *PremiumStoryFeatureSaveStories) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeatureSaveStories) String() string { + if p == nil { + return "PremiumStoryFeatureSaveStories(nil)" + } + type Alias PremiumStoryFeatureSaveStories + return fmt.Sprintf("PremiumStoryFeatureSaveStories%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeatureSaveStories) TypeID() uint32 { + return PremiumStoryFeatureSaveStoriesTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeatureSaveStories) TypeName() string { + return "premiumStoryFeatureSaveStories" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeatureSaveStories) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeatureSaveStories", + ID: PremiumStoryFeatureSaveStoriesTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeatureSaveStories) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureSaveStories#a6842fbd as nil") + } + b.PutID(PremiumStoryFeatureSaveStoriesTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeatureSaveStories) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureSaveStories#a6842fbd as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeatureSaveStories) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureSaveStories#a6842fbd to nil") + } + if err := b.ConsumeID(PremiumStoryFeatureSaveStoriesTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureSaveStories#a6842fbd: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeatureSaveStories) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureSaveStories#a6842fbd to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeatureSaveStories) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureSaveStories#a6842fbd as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeatureSaveStories") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeatureSaveStories) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureSaveStories#a6842fbd to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeatureSaveStories"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureSaveStories#a6842fbd: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeatureLinksAndFormatting represents TL type `premiumStoryFeatureLinksAndFormatting#dae383f7`. +type PremiumStoryFeatureLinksAndFormatting struct { +} + +// PremiumStoryFeatureLinksAndFormattingTypeID is TL type id of PremiumStoryFeatureLinksAndFormatting. +const PremiumStoryFeatureLinksAndFormattingTypeID = 0xdae383f7 + +// construct implements constructor of PremiumStoryFeatureClass. +func (p PremiumStoryFeatureLinksAndFormatting) construct() PremiumStoryFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumStoryFeatureLinksAndFormatting. +var ( + _ bin.Encoder = &PremiumStoryFeatureLinksAndFormatting{} + _ bin.Decoder = &PremiumStoryFeatureLinksAndFormatting{} + _ bin.BareEncoder = &PremiumStoryFeatureLinksAndFormatting{} + _ bin.BareDecoder = &PremiumStoryFeatureLinksAndFormatting{} + + _ PremiumStoryFeatureClass = &PremiumStoryFeatureLinksAndFormatting{} +) + +func (p *PremiumStoryFeatureLinksAndFormatting) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumStoryFeatureLinksAndFormatting) String() string { + if p == nil { + return "PremiumStoryFeatureLinksAndFormatting(nil)" + } + type Alias PremiumStoryFeatureLinksAndFormatting + return fmt.Sprintf("PremiumStoryFeatureLinksAndFormatting%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumStoryFeatureLinksAndFormatting) TypeID() uint32 { + return PremiumStoryFeatureLinksAndFormattingTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumStoryFeatureLinksAndFormatting) TypeName() string { + return "premiumStoryFeatureLinksAndFormatting" +} + +// TypeInfo returns info about TL type. +func (p *PremiumStoryFeatureLinksAndFormatting) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumStoryFeatureLinksAndFormatting", + ID: PremiumStoryFeatureLinksAndFormattingTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumStoryFeatureLinksAndFormatting) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureLinksAndFormatting#dae383f7 as nil") + } + b.PutID(PremiumStoryFeatureLinksAndFormattingTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumStoryFeatureLinksAndFormatting) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureLinksAndFormatting#dae383f7 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumStoryFeatureLinksAndFormatting) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureLinksAndFormatting#dae383f7 to nil") + } + if err := b.ConsumeID(PremiumStoryFeatureLinksAndFormattingTypeID); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureLinksAndFormatting#dae383f7: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumStoryFeatureLinksAndFormatting) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureLinksAndFormatting#dae383f7 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumStoryFeatureLinksAndFormatting) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumStoryFeatureLinksAndFormatting#dae383f7 as nil") + } + b.ObjStart() + b.PutID("premiumStoryFeatureLinksAndFormatting") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumStoryFeatureLinksAndFormatting) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumStoryFeatureLinksAndFormatting#dae383f7 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumStoryFeatureLinksAndFormatting"); err != nil { + return fmt.Errorf("unable to decode premiumStoryFeatureLinksAndFormatting#dae383f7: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PremiumStoryFeatureClassName is schema name of PremiumStoryFeatureClass. +const PremiumStoryFeatureClassName = "PremiumStoryFeature" + +// PremiumStoryFeatureClass represents PremiumStoryFeature generic type. +// +// Example: +// +// g, err := tdapi.DecodePremiumStoryFeature(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.PremiumStoryFeaturePriorityOrder: // premiumStoryFeaturePriorityOrder#8ff172c7 +// case *tdapi.PremiumStoryFeatureStealthMode: // premiumStoryFeatureStealthMode#47343da4 +// case *tdapi.PremiumStoryFeaturePermanentViewsHistory: // premiumStoryFeaturePermanentViewsHistory#c2a047a0 +// case *tdapi.PremiumStoryFeatureCustomExpirationDuration: // premiumStoryFeatureCustomExpirationDuration#dca40a96 +// case *tdapi.PremiumStoryFeatureSaveStories: // premiumStoryFeatureSaveStories#a6842fbd +// case *tdapi.PremiumStoryFeatureLinksAndFormatting: // premiumStoryFeatureLinksAndFormatting#dae383f7 +// default: panic(v) +// } +type PremiumStoryFeatureClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PremiumStoryFeatureClass + + // 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 +} + +// DecodePremiumStoryFeature implements binary de-serialization for PremiumStoryFeatureClass. +func DecodePremiumStoryFeature(buf *bin.Buffer) (PremiumStoryFeatureClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PremiumStoryFeaturePriorityOrderTypeID: + // Decoding premiumStoryFeaturePriorityOrder#8ff172c7. + v := PremiumStoryFeaturePriorityOrder{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case PremiumStoryFeatureStealthModeTypeID: + // Decoding premiumStoryFeatureStealthMode#47343da4. + v := PremiumStoryFeatureStealthMode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case PremiumStoryFeaturePermanentViewsHistoryTypeID: + // Decoding premiumStoryFeaturePermanentViewsHistory#c2a047a0. + v := PremiumStoryFeaturePermanentViewsHistory{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case PremiumStoryFeatureCustomExpirationDurationTypeID: + // Decoding premiumStoryFeatureCustomExpirationDuration#dca40a96. + v := PremiumStoryFeatureCustomExpirationDuration{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case PremiumStoryFeatureSaveStoriesTypeID: + // Decoding premiumStoryFeatureSaveStories#a6842fbd. + v := PremiumStoryFeatureSaveStories{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case PremiumStoryFeatureLinksAndFormattingTypeID: + // Decoding premiumStoryFeatureLinksAndFormatting#dae383f7. + v := PremiumStoryFeatureLinksAndFormatting{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONPremiumStoryFeature implements binary de-serialization for PremiumStoryFeatureClass. +func DecodeTDLibJSONPremiumStoryFeature(buf tdjson.Decoder) (PremiumStoryFeatureClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "premiumStoryFeaturePriorityOrder": + // Decoding premiumStoryFeaturePriorityOrder#8ff172c7. + v := PremiumStoryFeaturePriorityOrder{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case "premiumStoryFeatureStealthMode": + // Decoding premiumStoryFeatureStealthMode#47343da4. + v := PremiumStoryFeatureStealthMode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case "premiumStoryFeaturePermanentViewsHistory": + // Decoding premiumStoryFeaturePermanentViewsHistory#c2a047a0. + v := PremiumStoryFeaturePermanentViewsHistory{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case "premiumStoryFeatureCustomExpirationDuration": + // Decoding premiumStoryFeatureCustomExpirationDuration#dca40a96. + v := PremiumStoryFeatureCustomExpirationDuration{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case "premiumStoryFeatureSaveStories": + // Decoding premiumStoryFeatureSaveStories#a6842fbd. + v := PremiumStoryFeatureSaveStories{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + case "premiumStoryFeatureLinksAndFormatting": + // Decoding premiumStoryFeatureLinksAndFormatting#dae383f7. + v := PremiumStoryFeatureLinksAndFormatting{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PremiumStoryFeatureClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// PremiumStoryFeature boxes the PremiumStoryFeatureClass providing a helper. +type PremiumStoryFeatureBox struct { + PremiumStoryFeature PremiumStoryFeatureClass +} + +// Decode implements bin.Decoder for PremiumStoryFeatureBox. +func (b *PremiumStoryFeatureBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumStoryFeatureBox to nil") + } + v, err := DecodePremiumStoryFeature(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumStoryFeature = v + return nil +} + +// Encode implements bin.Encode for PremiumStoryFeatureBox. +func (b *PremiumStoryFeatureBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PremiumStoryFeature == nil { + return fmt.Errorf("unable to encode PremiumStoryFeatureClass as nil") + } + return b.PremiumStoryFeature.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for PremiumStoryFeatureBox. +func (b *PremiumStoryFeatureBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode PremiumStoryFeatureBox to nil") + } + v, err := DecodeTDLibJSONPremiumStoryFeature(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PremiumStoryFeature = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for PremiumStoryFeatureBox. +func (b *PremiumStoryFeatureBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.PremiumStoryFeature == nil { + return fmt.Errorf("unable to encode PremiumStoryFeatureClass as nil") + } + return b.PremiumStoryFeature.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 0211fd92d5..a56cc96782 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -160,7 +160,7 @@ func TypesMap() map[uint32]string { UsernamesTypeID: "usernames#bf343063", UserTypeID: "user#956ad2d2", BotInfoTypeID: "botInfo#bfdb89a", - UserFullInfoTypeID: "userFullInfo#bf73d22c", + UserFullInfoTypeID: "userFullInfo#a53c620b", UsersTypeID: "users#9d955a12", ChatAdministratorTypeID: "chatAdministrator#7277bd2c", ChatAdministratorsTypeID: "chatAdministrators#5141ca21", @@ -285,7 +285,7 @@ func TypesMap() map[uint32]string { ChatAvailableReactionsAllTypeID: "chatAvailableReactionsAll#dff07c4e", ChatAvailableReactionsSomeTypeID: "chatAvailableReactionsSome#d3cc0a6b", VideoChatTypeID: "videoChat#ae158d28", - ChatTypeID: "chat#d71735a8", + ChatTypeID: "chat#3f50a728", ChatsTypeID: "chats#9b93e3eb", ChatNearbyTypeID: "chatNearby#2de4255", ChatsNearbyTypeID: "chatsNearby#cc744cff", @@ -804,6 +804,9 @@ func TypesMap() map[uint32]string { PremiumLimitTypeChatFolderInviteLinkCountTypeID: "premiumLimitTypeChatFolderInviteLinkCount#f854261a", PremiumLimitTypeShareableChatFolderCountTypeID: "premiumLimitTypeShareableChatFolderCount#601eb4c7", PremiumLimitTypeActiveStoryCountTypeID: "premiumLimitTypeActiveStoryCount#8d2c269c", + PremiumLimitTypeWeeklySentStoryCountTypeID: "premiumLimitTypeWeeklySentStoryCount#269c34b", + PremiumLimitTypeMonthlySentStoryCountTypeID: "premiumLimitTypeMonthlySentStoryCount#30d84b83", + PremiumLimitTypeStoryCaptionLengthTypeID: "premiumLimitTypeStoryCaptionLength#bed53302", PremiumFeatureIncreasedLimitsTypeID: "premiumFeatureIncreasedLimits#6a6be1b7", PremiumFeatureIncreasedUploadFileSizeTypeID: "premiumFeatureIncreasedUploadFileSize#6ccce473", PremiumFeatureImprovedDownloadSpeedTypeID: "premiumFeatureImprovedDownloadSpeed#f00b4a3e", @@ -819,10 +822,18 @@ func TypesMap() map[uint32]string { PremiumFeatureForumTopicIconTypeID: "premiumFeatureForumTopicIcon#ceef6342", PremiumFeatureAppIconsTypeID: "premiumFeatureAppIcons#5e79f489", PremiumFeatureRealTimeChatTranslationTypeID: "premiumFeatureRealTimeChatTranslation#bbd80280", + PremiumFeatureUpgradedStoriesTypeID: "premiumFeatureUpgradedStories#9008051b", + PremiumStoryFeaturePriorityOrderTypeID: "premiumStoryFeaturePriorityOrder#8ff172c7", + PremiumStoryFeatureStealthModeTypeID: "premiumStoryFeatureStealthMode#47343da4", + PremiumStoryFeaturePermanentViewsHistoryTypeID: "premiumStoryFeaturePermanentViewsHistory#c2a047a0", + PremiumStoryFeatureCustomExpirationDurationTypeID: "premiumStoryFeatureCustomExpirationDuration#dca40a96", + PremiumStoryFeatureSaveStoriesTypeID: "premiumStoryFeatureSaveStories#a6842fbd", + PremiumStoryFeatureLinksAndFormattingTypeID: "premiumStoryFeatureLinksAndFormatting#dae383f7", PremiumLimitTypeID: "premiumLimit#7ed372e6", PremiumFeaturesTypeID: "premiumFeatures#4cf10e82", PremiumSourceLimitExceededTypeID: "premiumSourceLimitExceeded#85ae8702", PremiumSourceFeatureTypeID: "premiumSourceFeature#1a929325", + PremiumSourceStoryFeatureTypeID: "premiumSourceStoryFeature#c290316c", PremiumSourceLinkTypeID: "premiumSourceLink#7f42999c", PremiumSourceSettingsTypeID: "premiumSourceSettings#eef88535", PremiumFeaturePromotionAnimationTypeID: "premiumFeaturePromotionAnimation#899dab1c", @@ -854,6 +865,11 @@ func TypesMap() map[uint32]string { ThemeSettingsTypeID: "themeSettings#fc4c1c12", ChatThemeTypeID: "chatTheme#f9406c39", HashtagsTypeID: "hashtags#6c2c0ae1", + CanSendStoryResultOkTypeID: "canSendStoryResultOk#503cf0fd", + CanSendStoryResultPremiumNeededTypeID: "canSendStoryResultPremiumNeeded#567fde69", + CanSendStoryResultActiveStoryLimitExceededTypeID: "canSendStoryResultActiveStoryLimitExceeded#afd9aad6", + CanSendStoryResultWeeklyLimitExceededTypeID: "canSendStoryResultWeeklyLimitExceeded#1341a0b8", + CanSendStoryResultMonthlyLimitExceededTypeID: "canSendStoryResultMonthlyLimitExceeded#dd8242d5", CanTransferOwnershipResultOkTypeID: "canTransferOwnershipResultOk#faa48643", CanTransferOwnershipResultPasswordNeededTypeID: "canTransferOwnershipResultPasswordNeeded#5c4a4adf", CanTransferOwnershipResultPasswordTooFreshTypeID: "canTransferOwnershipResultPasswordTooFresh#305d9b11", @@ -928,7 +944,7 @@ func TypesMap() map[uint32]string { JSONValueStringTypeID: "jsonValueString#5f3ebdb1", JSONValueArrayTypeID: "jsonValueArray#eccdb0d8", JSONValueObjectTypeID: "jsonValueObject#c67bff40", - StoryPrivacySettingsEveryoneTypeID: "storyPrivacySettingsEveryone#a8204874", + StoryPrivacySettingsEveryoneTypeID: "storyPrivacySettingsEveryone#22d1053a", StoryPrivacySettingsContactsTypeID: "storyPrivacySettingsContacts#35515d71", StoryPrivacySettingsCloseFriendsTypeID: "storyPrivacySettingsCloseFriends#7cff8b60", StoryPrivacySettingsSelectedContactsTypeID: "storyPrivacySettingsSelectedContacts#25401fc7", @@ -1028,6 +1044,17 @@ func TypesMap() map[uint32]string { InternalLinkTypeWebAppTypeID: "internalLinkTypeWebApp#fc98d04f", MessageLinkTypeID: "messageLink#af4a3aa6", MessageLinkInfoTypeID: "messageLinkInfo#2b96fb50", + StoryViewerTypeID: "storyViewer#cf0fb132", + StoryViewersTypeID: "storyViewers#b9fed56b", + StoryAreaPositionTypeID: "storyAreaPosition#6389679", + StoryAreaTypeLocationTypeID: "storyAreaTypeLocation#9ebe1186", + StoryAreaTypeVenueTypeID: "storyAreaTypeVenue#18ae4d06", + StoryAreaTypeID: "storyArea#c9ff075e", + InputStoryAreaTypeLocationTypeID: "inputStoryAreaTypeLocation#6849d762", + InputStoryAreaTypeFoundVenueTypeID: "inputStoryAreaTypeFoundVenue#accda496", + InputStoryAreaTypePreviousVenueTypeID: "inputStoryAreaTypePreviousVenue#6e124e0c", + InputStoryAreaTypeID: "inputStoryArea#752ae7f", + InputStoryAreasTypeID: "inputStoryAreas#b8ba29fe", StoryVideoTypeID: "storyVideo#8588ba3", StoryContentPhotoTypeID: "storyContentPhoto#d45f0050", StoryContentVideoTypeID: "storyContentVideo#b30162a6", @@ -1036,11 +1063,13 @@ func TypesMap() map[uint32]string { InputStoryContentVideoTypeID: "inputStoryContentVideo#d7383f99", StoryListMainTypeID: "storyListMain#d7eeb3ff", StoryListArchiveTypeID: "storyListArchive#fd80a741", - StoryInteractionInfoTypeID: "storyInteractionInfo#853472cf", - StoryTypeID: "story#352d729c", + StoryInteractionInfoTypeID: "storyInteractionInfo#e5109256", + StoryTypeID: "story#3198c7c0", StoriesTypeID: "stories#5a860711", StoryInfoTypeID: "storyInfo#8997c352", ChatActiveStoriesTypeID: "chatActiveStories#d923d773", + BlockListMainTypeID: "blockListMain#50a4137c", + BlockListStoriesTypeID: "blockListStories#628965c", FilePartTypeID: "filePart#36594c36", FileTypeNoneTypeID: "fileTypeNone#77637ea5", FileTypeAnimationTypeID: "fileTypeAnimation#eeaa7dba", @@ -1183,7 +1212,7 @@ func TypesMap() map[uint32]string { UpdateChatHasProtectedContentTypeID: "updateChatHasProtectedContent#6b50071b", UpdateChatIsTranslatableTypeID: "updateChatIsTranslatable#7b031617", UpdateChatIsMarkedAsUnreadTypeID: "updateChatIsMarkedAsUnread#57853334", - UpdateChatIsBlockedTypeID: "updateChatIsBlocked#88da7e40", + UpdateChatBlockListTypeID: "updateChatBlockList#872af48e", UpdateChatHasScheduledMessagesTypeID: "updateChatHasScheduledMessages#7b14c2d7", UpdateChatFoldersTypeID: "updateChatFolders#71a4b3a", UpdateChatOnlineMemberCountTypeID: "updateChatOnlineMemberCount#1d0caa9d", @@ -1220,8 +1249,11 @@ func TypesMap() map[uint32]string { UpdateUnreadChatCountTypeID: "updateUnreadChatCount#76e19242", UpdateStoryTypeID: "updateStory#1906572f", UpdateStoryDeletedTypeID: "updateStoryDeleted#7007eb9d", + UpdateStorySendSucceededTypeID: "updateStorySendSucceeded#b9269e57", + UpdateStorySendFailedTypeID: "updateStorySendFailed#4418bca2", UpdateChatActiveStoriesTypeID: "updateChatActiveStories#79786c2c", UpdateStoryListChatCountTypeID: "updateStoryListChatCount#8833cd3f", + UpdateStoryStealthModeTypeID: "updateStoryStealthMode#6ff7bd1a", UpdateOptionTypeID: "updateOption#35b17404", UpdateStickerSetTypeID: "updateStickerSet#70035dcc", UpdateInstalledStickerSetsTypeID: "updateInstalledStickerSets#82cd5388", @@ -1549,8 +1581,9 @@ func TypesMap() map[uint32]string { SetPinnedChatsRequestTypeID: "setPinnedChats#c6c6edf1", ReadChatListRequestTypeID: "readChatList#bd6498aa", GetStoryRequestTypeID: "getStory#717b1c78", - SendStoryRequestTypeID: "sendStory#4dbecb6a", - EditStoryRequestTypeID: "editStory#ca87df56", + CanSendStoryRequestTypeID: "canSendStory#ede53a66", + SendStoryRequestTypeID: "sendStory#40b9f838", + EditStoryRequestTypeID: "editStory#aa2c3e86", SetStoryPrivacySettingsRequestTypeID: "setStoryPrivacySettings#d8e94332", ToggleStoryIsPinnedRequestTypeID: "toggleStoryIsPinned#df8031f9", DeleteStoryRequestTypeID: "deleteStory#62332a06", @@ -1562,8 +1595,11 @@ func TypesMap() map[uint32]string { GetArchivedStoriesRequestTypeID: "getArchivedStories#6a864fe7", OpenStoryRequestTypeID: "openStory#ceda7c7d", CloseStoryRequestTypeID: "closeStory#443d0f55", - GetStoryViewersRequestTypeID: "getStoryViewers#ab175e7b", + GetStoryAvailableReactionsRequestTypeID: "getStoryAvailableReactions#23854d3b", + SetStoryReactionRequestTypeID: "setStoryReaction#ac8b4fa7", + GetStoryViewersRequestTypeID: "getStoryViewers#40df8dba", ReportStoryRequestTypeID: "reportStory#9b5f709b", + ActivateStoryStealthModeRequestTypeID: "activateStoryStealthMode#c3db8491", GetAttachmentMenuBotRequestTypeID: "getAttachmentMenuBot#3da561fb", ToggleBotIsAddedToAttachmentMenuRequestTypeID: "toggleBotIsAddedToAttachmentMenu#8e59de9a", GetThemedEmojiStatusesRequestTypeID: "getThemedEmojiStatuses#6ac5c8c2", @@ -1642,9 +1678,9 @@ func TypesMap() map[uint32]string { EndGroupCallRequestTypeID: "endGroupCall#22294cb7", GetGroupCallStreamsRequestTypeID: "getGroupCallStreams#9f7c9164", GetGroupCallStreamSegmentRequestTypeID: "getGroupCallStreamSegment#8424daa5", - ToggleMessageSenderIsBlockedRequestTypeID: "toggleMessageSenderIsBlocked#884f0ed5", + SetMessageSenderBlockListRequestTypeID: "setMessageSenderBlockList#898b5c91", BlockMessageSenderFromRepliesRequestTypeID: "blockMessageSenderFromReplies#b79df58b", - GetBlockedMessageSendersRequestTypeID: "getBlockedMessageSenders#740e1460", + GetBlockedMessageSendersRequestTypeID: "getBlockedMessageSenders#8ce52f16", AddContactRequestTypeID: "addContact#6f707140", ImportContactsRequestTypeID: "importContacts#77bdb718", GetContactsRequestTypeID: "getContacts#ab7f4470", @@ -1906,1082 +1942,1111 @@ func TypesMap() map[uint32]string { // NamesMap returns mapping from type names to TL type ids. func NamesMap() map[string]uint32 { return map[string]uint32{ - "double": DoubleTypeID, - "string": StringTypeID, - "int32": Int32TypeID, - "int53": Int53TypeID, - "int64": Int64TypeID, - "bytes": BytesTypeID, - "boolFalse": BoolFalseTypeID, - "boolTrue": BoolTrueTypeID, - "error": ErrorTypeID, - "ok": OkTypeID, - "authenticationCodeTypeTelegramMessage": AuthenticationCodeTypeTelegramMessageTypeID, - "authenticationCodeTypeSms": AuthenticationCodeTypeSMSTypeID, - "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, - "emojiStatus": EmojiStatusTypeID, - "emojiStatuses": EmojiStatusesTypeID, - "usernames": UsernamesTypeID, - "user": UserTypeID, - "botInfo": BotInfoTypeID, - "userFullInfo": UserFullInfoTypeID, - "users": UsersTypeID, - "chatAdministrator": ChatAdministratorTypeID, - "chatAdministrators": ChatAdministratorsTypeID, - "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, - "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, - "chatMemberStatusMember": ChatMemberStatusMemberTypeID, - "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, - "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, - "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, - "chatMember": ChatMemberTypeID, - "chatMembers": ChatMembersTypeID, - "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, - "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, - "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, - "chatMembersFilterMention": ChatMembersFilterMentionTypeID, - "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, - "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, - "chatMembersFilterBots": ChatMembersFilterBotsTypeID, - "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, - "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, - "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, - "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, - "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, - "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, - "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, - "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, - "chatInviteLink": ChatInviteLinkTypeID, - "chatInviteLinks": ChatInviteLinksTypeID, - "chatInviteLinkCount": ChatInviteLinkCountTypeID, - "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, - "chatInviteLinkMember": ChatInviteLinkMemberTypeID, - "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, - "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, - "chatJoinRequest": ChatJoinRequestTypeID, - "chatJoinRequests": ChatJoinRequestsTypeID, - "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, - "basicGroup": BasicGroupTypeID, - "basicGroupFullInfo": BasicGroupFullInfoTypeID, - "supergroup": SupergroupTypeID, - "supergroupFullInfo": SupergroupFullInfoTypeID, - "secretChatStatePending": SecretChatStatePendingTypeID, - "secretChatStateReady": SecretChatStateReadyTypeID, - "secretChatStateClosed": SecretChatStateClosedTypeID, - "secretChat": SecretChatTypeID, - "messageSenderUser": MessageSenderUserTypeID, - "messageSenderChat": MessageSenderChatTypeID, - "messageSenders": MessageSendersTypeID, - "chatMessageSender": ChatMessageSenderTypeID, - "chatMessageSenders": ChatMessageSendersTypeID, - "messageViewer": MessageViewerTypeID, - "messageViewers": MessageViewersTypeID, - "messageForwardOriginUser": MessageForwardOriginUserTypeID, - "messageForwardOriginChat": MessageForwardOriginChatTypeID, - "messageForwardOriginHiddenUser": MessageForwardOriginHiddenUserTypeID, - "messageForwardOriginChannel": MessageForwardOriginChannelTypeID, - "messageForwardOriginMessageImport": MessageForwardOriginMessageImportTypeID, - "reactionTypeEmoji": ReactionTypeEmojiTypeID, - "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, - "messageForwardInfo": MessageForwardInfoTypeID, - "messageReplyInfo": MessageReplyInfoTypeID, - "messageReaction": MessageReactionTypeID, - "messageInteractionInfo": MessageInteractionInfoTypeID, - "unreadReaction": UnreadReactionTypeID, - "messageSendingStatePending": MessageSendingStatePendingTypeID, - "messageSendingStateFailed": MessageSendingStateFailedTypeID, - "messageReplyToMessage": MessageReplyToMessageTypeID, - "messageReplyToStory": MessageReplyToStoryTypeID, - "message": MessageTypeID, - "messages": MessagesTypeID, - "foundMessages": FoundMessagesTypeID, - "foundChatMessages": FoundChatMessagesTypeID, - "messagePosition": MessagePositionTypeID, - "messagePositions": MessagePositionsTypeID, - "messageCalendarDay": MessageCalendarDayTypeID, - "messageCalendar": MessageCalendarTypeID, - "messageSourceChatHistory": MessageSourceChatHistoryTypeID, - "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, - "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, - "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, - "messageSourceChatList": MessageSourceChatListTypeID, - "messageSourceSearch": MessageSourceSearchTypeID, - "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, - "messageSourceNotification": MessageSourceNotificationTypeID, - "messageSourceScreenshot": MessageSourceScreenshotTypeID, - "messageSourceOther": MessageSourceOtherTypeID, - "messageSponsorTypeBot": MessageSponsorTypeBotTypeID, - "messageSponsorTypePublicChannel": MessageSponsorTypePublicChannelTypeID, - "messageSponsorTypePrivateChannel": MessageSponsorTypePrivateChannelTypeID, - "messageSponsorTypeWebsite": MessageSponsorTypeWebsiteTypeID, - "messageSponsor": MessageSponsorTypeID, - "sponsoredMessage": SponsoredMessageTypeID, - "sponsoredMessages": SponsoredMessagesTypeID, - "fileDownload": FileDownloadTypeID, - "downloadedFileCounts": DownloadedFileCountsTypeID, - "foundFileDownloads": FoundFileDownloadsTypeID, - "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, - "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, - "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, - "chatNotificationSettings": ChatNotificationSettingsTypeID, - "scopeNotificationSettings": ScopeNotificationSettingsTypeID, - "draftMessage": DraftMessageTypeID, - "chatTypePrivate": ChatTypePrivateTypeID, - "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, - "chatTypeSupergroup": ChatTypeSupergroupTypeID, - "chatTypeSecret": ChatTypeSecretTypeID, - "chatFolderIcon": ChatFolderIconTypeID, - "chatFolder": ChatFolderTypeID, - "chatFolderInfo": ChatFolderInfoTypeID, - "chatFolderInviteLink": ChatFolderInviteLinkTypeID, - "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, - "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, - "recommendedChatFolder": RecommendedChatFolderTypeID, - "recommendedChatFolders": RecommendedChatFoldersTypeID, - "archiveChatListSettings": ArchiveChatListSettingsTypeID, - "chatListMain": ChatListMainTypeID, - "chatListArchive": ChatListArchiveTypeID, - "chatListFolder": ChatListFolderTypeID, - "chatLists": ChatListsTypeID, - "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, - "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, - "chatPosition": ChatPositionTypeID, - "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, - "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, - "videoChat": VideoChatTypeID, - "chat": ChatTypeID, - "chats": ChatsTypeID, - "chatNearby": ChatNearbyTypeID, - "chatsNearby": ChatsNearbyTypeID, - "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, - "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, - "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, - "chatActionBarReportUnrelatedLocation": ChatActionBarReportUnrelatedLocationTypeID, - "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, - "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, - "chatActionBarAddContact": ChatActionBarAddContactTypeID, - "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, - "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, - "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, - "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, - "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, - "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, - "keyboardButtonTypeRequestUser": KeyboardButtonTypeRequestUserTypeID, - "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, - "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, - "keyboardButton": KeyboardButtonTypeID, - "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, - "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, - "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, - "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, - "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, - "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, - "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, - "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, - "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, - "inlineKeyboardButton": InlineKeyboardButtonTypeID, - "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, - "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, - "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, - "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, - "loginUrlInfoOpen": LoginURLInfoOpenTypeID, - "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, - "foundWebApp": FoundWebAppTypeID, - "webAppInfo": WebAppInfoTypeID, - "messageThreadInfo": MessageThreadInfoTypeID, - "forumTopicIcon": ForumTopicIconTypeID, - "forumTopicInfo": ForumTopicInfoTypeID, - "forumTopic": ForumTopicTypeID, - "forumTopics": ForumTopicsTypeID, - "richTextPlain": RichTextPlainTypeID, - "richTextBold": RichTextBoldTypeID, - "richTextItalic": RichTextItalicTypeID, - "richTextUnderline": RichTextUnderlineTypeID, - "richTextStrikethrough": RichTextStrikethroughTypeID, - "richTextFixed": RichTextFixedTypeID, - "richTextUrl": RichTextURLTypeID, - "richTextEmailAddress": RichTextEmailAddressTypeID, - "richTextSubscript": RichTextSubscriptTypeID, - "richTextSuperscript": RichTextSuperscriptTypeID, - "richTextMarked": RichTextMarkedTypeID, - "richTextPhoneNumber": RichTextPhoneNumberTypeID, - "richTextIcon": RichTextIconTypeID, - "richTextReference": RichTextReferenceTypeID, - "richTextAnchor": RichTextAnchorTypeID, - "richTextAnchorLink": RichTextAnchorLinkTypeID, - "richTexts": RichTextsTypeID, - "pageBlockCaption": PageBlockCaptionTypeID, - "pageBlockListItem": PageBlockListItemTypeID, - "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, - "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, - "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, - "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, - "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, - "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, - "pageBlockTableCell": PageBlockTableCellTypeID, - "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, - "pageBlockTitle": PageBlockTitleTypeID, - "pageBlockSubtitle": PageBlockSubtitleTypeID, - "pageBlockAuthorDate": PageBlockAuthorDateTypeID, - "pageBlockHeader": PageBlockHeaderTypeID, - "pageBlockSubheader": PageBlockSubheaderTypeID, - "pageBlockKicker": PageBlockKickerTypeID, - "pageBlockParagraph": PageBlockParagraphTypeID, - "pageBlockPreformatted": PageBlockPreformattedTypeID, - "pageBlockFooter": PageBlockFooterTypeID, - "pageBlockDivider": PageBlockDividerTypeID, - "pageBlockAnchor": PageBlockAnchorTypeID, - "pageBlockList": PageBlockListTypeID, - "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, - "pageBlockPullQuote": PageBlockPullQuoteTypeID, - "pageBlockAnimation": PageBlockAnimationTypeID, - "pageBlockAudio": PageBlockAudioTypeID, - "pageBlockPhoto": PageBlockPhotoTypeID, - "pageBlockVideo": PageBlockVideoTypeID, - "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, - "pageBlockCover": PageBlockCoverTypeID, - "pageBlockEmbedded": PageBlockEmbeddedTypeID, - "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, - "pageBlockCollage": PageBlockCollageTypeID, - "pageBlockSlideshow": PageBlockSlideshowTypeID, - "pageBlockChatLink": PageBlockChatLinkTypeID, - "pageBlockTable": PageBlockTableTypeID, - "pageBlockDetails": PageBlockDetailsTypeID, - "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, - "pageBlockMap": PageBlockMapTypeID, - "webPageInstantView": WebPageInstantViewTypeID, - "webPage": WebPageTypeID, - "countryInfo": CountryInfoTypeID, - "countries": CountriesTypeID, - "phoneNumberInfo": PhoneNumberInfoTypeID, - "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, - "bankCardInfo": BankCardInfoTypeID, - "address": AddressTypeID, - "themeParameters": ThemeParametersTypeID, - "labeledPricePart": LabeledPricePartTypeID, - "invoice": InvoiceTypeID, - "orderInfo": OrderInfoTypeID, - "shippingOption": ShippingOptionTypeID, - "savedCredentials": SavedCredentialsTypeID, - "inputCredentialsSaved": InputCredentialsSavedTypeID, - "inputCredentialsNew": InputCredentialsNewTypeID, - "inputCredentialsApplePay": InputCredentialsApplePayTypeID, - "inputCredentialsGooglePay": InputCredentialsGooglePayTypeID, - "paymentProviderSmartGlocal": PaymentProviderSmartGlocalTypeID, - "paymentProviderStripe": PaymentProviderStripeTypeID, - "paymentProviderOther": PaymentProviderOtherTypeID, - "paymentOption": PaymentOptionTypeID, - "paymentForm": PaymentFormTypeID, - "validatedOrderInfo": ValidatedOrderInfoTypeID, - "paymentResult": PaymentResultTypeID, - "paymentReceipt": PaymentReceiptTypeID, - "inputInvoiceMessage": InputInvoiceMessageTypeID, - "inputInvoiceName": InputInvoiceNameTypeID, - "messageExtendedMediaPreview": MessageExtendedMediaPreviewTypeID, - "messageExtendedMediaPhoto": MessageExtendedMediaPhotoTypeID, - "messageExtendedMediaVideo": MessageExtendedMediaVideoTypeID, - "messageExtendedMediaUnsupported": MessageExtendedMediaUnsupportedTypeID, - "datedFile": DatedFileTypeID, - "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, - "passportElementTypePassport": PassportElementTypePassportTypeID, - "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, - "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, - "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, - "passportElementTypeAddress": PassportElementTypeAddressTypeID, - "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, - "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, - "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, - "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, - "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, - "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, - "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, - "date": DateTypeID, - "personalDetails": PersonalDetailsTypeID, - "identityDocument": IdentityDocumentTypeID, - "inputIdentityDocument": InputIdentityDocumentTypeID, - "personalDocument": PersonalDocumentTypeID, - "inputPersonalDocument": InputPersonalDocumentTypeID, - "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, - "passportElementPassport": PassportElementPassportTypeID, - "passportElementDriverLicense": PassportElementDriverLicenseTypeID, - "passportElementIdentityCard": PassportElementIdentityCardTypeID, - "passportElementInternalPassport": PassportElementInternalPassportTypeID, - "passportElementAddress": PassportElementAddressTypeID, - "passportElementUtilityBill": PassportElementUtilityBillTypeID, - "passportElementBankStatement": PassportElementBankStatementTypeID, - "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, - "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, - "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, - "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, - "passportElementEmailAddress": PassportElementEmailAddressTypeID, - "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, - "inputPassportElementPassport": InputPassportElementPassportTypeID, - "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, - "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, - "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, - "inputPassportElementAddress": InputPassportElementAddressTypeID, - "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, - "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, - "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, - "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, - "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, - "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, - "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, - "passportElements": PassportElementsTypeID, - "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, - "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, - "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, - "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, - "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, - "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, - "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, - "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, - "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, - "passportElementError": PassportElementErrorTypeID, - "passportSuitableElement": PassportSuitableElementTypeID, - "passportRequiredElement": PassportRequiredElementTypeID, - "passportAuthorizationForm": PassportAuthorizationFormTypeID, - "passportElementsWithErrors": PassportElementsWithErrorsTypeID, - "encryptedCredentials": EncryptedCredentialsTypeID, - "encryptedPassportElement": EncryptedPassportElementTypeID, - "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, - "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, - "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, - "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, - "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, - "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, - "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, - "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, - "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, - "inputPassportElementError": InputPassportElementErrorTypeID, - "messageText": MessageTextTypeID, - "messageAnimation": MessageAnimationTypeID, - "messageAudio": MessageAudioTypeID, - "messageDocument": MessageDocumentTypeID, - "messagePhoto": MessagePhotoTypeID, - "messageExpiredPhoto": MessageExpiredPhotoTypeID, - "messageSticker": MessageStickerTypeID, - "messageVideo": MessageVideoTypeID, - "messageExpiredVideo": MessageExpiredVideoTypeID, - "messageVideoNote": MessageVideoNoteTypeID, - "messageVoiceNote": MessageVoiceNoteTypeID, - "messageLocation": MessageLocationTypeID, - "messageVenue": MessageVenueTypeID, - "messageContact": MessageContactTypeID, - "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, - "messageDice": MessageDiceTypeID, - "messageGame": MessageGameTypeID, - "messagePoll": MessagePollTypeID, - "messageStory": MessageStoryTypeID, - "messageInvoice": MessageInvoiceTypeID, - "messageCall": MessageCallTypeID, - "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, - "messageVideoChatStarted": MessageVideoChatStartedTypeID, - "messageVideoChatEnded": MessageVideoChatEndedTypeID, - "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, - "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, - "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, - "messageChatChangeTitle": MessageChatChangeTitleTypeID, - "messageChatChangePhoto": MessageChatChangePhotoTypeID, - "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, - "messageChatAddMembers": MessageChatAddMembersTypeID, - "messageChatJoinByLink": MessageChatJoinByLinkTypeID, - "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, - "messageChatDeleteMember": MessageChatDeleteMemberTypeID, - "messageChatUpgradeTo": MessageChatUpgradeToTypeID, - "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, - "messagePinMessage": MessagePinMessageTypeID, - "messageScreenshotTaken": MessageScreenshotTakenTypeID, - "messageChatSetBackground": MessageChatSetBackgroundTypeID, - "messageChatSetTheme": MessageChatSetThemeTypeID, - "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, - "messageForumTopicCreated": MessageForumTopicCreatedTypeID, - "messageForumTopicEdited": MessageForumTopicEditedTypeID, - "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, - "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, - "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, - "messageCustomServiceAction": MessageCustomServiceActionTypeID, - "messageGameScore": MessageGameScoreTypeID, - "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, - "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, - "messageGiftedPremium": MessageGiftedPremiumTypeID, - "messageContactRegistered": MessageContactRegisteredTypeID, - "messageUserShared": MessageUserSharedTypeID, - "messageChatShared": MessageChatSharedTypeID, - "messageWebsiteConnected": MessageWebsiteConnectedTypeID, - "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, - "messageWebAppDataSent": MessageWebAppDataSentTypeID, - "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, - "messagePassportDataSent": MessagePassportDataSentTypeID, - "messagePassportDataReceived": MessagePassportDataReceivedTypeID, - "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, - "messageUnsupported": MessageUnsupportedTypeID, - "textEntityTypeMention": TextEntityTypeMentionTypeID, - "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, - "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, - "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, - "textEntityTypeUrl": TextEntityTypeURLTypeID, - "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, - "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, - "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, - "textEntityTypeBold": TextEntityTypeBoldTypeID, - "textEntityTypeItalic": TextEntityTypeItalicTypeID, - "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, - "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, - "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, - "textEntityTypeCode": TextEntityTypeCodeTypeID, - "textEntityTypePre": TextEntityTypePreTypeID, - "textEntityTypePreCode": TextEntityTypePreCodeTypeID, - "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, - "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, - "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, - "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, - "inputThumbnail": InputThumbnailTypeID, - "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, - "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, - "messageSendOptions": MessageSendOptionsTypeID, - "messageCopyOptions": MessageCopyOptionsTypeID, - "inputMessageText": InputMessageTextTypeID, - "inputMessageAnimation": InputMessageAnimationTypeID, - "inputMessageAudio": InputMessageAudioTypeID, - "inputMessageDocument": InputMessageDocumentTypeID, - "inputMessagePhoto": InputMessagePhotoTypeID, - "inputMessageSticker": InputMessageStickerTypeID, - "inputMessageVideo": InputMessageVideoTypeID, - "inputMessageVideoNote": InputMessageVideoNoteTypeID, - "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, - "inputMessageLocation": InputMessageLocationTypeID, - "inputMessageVenue": InputMessageVenueTypeID, - "inputMessageContact": InputMessageContactTypeID, - "inputMessageDice": InputMessageDiceTypeID, - "inputMessageGame": InputMessageGameTypeID, - "inputMessageInvoice": InputMessageInvoiceTypeID, - "inputMessagePoll": InputMessagePollTypeID, - "inputMessageStory": InputMessageStoryTypeID, - "inputMessageForwarded": InputMessageForwardedTypeID, - "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, - "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, - "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, - "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, - "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, - "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, - "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, - "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, - "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, - "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, - "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, - "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, - "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, - "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, - "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, - "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, - "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, - "chatActionTyping": ChatActionTypingTypeID, - "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, - "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, - "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, - "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, - "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, - "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, - "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, - "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, - "chatActionChoosingContact": ChatActionChoosingContactTypeID, - "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, - "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, - "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, - "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, - "chatActionCancel": ChatActionCancelTypeID, - "userStatusEmpty": UserStatusEmptyTypeID, - "userStatusOnline": UserStatusOnlineTypeID, - "userStatusOffline": UserStatusOfflineTypeID, - "userStatusRecently": UserStatusRecentlyTypeID, - "userStatusLastWeek": UserStatusLastWeekTypeID, - "userStatusLastMonth": UserStatusLastMonthTypeID, - "stickers": StickersTypeID, - "emojis": EmojisTypeID, - "stickerSet": StickerSetTypeID, - "stickerSetInfo": StickerSetInfoTypeID, - "stickerSets": StickerSetsTypeID, - "trendingStickerSets": TrendingStickerSetsTypeID, - "emojiCategory": EmojiCategoryTypeID, - "emojiCategories": EmojiCategoriesTypeID, - "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, - "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, - "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, - "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, - "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, - "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, - "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, - "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, - "callProtocol": CallProtocolTypeID, - "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, - "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, - "callServer": CallServerTypeID, - "callId": CallIDTypeID, - "groupCallId": GroupCallIDTypeID, - "callStatePending": CallStatePendingTypeID, - "callStateExchangingKeys": CallStateExchangingKeysTypeID, - "callStateReady": CallStateReadyTypeID, - "callStateHangingUp": CallStateHangingUpTypeID, - "callStateDiscarded": CallStateDiscardedTypeID, - "callStateError": CallStateErrorTypeID, - "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, - "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, - "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, - "groupCallStream": GroupCallStreamTypeID, - "groupCallStreams": GroupCallStreamsTypeID, - "rtmpUrl": RtmpURLTypeID, - "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, - "groupCall": GroupCallTypeID, - "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, - "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, - "groupCallParticipant": GroupCallParticipantTypeID, - "callProblemEcho": CallProblemEchoTypeID, - "callProblemNoise": CallProblemNoiseTypeID, - "callProblemInterruptions": CallProblemInterruptionsTypeID, - "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, - "callProblemSilentLocal": CallProblemSilentLocalTypeID, - "callProblemSilentRemote": CallProblemSilentRemoteTypeID, - "callProblemDropped": CallProblemDroppedTypeID, - "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, - "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, - "call": CallTypeID, - "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, - "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, - "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, - "addedReaction": AddedReactionTypeID, - "addedReactions": AddedReactionsTypeID, - "availableReaction": AvailableReactionTypeID, - "availableReactions": AvailableReactionsTypeID, - "emojiReaction": EmojiReactionTypeID, - "animations": AnimationsTypeID, - "diceStickersRegular": DiceStickersRegularTypeID, - "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, - "importedContacts": ImportedContactsTypeID, - "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, - "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, - "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, - "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, - "attachmentMenuBot": AttachmentMenuBotTypeID, - "sentWebAppMessage": SentWebAppMessageTypeID, - "httpUrl": HTTPURLTypeID, - "userLink": UserLinkTypeID, - "inputInlineQueryResultAnimation": InputInlineQueryResultAnimationTypeID, - "inputInlineQueryResultArticle": InputInlineQueryResultArticleTypeID, - "inputInlineQueryResultAudio": InputInlineQueryResultAudioTypeID, - "inputInlineQueryResultContact": InputInlineQueryResultContactTypeID, - "inputInlineQueryResultDocument": InputInlineQueryResultDocumentTypeID, - "inputInlineQueryResultGame": InputInlineQueryResultGameTypeID, - "inputInlineQueryResultLocation": InputInlineQueryResultLocationTypeID, - "inputInlineQueryResultPhoto": InputInlineQueryResultPhotoTypeID, - "inputInlineQueryResultSticker": InputInlineQueryResultStickerTypeID, - "inputInlineQueryResultVenue": InputInlineQueryResultVenueTypeID, - "inputInlineQueryResultVideo": InputInlineQueryResultVideoTypeID, - "inputInlineQueryResultVoiceNote": InputInlineQueryResultVoiceNoteTypeID, - "inlineQueryResultArticle": InlineQueryResultArticleTypeID, - "inlineQueryResultContact": InlineQueryResultContactTypeID, - "inlineQueryResultLocation": InlineQueryResultLocationTypeID, - "inlineQueryResultVenue": InlineQueryResultVenueTypeID, - "inlineQueryResultGame": InlineQueryResultGameTypeID, - "inlineQueryResultAnimation": InlineQueryResultAnimationTypeID, - "inlineQueryResultAudio": InlineQueryResultAudioTypeID, - "inlineQueryResultDocument": InlineQueryResultDocumentTypeID, - "inlineQueryResultPhoto": InlineQueryResultPhotoTypeID, - "inlineQueryResultSticker": InlineQueryResultStickerTypeID, - "inlineQueryResultVideo": InlineQueryResultVideoTypeID, - "inlineQueryResultVoiceNote": InlineQueryResultVoiceNoteTypeID, - "inlineQueryResultsButtonTypeStartBot": InlineQueryResultsButtonTypeStartBotTypeID, - "inlineQueryResultsButtonTypeWebApp": InlineQueryResultsButtonTypeWebAppTypeID, - "inlineQueryResultsButton": InlineQueryResultsButtonTypeID, - "inlineQueryResults": InlineQueryResultsTypeID, - "callbackQueryPayloadData": CallbackQueryPayloadDataTypeID, - "callbackQueryPayloadDataWithPassword": CallbackQueryPayloadDataWithPasswordTypeID, - "callbackQueryPayloadGame": CallbackQueryPayloadGameTypeID, - "callbackQueryAnswer": CallbackQueryAnswerTypeID, - "customRequestResult": CustomRequestResultTypeID, - "gameHighScore": GameHighScoreTypeID, - "gameHighScores": GameHighScoresTypeID, - "chatEventMessageEdited": ChatEventMessageEditedTypeID, - "chatEventMessageDeleted": ChatEventMessageDeletedTypeID, - "chatEventMessagePinned": ChatEventMessagePinnedTypeID, - "chatEventMessageUnpinned": ChatEventMessageUnpinnedTypeID, - "chatEventPollStopped": ChatEventPollStoppedTypeID, - "chatEventMemberJoined": ChatEventMemberJoinedTypeID, - "chatEventMemberJoinedByInviteLink": ChatEventMemberJoinedByInviteLinkTypeID, - "chatEventMemberJoinedByRequest": ChatEventMemberJoinedByRequestTypeID, - "chatEventMemberInvited": ChatEventMemberInvitedTypeID, - "chatEventMemberLeft": ChatEventMemberLeftTypeID, - "chatEventMemberPromoted": ChatEventMemberPromotedTypeID, - "chatEventMemberRestricted": ChatEventMemberRestrictedTypeID, - "chatEventAvailableReactionsChanged": ChatEventAvailableReactionsChangedTypeID, - "chatEventDescriptionChanged": ChatEventDescriptionChangedTypeID, - "chatEventLinkedChatChanged": ChatEventLinkedChatChangedTypeID, - "chatEventLocationChanged": ChatEventLocationChangedTypeID, - "chatEventMessageAutoDeleteTimeChanged": ChatEventMessageAutoDeleteTimeChangedTypeID, - "chatEventPermissionsChanged": ChatEventPermissionsChangedTypeID, - "chatEventPhotoChanged": ChatEventPhotoChangedTypeID, - "chatEventSlowModeDelayChanged": ChatEventSlowModeDelayChangedTypeID, - "chatEventStickerSetChanged": ChatEventStickerSetChangedTypeID, - "chatEventTitleChanged": ChatEventTitleChangedTypeID, - "chatEventUsernameChanged": ChatEventUsernameChangedTypeID, - "chatEventActiveUsernamesChanged": ChatEventActiveUsernamesChangedTypeID, - "chatEventHasProtectedContentToggled": ChatEventHasProtectedContentToggledTypeID, - "chatEventInvitesToggled": ChatEventInvitesToggledTypeID, - "chatEventIsAllHistoryAvailableToggled": ChatEventIsAllHistoryAvailableToggledTypeID, - "chatEventHasAggressiveAntiSpamEnabledToggled": ChatEventHasAggressiveAntiSpamEnabledToggledTypeID, - "chatEventSignMessagesToggled": ChatEventSignMessagesToggledTypeID, - "chatEventInviteLinkEdited": ChatEventInviteLinkEditedTypeID, - "chatEventInviteLinkRevoked": ChatEventInviteLinkRevokedTypeID, - "chatEventInviteLinkDeleted": ChatEventInviteLinkDeletedTypeID, - "chatEventVideoChatCreated": ChatEventVideoChatCreatedTypeID, - "chatEventVideoChatEnded": ChatEventVideoChatEndedTypeID, - "chatEventVideoChatMuteNewParticipantsToggled": ChatEventVideoChatMuteNewParticipantsToggledTypeID, - "chatEventVideoChatParticipantIsMutedToggled": ChatEventVideoChatParticipantIsMutedToggledTypeID, - "chatEventVideoChatParticipantVolumeLevelChanged": ChatEventVideoChatParticipantVolumeLevelChangedTypeID, - "chatEventIsForumToggled": ChatEventIsForumToggledTypeID, - "chatEventForumTopicCreated": ChatEventForumTopicCreatedTypeID, - "chatEventForumTopicEdited": ChatEventForumTopicEditedTypeID, - "chatEventForumTopicToggleIsClosed": ChatEventForumTopicToggleIsClosedTypeID, - "chatEventForumTopicToggleIsHidden": ChatEventForumTopicToggleIsHiddenTypeID, - "chatEventForumTopicDeleted": ChatEventForumTopicDeletedTypeID, - "chatEventForumTopicPinned": ChatEventForumTopicPinnedTypeID, - "chatEvent": ChatEventTypeID, - "chatEvents": ChatEventsTypeID, - "chatEventLogFilters": ChatEventLogFiltersTypeID, - "languagePackStringValueOrdinary": LanguagePackStringValueOrdinaryTypeID, - "languagePackStringValuePluralized": LanguagePackStringValuePluralizedTypeID, - "languagePackStringValueDeleted": LanguagePackStringValueDeletedTypeID, - "languagePackString": LanguagePackStringTypeID, - "languagePackStrings": LanguagePackStringsTypeID, - "languagePackInfo": LanguagePackInfoTypeID, - "localizationTargetInfo": LocalizationTargetInfoTypeID, - "premiumLimitTypeSupergroupCount": PremiumLimitTypeSupergroupCountTypeID, - "premiumLimitTypePinnedChatCount": PremiumLimitTypePinnedChatCountTypeID, - "premiumLimitTypeCreatedPublicChatCount": PremiumLimitTypeCreatedPublicChatCountTypeID, - "premiumLimitTypeSavedAnimationCount": PremiumLimitTypeSavedAnimationCountTypeID, - "premiumLimitTypeFavoriteStickerCount": PremiumLimitTypeFavoriteStickerCountTypeID, - "premiumLimitTypeChatFolderCount": PremiumLimitTypeChatFolderCountTypeID, - "premiumLimitTypeChatFolderChosenChatCount": PremiumLimitTypeChatFolderChosenChatCountTypeID, - "premiumLimitTypePinnedArchivedChatCount": PremiumLimitTypePinnedArchivedChatCountTypeID, - "premiumLimitTypeCaptionLength": PremiumLimitTypeCaptionLengthTypeID, - "premiumLimitTypeBioLength": PremiumLimitTypeBioLengthTypeID, - "premiumLimitTypeChatFolderInviteLinkCount": PremiumLimitTypeChatFolderInviteLinkCountTypeID, - "premiumLimitTypeShareableChatFolderCount": PremiumLimitTypeShareableChatFolderCountTypeID, - "premiumLimitTypeActiveStoryCount": PremiumLimitTypeActiveStoryCountTypeID, - "premiumFeatureIncreasedLimits": PremiumFeatureIncreasedLimitsTypeID, - "premiumFeatureIncreasedUploadFileSize": PremiumFeatureIncreasedUploadFileSizeTypeID, - "premiumFeatureImprovedDownloadSpeed": PremiumFeatureImprovedDownloadSpeedTypeID, - "premiumFeatureVoiceRecognition": PremiumFeatureVoiceRecognitionTypeID, - "premiumFeatureDisabledAds": PremiumFeatureDisabledAdsTypeID, - "premiumFeatureUniqueReactions": PremiumFeatureUniqueReactionsTypeID, - "premiumFeatureUniqueStickers": PremiumFeatureUniqueStickersTypeID, - "premiumFeatureCustomEmoji": PremiumFeatureCustomEmojiTypeID, - "premiumFeatureAdvancedChatManagement": PremiumFeatureAdvancedChatManagementTypeID, - "premiumFeatureProfileBadge": PremiumFeatureProfileBadgeTypeID, - "premiumFeatureEmojiStatus": PremiumFeatureEmojiStatusTypeID, - "premiumFeatureAnimatedProfilePhoto": PremiumFeatureAnimatedProfilePhotoTypeID, - "premiumFeatureForumTopicIcon": PremiumFeatureForumTopicIconTypeID, - "premiumFeatureAppIcons": PremiumFeatureAppIconsTypeID, - "premiumFeatureRealTimeChatTranslation": PremiumFeatureRealTimeChatTranslationTypeID, - "premiumLimit": PremiumLimitTypeID, - "premiumFeatures": PremiumFeaturesTypeID, - "premiumSourceLimitExceeded": PremiumSourceLimitExceededTypeID, - "premiumSourceFeature": PremiumSourceFeatureTypeID, - "premiumSourceLink": PremiumSourceLinkTypeID, - "premiumSourceSettings": PremiumSourceSettingsTypeID, - "premiumFeaturePromotionAnimation": PremiumFeaturePromotionAnimationTypeID, - "premiumState": PremiumStateTypeID, - "storePaymentPurposePremiumSubscription": StorePaymentPurposePremiumSubscriptionTypeID, - "storePaymentPurposeGiftedPremium": StorePaymentPurposeGiftedPremiumTypeID, - "deviceTokenFirebaseCloudMessaging": DeviceTokenFirebaseCloudMessagingTypeID, - "deviceTokenApplePush": DeviceTokenApplePushTypeID, - "deviceTokenApplePushVoIP": DeviceTokenApplePushVoIPTypeID, - "deviceTokenWindowsPush": DeviceTokenWindowsPushTypeID, - "deviceTokenMicrosoftPush": DeviceTokenMicrosoftPushTypeID, - "deviceTokenMicrosoftPushVoIP": DeviceTokenMicrosoftPushVoIPTypeID, - "deviceTokenWebPush": DeviceTokenWebPushTypeID, - "deviceTokenSimplePush": DeviceTokenSimplePushTypeID, - "deviceTokenUbuntuPush": DeviceTokenUbuntuPushTypeID, - "deviceTokenBlackBerryPush": DeviceTokenBlackBerryPushTypeID, - "deviceTokenTizenPush": DeviceTokenTizenPushTypeID, - "deviceTokenHuaweiPush": DeviceTokenHuaweiPushTypeID, - "pushReceiverId": PushReceiverIDTypeID, - "backgroundFillSolid": BackgroundFillSolidTypeID, - "backgroundFillGradient": BackgroundFillGradientTypeID, - "backgroundFillFreeformGradient": BackgroundFillFreeformGradientTypeID, - "backgroundTypeWallpaper": BackgroundTypeWallpaperTypeID, - "backgroundTypePattern": BackgroundTypePatternTypeID, - "backgroundTypeFill": BackgroundTypeFillTypeID, - "inputBackgroundLocal": InputBackgroundLocalTypeID, - "inputBackgroundRemote": InputBackgroundRemoteTypeID, - "inputBackgroundPrevious": InputBackgroundPreviousTypeID, - "themeSettings": ThemeSettingsTypeID, - "chatTheme": ChatThemeTypeID, - "hashtags": HashtagsTypeID, - "canTransferOwnershipResultOk": CanTransferOwnershipResultOkTypeID, - "canTransferOwnershipResultPasswordNeeded": CanTransferOwnershipResultPasswordNeededTypeID, - "canTransferOwnershipResultPasswordTooFresh": CanTransferOwnershipResultPasswordTooFreshTypeID, - "canTransferOwnershipResultSessionTooFresh": CanTransferOwnershipResultSessionTooFreshTypeID, - "checkChatUsernameResultOk": CheckChatUsernameResultOkTypeID, - "checkChatUsernameResultUsernameInvalid": CheckChatUsernameResultUsernameInvalidTypeID, - "checkChatUsernameResultUsernameOccupied": CheckChatUsernameResultUsernameOccupiedTypeID, - "checkChatUsernameResultUsernamePurchasable": CheckChatUsernameResultUsernamePurchasableTypeID, - "checkChatUsernameResultPublicChatsTooMany": CheckChatUsernameResultPublicChatsTooManyTypeID, - "checkChatUsernameResultPublicGroupsUnavailable": CheckChatUsernameResultPublicGroupsUnavailableTypeID, - "checkStickerSetNameResultOk": CheckStickerSetNameResultOkTypeID, - "checkStickerSetNameResultNameInvalid": CheckStickerSetNameResultNameInvalidTypeID, - "checkStickerSetNameResultNameOccupied": CheckStickerSetNameResultNameOccupiedTypeID, - "resetPasswordResultOk": ResetPasswordResultOkTypeID, - "resetPasswordResultPending": ResetPasswordResultPendingTypeID, - "resetPasswordResultDeclined": ResetPasswordResultDeclinedTypeID, - "messageFileTypePrivate": MessageFileTypePrivateTypeID, - "messageFileTypeGroup": MessageFileTypeGroupTypeID, - "messageFileTypeUnknown": MessageFileTypeUnknownTypeID, - "pushMessageContentHidden": PushMessageContentHiddenTypeID, - "pushMessageContentAnimation": PushMessageContentAnimationTypeID, - "pushMessageContentAudio": PushMessageContentAudioTypeID, - "pushMessageContentContact": PushMessageContentContactTypeID, - "pushMessageContentContactRegistered": PushMessageContentContactRegisteredTypeID, - "pushMessageContentDocument": PushMessageContentDocumentTypeID, - "pushMessageContentGame": PushMessageContentGameTypeID, - "pushMessageContentGameScore": PushMessageContentGameScoreTypeID, - "pushMessageContentInvoice": PushMessageContentInvoiceTypeID, - "pushMessageContentLocation": PushMessageContentLocationTypeID, - "pushMessageContentPhoto": PushMessageContentPhotoTypeID, - "pushMessageContentPoll": PushMessageContentPollTypeID, - "pushMessageContentScreenshotTaken": PushMessageContentScreenshotTakenTypeID, - "pushMessageContentSticker": PushMessageContentStickerTypeID, - "pushMessageContentStory": PushMessageContentStoryTypeID, - "pushMessageContentText": PushMessageContentTextTypeID, - "pushMessageContentVideo": PushMessageContentVideoTypeID, - "pushMessageContentVideoNote": PushMessageContentVideoNoteTypeID, - "pushMessageContentVoiceNote": PushMessageContentVoiceNoteTypeID, - "pushMessageContentBasicGroupChatCreate": PushMessageContentBasicGroupChatCreateTypeID, - "pushMessageContentChatAddMembers": PushMessageContentChatAddMembersTypeID, - "pushMessageContentChatChangePhoto": PushMessageContentChatChangePhotoTypeID, - "pushMessageContentChatChangeTitle": PushMessageContentChatChangeTitleTypeID, - "pushMessageContentChatSetBackground": PushMessageContentChatSetBackgroundTypeID, - "pushMessageContentChatSetTheme": PushMessageContentChatSetThemeTypeID, - "pushMessageContentChatDeleteMember": PushMessageContentChatDeleteMemberTypeID, - "pushMessageContentChatJoinByLink": PushMessageContentChatJoinByLinkTypeID, - "pushMessageContentChatJoinByRequest": PushMessageContentChatJoinByRequestTypeID, - "pushMessageContentRecurringPayment": PushMessageContentRecurringPaymentTypeID, - "pushMessageContentSuggestProfilePhoto": PushMessageContentSuggestProfilePhotoTypeID, - "pushMessageContentMessageForwards": PushMessageContentMessageForwardsTypeID, - "pushMessageContentMediaAlbum": PushMessageContentMediaAlbumTypeID, - "notificationTypeNewMessage": NotificationTypeNewMessageTypeID, - "notificationTypeNewSecretChat": NotificationTypeNewSecretChatTypeID, - "notificationTypeNewCall": NotificationTypeNewCallTypeID, - "notificationTypeNewPushMessage": NotificationTypeNewPushMessageTypeID, - "notificationGroupTypeMessages": NotificationGroupTypeMessagesTypeID, - "notificationGroupTypeMentions": NotificationGroupTypeMentionsTypeID, - "notificationGroupTypeSecretChat": NotificationGroupTypeSecretChatTypeID, - "notificationGroupTypeCalls": NotificationGroupTypeCallsTypeID, - "notificationSound": NotificationSoundTypeID, - "notificationSounds": NotificationSoundsTypeID, - "notification": NotificationTypeID, - "notificationGroup": NotificationGroupTypeID, - "optionValueBoolean": OptionValueBooleanTypeID, - "optionValueEmpty": OptionValueEmptyTypeID, - "optionValueInteger": OptionValueIntegerTypeID, - "optionValueString": OptionValueStringTypeID, - "jsonObjectMember": JSONObjectMemberTypeID, - "jsonValueNull": JSONValueNullTypeID, - "jsonValueBoolean": JSONValueBooleanTypeID, - "jsonValueNumber": JSONValueNumberTypeID, - "jsonValueString": JSONValueStringTypeID, - "jsonValueArray": JSONValueArrayTypeID, - "jsonValueObject": JSONValueObjectTypeID, - "storyPrivacySettingsEveryone": StoryPrivacySettingsEveryoneTypeID, - "storyPrivacySettingsContacts": StoryPrivacySettingsContactsTypeID, - "storyPrivacySettingsCloseFriends": StoryPrivacySettingsCloseFriendsTypeID, - "storyPrivacySettingsSelectedContacts": StoryPrivacySettingsSelectedContactsTypeID, - "userPrivacySettingRuleAllowAll": UserPrivacySettingRuleAllowAllTypeID, - "userPrivacySettingRuleAllowContacts": UserPrivacySettingRuleAllowContactsTypeID, - "userPrivacySettingRuleAllowUsers": UserPrivacySettingRuleAllowUsersTypeID, - "userPrivacySettingRuleAllowChatMembers": UserPrivacySettingRuleAllowChatMembersTypeID, - "userPrivacySettingRuleRestrictAll": UserPrivacySettingRuleRestrictAllTypeID, - "userPrivacySettingRuleRestrictContacts": UserPrivacySettingRuleRestrictContactsTypeID, - "userPrivacySettingRuleRestrictUsers": UserPrivacySettingRuleRestrictUsersTypeID, - "userPrivacySettingRuleRestrictChatMembers": UserPrivacySettingRuleRestrictChatMembersTypeID, - "userPrivacySettingRules": UserPrivacySettingRulesTypeID, - "userPrivacySettingShowStatus": UserPrivacySettingShowStatusTypeID, - "userPrivacySettingShowProfilePhoto": UserPrivacySettingShowProfilePhotoTypeID, - "userPrivacySettingShowLinkInForwardedMessages": UserPrivacySettingShowLinkInForwardedMessagesTypeID, - "userPrivacySettingShowPhoneNumber": UserPrivacySettingShowPhoneNumberTypeID, - "userPrivacySettingShowBio": UserPrivacySettingShowBioTypeID, - "userPrivacySettingAllowChatInvites": UserPrivacySettingAllowChatInvitesTypeID, - "userPrivacySettingAllowCalls": UserPrivacySettingAllowCallsTypeID, - "userPrivacySettingAllowPeerToPeerCalls": UserPrivacySettingAllowPeerToPeerCallsTypeID, - "userPrivacySettingAllowFindingByPhoneNumber": UserPrivacySettingAllowFindingByPhoneNumberTypeID, + "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, + "emojiStatus": EmojiStatusTypeID, + "emojiStatuses": EmojiStatusesTypeID, + "usernames": UsernamesTypeID, + "user": UserTypeID, + "botInfo": BotInfoTypeID, + "userFullInfo": UserFullInfoTypeID, + "users": UsersTypeID, + "chatAdministrator": ChatAdministratorTypeID, + "chatAdministrators": ChatAdministratorsTypeID, + "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, + "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, + "chatMemberStatusMember": ChatMemberStatusMemberTypeID, + "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, + "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, + "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, + "chatMember": ChatMemberTypeID, + "chatMembers": ChatMembersTypeID, + "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, + "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, + "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, + "chatMembersFilterMention": ChatMembersFilterMentionTypeID, + "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, + "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, + "chatMembersFilterBots": ChatMembersFilterBotsTypeID, + "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, + "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, + "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, + "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, + "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, + "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, + "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, + "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, + "chatInviteLink": ChatInviteLinkTypeID, + "chatInviteLinks": ChatInviteLinksTypeID, + "chatInviteLinkCount": ChatInviteLinkCountTypeID, + "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, + "chatInviteLinkMember": ChatInviteLinkMemberTypeID, + "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, + "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, + "chatJoinRequest": ChatJoinRequestTypeID, + "chatJoinRequests": ChatJoinRequestsTypeID, + "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, + "basicGroup": BasicGroupTypeID, + "basicGroupFullInfo": BasicGroupFullInfoTypeID, + "supergroup": SupergroupTypeID, + "supergroupFullInfo": SupergroupFullInfoTypeID, + "secretChatStatePending": SecretChatStatePendingTypeID, + "secretChatStateReady": SecretChatStateReadyTypeID, + "secretChatStateClosed": SecretChatStateClosedTypeID, + "secretChat": SecretChatTypeID, + "messageSenderUser": MessageSenderUserTypeID, + "messageSenderChat": MessageSenderChatTypeID, + "messageSenders": MessageSendersTypeID, + "chatMessageSender": ChatMessageSenderTypeID, + "chatMessageSenders": ChatMessageSendersTypeID, + "messageViewer": MessageViewerTypeID, + "messageViewers": MessageViewersTypeID, + "messageForwardOriginUser": MessageForwardOriginUserTypeID, + "messageForwardOriginChat": MessageForwardOriginChatTypeID, + "messageForwardOriginHiddenUser": MessageForwardOriginHiddenUserTypeID, + "messageForwardOriginChannel": MessageForwardOriginChannelTypeID, + "messageForwardOriginMessageImport": MessageForwardOriginMessageImportTypeID, + "reactionTypeEmoji": ReactionTypeEmojiTypeID, + "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, + "messageForwardInfo": MessageForwardInfoTypeID, + "messageReplyInfo": MessageReplyInfoTypeID, + "messageReaction": MessageReactionTypeID, + "messageInteractionInfo": MessageInteractionInfoTypeID, + "unreadReaction": UnreadReactionTypeID, + "messageSendingStatePending": MessageSendingStatePendingTypeID, + "messageSendingStateFailed": MessageSendingStateFailedTypeID, + "messageReplyToMessage": MessageReplyToMessageTypeID, + "messageReplyToStory": MessageReplyToStoryTypeID, + "message": MessageTypeID, + "messages": MessagesTypeID, + "foundMessages": FoundMessagesTypeID, + "foundChatMessages": FoundChatMessagesTypeID, + "messagePosition": MessagePositionTypeID, + "messagePositions": MessagePositionsTypeID, + "messageCalendarDay": MessageCalendarDayTypeID, + "messageCalendar": MessageCalendarTypeID, + "messageSourceChatHistory": MessageSourceChatHistoryTypeID, + "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, + "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, + "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, + "messageSourceChatList": MessageSourceChatListTypeID, + "messageSourceSearch": MessageSourceSearchTypeID, + "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, + "messageSourceNotification": MessageSourceNotificationTypeID, + "messageSourceScreenshot": MessageSourceScreenshotTypeID, + "messageSourceOther": MessageSourceOtherTypeID, + "messageSponsorTypeBot": MessageSponsorTypeBotTypeID, + "messageSponsorTypePublicChannel": MessageSponsorTypePublicChannelTypeID, + "messageSponsorTypePrivateChannel": MessageSponsorTypePrivateChannelTypeID, + "messageSponsorTypeWebsite": MessageSponsorTypeWebsiteTypeID, + "messageSponsor": MessageSponsorTypeID, + "sponsoredMessage": SponsoredMessageTypeID, + "sponsoredMessages": SponsoredMessagesTypeID, + "fileDownload": FileDownloadTypeID, + "downloadedFileCounts": DownloadedFileCountsTypeID, + "foundFileDownloads": FoundFileDownloadsTypeID, + "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, + "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, + "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, + "chatNotificationSettings": ChatNotificationSettingsTypeID, + "scopeNotificationSettings": ScopeNotificationSettingsTypeID, + "draftMessage": DraftMessageTypeID, + "chatTypePrivate": ChatTypePrivateTypeID, + "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, + "chatTypeSupergroup": ChatTypeSupergroupTypeID, + "chatTypeSecret": ChatTypeSecretTypeID, + "chatFolderIcon": ChatFolderIconTypeID, + "chatFolder": ChatFolderTypeID, + "chatFolderInfo": ChatFolderInfoTypeID, + "chatFolderInviteLink": ChatFolderInviteLinkTypeID, + "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, + "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, + "recommendedChatFolder": RecommendedChatFolderTypeID, + "recommendedChatFolders": RecommendedChatFoldersTypeID, + "archiveChatListSettings": ArchiveChatListSettingsTypeID, + "chatListMain": ChatListMainTypeID, + "chatListArchive": ChatListArchiveTypeID, + "chatListFolder": ChatListFolderTypeID, + "chatLists": ChatListsTypeID, + "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, + "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, + "chatPosition": ChatPositionTypeID, + "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, + "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, + "videoChat": VideoChatTypeID, + "chat": ChatTypeID, + "chats": ChatsTypeID, + "chatNearby": ChatNearbyTypeID, + "chatsNearby": ChatsNearbyTypeID, + "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, + "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, + "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, + "chatActionBarReportUnrelatedLocation": ChatActionBarReportUnrelatedLocationTypeID, + "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, + "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, + "chatActionBarAddContact": ChatActionBarAddContactTypeID, + "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, + "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, + "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, + "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, + "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, + "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, + "keyboardButtonTypeRequestUser": KeyboardButtonTypeRequestUserTypeID, + "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, + "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, + "keyboardButton": KeyboardButtonTypeID, + "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, + "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, + "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, + "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, + "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, + "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, + "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, + "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, + "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, + "inlineKeyboardButton": InlineKeyboardButtonTypeID, + "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, + "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, + "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, + "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, + "loginUrlInfoOpen": LoginURLInfoOpenTypeID, + "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, + "foundWebApp": FoundWebAppTypeID, + "webAppInfo": WebAppInfoTypeID, + "messageThreadInfo": MessageThreadInfoTypeID, + "forumTopicIcon": ForumTopicIconTypeID, + "forumTopicInfo": ForumTopicInfoTypeID, + "forumTopic": ForumTopicTypeID, + "forumTopics": ForumTopicsTypeID, + "richTextPlain": RichTextPlainTypeID, + "richTextBold": RichTextBoldTypeID, + "richTextItalic": RichTextItalicTypeID, + "richTextUnderline": RichTextUnderlineTypeID, + "richTextStrikethrough": RichTextStrikethroughTypeID, + "richTextFixed": RichTextFixedTypeID, + "richTextUrl": RichTextURLTypeID, + "richTextEmailAddress": RichTextEmailAddressTypeID, + "richTextSubscript": RichTextSubscriptTypeID, + "richTextSuperscript": RichTextSuperscriptTypeID, + "richTextMarked": RichTextMarkedTypeID, + "richTextPhoneNumber": RichTextPhoneNumberTypeID, + "richTextIcon": RichTextIconTypeID, + "richTextReference": RichTextReferenceTypeID, + "richTextAnchor": RichTextAnchorTypeID, + "richTextAnchorLink": RichTextAnchorLinkTypeID, + "richTexts": RichTextsTypeID, + "pageBlockCaption": PageBlockCaptionTypeID, + "pageBlockListItem": PageBlockListItemTypeID, + "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, + "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, + "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, + "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, + "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, + "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, + "pageBlockTableCell": PageBlockTableCellTypeID, + "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, + "pageBlockTitle": PageBlockTitleTypeID, + "pageBlockSubtitle": PageBlockSubtitleTypeID, + "pageBlockAuthorDate": PageBlockAuthorDateTypeID, + "pageBlockHeader": PageBlockHeaderTypeID, + "pageBlockSubheader": PageBlockSubheaderTypeID, + "pageBlockKicker": PageBlockKickerTypeID, + "pageBlockParagraph": PageBlockParagraphTypeID, + "pageBlockPreformatted": PageBlockPreformattedTypeID, + "pageBlockFooter": PageBlockFooterTypeID, + "pageBlockDivider": PageBlockDividerTypeID, + "pageBlockAnchor": PageBlockAnchorTypeID, + "pageBlockList": PageBlockListTypeID, + "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, + "pageBlockPullQuote": PageBlockPullQuoteTypeID, + "pageBlockAnimation": PageBlockAnimationTypeID, + "pageBlockAudio": PageBlockAudioTypeID, + "pageBlockPhoto": PageBlockPhotoTypeID, + "pageBlockVideo": PageBlockVideoTypeID, + "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, + "pageBlockCover": PageBlockCoverTypeID, + "pageBlockEmbedded": PageBlockEmbeddedTypeID, + "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, + "pageBlockCollage": PageBlockCollageTypeID, + "pageBlockSlideshow": PageBlockSlideshowTypeID, + "pageBlockChatLink": PageBlockChatLinkTypeID, + "pageBlockTable": PageBlockTableTypeID, + "pageBlockDetails": PageBlockDetailsTypeID, + "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, + "pageBlockMap": PageBlockMapTypeID, + "webPageInstantView": WebPageInstantViewTypeID, + "webPage": WebPageTypeID, + "countryInfo": CountryInfoTypeID, + "countries": CountriesTypeID, + "phoneNumberInfo": PhoneNumberInfoTypeID, + "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, + "bankCardInfo": BankCardInfoTypeID, + "address": AddressTypeID, + "themeParameters": ThemeParametersTypeID, + "labeledPricePart": LabeledPricePartTypeID, + "invoice": InvoiceTypeID, + "orderInfo": OrderInfoTypeID, + "shippingOption": ShippingOptionTypeID, + "savedCredentials": SavedCredentialsTypeID, + "inputCredentialsSaved": InputCredentialsSavedTypeID, + "inputCredentialsNew": InputCredentialsNewTypeID, + "inputCredentialsApplePay": InputCredentialsApplePayTypeID, + "inputCredentialsGooglePay": InputCredentialsGooglePayTypeID, + "paymentProviderSmartGlocal": PaymentProviderSmartGlocalTypeID, + "paymentProviderStripe": PaymentProviderStripeTypeID, + "paymentProviderOther": PaymentProviderOtherTypeID, + "paymentOption": PaymentOptionTypeID, + "paymentForm": PaymentFormTypeID, + "validatedOrderInfo": ValidatedOrderInfoTypeID, + "paymentResult": PaymentResultTypeID, + "paymentReceipt": PaymentReceiptTypeID, + "inputInvoiceMessage": InputInvoiceMessageTypeID, + "inputInvoiceName": InputInvoiceNameTypeID, + "messageExtendedMediaPreview": MessageExtendedMediaPreviewTypeID, + "messageExtendedMediaPhoto": MessageExtendedMediaPhotoTypeID, + "messageExtendedMediaVideo": MessageExtendedMediaVideoTypeID, + "messageExtendedMediaUnsupported": MessageExtendedMediaUnsupportedTypeID, + "datedFile": DatedFileTypeID, + "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, + "passportElementTypePassport": PassportElementTypePassportTypeID, + "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, + "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, + "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, + "passportElementTypeAddress": PassportElementTypeAddressTypeID, + "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, + "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, + "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, + "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, + "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, + "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, + "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, + "date": DateTypeID, + "personalDetails": PersonalDetailsTypeID, + "identityDocument": IdentityDocumentTypeID, + "inputIdentityDocument": InputIdentityDocumentTypeID, + "personalDocument": PersonalDocumentTypeID, + "inputPersonalDocument": InputPersonalDocumentTypeID, + "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, + "passportElementPassport": PassportElementPassportTypeID, + "passportElementDriverLicense": PassportElementDriverLicenseTypeID, + "passportElementIdentityCard": PassportElementIdentityCardTypeID, + "passportElementInternalPassport": PassportElementInternalPassportTypeID, + "passportElementAddress": PassportElementAddressTypeID, + "passportElementUtilityBill": PassportElementUtilityBillTypeID, + "passportElementBankStatement": PassportElementBankStatementTypeID, + "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, + "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, + "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, + "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, + "passportElementEmailAddress": PassportElementEmailAddressTypeID, + "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, + "inputPassportElementPassport": InputPassportElementPassportTypeID, + "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, + "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, + "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, + "inputPassportElementAddress": InputPassportElementAddressTypeID, + "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, + "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, + "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, + "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, + "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, + "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, + "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, + "passportElements": PassportElementsTypeID, + "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, + "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, + "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, + "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, + "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, + "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, + "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, + "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, + "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, + "passportElementError": PassportElementErrorTypeID, + "passportSuitableElement": PassportSuitableElementTypeID, + "passportRequiredElement": PassportRequiredElementTypeID, + "passportAuthorizationForm": PassportAuthorizationFormTypeID, + "passportElementsWithErrors": PassportElementsWithErrorsTypeID, + "encryptedCredentials": EncryptedCredentialsTypeID, + "encryptedPassportElement": EncryptedPassportElementTypeID, + "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, + "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, + "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, + "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, + "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, + "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, + "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, + "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, + "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, + "inputPassportElementError": InputPassportElementErrorTypeID, + "messageText": MessageTextTypeID, + "messageAnimation": MessageAnimationTypeID, + "messageAudio": MessageAudioTypeID, + "messageDocument": MessageDocumentTypeID, + "messagePhoto": MessagePhotoTypeID, + "messageExpiredPhoto": MessageExpiredPhotoTypeID, + "messageSticker": MessageStickerTypeID, + "messageVideo": MessageVideoTypeID, + "messageExpiredVideo": MessageExpiredVideoTypeID, + "messageVideoNote": MessageVideoNoteTypeID, + "messageVoiceNote": MessageVoiceNoteTypeID, + "messageLocation": MessageLocationTypeID, + "messageVenue": MessageVenueTypeID, + "messageContact": MessageContactTypeID, + "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, + "messageDice": MessageDiceTypeID, + "messageGame": MessageGameTypeID, + "messagePoll": MessagePollTypeID, + "messageStory": MessageStoryTypeID, + "messageInvoice": MessageInvoiceTypeID, + "messageCall": MessageCallTypeID, + "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, + "messageVideoChatStarted": MessageVideoChatStartedTypeID, + "messageVideoChatEnded": MessageVideoChatEndedTypeID, + "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, + "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, + "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, + "messageChatChangeTitle": MessageChatChangeTitleTypeID, + "messageChatChangePhoto": MessageChatChangePhotoTypeID, + "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, + "messageChatAddMembers": MessageChatAddMembersTypeID, + "messageChatJoinByLink": MessageChatJoinByLinkTypeID, + "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, + "messageChatDeleteMember": MessageChatDeleteMemberTypeID, + "messageChatUpgradeTo": MessageChatUpgradeToTypeID, + "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, + "messagePinMessage": MessagePinMessageTypeID, + "messageScreenshotTaken": MessageScreenshotTakenTypeID, + "messageChatSetBackground": MessageChatSetBackgroundTypeID, + "messageChatSetTheme": MessageChatSetThemeTypeID, + "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, + "messageForumTopicCreated": MessageForumTopicCreatedTypeID, + "messageForumTopicEdited": MessageForumTopicEditedTypeID, + "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, + "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, + "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, + "messageCustomServiceAction": MessageCustomServiceActionTypeID, + "messageGameScore": MessageGameScoreTypeID, + "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, + "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, + "messageGiftedPremium": MessageGiftedPremiumTypeID, + "messageContactRegistered": MessageContactRegisteredTypeID, + "messageUserShared": MessageUserSharedTypeID, + "messageChatShared": MessageChatSharedTypeID, + "messageWebsiteConnected": MessageWebsiteConnectedTypeID, + "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, + "messageWebAppDataSent": MessageWebAppDataSentTypeID, + "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, + "messagePassportDataSent": MessagePassportDataSentTypeID, + "messagePassportDataReceived": MessagePassportDataReceivedTypeID, + "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, + "messageUnsupported": MessageUnsupportedTypeID, + "textEntityTypeMention": TextEntityTypeMentionTypeID, + "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, + "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, + "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, + "textEntityTypeUrl": TextEntityTypeURLTypeID, + "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, + "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, + "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, + "textEntityTypeBold": TextEntityTypeBoldTypeID, + "textEntityTypeItalic": TextEntityTypeItalicTypeID, + "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, + "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, + "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, + "textEntityTypeCode": TextEntityTypeCodeTypeID, + "textEntityTypePre": TextEntityTypePreTypeID, + "textEntityTypePreCode": TextEntityTypePreCodeTypeID, + "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, + "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, + "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, + "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, + "inputThumbnail": InputThumbnailTypeID, + "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, + "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, + "messageSendOptions": MessageSendOptionsTypeID, + "messageCopyOptions": MessageCopyOptionsTypeID, + "inputMessageText": InputMessageTextTypeID, + "inputMessageAnimation": InputMessageAnimationTypeID, + "inputMessageAudio": InputMessageAudioTypeID, + "inputMessageDocument": InputMessageDocumentTypeID, + "inputMessagePhoto": InputMessagePhotoTypeID, + "inputMessageSticker": InputMessageStickerTypeID, + "inputMessageVideo": InputMessageVideoTypeID, + "inputMessageVideoNote": InputMessageVideoNoteTypeID, + "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, + "inputMessageLocation": InputMessageLocationTypeID, + "inputMessageVenue": InputMessageVenueTypeID, + "inputMessageContact": InputMessageContactTypeID, + "inputMessageDice": InputMessageDiceTypeID, + "inputMessageGame": InputMessageGameTypeID, + "inputMessageInvoice": InputMessageInvoiceTypeID, + "inputMessagePoll": InputMessagePollTypeID, + "inputMessageStory": InputMessageStoryTypeID, + "inputMessageForwarded": InputMessageForwardedTypeID, + "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, + "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, + "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, + "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, + "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, + "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, + "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, + "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, + "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, + "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, + "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, + "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, + "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, + "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, + "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, + "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, + "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, + "chatActionTyping": ChatActionTypingTypeID, + "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, + "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, + "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, + "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, + "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, + "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, + "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, + "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, + "chatActionChoosingContact": ChatActionChoosingContactTypeID, + "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, + "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, + "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, + "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, + "chatActionCancel": ChatActionCancelTypeID, + "userStatusEmpty": UserStatusEmptyTypeID, + "userStatusOnline": UserStatusOnlineTypeID, + "userStatusOffline": UserStatusOfflineTypeID, + "userStatusRecently": UserStatusRecentlyTypeID, + "userStatusLastWeek": UserStatusLastWeekTypeID, + "userStatusLastMonth": UserStatusLastMonthTypeID, + "stickers": StickersTypeID, + "emojis": EmojisTypeID, + "stickerSet": StickerSetTypeID, + "stickerSetInfo": StickerSetInfoTypeID, + "stickerSets": StickerSetsTypeID, + "trendingStickerSets": TrendingStickerSetsTypeID, + "emojiCategory": EmojiCategoryTypeID, + "emojiCategories": EmojiCategoriesTypeID, + "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, + "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, + "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, + "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, + "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, + "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, + "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, + "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, + "callProtocol": CallProtocolTypeID, + "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, + "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, + "callServer": CallServerTypeID, + "callId": CallIDTypeID, + "groupCallId": GroupCallIDTypeID, + "callStatePending": CallStatePendingTypeID, + "callStateExchangingKeys": CallStateExchangingKeysTypeID, + "callStateReady": CallStateReadyTypeID, + "callStateHangingUp": CallStateHangingUpTypeID, + "callStateDiscarded": CallStateDiscardedTypeID, + "callStateError": CallStateErrorTypeID, + "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, + "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, + "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, + "groupCallStream": GroupCallStreamTypeID, + "groupCallStreams": GroupCallStreamsTypeID, + "rtmpUrl": RtmpURLTypeID, + "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, + "groupCall": GroupCallTypeID, + "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, + "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, + "groupCallParticipant": GroupCallParticipantTypeID, + "callProblemEcho": CallProblemEchoTypeID, + "callProblemNoise": CallProblemNoiseTypeID, + "callProblemInterruptions": CallProblemInterruptionsTypeID, + "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, + "callProblemSilentLocal": CallProblemSilentLocalTypeID, + "callProblemSilentRemote": CallProblemSilentRemoteTypeID, + "callProblemDropped": CallProblemDroppedTypeID, + "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, + "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, + "call": CallTypeID, + "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, + "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, + "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, + "addedReaction": AddedReactionTypeID, + "addedReactions": AddedReactionsTypeID, + "availableReaction": AvailableReactionTypeID, + "availableReactions": AvailableReactionsTypeID, + "emojiReaction": EmojiReactionTypeID, + "animations": AnimationsTypeID, + "diceStickersRegular": DiceStickersRegularTypeID, + "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, + "importedContacts": ImportedContactsTypeID, + "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, + "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, + "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, + "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, + "attachmentMenuBot": AttachmentMenuBotTypeID, + "sentWebAppMessage": SentWebAppMessageTypeID, + "httpUrl": HTTPURLTypeID, + "userLink": UserLinkTypeID, + "inputInlineQueryResultAnimation": InputInlineQueryResultAnimationTypeID, + "inputInlineQueryResultArticle": InputInlineQueryResultArticleTypeID, + "inputInlineQueryResultAudio": InputInlineQueryResultAudioTypeID, + "inputInlineQueryResultContact": InputInlineQueryResultContactTypeID, + "inputInlineQueryResultDocument": InputInlineQueryResultDocumentTypeID, + "inputInlineQueryResultGame": InputInlineQueryResultGameTypeID, + "inputInlineQueryResultLocation": InputInlineQueryResultLocationTypeID, + "inputInlineQueryResultPhoto": InputInlineQueryResultPhotoTypeID, + "inputInlineQueryResultSticker": InputInlineQueryResultStickerTypeID, + "inputInlineQueryResultVenue": InputInlineQueryResultVenueTypeID, + "inputInlineQueryResultVideo": InputInlineQueryResultVideoTypeID, + "inputInlineQueryResultVoiceNote": InputInlineQueryResultVoiceNoteTypeID, + "inlineQueryResultArticle": InlineQueryResultArticleTypeID, + "inlineQueryResultContact": InlineQueryResultContactTypeID, + "inlineQueryResultLocation": InlineQueryResultLocationTypeID, + "inlineQueryResultVenue": InlineQueryResultVenueTypeID, + "inlineQueryResultGame": InlineQueryResultGameTypeID, + "inlineQueryResultAnimation": InlineQueryResultAnimationTypeID, + "inlineQueryResultAudio": InlineQueryResultAudioTypeID, + "inlineQueryResultDocument": InlineQueryResultDocumentTypeID, + "inlineQueryResultPhoto": InlineQueryResultPhotoTypeID, + "inlineQueryResultSticker": InlineQueryResultStickerTypeID, + "inlineQueryResultVideo": InlineQueryResultVideoTypeID, + "inlineQueryResultVoiceNote": InlineQueryResultVoiceNoteTypeID, + "inlineQueryResultsButtonTypeStartBot": InlineQueryResultsButtonTypeStartBotTypeID, + "inlineQueryResultsButtonTypeWebApp": InlineQueryResultsButtonTypeWebAppTypeID, + "inlineQueryResultsButton": InlineQueryResultsButtonTypeID, + "inlineQueryResults": InlineQueryResultsTypeID, + "callbackQueryPayloadData": CallbackQueryPayloadDataTypeID, + "callbackQueryPayloadDataWithPassword": CallbackQueryPayloadDataWithPasswordTypeID, + "callbackQueryPayloadGame": CallbackQueryPayloadGameTypeID, + "callbackQueryAnswer": CallbackQueryAnswerTypeID, + "customRequestResult": CustomRequestResultTypeID, + "gameHighScore": GameHighScoreTypeID, + "gameHighScores": GameHighScoresTypeID, + "chatEventMessageEdited": ChatEventMessageEditedTypeID, + "chatEventMessageDeleted": ChatEventMessageDeletedTypeID, + "chatEventMessagePinned": ChatEventMessagePinnedTypeID, + "chatEventMessageUnpinned": ChatEventMessageUnpinnedTypeID, + "chatEventPollStopped": ChatEventPollStoppedTypeID, + "chatEventMemberJoined": ChatEventMemberJoinedTypeID, + "chatEventMemberJoinedByInviteLink": ChatEventMemberJoinedByInviteLinkTypeID, + "chatEventMemberJoinedByRequest": ChatEventMemberJoinedByRequestTypeID, + "chatEventMemberInvited": ChatEventMemberInvitedTypeID, + "chatEventMemberLeft": ChatEventMemberLeftTypeID, + "chatEventMemberPromoted": ChatEventMemberPromotedTypeID, + "chatEventMemberRestricted": ChatEventMemberRestrictedTypeID, + "chatEventAvailableReactionsChanged": ChatEventAvailableReactionsChangedTypeID, + "chatEventDescriptionChanged": ChatEventDescriptionChangedTypeID, + "chatEventLinkedChatChanged": ChatEventLinkedChatChangedTypeID, + "chatEventLocationChanged": ChatEventLocationChangedTypeID, + "chatEventMessageAutoDeleteTimeChanged": ChatEventMessageAutoDeleteTimeChangedTypeID, + "chatEventPermissionsChanged": ChatEventPermissionsChangedTypeID, + "chatEventPhotoChanged": ChatEventPhotoChangedTypeID, + "chatEventSlowModeDelayChanged": ChatEventSlowModeDelayChangedTypeID, + "chatEventStickerSetChanged": ChatEventStickerSetChangedTypeID, + "chatEventTitleChanged": ChatEventTitleChangedTypeID, + "chatEventUsernameChanged": ChatEventUsernameChangedTypeID, + "chatEventActiveUsernamesChanged": ChatEventActiveUsernamesChangedTypeID, + "chatEventHasProtectedContentToggled": ChatEventHasProtectedContentToggledTypeID, + "chatEventInvitesToggled": ChatEventInvitesToggledTypeID, + "chatEventIsAllHistoryAvailableToggled": ChatEventIsAllHistoryAvailableToggledTypeID, + "chatEventHasAggressiveAntiSpamEnabledToggled": ChatEventHasAggressiveAntiSpamEnabledToggledTypeID, + "chatEventSignMessagesToggled": ChatEventSignMessagesToggledTypeID, + "chatEventInviteLinkEdited": ChatEventInviteLinkEditedTypeID, + "chatEventInviteLinkRevoked": ChatEventInviteLinkRevokedTypeID, + "chatEventInviteLinkDeleted": ChatEventInviteLinkDeletedTypeID, + "chatEventVideoChatCreated": ChatEventVideoChatCreatedTypeID, + "chatEventVideoChatEnded": ChatEventVideoChatEndedTypeID, + "chatEventVideoChatMuteNewParticipantsToggled": ChatEventVideoChatMuteNewParticipantsToggledTypeID, + "chatEventVideoChatParticipantIsMutedToggled": ChatEventVideoChatParticipantIsMutedToggledTypeID, + "chatEventVideoChatParticipantVolumeLevelChanged": ChatEventVideoChatParticipantVolumeLevelChangedTypeID, + "chatEventIsForumToggled": ChatEventIsForumToggledTypeID, + "chatEventForumTopicCreated": ChatEventForumTopicCreatedTypeID, + "chatEventForumTopicEdited": ChatEventForumTopicEditedTypeID, + "chatEventForumTopicToggleIsClosed": ChatEventForumTopicToggleIsClosedTypeID, + "chatEventForumTopicToggleIsHidden": ChatEventForumTopicToggleIsHiddenTypeID, + "chatEventForumTopicDeleted": ChatEventForumTopicDeletedTypeID, + "chatEventForumTopicPinned": ChatEventForumTopicPinnedTypeID, + "chatEvent": ChatEventTypeID, + "chatEvents": ChatEventsTypeID, + "chatEventLogFilters": ChatEventLogFiltersTypeID, + "languagePackStringValueOrdinary": LanguagePackStringValueOrdinaryTypeID, + "languagePackStringValuePluralized": LanguagePackStringValuePluralizedTypeID, + "languagePackStringValueDeleted": LanguagePackStringValueDeletedTypeID, + "languagePackString": LanguagePackStringTypeID, + "languagePackStrings": LanguagePackStringsTypeID, + "languagePackInfo": LanguagePackInfoTypeID, + "localizationTargetInfo": LocalizationTargetInfoTypeID, + "premiumLimitTypeSupergroupCount": PremiumLimitTypeSupergroupCountTypeID, + "premiumLimitTypePinnedChatCount": PremiumLimitTypePinnedChatCountTypeID, + "premiumLimitTypeCreatedPublicChatCount": PremiumLimitTypeCreatedPublicChatCountTypeID, + "premiumLimitTypeSavedAnimationCount": PremiumLimitTypeSavedAnimationCountTypeID, + "premiumLimitTypeFavoriteStickerCount": PremiumLimitTypeFavoriteStickerCountTypeID, + "premiumLimitTypeChatFolderCount": PremiumLimitTypeChatFolderCountTypeID, + "premiumLimitTypeChatFolderChosenChatCount": PremiumLimitTypeChatFolderChosenChatCountTypeID, + "premiumLimitTypePinnedArchivedChatCount": PremiumLimitTypePinnedArchivedChatCountTypeID, + "premiumLimitTypeCaptionLength": PremiumLimitTypeCaptionLengthTypeID, + "premiumLimitTypeBioLength": PremiumLimitTypeBioLengthTypeID, + "premiumLimitTypeChatFolderInviteLinkCount": PremiumLimitTypeChatFolderInviteLinkCountTypeID, + "premiumLimitTypeShareableChatFolderCount": PremiumLimitTypeShareableChatFolderCountTypeID, + "premiumLimitTypeActiveStoryCount": PremiumLimitTypeActiveStoryCountTypeID, + "premiumLimitTypeWeeklySentStoryCount": PremiumLimitTypeWeeklySentStoryCountTypeID, + "premiumLimitTypeMonthlySentStoryCount": PremiumLimitTypeMonthlySentStoryCountTypeID, + "premiumLimitTypeStoryCaptionLength": PremiumLimitTypeStoryCaptionLengthTypeID, + "premiumFeatureIncreasedLimits": PremiumFeatureIncreasedLimitsTypeID, + "premiumFeatureIncreasedUploadFileSize": PremiumFeatureIncreasedUploadFileSizeTypeID, + "premiumFeatureImprovedDownloadSpeed": PremiumFeatureImprovedDownloadSpeedTypeID, + "premiumFeatureVoiceRecognition": PremiumFeatureVoiceRecognitionTypeID, + "premiumFeatureDisabledAds": PremiumFeatureDisabledAdsTypeID, + "premiumFeatureUniqueReactions": PremiumFeatureUniqueReactionsTypeID, + "premiumFeatureUniqueStickers": PremiumFeatureUniqueStickersTypeID, + "premiumFeatureCustomEmoji": PremiumFeatureCustomEmojiTypeID, + "premiumFeatureAdvancedChatManagement": PremiumFeatureAdvancedChatManagementTypeID, + "premiumFeatureProfileBadge": PremiumFeatureProfileBadgeTypeID, + "premiumFeatureEmojiStatus": PremiumFeatureEmojiStatusTypeID, + "premiumFeatureAnimatedProfilePhoto": PremiumFeatureAnimatedProfilePhotoTypeID, + "premiumFeatureForumTopicIcon": PremiumFeatureForumTopicIconTypeID, + "premiumFeatureAppIcons": PremiumFeatureAppIconsTypeID, + "premiumFeatureRealTimeChatTranslation": PremiumFeatureRealTimeChatTranslationTypeID, + "premiumFeatureUpgradedStories": PremiumFeatureUpgradedStoriesTypeID, + "premiumStoryFeaturePriorityOrder": PremiumStoryFeaturePriorityOrderTypeID, + "premiumStoryFeatureStealthMode": PremiumStoryFeatureStealthModeTypeID, + "premiumStoryFeaturePermanentViewsHistory": PremiumStoryFeaturePermanentViewsHistoryTypeID, + "premiumStoryFeatureCustomExpirationDuration": PremiumStoryFeatureCustomExpirationDurationTypeID, + "premiumStoryFeatureSaveStories": PremiumStoryFeatureSaveStoriesTypeID, + "premiumStoryFeatureLinksAndFormatting": PremiumStoryFeatureLinksAndFormattingTypeID, + "premiumLimit": PremiumLimitTypeID, + "premiumFeatures": PremiumFeaturesTypeID, + "premiumSourceLimitExceeded": PremiumSourceLimitExceededTypeID, + "premiumSourceFeature": PremiumSourceFeatureTypeID, + "premiumSourceStoryFeature": PremiumSourceStoryFeatureTypeID, + "premiumSourceLink": PremiumSourceLinkTypeID, + "premiumSourceSettings": PremiumSourceSettingsTypeID, + "premiumFeaturePromotionAnimation": PremiumFeaturePromotionAnimationTypeID, + "premiumState": PremiumStateTypeID, + "storePaymentPurposePremiumSubscription": StorePaymentPurposePremiumSubscriptionTypeID, + "storePaymentPurposeGiftedPremium": StorePaymentPurposeGiftedPremiumTypeID, + "deviceTokenFirebaseCloudMessaging": DeviceTokenFirebaseCloudMessagingTypeID, + "deviceTokenApplePush": DeviceTokenApplePushTypeID, + "deviceTokenApplePushVoIP": DeviceTokenApplePushVoIPTypeID, + "deviceTokenWindowsPush": DeviceTokenWindowsPushTypeID, + "deviceTokenMicrosoftPush": DeviceTokenMicrosoftPushTypeID, + "deviceTokenMicrosoftPushVoIP": DeviceTokenMicrosoftPushVoIPTypeID, + "deviceTokenWebPush": DeviceTokenWebPushTypeID, + "deviceTokenSimplePush": DeviceTokenSimplePushTypeID, + "deviceTokenUbuntuPush": DeviceTokenUbuntuPushTypeID, + "deviceTokenBlackBerryPush": DeviceTokenBlackBerryPushTypeID, + "deviceTokenTizenPush": DeviceTokenTizenPushTypeID, + "deviceTokenHuaweiPush": DeviceTokenHuaweiPushTypeID, + "pushReceiverId": PushReceiverIDTypeID, + "backgroundFillSolid": BackgroundFillSolidTypeID, + "backgroundFillGradient": BackgroundFillGradientTypeID, + "backgroundFillFreeformGradient": BackgroundFillFreeformGradientTypeID, + "backgroundTypeWallpaper": BackgroundTypeWallpaperTypeID, + "backgroundTypePattern": BackgroundTypePatternTypeID, + "backgroundTypeFill": BackgroundTypeFillTypeID, + "inputBackgroundLocal": InputBackgroundLocalTypeID, + "inputBackgroundRemote": InputBackgroundRemoteTypeID, + "inputBackgroundPrevious": InputBackgroundPreviousTypeID, + "themeSettings": ThemeSettingsTypeID, + "chatTheme": ChatThemeTypeID, + "hashtags": HashtagsTypeID, + "canSendStoryResultOk": CanSendStoryResultOkTypeID, + "canSendStoryResultPremiumNeeded": CanSendStoryResultPremiumNeededTypeID, + "canSendStoryResultActiveStoryLimitExceeded": CanSendStoryResultActiveStoryLimitExceededTypeID, + "canSendStoryResultWeeklyLimitExceeded": CanSendStoryResultWeeklyLimitExceededTypeID, + "canSendStoryResultMonthlyLimitExceeded": CanSendStoryResultMonthlyLimitExceededTypeID, + "canTransferOwnershipResultOk": CanTransferOwnershipResultOkTypeID, + "canTransferOwnershipResultPasswordNeeded": CanTransferOwnershipResultPasswordNeededTypeID, + "canTransferOwnershipResultPasswordTooFresh": CanTransferOwnershipResultPasswordTooFreshTypeID, + "canTransferOwnershipResultSessionTooFresh": CanTransferOwnershipResultSessionTooFreshTypeID, + "checkChatUsernameResultOk": CheckChatUsernameResultOkTypeID, + "checkChatUsernameResultUsernameInvalid": CheckChatUsernameResultUsernameInvalidTypeID, + "checkChatUsernameResultUsernameOccupied": CheckChatUsernameResultUsernameOccupiedTypeID, + "checkChatUsernameResultUsernamePurchasable": CheckChatUsernameResultUsernamePurchasableTypeID, + "checkChatUsernameResultPublicChatsTooMany": CheckChatUsernameResultPublicChatsTooManyTypeID, + "checkChatUsernameResultPublicGroupsUnavailable": CheckChatUsernameResultPublicGroupsUnavailableTypeID, + "checkStickerSetNameResultOk": CheckStickerSetNameResultOkTypeID, + "checkStickerSetNameResultNameInvalid": CheckStickerSetNameResultNameInvalidTypeID, + "checkStickerSetNameResultNameOccupied": CheckStickerSetNameResultNameOccupiedTypeID, + "resetPasswordResultOk": ResetPasswordResultOkTypeID, + "resetPasswordResultPending": ResetPasswordResultPendingTypeID, + "resetPasswordResultDeclined": ResetPasswordResultDeclinedTypeID, + "messageFileTypePrivate": MessageFileTypePrivateTypeID, + "messageFileTypeGroup": MessageFileTypeGroupTypeID, + "messageFileTypeUnknown": MessageFileTypeUnknownTypeID, + "pushMessageContentHidden": PushMessageContentHiddenTypeID, + "pushMessageContentAnimation": PushMessageContentAnimationTypeID, + "pushMessageContentAudio": PushMessageContentAudioTypeID, + "pushMessageContentContact": PushMessageContentContactTypeID, + "pushMessageContentContactRegistered": PushMessageContentContactRegisteredTypeID, + "pushMessageContentDocument": PushMessageContentDocumentTypeID, + "pushMessageContentGame": PushMessageContentGameTypeID, + "pushMessageContentGameScore": PushMessageContentGameScoreTypeID, + "pushMessageContentInvoice": PushMessageContentInvoiceTypeID, + "pushMessageContentLocation": PushMessageContentLocationTypeID, + "pushMessageContentPhoto": PushMessageContentPhotoTypeID, + "pushMessageContentPoll": PushMessageContentPollTypeID, + "pushMessageContentScreenshotTaken": PushMessageContentScreenshotTakenTypeID, + "pushMessageContentSticker": PushMessageContentStickerTypeID, + "pushMessageContentStory": PushMessageContentStoryTypeID, + "pushMessageContentText": PushMessageContentTextTypeID, + "pushMessageContentVideo": PushMessageContentVideoTypeID, + "pushMessageContentVideoNote": PushMessageContentVideoNoteTypeID, + "pushMessageContentVoiceNote": PushMessageContentVoiceNoteTypeID, + "pushMessageContentBasicGroupChatCreate": PushMessageContentBasicGroupChatCreateTypeID, + "pushMessageContentChatAddMembers": PushMessageContentChatAddMembersTypeID, + "pushMessageContentChatChangePhoto": PushMessageContentChatChangePhotoTypeID, + "pushMessageContentChatChangeTitle": PushMessageContentChatChangeTitleTypeID, + "pushMessageContentChatSetBackground": PushMessageContentChatSetBackgroundTypeID, + "pushMessageContentChatSetTheme": PushMessageContentChatSetThemeTypeID, + "pushMessageContentChatDeleteMember": PushMessageContentChatDeleteMemberTypeID, + "pushMessageContentChatJoinByLink": PushMessageContentChatJoinByLinkTypeID, + "pushMessageContentChatJoinByRequest": PushMessageContentChatJoinByRequestTypeID, + "pushMessageContentRecurringPayment": PushMessageContentRecurringPaymentTypeID, + "pushMessageContentSuggestProfilePhoto": PushMessageContentSuggestProfilePhotoTypeID, + "pushMessageContentMessageForwards": PushMessageContentMessageForwardsTypeID, + "pushMessageContentMediaAlbum": PushMessageContentMediaAlbumTypeID, + "notificationTypeNewMessage": NotificationTypeNewMessageTypeID, + "notificationTypeNewSecretChat": NotificationTypeNewSecretChatTypeID, + "notificationTypeNewCall": NotificationTypeNewCallTypeID, + "notificationTypeNewPushMessage": NotificationTypeNewPushMessageTypeID, + "notificationGroupTypeMessages": NotificationGroupTypeMessagesTypeID, + "notificationGroupTypeMentions": NotificationGroupTypeMentionsTypeID, + "notificationGroupTypeSecretChat": NotificationGroupTypeSecretChatTypeID, + "notificationGroupTypeCalls": NotificationGroupTypeCallsTypeID, + "notificationSound": NotificationSoundTypeID, + "notificationSounds": NotificationSoundsTypeID, + "notification": NotificationTypeID, + "notificationGroup": NotificationGroupTypeID, + "optionValueBoolean": OptionValueBooleanTypeID, + "optionValueEmpty": OptionValueEmptyTypeID, + "optionValueInteger": OptionValueIntegerTypeID, + "optionValueString": OptionValueStringTypeID, + "jsonObjectMember": JSONObjectMemberTypeID, + "jsonValueNull": JSONValueNullTypeID, + "jsonValueBoolean": JSONValueBooleanTypeID, + "jsonValueNumber": JSONValueNumberTypeID, + "jsonValueString": JSONValueStringTypeID, + "jsonValueArray": JSONValueArrayTypeID, + "jsonValueObject": JSONValueObjectTypeID, + "storyPrivacySettingsEveryone": StoryPrivacySettingsEveryoneTypeID, + "storyPrivacySettingsContacts": StoryPrivacySettingsContactsTypeID, + "storyPrivacySettingsCloseFriends": StoryPrivacySettingsCloseFriendsTypeID, + "storyPrivacySettingsSelectedContacts": StoryPrivacySettingsSelectedContactsTypeID, + "userPrivacySettingRuleAllowAll": UserPrivacySettingRuleAllowAllTypeID, + "userPrivacySettingRuleAllowContacts": UserPrivacySettingRuleAllowContactsTypeID, + "userPrivacySettingRuleAllowUsers": UserPrivacySettingRuleAllowUsersTypeID, + "userPrivacySettingRuleAllowChatMembers": UserPrivacySettingRuleAllowChatMembersTypeID, + "userPrivacySettingRuleRestrictAll": UserPrivacySettingRuleRestrictAllTypeID, + "userPrivacySettingRuleRestrictContacts": UserPrivacySettingRuleRestrictContactsTypeID, + "userPrivacySettingRuleRestrictUsers": UserPrivacySettingRuleRestrictUsersTypeID, + "userPrivacySettingRuleRestrictChatMembers": UserPrivacySettingRuleRestrictChatMembersTypeID, + "userPrivacySettingRules": UserPrivacySettingRulesTypeID, + "userPrivacySettingShowStatus": UserPrivacySettingShowStatusTypeID, + "userPrivacySettingShowProfilePhoto": UserPrivacySettingShowProfilePhotoTypeID, + "userPrivacySettingShowLinkInForwardedMessages": UserPrivacySettingShowLinkInForwardedMessagesTypeID, + "userPrivacySettingShowPhoneNumber": UserPrivacySettingShowPhoneNumberTypeID, + "userPrivacySettingShowBio": UserPrivacySettingShowBioTypeID, + "userPrivacySettingAllowChatInvites": UserPrivacySettingAllowChatInvitesTypeID, + "userPrivacySettingAllowCalls": UserPrivacySettingAllowCallsTypeID, + "userPrivacySettingAllowPeerToPeerCalls": UserPrivacySettingAllowPeerToPeerCallsTypeID, + "userPrivacySettingAllowFindingByPhoneNumber": UserPrivacySettingAllowFindingByPhoneNumberTypeID, "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages": UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessagesTypeID, - "accountTtl": AccountTTLTypeID, - "messageAutoDeleteTime": MessageAutoDeleteTimeTypeID, - "sessionTypeAndroid": SessionTypeAndroidTypeID, - "sessionTypeApple": SessionTypeAppleTypeID, - "sessionTypeBrave": SessionTypeBraveTypeID, - "sessionTypeChrome": SessionTypeChromeTypeID, - "sessionTypeEdge": SessionTypeEdgeTypeID, - "sessionTypeFirefox": SessionTypeFirefoxTypeID, - "sessionTypeIpad": SessionTypeIpadTypeID, - "sessionTypeIphone": SessionTypeIphoneTypeID, - "sessionTypeLinux": SessionTypeLinuxTypeID, - "sessionTypeMac": SessionTypeMACTypeID, - "sessionTypeOpera": SessionTypeOperaTypeID, - "sessionTypeSafari": SessionTypeSafariTypeID, - "sessionTypeUbuntu": SessionTypeUbuntuTypeID, - "sessionTypeUnknown": SessionTypeUnknownTypeID, - "sessionTypeVivaldi": SessionTypeVivaldiTypeID, - "sessionTypeWindows": SessionTypeWindowsTypeID, - "sessionTypeXbox": SessionTypeXboxTypeID, - "session": SessionTypeID, - "sessions": SessionsTypeID, - "connectedWebsite": ConnectedWebsiteTypeID, - "connectedWebsites": ConnectedWebsitesTypeID, - "reportReasonSpam": ReportReasonSpamTypeID, - "reportReasonViolence": ReportReasonViolenceTypeID, - "reportReasonPornography": ReportReasonPornographyTypeID, - "reportReasonChildAbuse": ReportReasonChildAbuseTypeID, - "reportReasonCopyright": ReportReasonCopyrightTypeID, - "reportReasonUnrelatedLocation": ReportReasonUnrelatedLocationTypeID, - "reportReasonFake": ReportReasonFakeTypeID, - "reportReasonIllegalDrugs": ReportReasonIllegalDrugsTypeID, - "reportReasonPersonalDetails": ReportReasonPersonalDetailsTypeID, - "reportReasonCustom": ReportReasonCustomTypeID, - "targetChatCurrent": TargetChatCurrentTypeID, - "targetChatChosen": TargetChatChosenTypeID, - "targetChatInternalLink": TargetChatInternalLinkTypeID, - "internalLinkTypeActiveSessions": InternalLinkTypeActiveSessionsTypeID, - "internalLinkTypeAttachmentMenuBot": InternalLinkTypeAttachmentMenuBotTypeID, - "internalLinkTypeAuthenticationCode": InternalLinkTypeAuthenticationCodeTypeID, - "internalLinkTypeBackground": InternalLinkTypeBackgroundTypeID, - "internalLinkTypeBotAddToChannel": InternalLinkTypeBotAddToChannelTypeID, - "internalLinkTypeBotStart": InternalLinkTypeBotStartTypeID, - "internalLinkTypeBotStartInGroup": InternalLinkTypeBotStartInGroupTypeID, - "internalLinkTypeChangePhoneNumber": InternalLinkTypeChangePhoneNumberTypeID, - "internalLinkTypeChatFolderInvite": InternalLinkTypeChatFolderInviteTypeID, - "internalLinkTypeChatFolderSettings": InternalLinkTypeChatFolderSettingsTypeID, - "internalLinkTypeChatInvite": InternalLinkTypeChatInviteTypeID, - "internalLinkTypeDefaultMessageAutoDeleteTimerSettings": InternalLinkTypeDefaultMessageAutoDeleteTimerSettingsTypeID, - "internalLinkTypeEditProfileSettings": InternalLinkTypeEditProfileSettingsTypeID, - "internalLinkTypeGame": InternalLinkTypeGameTypeID, - "internalLinkTypeInstantView": InternalLinkTypeInstantViewTypeID, - "internalLinkTypeInvoice": InternalLinkTypeInvoiceTypeID, - "internalLinkTypeLanguagePack": InternalLinkTypeLanguagePackTypeID, - "internalLinkTypeLanguageSettings": InternalLinkTypeLanguageSettingsTypeID, - "internalLinkTypeMessage": InternalLinkTypeMessageTypeID, - "internalLinkTypeMessageDraft": InternalLinkTypeMessageDraftTypeID, - "internalLinkTypePassportDataRequest": InternalLinkTypePassportDataRequestTypeID, - "internalLinkTypePhoneNumberConfirmation": InternalLinkTypePhoneNumberConfirmationTypeID, - "internalLinkTypePremiumFeatures": InternalLinkTypePremiumFeaturesTypeID, - "internalLinkTypePrivacyAndSecuritySettings": InternalLinkTypePrivacyAndSecuritySettingsTypeID, - "internalLinkTypeProxy": InternalLinkTypeProxyTypeID, - "internalLinkTypePublicChat": InternalLinkTypePublicChatTypeID, - "internalLinkTypeQrCodeAuthentication": InternalLinkTypeQrCodeAuthenticationTypeID, - "internalLinkTypeRestorePurchases": InternalLinkTypeRestorePurchasesTypeID, - "internalLinkTypeSettings": InternalLinkTypeSettingsTypeID, - "internalLinkTypeStickerSet": InternalLinkTypeStickerSetTypeID, - "internalLinkTypeStory": InternalLinkTypeStoryTypeID, - "internalLinkTypeTheme": InternalLinkTypeThemeTypeID, - "internalLinkTypeThemeSettings": InternalLinkTypeThemeSettingsTypeID, - "internalLinkTypeUnknownDeepLink": InternalLinkTypeUnknownDeepLinkTypeID, - "internalLinkTypeUnsupportedProxy": InternalLinkTypeUnsupportedProxyTypeID, - "internalLinkTypeUserPhoneNumber": InternalLinkTypeUserPhoneNumberTypeID, - "internalLinkTypeUserToken": InternalLinkTypeUserTokenTypeID, - "internalLinkTypeVideoChat": InternalLinkTypeVideoChatTypeID, - "internalLinkTypeWebApp": InternalLinkTypeWebAppTypeID, - "messageLink": MessageLinkTypeID, - "messageLinkInfo": MessageLinkInfoTypeID, - "storyVideo": StoryVideoTypeID, - "storyContentPhoto": StoryContentPhotoTypeID, - "storyContentVideo": StoryContentVideoTypeID, - "storyContentUnsupported": StoryContentUnsupportedTypeID, - "inputStoryContentPhoto": InputStoryContentPhotoTypeID, - "inputStoryContentVideo": InputStoryContentVideoTypeID, - "storyListMain": StoryListMainTypeID, - "storyListArchive": StoryListArchiveTypeID, - "storyInteractionInfo": StoryInteractionInfoTypeID, - "story": StoryTypeID, - "stories": StoriesTypeID, - "storyInfo": StoryInfoTypeID, - "chatActiveStories": ChatActiveStoriesTypeID, - "filePart": FilePartTypeID, - "fileTypeNone": FileTypeNoneTypeID, - "fileTypeAnimation": FileTypeAnimationTypeID, - "fileTypeAudio": FileTypeAudioTypeID, - "fileTypeDocument": FileTypeDocumentTypeID, - "fileTypeNotificationSound": FileTypeNotificationSoundTypeID, - "fileTypePhoto": FileTypePhotoTypeID, - "fileTypePhotoStory": FileTypePhotoStoryTypeID, - "fileTypeProfilePhoto": FileTypeProfilePhotoTypeID, - "fileTypeSecret": FileTypeSecretTypeID, - "fileTypeSecretThumbnail": FileTypeSecretThumbnailTypeID, - "fileTypeSecure": FileTypeSecureTypeID, - "fileTypeSticker": FileTypeStickerTypeID, - "fileTypeThumbnail": FileTypeThumbnailTypeID, - "fileTypeUnknown": FileTypeUnknownTypeID, - "fileTypeVideo": FileTypeVideoTypeID, - "fileTypeVideoNote": FileTypeVideoNoteTypeID, - "fileTypeVideoStory": FileTypeVideoStoryTypeID, - "fileTypeVoiceNote": FileTypeVoiceNoteTypeID, - "fileTypeWallpaper": FileTypeWallpaperTypeID, - "storageStatisticsByFileType": StorageStatisticsByFileTypeTypeID, - "storageStatisticsByChat": StorageStatisticsByChatTypeID, - "storageStatistics": StorageStatisticsTypeID, - "storageStatisticsFast": StorageStatisticsFastTypeID, - "databaseStatistics": DatabaseStatisticsTypeID, - "networkTypeNone": NetworkTypeNoneTypeID, - "networkTypeMobile": NetworkTypeMobileTypeID, - "networkTypeMobileRoaming": NetworkTypeMobileRoamingTypeID, - "networkTypeWiFi": NetworkTypeWiFiTypeID, - "networkTypeOther": NetworkTypeOtherTypeID, - "networkStatisticsEntryFile": NetworkStatisticsEntryFileTypeID, - "networkStatisticsEntryCall": NetworkStatisticsEntryCallTypeID, - "networkStatistics": NetworkStatisticsTypeID, - "autoDownloadSettings": AutoDownloadSettingsTypeID, - "autoDownloadSettingsPresets": AutoDownloadSettingsPresetsTypeID, - "autosaveSettingsScopePrivateChats": AutosaveSettingsScopePrivateChatsTypeID, - "autosaveSettingsScopeGroupChats": AutosaveSettingsScopeGroupChatsTypeID, - "autosaveSettingsScopeChannelChats": AutosaveSettingsScopeChannelChatsTypeID, - "autosaveSettingsScopeChat": AutosaveSettingsScopeChatTypeID, - "scopeAutosaveSettings": ScopeAutosaveSettingsTypeID, - "autosaveSettingsException": AutosaveSettingsExceptionTypeID, - "autosaveSettings": AutosaveSettingsTypeID, - "connectionStateWaitingForNetwork": ConnectionStateWaitingForNetworkTypeID, - "connectionStateConnectingToProxy": ConnectionStateConnectingToProxyTypeID, - "connectionStateConnecting": ConnectionStateConnectingTypeID, - "connectionStateUpdating": ConnectionStateUpdatingTypeID, - "connectionStateReady": ConnectionStateReadyTypeID, - "topChatCategoryUsers": TopChatCategoryUsersTypeID, - "topChatCategoryBots": TopChatCategoryBotsTypeID, - "topChatCategoryGroups": TopChatCategoryGroupsTypeID, - "topChatCategoryChannels": TopChatCategoryChannelsTypeID, - "topChatCategoryInlineBots": TopChatCategoryInlineBotsTypeID, - "topChatCategoryCalls": TopChatCategoryCallsTypeID, - "topChatCategoryForwardChats": TopChatCategoryForwardChatsTypeID, - "tMeUrlTypeUser": TMeURLTypeUserTypeID, - "tMeUrlTypeSupergroup": TMeURLTypeSupergroupTypeID, - "tMeUrlTypeChatInvite": TMeURLTypeChatInviteTypeID, - "tMeUrlTypeStickerSet": TMeURLTypeStickerSetTypeID, - "tMeUrl": TMeURLTypeID, - "tMeUrls": TMeURLsTypeID, - "suggestedActionEnableArchiveAndMuteNewChats": SuggestedActionEnableArchiveAndMuteNewChatsTypeID, - "suggestedActionCheckPassword": SuggestedActionCheckPasswordTypeID, - "suggestedActionCheckPhoneNumber": SuggestedActionCheckPhoneNumberTypeID, - "suggestedActionViewChecksHint": SuggestedActionViewChecksHintTypeID, - "suggestedActionConvertToBroadcastGroup": SuggestedActionConvertToBroadcastGroupTypeID, - "suggestedActionSetPassword": SuggestedActionSetPasswordTypeID, - "suggestedActionUpgradePremium": SuggestedActionUpgradePremiumTypeID, - "suggestedActionRestorePremium": SuggestedActionRestorePremiumTypeID, - "suggestedActionSubscribeToAnnualPremium": SuggestedActionSubscribeToAnnualPremiumTypeID, + "accountTtl": AccountTTLTypeID, + "messageAutoDeleteTime": MessageAutoDeleteTimeTypeID, + "sessionTypeAndroid": SessionTypeAndroidTypeID, + "sessionTypeApple": SessionTypeAppleTypeID, + "sessionTypeBrave": SessionTypeBraveTypeID, + "sessionTypeChrome": SessionTypeChromeTypeID, + "sessionTypeEdge": SessionTypeEdgeTypeID, + "sessionTypeFirefox": SessionTypeFirefoxTypeID, + "sessionTypeIpad": SessionTypeIpadTypeID, + "sessionTypeIphone": SessionTypeIphoneTypeID, + "sessionTypeLinux": SessionTypeLinuxTypeID, + "sessionTypeMac": SessionTypeMACTypeID, + "sessionTypeOpera": SessionTypeOperaTypeID, + "sessionTypeSafari": SessionTypeSafariTypeID, + "sessionTypeUbuntu": SessionTypeUbuntuTypeID, + "sessionTypeUnknown": SessionTypeUnknownTypeID, + "sessionTypeVivaldi": SessionTypeVivaldiTypeID, + "sessionTypeWindows": SessionTypeWindowsTypeID, + "sessionTypeXbox": SessionTypeXboxTypeID, + "session": SessionTypeID, + "sessions": SessionsTypeID, + "connectedWebsite": ConnectedWebsiteTypeID, + "connectedWebsites": ConnectedWebsitesTypeID, + "reportReasonSpam": ReportReasonSpamTypeID, + "reportReasonViolence": ReportReasonViolenceTypeID, + "reportReasonPornography": ReportReasonPornographyTypeID, + "reportReasonChildAbuse": ReportReasonChildAbuseTypeID, + "reportReasonCopyright": ReportReasonCopyrightTypeID, + "reportReasonUnrelatedLocation": ReportReasonUnrelatedLocationTypeID, + "reportReasonFake": ReportReasonFakeTypeID, + "reportReasonIllegalDrugs": ReportReasonIllegalDrugsTypeID, + "reportReasonPersonalDetails": ReportReasonPersonalDetailsTypeID, + "reportReasonCustom": ReportReasonCustomTypeID, + "targetChatCurrent": TargetChatCurrentTypeID, + "targetChatChosen": TargetChatChosenTypeID, + "targetChatInternalLink": TargetChatInternalLinkTypeID, + "internalLinkTypeActiveSessions": InternalLinkTypeActiveSessionsTypeID, + "internalLinkTypeAttachmentMenuBot": InternalLinkTypeAttachmentMenuBotTypeID, + "internalLinkTypeAuthenticationCode": InternalLinkTypeAuthenticationCodeTypeID, + "internalLinkTypeBackground": InternalLinkTypeBackgroundTypeID, + "internalLinkTypeBotAddToChannel": InternalLinkTypeBotAddToChannelTypeID, + "internalLinkTypeBotStart": InternalLinkTypeBotStartTypeID, + "internalLinkTypeBotStartInGroup": InternalLinkTypeBotStartInGroupTypeID, + "internalLinkTypeChangePhoneNumber": InternalLinkTypeChangePhoneNumberTypeID, + "internalLinkTypeChatFolderInvite": InternalLinkTypeChatFolderInviteTypeID, + "internalLinkTypeChatFolderSettings": InternalLinkTypeChatFolderSettingsTypeID, + "internalLinkTypeChatInvite": InternalLinkTypeChatInviteTypeID, + "internalLinkTypeDefaultMessageAutoDeleteTimerSettings": InternalLinkTypeDefaultMessageAutoDeleteTimerSettingsTypeID, + "internalLinkTypeEditProfileSettings": InternalLinkTypeEditProfileSettingsTypeID, + "internalLinkTypeGame": InternalLinkTypeGameTypeID, + "internalLinkTypeInstantView": InternalLinkTypeInstantViewTypeID, + "internalLinkTypeInvoice": InternalLinkTypeInvoiceTypeID, + "internalLinkTypeLanguagePack": InternalLinkTypeLanguagePackTypeID, + "internalLinkTypeLanguageSettings": InternalLinkTypeLanguageSettingsTypeID, + "internalLinkTypeMessage": InternalLinkTypeMessageTypeID, + "internalLinkTypeMessageDraft": InternalLinkTypeMessageDraftTypeID, + "internalLinkTypePassportDataRequest": InternalLinkTypePassportDataRequestTypeID, + "internalLinkTypePhoneNumberConfirmation": InternalLinkTypePhoneNumberConfirmationTypeID, + "internalLinkTypePremiumFeatures": InternalLinkTypePremiumFeaturesTypeID, + "internalLinkTypePrivacyAndSecuritySettings": InternalLinkTypePrivacyAndSecuritySettingsTypeID, + "internalLinkTypeProxy": InternalLinkTypeProxyTypeID, + "internalLinkTypePublicChat": InternalLinkTypePublicChatTypeID, + "internalLinkTypeQrCodeAuthentication": InternalLinkTypeQrCodeAuthenticationTypeID, + "internalLinkTypeRestorePurchases": InternalLinkTypeRestorePurchasesTypeID, + "internalLinkTypeSettings": InternalLinkTypeSettingsTypeID, + "internalLinkTypeStickerSet": InternalLinkTypeStickerSetTypeID, + "internalLinkTypeStory": InternalLinkTypeStoryTypeID, + "internalLinkTypeTheme": InternalLinkTypeThemeTypeID, + "internalLinkTypeThemeSettings": InternalLinkTypeThemeSettingsTypeID, + "internalLinkTypeUnknownDeepLink": InternalLinkTypeUnknownDeepLinkTypeID, + "internalLinkTypeUnsupportedProxy": InternalLinkTypeUnsupportedProxyTypeID, + "internalLinkTypeUserPhoneNumber": InternalLinkTypeUserPhoneNumberTypeID, + "internalLinkTypeUserToken": InternalLinkTypeUserTokenTypeID, + "internalLinkTypeVideoChat": InternalLinkTypeVideoChatTypeID, + "internalLinkTypeWebApp": InternalLinkTypeWebAppTypeID, + "messageLink": MessageLinkTypeID, + "messageLinkInfo": MessageLinkInfoTypeID, + "storyViewer": StoryViewerTypeID, + "storyViewers": StoryViewersTypeID, + "storyAreaPosition": StoryAreaPositionTypeID, + "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, + "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, + "storyArea": StoryAreaTypeID, + "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, + "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, + "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, + "inputStoryArea": InputStoryAreaTypeID, + "inputStoryAreas": InputStoryAreasTypeID, + "storyVideo": StoryVideoTypeID, + "storyContentPhoto": StoryContentPhotoTypeID, + "storyContentVideo": StoryContentVideoTypeID, + "storyContentUnsupported": StoryContentUnsupportedTypeID, + "inputStoryContentPhoto": InputStoryContentPhotoTypeID, + "inputStoryContentVideo": InputStoryContentVideoTypeID, + "storyListMain": StoryListMainTypeID, + "storyListArchive": StoryListArchiveTypeID, + "storyInteractionInfo": StoryInteractionInfoTypeID, + "story": StoryTypeID, + "stories": StoriesTypeID, + "storyInfo": StoryInfoTypeID, + "chatActiveStories": ChatActiveStoriesTypeID, + "blockListMain": BlockListMainTypeID, + "blockListStories": BlockListStoriesTypeID, + "filePart": FilePartTypeID, + "fileTypeNone": FileTypeNoneTypeID, + "fileTypeAnimation": FileTypeAnimationTypeID, + "fileTypeAudio": FileTypeAudioTypeID, + "fileTypeDocument": FileTypeDocumentTypeID, + "fileTypeNotificationSound": FileTypeNotificationSoundTypeID, + "fileTypePhoto": FileTypePhotoTypeID, + "fileTypePhotoStory": FileTypePhotoStoryTypeID, + "fileTypeProfilePhoto": FileTypeProfilePhotoTypeID, + "fileTypeSecret": FileTypeSecretTypeID, + "fileTypeSecretThumbnail": FileTypeSecretThumbnailTypeID, + "fileTypeSecure": FileTypeSecureTypeID, + "fileTypeSticker": FileTypeStickerTypeID, + "fileTypeThumbnail": FileTypeThumbnailTypeID, + "fileTypeUnknown": FileTypeUnknownTypeID, + "fileTypeVideo": FileTypeVideoTypeID, + "fileTypeVideoNote": FileTypeVideoNoteTypeID, + "fileTypeVideoStory": FileTypeVideoStoryTypeID, + "fileTypeVoiceNote": FileTypeVoiceNoteTypeID, + "fileTypeWallpaper": FileTypeWallpaperTypeID, + "storageStatisticsByFileType": StorageStatisticsByFileTypeTypeID, + "storageStatisticsByChat": StorageStatisticsByChatTypeID, + "storageStatistics": StorageStatisticsTypeID, + "storageStatisticsFast": StorageStatisticsFastTypeID, + "databaseStatistics": DatabaseStatisticsTypeID, + "networkTypeNone": NetworkTypeNoneTypeID, + "networkTypeMobile": NetworkTypeMobileTypeID, + "networkTypeMobileRoaming": NetworkTypeMobileRoamingTypeID, + "networkTypeWiFi": NetworkTypeWiFiTypeID, + "networkTypeOther": NetworkTypeOtherTypeID, + "networkStatisticsEntryFile": NetworkStatisticsEntryFileTypeID, + "networkStatisticsEntryCall": NetworkStatisticsEntryCallTypeID, + "networkStatistics": NetworkStatisticsTypeID, + "autoDownloadSettings": AutoDownloadSettingsTypeID, + "autoDownloadSettingsPresets": AutoDownloadSettingsPresetsTypeID, + "autosaveSettingsScopePrivateChats": AutosaveSettingsScopePrivateChatsTypeID, + "autosaveSettingsScopeGroupChats": AutosaveSettingsScopeGroupChatsTypeID, + "autosaveSettingsScopeChannelChats": AutosaveSettingsScopeChannelChatsTypeID, + "autosaveSettingsScopeChat": AutosaveSettingsScopeChatTypeID, + "scopeAutosaveSettings": ScopeAutosaveSettingsTypeID, + "autosaveSettingsException": AutosaveSettingsExceptionTypeID, + "autosaveSettings": AutosaveSettingsTypeID, + "connectionStateWaitingForNetwork": ConnectionStateWaitingForNetworkTypeID, + "connectionStateConnectingToProxy": ConnectionStateConnectingToProxyTypeID, + "connectionStateConnecting": ConnectionStateConnectingTypeID, + "connectionStateUpdating": ConnectionStateUpdatingTypeID, + "connectionStateReady": ConnectionStateReadyTypeID, + "topChatCategoryUsers": TopChatCategoryUsersTypeID, + "topChatCategoryBots": TopChatCategoryBotsTypeID, + "topChatCategoryGroups": TopChatCategoryGroupsTypeID, + "topChatCategoryChannels": TopChatCategoryChannelsTypeID, + "topChatCategoryInlineBots": TopChatCategoryInlineBotsTypeID, + "topChatCategoryCalls": TopChatCategoryCallsTypeID, + "topChatCategoryForwardChats": TopChatCategoryForwardChatsTypeID, + "tMeUrlTypeUser": TMeURLTypeUserTypeID, + "tMeUrlTypeSupergroup": TMeURLTypeSupergroupTypeID, + "tMeUrlTypeChatInvite": TMeURLTypeChatInviteTypeID, + "tMeUrlTypeStickerSet": TMeURLTypeStickerSetTypeID, + "tMeUrl": TMeURLTypeID, + "tMeUrls": TMeURLsTypeID, + "suggestedActionEnableArchiveAndMuteNewChats": SuggestedActionEnableArchiveAndMuteNewChatsTypeID, + "suggestedActionCheckPassword": SuggestedActionCheckPasswordTypeID, + "suggestedActionCheckPhoneNumber": SuggestedActionCheckPhoneNumberTypeID, + "suggestedActionViewChecksHint": SuggestedActionViewChecksHintTypeID, + "suggestedActionConvertToBroadcastGroup": SuggestedActionConvertToBroadcastGroupTypeID, + "suggestedActionSetPassword": SuggestedActionSetPasswordTypeID, + "suggestedActionUpgradePremium": SuggestedActionUpgradePremiumTypeID, + "suggestedActionRestorePremium": SuggestedActionRestorePremiumTypeID, + "suggestedActionSubscribeToAnnualPremium": SuggestedActionSubscribeToAnnualPremiumTypeID, "count": CountTypeID, "text": TextTypeID, "seconds": SecondsTypeID, @@ -3055,7 +3120,7 @@ func NamesMap() map[string]uint32 { "updateChatHasProtectedContent": UpdateChatHasProtectedContentTypeID, "updateChatIsTranslatable": UpdateChatIsTranslatableTypeID, "updateChatIsMarkedAsUnread": UpdateChatIsMarkedAsUnreadTypeID, - "updateChatIsBlocked": UpdateChatIsBlockedTypeID, + "updateChatBlockList": UpdateChatBlockListTypeID, "updateChatHasScheduledMessages": UpdateChatHasScheduledMessagesTypeID, "updateChatFolders": UpdateChatFoldersTypeID, "updateChatOnlineMemberCount": UpdateChatOnlineMemberCountTypeID, @@ -3092,8 +3157,11 @@ func NamesMap() map[string]uint32 { "updateUnreadChatCount": UpdateUnreadChatCountTypeID, "updateStory": UpdateStoryTypeID, "updateStoryDeleted": UpdateStoryDeletedTypeID, + "updateStorySendSucceeded": UpdateStorySendSucceededTypeID, + "updateStorySendFailed": UpdateStorySendFailedTypeID, "updateChatActiveStories": UpdateChatActiveStoriesTypeID, "updateStoryListChatCount": UpdateStoryListChatCountTypeID, + "updateStoryStealthMode": UpdateStoryStealthModeTypeID, "updateOption": UpdateOptionTypeID, "updateStickerSet": UpdateStickerSetTypeID, "updateInstalledStickerSets": UpdateInstalledStickerSetsTypeID, @@ -3421,6 +3489,7 @@ func NamesMap() map[string]uint32 { "setPinnedChats": SetPinnedChatsRequestTypeID, "readChatList": ReadChatListRequestTypeID, "getStory": GetStoryRequestTypeID, + "canSendStory": CanSendStoryRequestTypeID, "sendStory": SendStoryRequestTypeID, "editStory": EditStoryRequestTypeID, "setStoryPrivacySettings": SetStoryPrivacySettingsRequestTypeID, @@ -3434,8 +3503,11 @@ func NamesMap() map[string]uint32 { "getArchivedStories": GetArchivedStoriesRequestTypeID, "openStory": OpenStoryRequestTypeID, "closeStory": CloseStoryRequestTypeID, + "getStoryAvailableReactions": GetStoryAvailableReactionsRequestTypeID, + "setStoryReaction": SetStoryReactionRequestTypeID, "getStoryViewers": GetStoryViewersRequestTypeID, "reportStory": ReportStoryRequestTypeID, + "activateStoryStealthMode": ActivateStoryStealthModeRequestTypeID, "getAttachmentMenuBot": GetAttachmentMenuBotRequestTypeID, "toggleBotIsAddedToAttachmentMenu": ToggleBotIsAddedToAttachmentMenuRequestTypeID, "getThemedEmojiStatuses": GetThemedEmojiStatusesRequestTypeID, @@ -3514,7 +3586,7 @@ func NamesMap() map[string]uint32 { "endGroupCall": EndGroupCallRequestTypeID, "getGroupCallStreams": GetGroupCallStreamsRequestTypeID, "getGroupCallStreamSegment": GetGroupCallStreamSegmentRequestTypeID, - "toggleMessageSenderIsBlocked": ToggleMessageSenderIsBlockedRequestTypeID, + "setMessageSenderBlockList": SetMessageSenderBlockListRequestTypeID, "blockMessageSenderFromReplies": BlockMessageSenderFromRepliesRequestTypeID, "getBlockedMessageSenders": GetBlockedMessageSendersRequestTypeID, "addContact": AddContactRequestTypeID, @@ -4548,6 +4620,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PremiumLimitTypeChatFolderInviteLinkCountTypeID: func() bin.Object { return &PremiumLimitTypeChatFolderInviteLinkCount{} }, PremiumLimitTypeShareableChatFolderCountTypeID: func() bin.Object { return &PremiumLimitTypeShareableChatFolderCount{} }, PremiumLimitTypeActiveStoryCountTypeID: func() bin.Object { return &PremiumLimitTypeActiveStoryCount{} }, + PremiumLimitTypeWeeklySentStoryCountTypeID: func() bin.Object { return &PremiumLimitTypeWeeklySentStoryCount{} }, + PremiumLimitTypeMonthlySentStoryCountTypeID: func() bin.Object { return &PremiumLimitTypeMonthlySentStoryCount{} }, + PremiumLimitTypeStoryCaptionLengthTypeID: func() bin.Object { return &PremiumLimitTypeStoryCaptionLength{} }, PremiumFeatureIncreasedLimitsTypeID: func() bin.Object { return &PremiumFeatureIncreasedLimits{} }, PremiumFeatureIncreasedUploadFileSizeTypeID: func() bin.Object { return &PremiumFeatureIncreasedUploadFileSize{} }, PremiumFeatureImprovedDownloadSpeedTypeID: func() bin.Object { return &PremiumFeatureImprovedDownloadSpeed{} }, @@ -4563,10 +4638,18 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PremiumFeatureForumTopicIconTypeID: func() bin.Object { return &PremiumFeatureForumTopicIcon{} }, PremiumFeatureAppIconsTypeID: func() bin.Object { return &PremiumFeatureAppIcons{} }, PremiumFeatureRealTimeChatTranslationTypeID: func() bin.Object { return &PremiumFeatureRealTimeChatTranslation{} }, + PremiumFeatureUpgradedStoriesTypeID: func() bin.Object { return &PremiumFeatureUpgradedStories{} }, + PremiumStoryFeaturePriorityOrderTypeID: func() bin.Object { return &PremiumStoryFeaturePriorityOrder{} }, + PremiumStoryFeatureStealthModeTypeID: func() bin.Object { return &PremiumStoryFeatureStealthMode{} }, + PremiumStoryFeaturePermanentViewsHistoryTypeID: func() bin.Object { return &PremiumStoryFeaturePermanentViewsHistory{} }, + PremiumStoryFeatureCustomExpirationDurationTypeID: func() bin.Object { return &PremiumStoryFeatureCustomExpirationDuration{} }, + PremiumStoryFeatureSaveStoriesTypeID: func() bin.Object { return &PremiumStoryFeatureSaveStories{} }, + PremiumStoryFeatureLinksAndFormattingTypeID: func() bin.Object { return &PremiumStoryFeatureLinksAndFormatting{} }, PremiumLimitTypeID: func() bin.Object { return &PremiumLimit{} }, PremiumFeaturesTypeID: func() bin.Object { return &PremiumFeatures{} }, PremiumSourceLimitExceededTypeID: func() bin.Object { return &PremiumSourceLimitExceeded{} }, PremiumSourceFeatureTypeID: func() bin.Object { return &PremiumSourceFeature{} }, + PremiumSourceStoryFeatureTypeID: func() bin.Object { return &PremiumSourceStoryFeature{} }, PremiumSourceLinkTypeID: func() bin.Object { return &PremiumSourceLink{} }, PremiumSourceSettingsTypeID: func() bin.Object { return &PremiumSourceSettings{} }, PremiumFeaturePromotionAnimationTypeID: func() bin.Object { return &PremiumFeaturePromotionAnimation{} }, @@ -4598,6 +4681,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ThemeSettingsTypeID: func() bin.Object { return &ThemeSettings{} }, ChatThemeTypeID: func() bin.Object { return &ChatTheme{} }, HashtagsTypeID: func() bin.Object { return &Hashtags{} }, + CanSendStoryResultOkTypeID: func() bin.Object { return &CanSendStoryResultOk{} }, + CanSendStoryResultPremiumNeededTypeID: func() bin.Object { return &CanSendStoryResultPremiumNeeded{} }, + CanSendStoryResultActiveStoryLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultActiveStoryLimitExceeded{} }, + CanSendStoryResultWeeklyLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultWeeklyLimitExceeded{} }, + CanSendStoryResultMonthlyLimitExceededTypeID: func() bin.Object { return &CanSendStoryResultMonthlyLimitExceeded{} }, CanTransferOwnershipResultOkTypeID: func() bin.Object { return &CanTransferOwnershipResultOk{} }, CanTransferOwnershipResultPasswordNeededTypeID: func() bin.Object { return &CanTransferOwnershipResultPasswordNeeded{} }, CanTransferOwnershipResultPasswordTooFreshTypeID: func() bin.Object { return &CanTransferOwnershipResultPasswordTooFresh{} }, @@ -4772,6 +4860,17 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InternalLinkTypeWebAppTypeID: func() bin.Object { return &InternalLinkTypeWebApp{} }, MessageLinkTypeID: func() bin.Object { return &MessageLink{} }, MessageLinkInfoTypeID: func() bin.Object { return &MessageLinkInfo{} }, + StoryViewerTypeID: func() bin.Object { return &StoryViewer{} }, + StoryViewersTypeID: func() bin.Object { return &StoryViewers{} }, + StoryAreaPositionTypeID: func() bin.Object { return &StoryAreaPosition{} }, + StoryAreaTypeLocationTypeID: func() bin.Object { return &StoryAreaTypeLocation{} }, + StoryAreaTypeVenueTypeID: func() bin.Object { return &StoryAreaTypeVenue{} }, + StoryAreaTypeID: func() bin.Object { return &StoryArea{} }, + InputStoryAreaTypeLocationTypeID: func() bin.Object { return &InputStoryAreaTypeLocation{} }, + InputStoryAreaTypeFoundVenueTypeID: func() bin.Object { return &InputStoryAreaTypeFoundVenue{} }, + InputStoryAreaTypePreviousVenueTypeID: func() bin.Object { return &InputStoryAreaTypePreviousVenue{} }, + InputStoryAreaTypeID: func() bin.Object { return &InputStoryArea{} }, + InputStoryAreasTypeID: func() bin.Object { return &InputStoryAreas{} }, StoryVideoTypeID: func() bin.Object { return &StoryVideo{} }, StoryContentPhotoTypeID: func() bin.Object { return &StoryContentPhoto{} }, StoryContentVideoTypeID: func() bin.Object { return &StoryContentVideo{} }, @@ -4785,6 +4884,8 @@ 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{} }, + BlockListMainTypeID: func() bin.Object { return &BlockListMain{} }, + BlockListStoriesTypeID: func() bin.Object { return &BlockListStories{} }, FilePartTypeID: func() bin.Object { return &FilePart{} }, FileTypeNoneTypeID: func() bin.Object { return &FileTypeNone{} }, FileTypeAnimationTypeID: func() bin.Object { return &FileTypeAnimation{} }, @@ -4927,7 +5028,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateChatHasProtectedContentTypeID: func() bin.Object { return &UpdateChatHasProtectedContent{} }, UpdateChatIsTranslatableTypeID: func() bin.Object { return &UpdateChatIsTranslatable{} }, UpdateChatIsMarkedAsUnreadTypeID: func() bin.Object { return &UpdateChatIsMarkedAsUnread{} }, - UpdateChatIsBlockedTypeID: func() bin.Object { return &UpdateChatIsBlocked{} }, + UpdateChatBlockListTypeID: func() bin.Object { return &UpdateChatBlockList{} }, UpdateChatHasScheduledMessagesTypeID: func() bin.Object { return &UpdateChatHasScheduledMessages{} }, UpdateChatFoldersTypeID: func() bin.Object { return &UpdateChatFolders{} }, UpdateChatOnlineMemberCountTypeID: func() bin.Object { return &UpdateChatOnlineMemberCount{} }, @@ -4964,8 +5065,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 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{} }, @@ -5293,6 +5397,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { SetPinnedChatsRequestTypeID: func() bin.Object { return &SetPinnedChatsRequest{} }, ReadChatListRequestTypeID: func() bin.Object { return &ReadChatListRequest{} }, GetStoryRequestTypeID: func() bin.Object { return &GetStoryRequest{} }, + CanSendStoryRequestTypeID: func() bin.Object { return &CanSendStoryRequest{} }, SendStoryRequestTypeID: func() bin.Object { return &SendStoryRequest{} }, EditStoryRequestTypeID: func() bin.Object { return &EditStoryRequest{} }, SetStoryPrivacySettingsRequestTypeID: func() bin.Object { return &SetStoryPrivacySettingsRequest{} }, @@ -5306,8 +5411,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetArchivedStoriesRequestTypeID: func() bin.Object { return &GetArchivedStoriesRequest{} }, 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{} }, GetAttachmentMenuBotRequestTypeID: func() bin.Object { return &GetAttachmentMenuBotRequest{} }, ToggleBotIsAddedToAttachmentMenuRequestTypeID: func() bin.Object { return &ToggleBotIsAddedToAttachmentMenuRequest{} }, GetThemedEmojiStatusesRequestTypeID: func() bin.Object { return &GetThemedEmojiStatusesRequest{} }, @@ -5386,7 +5494,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { EndGroupCallRequestTypeID: func() bin.Object { return &EndGroupCallRequest{} }, GetGroupCallStreamsRequestTypeID: func() bin.Object { return &GetGroupCallStreamsRequest{} }, GetGroupCallStreamSegmentRequestTypeID: func() bin.Object { return &GetGroupCallStreamSegmentRequest{} }, - ToggleMessageSenderIsBlockedRequestTypeID: func() bin.Object { return &ToggleMessageSenderIsBlockedRequest{} }, + SetMessageSenderBlockListRequestTypeID: func() bin.Object { return &SetMessageSenderBlockListRequest{} }, BlockMessageSenderFromRepliesRequestTypeID: func() bin.Object { return &BlockMessageSenderFromRepliesRequest{} }, GetBlockedMessageSendersRequestTypeID: func() bin.Object { return &GetBlockedMessageSendersRequest{} }, AddContactRequestTypeID: func() bin.Object { return &AddContactRequest{} }, @@ -5690,6 +5798,10 @@ func ClassConstructorsMap() map[string][]uint32 { BackgroundTypePatternTypeID, BackgroundTypeFillTypeID, }, + BlockListClassName: { + BlockListMainTypeID, + BlockListStoriesTypeID, + }, BoolClassName: { BoolFalseTypeID, BoolTrueTypeID, @@ -5738,6 +5850,13 @@ func ClassConstructorsMap() map[string][]uint32 { CallbackQueryPayloadDataWithPasswordTypeID, CallbackQueryPayloadGameTypeID, }, + CanSendStoryResultClassName: { + CanSendStoryResultOkTypeID, + CanSendStoryResultPremiumNeededTypeID, + CanSendStoryResultActiveStoryLimitExceededTypeID, + CanSendStoryResultWeeklyLimitExceededTypeID, + CanSendStoryResultMonthlyLimitExceededTypeID, + }, CanTransferOwnershipResultClassName: { CanTransferOwnershipResultOkTypeID, CanTransferOwnershipResultPasswordNeededTypeID, @@ -6058,6 +6177,11 @@ func ClassConstructorsMap() map[string][]uint32 { InputPassportElementErrorSourceFileTypeID, InputPassportElementErrorSourceFilesTypeID, }, + InputStoryAreaTypeClassName: { + InputStoryAreaTypeLocationTypeID, + InputStoryAreaTypeFoundVenueTypeID, + InputStoryAreaTypePreviousVenueTypeID, + }, InputStoryContentClassName: { InputStoryContentPhotoTypeID, InputStoryContentVideoTypeID, @@ -6397,6 +6521,7 @@ func ClassConstructorsMap() map[string][]uint32 { PremiumFeatureForumTopicIconTypeID, PremiumFeatureAppIconsTypeID, PremiumFeatureRealTimeChatTranslationTypeID, + PremiumFeatureUpgradedStoriesTypeID, }, PremiumLimitTypeClassName: { PremiumLimitTypeSupergroupCountTypeID, @@ -6412,13 +6537,25 @@ func ClassConstructorsMap() map[string][]uint32 { PremiumLimitTypeChatFolderInviteLinkCountTypeID, PremiumLimitTypeShareableChatFolderCountTypeID, PremiumLimitTypeActiveStoryCountTypeID, + PremiumLimitTypeWeeklySentStoryCountTypeID, + PremiumLimitTypeMonthlySentStoryCountTypeID, + PremiumLimitTypeStoryCaptionLengthTypeID, }, PremiumSourceClassName: { PremiumSourceLimitExceededTypeID, PremiumSourceFeatureTypeID, + PremiumSourceStoryFeatureTypeID, PremiumSourceLinkTypeID, PremiumSourceSettingsTypeID, }, + PremiumStoryFeatureClassName: { + PremiumStoryFeaturePriorityOrderTypeID, + PremiumStoryFeatureStealthModeTypeID, + PremiumStoryFeaturePermanentViewsHistoryTypeID, + PremiumStoryFeatureCustomExpirationDurationTypeID, + PremiumStoryFeatureSaveStoriesTypeID, + PremiumStoryFeatureLinksAndFormattingTypeID, + }, ProxyTypeClassName: { ProxyTypeSocks5TypeID, ProxyTypeHTTPTypeID, @@ -6580,6 +6717,10 @@ func ClassConstructorsMap() map[string][]uint32 { StorePaymentPurposePremiumSubscriptionTypeID, StorePaymentPurposeGiftedPremiumTypeID, }, + StoryAreaTypeClassName: { + StoryAreaTypeLocationTypeID, + StoryAreaTypeVenueTypeID, + }, StoryContentClassName: { StoryContentPhotoTypeID, StoryContentVideoTypeID, @@ -6710,7 +6851,7 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateChatHasProtectedContentTypeID, UpdateChatIsTranslatableTypeID, UpdateChatIsMarkedAsUnreadTypeID, - UpdateChatIsBlockedTypeID, + UpdateChatBlockListTypeID, UpdateChatHasScheduledMessagesTypeID, UpdateChatFoldersTypeID, UpdateChatOnlineMemberCountTypeID, @@ -6747,8 +6888,11 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateUnreadChatCountTypeID, UpdateStoryTypeID, UpdateStoryDeletedTypeID, + UpdateStorySendSucceededTypeID, + UpdateStorySendFailedTypeID, UpdateChatActiveStoriesTypeID, UpdateStoryListChatCountTypeID, + UpdateStoryStealthModeTypeID, UpdateOptionTypeID, UpdateStickerSetTypeID, UpdateInstalledStickerSetsTypeID, diff --git a/tdapi/tl_send_inline_query_result_message_gen.go b/tdapi/tl_send_inline_query_result_message_gen.go index aec14a0f7a..96521ada2f 100644 --- a/tdapi/tl_send_inline_query_result_message_gen.go +++ b/tdapi/tl_send_inline_query_result_message_gen.go @@ -43,7 +43,7 @@ type SendInlineQueryResultMessageRequest struct { Options MessageSendOptions // Identifier of the inline query QueryID int64 - // Identifier of the inline result + // Identifier of the inline query result ResultID string // 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"), diff --git a/tdapi/tl_send_story_gen.go b/tdapi/tl_send_story_gen.go index bb963c7540..006f68d5e7 100644 --- a/tdapi/tl_send_story_gen.go +++ b/tdapi/tl_send_story_gen.go @@ -31,18 +31,19 @@ var ( _ = tdjson.Encoder{} ) -// SendStoryRequest represents TL type `sendStory#4dbecb6a`. +// SendStoryRequest represents TL type `sendStory#40b9f838`. type SendStoryRequest struct { // Content of the story Content InputStoryContentClass + // Clickable rectangle areas to be shown on the story media; pass null if none + Areas InputStoryAreas // Story caption; pass null to use an empty caption; // 0-getOption("story_caption_length_max") characters Caption FormattedText // The privacy settings for the story PrivacySettings StoryPrivacySettingsClass // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, - // 12 * 3600, 86400, 2 * 86400, 3 * 86400, or 7 * 86400 for Telegram Premium users, and - // 86400 otherwise + // 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise ActivePeriod int32 // Pass true to keep the story accessible after expiration IsPinned bool @@ -52,7 +53,7 @@ type SendStoryRequest struct { } // SendStoryRequestTypeID is TL type id of SendStoryRequest. -const SendStoryRequestTypeID = 0x4dbecb6a +const SendStoryRequestTypeID = 0x40b9f838 // Ensuring interfaces in compile-time for SendStoryRequest. var ( @@ -69,6 +70,9 @@ func (s *SendStoryRequest) Zero() bool { if !(s.Content == nil) { return false } + if !(s.Areas.Zero()) { + return false + } if !(s.Caption.Zero()) { return false } @@ -124,6 +128,10 @@ func (s *SendStoryRequest) TypeInfo() tdp.Type { Name: "Content", SchemaName: "content", }, + { + Name: "Areas", + SchemaName: "areas", + }, { Name: "Caption", SchemaName: "caption", @@ -151,7 +159,7 @@ func (s *SendStoryRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *SendStoryRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendStory#4dbecb6a as nil") + return fmt.Errorf("can't encode sendStory#40b9f838 as nil") } b.PutID(SendStoryRequestTypeID) return s.EncodeBare(b) @@ -160,22 +168,25 @@ func (s *SendStoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SendStoryRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sendStory#4dbecb6a as nil") + return fmt.Errorf("can't encode sendStory#40b9f838 as nil") } if s.Content == nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field content is nil") + return fmt.Errorf("unable to encode sendStory#40b9f838: field content is nil") } if err := s.Content.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field content: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field content: %w", err) + } + if err := s.Areas.Encode(b); err != nil { + return fmt.Errorf("unable to encode sendStory#40b9f838: field areas: %w", err) } if err := s.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field caption: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field caption: %w", err) } if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field privacy_settings is nil") + return fmt.Errorf("unable to encode sendStory#40b9f838: field privacy_settings is nil") } if err := s.PrivacySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field privacy_settings: %w", err) } b.PutInt32(s.ActivePeriod) b.PutBool(s.IsPinned) @@ -186,10 +197,10 @@ func (s *SendStoryRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *SendStoryRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendStory#4dbecb6a to nil") + return fmt.Errorf("can't decode sendStory#40b9f838 to nil") } if err := b.ConsumeID(SendStoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: %w", err) } return s.DecodeBare(b) } @@ -197,45 +208,50 @@ func (s *SendStoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SendStoryRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sendStory#4dbecb6a to nil") + return fmt.Errorf("can't decode sendStory#40b9f838 to nil") } { value, err := DecodeInputStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field content: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field content: %w", err) } s.Content = value } + { + if err := s.Areas.Decode(b); err != nil { + return fmt.Errorf("unable to decode sendStory#40b9f838: field areas: %w", err) + } + } { if err := s.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field caption: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field caption: %w", err) } } { value, err := DecodeStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field privacy_settings: %w", err) } s.PrivacySettings = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field active_period: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field active_period: %w", err) } s.ActivePeriod = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field is_pinned: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field is_pinned: %w", err) } s.IsPinned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field protect_content: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field protect_content: %w", err) } s.ProtectContent = value } @@ -245,30 +261,35 @@ func (s *SendStoryRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *SendStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode sendStory#4dbecb6a as nil") + return fmt.Errorf("can't encode sendStory#40b9f838 as nil") } b.ObjStart() b.PutID("sendStory") b.Comma() b.FieldStart("content") if s.Content == nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field content is nil") + return fmt.Errorf("unable to encode sendStory#40b9f838: field content is nil") } if err := s.Content.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field content: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field content: %w", err) + } + b.Comma() + b.FieldStart("areas") + if err := s.Areas.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode sendStory#40b9f838: field areas: %w", err) } b.Comma() b.FieldStart("caption") if err := s.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field caption: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field caption: %w", err) } b.Comma() b.FieldStart("privacy_settings") if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field privacy_settings is nil") + return fmt.Errorf("unable to encode sendStory#40b9f838: field privacy_settings is nil") } if err := s.PrivacySettings.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sendStory#4dbecb6a: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode sendStory#40b9f838: field privacy_settings: %w", err) } b.Comma() b.FieldStart("active_period") @@ -288,47 +309,51 @@ func (s *SendStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *SendStoryRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode sendStory#4dbecb6a to nil") + return fmt.Errorf("can't decode sendStory#40b9f838 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("sendStory"); err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: %w", err) } case "content": value, err := DecodeTDLibJSONInputStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field content: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field content: %w", err) } s.Content = value + case "areas": + if err := s.Areas.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode sendStory#40b9f838: field areas: %w", err) + } case "caption": if err := s.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field caption: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field caption: %w", err) } case "privacy_settings": value, err := DecodeTDLibJSONStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field privacy_settings: %w", err) } s.PrivacySettings = value case "active_period": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field active_period: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field active_period: %w", err) } s.ActivePeriod = value case "is_pinned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field is_pinned: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field is_pinned: %w", err) } s.IsPinned = value case "protect_content": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode sendStory#4dbecb6a: field protect_content: %w", err) + return fmt.Errorf("unable to decode sendStory#40b9f838: field protect_content: %w", err) } s.ProtectContent = value default: @@ -346,6 +371,14 @@ func (s *SendStoryRequest) GetContent() (value InputStoryContentClass) { return s.Content } +// GetAreas returns value of Areas field. +func (s *SendStoryRequest) GetAreas() (value InputStoryAreas) { + if s == nil { + return + } + return s.Areas +} + // GetCaption returns value of Caption field. func (s *SendStoryRequest) GetCaption() (value FormattedText) { if s == nil { @@ -386,7 +419,7 @@ func (s *SendStoryRequest) GetProtectContent() (value bool) { return s.ProtectContent } -// SendStory invokes method sendStory#4dbecb6a returning error if any. +// SendStory invokes method sendStory#40b9f838 returning error if any. func (c *Client) SendStory(ctx context.Context, request *SendStoryRequest) (*Story, error) { var result Story diff --git a/tdapi/tl_set_message_sender_block_list_gen.go b/tdapi/tl_set_message_sender_block_list_gen.go new file mode 100644 index 0000000000..70aea03f56 --- /dev/null +++ b/tdapi/tl_set_message_sender_block_list_gen.go @@ -0,0 +1,257 @@ +// 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{} +) + +// SetMessageSenderBlockListRequest represents TL type `setMessageSenderBlockList#898b5c91`. +type SetMessageSenderBlockListRequest struct { + // Identifier of a message sender to block/unblock + SenderID MessageSenderClass + // New block list for the message sender; pass null to unblock the message sender + BlockList BlockListClass +} + +// SetMessageSenderBlockListRequestTypeID is TL type id of SetMessageSenderBlockListRequest. +const SetMessageSenderBlockListRequestTypeID = 0x898b5c91 + +// Ensuring interfaces in compile-time for SetMessageSenderBlockListRequest. +var ( + _ bin.Encoder = &SetMessageSenderBlockListRequest{} + _ bin.Decoder = &SetMessageSenderBlockListRequest{} + _ bin.BareEncoder = &SetMessageSenderBlockListRequest{} + _ bin.BareDecoder = &SetMessageSenderBlockListRequest{} +) + +func (s *SetMessageSenderBlockListRequest) Zero() bool { + if s == nil { + return true + } + if !(s.SenderID == nil) { + return false + } + if !(s.BlockList == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetMessageSenderBlockListRequest) String() string { + if s == nil { + return "SetMessageSenderBlockListRequest(nil)" + } + type Alias SetMessageSenderBlockListRequest + return fmt.Sprintf("SetMessageSenderBlockListRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetMessageSenderBlockListRequest) TypeID() uint32 { + return SetMessageSenderBlockListRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetMessageSenderBlockListRequest) TypeName() string { + return "setMessageSenderBlockList" +} + +// TypeInfo returns info about TL type. +func (s *SetMessageSenderBlockListRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setMessageSenderBlockList", + ID: SetMessageSenderBlockListRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderID", + SchemaName: "sender_id", + }, + { + Name: "BlockList", + SchemaName: "block_list", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetMessageSenderBlockListRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setMessageSenderBlockList#898b5c91 as nil") + } + b.PutID(SetMessageSenderBlockListRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetMessageSenderBlockListRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setMessageSenderBlockList#898b5c91 as nil") + } + if s.SenderID == nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field sender_id is nil") + } + if err := s.SenderID.Encode(b); err != nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field sender_id: %w", err) + } + if s.BlockList == nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field block_list is nil") + } + if err := s.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field block_list: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SetMessageSenderBlockListRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setMessageSenderBlockList#898b5c91 to nil") + } + if err := b.ConsumeID(SetMessageSenderBlockListRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetMessageSenderBlockListRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setMessageSenderBlockList#898b5c91 to nil") + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: field sender_id: %w", err) + } + s.SenderID = value + } + { + value, err := DecodeBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: field block_list: %w", err) + } + s.BlockList = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetMessageSenderBlockListRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setMessageSenderBlockList#898b5c91 as nil") + } + b.ObjStart() + b.PutID("setMessageSenderBlockList") + b.Comma() + b.FieldStart("sender_id") + if s.SenderID == nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field sender_id is nil") + } + if err := s.SenderID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field sender_id: %w", err) + } + b.Comma() + b.FieldStart("block_list") + if s.BlockList == nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field block_list is nil") + } + if err := s.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setMessageSenderBlockList#898b5c91: field block_list: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetMessageSenderBlockListRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setMessageSenderBlockList#898b5c91 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setMessageSenderBlockList"); err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: %w", err) + } + case "sender_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: field sender_id: %w", err) + } + s.SenderID = value + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode setMessageSenderBlockList#898b5c91: field block_list: %w", err) + } + s.BlockList = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderID returns value of SenderID field. +func (s *SetMessageSenderBlockListRequest) GetSenderID() (value MessageSenderClass) { + if s == nil { + return + } + return s.SenderID +} + +// GetBlockList returns value of BlockList field. +func (s *SetMessageSenderBlockListRequest) GetBlockList() (value BlockListClass) { + if s == nil { + return + } + return s.BlockList +} + +// SetMessageSenderBlockList invokes method setMessageSenderBlockList#898b5c91 returning error if any. +func (c *Client) SetMessageSenderBlockList(ctx context.Context, request *SetMessageSenderBlockListRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_set_story_reaction_gen.go b/tdapi/tl_set_story_reaction_gen.go new file mode 100644 index 0000000000..d5a191dda7 --- /dev/null +++ b/tdapi/tl_set_story_reaction_gen.go @@ -0,0 +1,316 @@ +// 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{} +) + +// SetStoryReactionRequest represents TL type `setStoryReaction#ac8b4fa7`. +type SetStoryReactionRequest struct { + // The identifier of the sender of the story + StorySenderChatID int64 + // The identifier of the story + StoryID int32 + // Type of the reaction to set; pass null to remove the reaction. + // `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users + ReactionType ReactionTypeClass + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool +} + +// SetStoryReactionRequestTypeID is TL type id of SetStoryReactionRequest. +const SetStoryReactionRequestTypeID = 0xac8b4fa7 + +// Ensuring interfaces in compile-time for SetStoryReactionRequest. +var ( + _ bin.Encoder = &SetStoryReactionRequest{} + _ bin.Decoder = &SetStoryReactionRequest{} + _ bin.BareEncoder = &SetStoryReactionRequest{} + _ bin.BareDecoder = &SetStoryReactionRequest{} +) + +func (s *SetStoryReactionRequest) Zero() bool { + if s == nil { + return true + } + if !(s.StorySenderChatID == 0) { + return false + } + if !(s.StoryID == 0) { + return false + } + if !(s.ReactionType == nil) { + return false + } + if !(s.UpdateRecentReactions == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetStoryReactionRequest) String() string { + if s == nil { + return "SetStoryReactionRequest(nil)" + } + type Alias SetStoryReactionRequest + return fmt.Sprintf("SetStoryReactionRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetStoryReactionRequest) TypeID() uint32 { + return SetStoryReactionRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetStoryReactionRequest) TypeName() string { + return "setStoryReaction" +} + +// TypeInfo returns info about TL type. +func (s *SetStoryReactionRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setStoryReaction", + ID: SetStoryReactionRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StorySenderChatID", + SchemaName: "story_sender_chat_id", + }, + { + Name: "StoryID", + SchemaName: "story_id", + }, + { + Name: "ReactionType", + SchemaName: "reaction_type", + }, + { + Name: "UpdateRecentReactions", + SchemaName: "update_recent_reactions", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetStoryReactionRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setStoryReaction#ac8b4fa7 as nil") + } + b.PutID(SetStoryReactionRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetStoryReactionRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setStoryReaction#ac8b4fa7 as nil") + } + b.PutInt53(s.StorySenderChatID) + b.PutInt32(s.StoryID) + if s.ReactionType == nil { + return fmt.Errorf("unable to encode setStoryReaction#ac8b4fa7: field reaction_type is nil") + } + if err := s.ReactionType.Encode(b); err != nil { + return fmt.Errorf("unable to encode setStoryReaction#ac8b4fa7: field reaction_type: %w", err) + } + b.PutBool(s.UpdateRecentReactions) + return nil +} + +// Decode implements bin.Decoder. +func (s *SetStoryReactionRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setStoryReaction#ac8b4fa7 to nil") + } + if err := b.ConsumeID(SetStoryReactionRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetStoryReactionRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setStoryReaction#ac8b4fa7 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field story_sender_chat_id: %w", err) + } + s.StorySenderChatID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field story_id: %w", err) + } + s.StoryID = value + } + { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field reaction_type: %w", err) + } + s.ReactionType = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field update_recent_reactions: %w", err) + } + s.UpdateRecentReactions = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetStoryReactionRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setStoryReaction#ac8b4fa7 as nil") + } + b.ObjStart() + b.PutID("setStoryReaction") + b.Comma() + b.FieldStart("story_sender_chat_id") + b.PutInt53(s.StorySenderChatID) + b.Comma() + b.FieldStart("story_id") + b.PutInt32(s.StoryID) + b.Comma() + b.FieldStart("reaction_type") + if s.ReactionType == nil { + return fmt.Errorf("unable to encode setStoryReaction#ac8b4fa7: field reaction_type is nil") + } + if err := s.ReactionType.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setStoryReaction#ac8b4fa7: field reaction_type: %w", err) + } + b.Comma() + b.FieldStart("update_recent_reactions") + b.PutBool(s.UpdateRecentReactions) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetStoryReactionRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setStoryReaction#ac8b4fa7 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setStoryReaction"); err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: %w", err) + } + case "story_sender_chat_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field story_sender_chat_id: %w", err) + } + s.StorySenderChatID = value + case "story_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field story_id: %w", err) + } + s.StoryID = value + case "reaction_type": + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field reaction_type: %w", err) + } + s.ReactionType = value + case "update_recent_reactions": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode setStoryReaction#ac8b4fa7: field update_recent_reactions: %w", err) + } + s.UpdateRecentReactions = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStorySenderChatID returns value of StorySenderChatID field. +func (s *SetStoryReactionRequest) GetStorySenderChatID() (value int64) { + if s == nil { + return + } + return s.StorySenderChatID +} + +// GetStoryID returns value of StoryID field. +func (s *SetStoryReactionRequest) GetStoryID() (value int32) { + if s == nil { + return + } + return s.StoryID +} + +// GetReactionType returns value of ReactionType field. +func (s *SetStoryReactionRequest) GetReactionType() (value ReactionTypeClass) { + if s == nil { + return + } + return s.ReactionType +} + +// GetUpdateRecentReactions returns value of UpdateRecentReactions field. +func (s *SetStoryReactionRequest) GetUpdateRecentReactions() (value bool) { + if s == nil { + return + } + return s.UpdateRecentReactions +} + +// SetStoryReaction invokes method setStoryReaction#ac8b4fa7 returning error if any. +func (c *Client) SetStoryReaction(ctx context.Context, request *SetStoryReactionRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_story_area_gen.go b/tdapi/tl_story_area_gen.go new file mode 100644 index 0000000000..1c75b1401b --- /dev/null +++ b/tdapi/tl_story_area_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{} +) + +// StoryArea represents TL type `storyArea#c9ff075e`. +type StoryArea struct { + // Position of the area + Position StoryAreaPosition + // Type of the area + Type StoryAreaTypeClass +} + +// StoryAreaTypeID is TL type id of StoryArea. +const StoryAreaTypeID = 0xc9ff075e + +// Ensuring interfaces in compile-time for StoryArea. +var ( + _ bin.Encoder = &StoryArea{} + _ bin.Decoder = &StoryArea{} + _ bin.BareEncoder = &StoryArea{} + _ bin.BareDecoder = &StoryArea{} +) + +func (s *StoryArea) Zero() bool { + if s == nil { + return true + } + if !(s.Position.Zero()) { + return false + } + if !(s.Type == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryArea) String() string { + if s == nil { + return "StoryArea(nil)" + } + type Alias StoryArea + return fmt.Sprintf("StoryArea%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryArea) TypeID() uint32 { + return StoryAreaTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryArea) TypeName() string { + return "storyArea" +} + +// TypeInfo returns info about TL type. +func (s *StoryArea) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyArea", + ID: StoryAreaTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Position", + SchemaName: "position", + }, + { + Name: "Type", + SchemaName: "type", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryArea) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyArea#c9ff075e as nil") + } + b.PutID(StoryAreaTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryArea) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyArea#c9ff075e as nil") + } + if err := s.Position.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field position: %w", err) + } + if s.Type == nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field type is nil") + } + if err := s.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field type: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryArea) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyArea#c9ff075e to nil") + } + if err := b.ConsumeID(StoryAreaTypeID); err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryArea) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyArea#c9ff075e to nil") + } + { + if err := s.Position.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: field position: %w", err) + } + } + { + value, err := DecodeStoryAreaType(b) + if err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: field type: %w", err) + } + s.Type = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryArea) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyArea#c9ff075e as nil") + } + b.ObjStart() + b.PutID("storyArea") + b.Comma() + b.FieldStart("position") + if err := s.Position.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field position: %w", err) + } + b.Comma() + b.FieldStart("type") + if s.Type == nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field type is nil") + } + if err := s.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyArea#c9ff075e: field type: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryArea) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyArea#c9ff075e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyArea"); err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: %w", err) + } + case "position": + if err := s.Position.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: field position: %w", err) + } + case "type": + value, err := DecodeTDLibJSONStoryAreaType(b) + if err != nil { + return fmt.Errorf("unable to decode storyArea#c9ff075e: field type: %w", err) + } + s.Type = value + default: + return b.Skip() + } + return nil + }) +} + +// GetPosition returns value of Position field. +func (s *StoryArea) GetPosition() (value StoryAreaPosition) { + if s == nil { + return + } + return s.Position +} + +// GetType returns value of Type field. +func (s *StoryArea) GetType() (value StoryAreaTypeClass) { + if s == nil { + return + } + return s.Type +} diff --git a/tdapi/tl_story_area_position_gen.go b/tdapi/tl_story_area_position_gen.go new file mode 100644 index 0000000000..4f4b386b4e --- /dev/null +++ b/tdapi/tl_story_area_position_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{} +) + +// StoryAreaPosition represents TL type `storyAreaPosition#6389679`. +type StoryAreaPosition struct { + // The abscissa of the rectangle's center, as a percentage of the media width + XPercentage float64 + // The ordinate of the rectangle's center, as a percentage of the media height + YPercentage float64 + // The width of the rectangle, as a percentage of the media width + WidthPercentage float64 + // The ordinate of the rectangle's center, as a percentage of the media height + HeightPercentage float64 + // Clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 +} + +// StoryAreaPositionTypeID is TL type id of StoryAreaPosition. +const StoryAreaPositionTypeID = 0x6389679 + +// Ensuring interfaces in compile-time for StoryAreaPosition. +var ( + _ bin.Encoder = &StoryAreaPosition{} + _ bin.Decoder = &StoryAreaPosition{} + _ bin.BareEncoder = &StoryAreaPosition{} + _ bin.BareDecoder = &StoryAreaPosition{} +) + +func (s *StoryAreaPosition) Zero() bool { + if s == nil { + return true + } + if !(s.XPercentage == 0) { + return false + } + if !(s.YPercentage == 0) { + return false + } + if !(s.WidthPercentage == 0) { + return false + } + if !(s.HeightPercentage == 0) { + return false + } + if !(s.RotationAngle == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryAreaPosition) String() string { + if s == nil { + return "StoryAreaPosition(nil)" + } + type Alias StoryAreaPosition + return fmt.Sprintf("StoryAreaPosition%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryAreaPosition) TypeID() uint32 { + return StoryAreaPositionTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryAreaPosition) TypeName() string { + return "storyAreaPosition" +} + +// TypeInfo returns info about TL type. +func (s *StoryAreaPosition) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyAreaPosition", + ID: StoryAreaPositionTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "XPercentage", + SchemaName: "x_percentage", + }, + { + Name: "YPercentage", + SchemaName: "y_percentage", + }, + { + Name: "WidthPercentage", + SchemaName: "width_percentage", + }, + { + Name: "HeightPercentage", + SchemaName: "height_percentage", + }, + { + Name: "RotationAngle", + SchemaName: "rotation_angle", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryAreaPosition) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaPosition#6389679 as nil") + } + b.PutID(StoryAreaPositionTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryAreaPosition) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaPosition#6389679 as nil") + } + b.PutDouble(s.XPercentage) + b.PutDouble(s.YPercentage) + b.PutDouble(s.WidthPercentage) + b.PutDouble(s.HeightPercentage) + b.PutDouble(s.RotationAngle) + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryAreaPosition) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaPosition#6389679 to nil") + } + if err := b.ConsumeID(StoryAreaPositionTypeID); err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryAreaPosition) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaPosition#6389679 to nil") + } + { + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field x_percentage: %w", err) + } + s.XPercentage = value + } + { + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field y_percentage: %w", err) + } + s.YPercentage = value + } + { + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field width_percentage: %w", err) + } + s.WidthPercentage = value + } + { + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field height_percentage: %w", err) + } + s.HeightPercentage = value + } + { + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field rotation_angle: %w", err) + } + s.RotationAngle = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryAreaPosition) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaPosition#6389679 as nil") + } + b.ObjStart() + b.PutID("storyAreaPosition") + b.Comma() + b.FieldStart("x_percentage") + b.PutDouble(s.XPercentage) + b.Comma() + b.FieldStart("y_percentage") + b.PutDouble(s.YPercentage) + b.Comma() + b.FieldStart("width_percentage") + b.PutDouble(s.WidthPercentage) + b.Comma() + b.FieldStart("height_percentage") + b.PutDouble(s.HeightPercentage) + b.Comma() + b.FieldStart("rotation_angle") + b.PutDouble(s.RotationAngle) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryAreaPosition) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaPosition#6389679 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyAreaPosition"); err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: %w", err) + } + case "x_percentage": + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field x_percentage: %w", err) + } + s.XPercentage = value + case "y_percentage": + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field y_percentage: %w", err) + } + s.YPercentage = value + case "width_percentage": + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field width_percentage: %w", err) + } + s.WidthPercentage = value + case "height_percentage": + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field height_percentage: %w", err) + } + s.HeightPercentage = value + case "rotation_angle": + value, err := b.Double() + if err != nil { + return fmt.Errorf("unable to decode storyAreaPosition#6389679: field rotation_angle: %w", err) + } + s.RotationAngle = value + default: + return b.Skip() + } + return nil + }) +} + +// GetXPercentage returns value of XPercentage field. +func (s *StoryAreaPosition) GetXPercentage() (value float64) { + if s == nil { + return + } + return s.XPercentage +} + +// GetYPercentage returns value of YPercentage field. +func (s *StoryAreaPosition) GetYPercentage() (value float64) { + if s == nil { + return + } + return s.YPercentage +} + +// GetWidthPercentage returns value of WidthPercentage field. +func (s *StoryAreaPosition) GetWidthPercentage() (value float64) { + if s == nil { + return + } + return s.WidthPercentage +} + +// GetHeightPercentage returns value of HeightPercentage field. +func (s *StoryAreaPosition) GetHeightPercentage() (value float64) { + if s == nil { + return + } + return s.HeightPercentage +} + +// GetRotationAngle returns value of RotationAngle field. +func (s *StoryAreaPosition) GetRotationAngle() (value float64) { + if s == nil { + return + } + return s.RotationAngle +} diff --git a/tdapi/tl_story_area_type_gen.go b/tdapi/tl_story_area_type_gen.go new file mode 100644 index 0000000000..00ddecac92 --- /dev/null +++ b/tdapi/tl_story_area_type_gen.go @@ -0,0 +1,501 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryAreaTypeLocation represents TL type `storyAreaTypeLocation#9ebe1186`. +type StoryAreaTypeLocation struct { + // The location + Location Location +} + +// StoryAreaTypeLocationTypeID is TL type id of StoryAreaTypeLocation. +const StoryAreaTypeLocationTypeID = 0x9ebe1186 + +// construct implements constructor of StoryAreaTypeClass. +func (s StoryAreaTypeLocation) construct() StoryAreaTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryAreaTypeLocation. +var ( + _ bin.Encoder = &StoryAreaTypeLocation{} + _ bin.Decoder = &StoryAreaTypeLocation{} + _ bin.BareEncoder = &StoryAreaTypeLocation{} + _ bin.BareDecoder = &StoryAreaTypeLocation{} + + _ StoryAreaTypeClass = &StoryAreaTypeLocation{} +) + +func (s *StoryAreaTypeLocation) Zero() bool { + if s == nil { + return true + } + if !(s.Location.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryAreaTypeLocation) String() string { + if s == nil { + return "StoryAreaTypeLocation(nil)" + } + type Alias StoryAreaTypeLocation + return fmt.Sprintf("StoryAreaTypeLocation%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryAreaTypeLocation) TypeID() uint32 { + return StoryAreaTypeLocationTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryAreaTypeLocation) TypeName() string { + return "storyAreaTypeLocation" +} + +// TypeInfo returns info about TL type. +func (s *StoryAreaTypeLocation) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyAreaTypeLocation", + ID: StoryAreaTypeLocationTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Location", + SchemaName: "location", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryAreaTypeLocation) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeLocation#9ebe1186 as nil") + } + b.PutID(StoryAreaTypeLocationTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryAreaTypeLocation) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeLocation#9ebe1186 as nil") + } + if err := s.Location.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyAreaTypeLocation#9ebe1186: field location: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryAreaTypeLocation) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeLocation#9ebe1186 to nil") + } + if err := b.ConsumeID(StoryAreaTypeLocationTypeID); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeLocation#9ebe1186: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryAreaTypeLocation) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeLocation#9ebe1186 to nil") + } + { + if err := s.Location.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeLocation#9ebe1186: field location: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryAreaTypeLocation) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeLocation#9ebe1186 as nil") + } + b.ObjStart() + b.PutID("storyAreaTypeLocation") + b.Comma() + b.FieldStart("location") + if err := s.Location.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyAreaTypeLocation#9ebe1186: field location: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryAreaTypeLocation) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeLocation#9ebe1186 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyAreaTypeLocation"); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeLocation#9ebe1186: %w", err) + } + case "location": + if err := s.Location.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeLocation#9ebe1186: field location: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetLocation returns value of Location field. +func (s *StoryAreaTypeLocation) GetLocation() (value Location) { + if s == nil { + return + } + return s.Location +} + +// StoryAreaTypeVenue represents TL type `storyAreaTypeVenue#18ae4d06`. +type StoryAreaTypeVenue struct { + // Information about the venue + Venue Venue +} + +// StoryAreaTypeVenueTypeID is TL type id of StoryAreaTypeVenue. +const StoryAreaTypeVenueTypeID = 0x18ae4d06 + +// construct implements constructor of StoryAreaTypeClass. +func (s StoryAreaTypeVenue) construct() StoryAreaTypeClass { return &s } + +// Ensuring interfaces in compile-time for StoryAreaTypeVenue. +var ( + _ bin.Encoder = &StoryAreaTypeVenue{} + _ bin.Decoder = &StoryAreaTypeVenue{} + _ bin.BareEncoder = &StoryAreaTypeVenue{} + _ bin.BareDecoder = &StoryAreaTypeVenue{} + + _ StoryAreaTypeClass = &StoryAreaTypeVenue{} +) + +func (s *StoryAreaTypeVenue) Zero() bool { + if s == nil { + return true + } + if !(s.Venue.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryAreaTypeVenue) String() string { + if s == nil { + return "StoryAreaTypeVenue(nil)" + } + type Alias StoryAreaTypeVenue + return fmt.Sprintf("StoryAreaTypeVenue%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryAreaTypeVenue) TypeID() uint32 { + return StoryAreaTypeVenueTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryAreaTypeVenue) TypeName() string { + return "storyAreaTypeVenue" +} + +// TypeInfo returns info about TL type. +func (s *StoryAreaTypeVenue) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyAreaTypeVenue", + ID: StoryAreaTypeVenueTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Venue", + SchemaName: "venue", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryAreaTypeVenue) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeVenue#18ae4d06 as nil") + } + b.PutID(StoryAreaTypeVenueTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryAreaTypeVenue) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeVenue#18ae4d06 as nil") + } + if err := s.Venue.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyAreaTypeVenue#18ae4d06: field venue: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryAreaTypeVenue) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeVenue#18ae4d06 to nil") + } + if err := b.ConsumeID(StoryAreaTypeVenueTypeID); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeVenue#18ae4d06: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryAreaTypeVenue) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeVenue#18ae4d06 to nil") + } + { + if err := s.Venue.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeVenue#18ae4d06: field venue: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryAreaTypeVenue) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyAreaTypeVenue#18ae4d06 as nil") + } + b.ObjStart() + b.PutID("storyAreaTypeVenue") + b.Comma() + b.FieldStart("venue") + if err := s.Venue.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyAreaTypeVenue#18ae4d06: field venue: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryAreaTypeVenue) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyAreaTypeVenue#18ae4d06 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyAreaTypeVenue"); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeVenue#18ae4d06: %w", err) + } + case "venue": + if err := s.Venue.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyAreaTypeVenue#18ae4d06: field venue: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetVenue returns value of Venue field. +func (s *StoryAreaTypeVenue) GetVenue() (value Venue) { + if s == nil { + return + } + return s.Venue +} + +// StoryAreaTypeClassName is schema name of StoryAreaTypeClass. +const StoryAreaTypeClassName = "StoryAreaType" + +// StoryAreaTypeClass represents StoryAreaType generic type. +// +// Example: +// +// g, err := tdapi.DecodeStoryAreaType(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.StoryAreaTypeLocation: // storyAreaTypeLocation#9ebe1186 +// case *tdapi.StoryAreaTypeVenue: // storyAreaTypeVenue#18ae4d06 +// default: panic(v) +// } +type StoryAreaTypeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() StoryAreaTypeClass + + // 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 +} + +// DecodeStoryAreaType implements binary de-serialization for StoryAreaTypeClass. +func DecodeStoryAreaType(buf *bin.Buffer) (StoryAreaTypeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case StoryAreaTypeLocationTypeID: + // Decoding storyAreaTypeLocation#9ebe1186. + v := StoryAreaTypeLocation{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil + case StoryAreaTypeVenueTypeID: + // Decoding storyAreaTypeVenue#18ae4d06. + v := StoryAreaTypeVenue{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONStoryAreaType implements binary de-serialization for StoryAreaTypeClass. +func DecodeTDLibJSONStoryAreaType(buf tdjson.Decoder) (StoryAreaTypeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "storyAreaTypeLocation": + // Decoding storyAreaTypeLocation#9ebe1186. + v := StoryAreaTypeLocation{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil + case "storyAreaTypeVenue": + // Decoding storyAreaTypeVenue#18ae4d06. + v := StoryAreaTypeVenue{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryAreaTypeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// StoryAreaType boxes the StoryAreaTypeClass providing a helper. +type StoryAreaTypeBox struct { + StoryAreaType StoryAreaTypeClass +} + +// Decode implements bin.Decoder for StoryAreaTypeBox. +func (b *StoryAreaTypeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode StoryAreaTypeBox to nil") + } + v, err := DecodeStoryAreaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryAreaType = v + return nil +} + +// Encode implements bin.Encode for StoryAreaTypeBox. +func (b *StoryAreaTypeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.StoryAreaType == nil { + return fmt.Errorf("unable to encode StoryAreaTypeClass as nil") + } + return b.StoryAreaType.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for StoryAreaTypeBox. +func (b *StoryAreaTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode StoryAreaTypeBox to nil") + } + v, err := DecodeTDLibJSONStoryAreaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryAreaType = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for StoryAreaTypeBox. +func (b *StoryAreaTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.StoryAreaType == nil { + return fmt.Errorf("unable to encode StoryAreaTypeClass as nil") + } + return b.StoryAreaType.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_story_gen.go b/tdapi/tl_story_gen.go index 00be3dbb73..eb38fd1dd1 100644 --- a/tdapi/tl_story_gen.go +++ b/tdapi/tl_story_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Story represents TL type `story#352d729c`. +// Story represents TL type `story#3198c7c0`. type Story struct { // Unique story identifier among stories of the given sender ID int32 @@ -39,6 +39,8 @@ type Story struct { SenderChatID int64 // Point in time (Unix timestamp) when the story was published Date int32 + // True, if the story is being sent by the current user + IsBeingSent bool // True, if the story is being edited by the current user IsBeingEdited bool // True, if the story was edited @@ -61,16 +63,20 @@ type Story struct { // Information about interactions with the story; may be null if the story isn't owned or // there were no interactions InteractionInfo StoryInteractionInfo + // Type of the chosen reaction; may be null if none + ChosenReactionType ReactionTypeClass // Privacy rules affecting story visibility; may be approximate for non-owned stories PrivacySettings StoryPrivacySettingsClass // Content of the story Content StoryContentClass + // Clickable areas to be shown on the story content + Areas []StoryArea // Caption of the story Caption FormattedText } // StoryTypeID is TL type id of Story. -const StoryTypeID = 0x352d729c +const StoryTypeID = 0x3198c7c0 // Ensuring interfaces in compile-time for Story. var ( @@ -93,6 +99,9 @@ func (s *Story) Zero() bool { if !(s.Date == 0) { return false } + if !(s.IsBeingSent == false) { + return false + } if !(s.IsBeingEdited == false) { return false } @@ -120,12 +129,18 @@ func (s *Story) Zero() bool { if !(s.InteractionInfo.Zero()) { return false } + if !(s.ChosenReactionType == nil) { + return false + } if !(s.PrivacySettings == nil) { return false } if !(s.Content == nil) { return false } + if !(s.Areas == nil) { + return false + } if !(s.Caption.Zero()) { return false } @@ -177,6 +192,10 @@ func (s *Story) TypeInfo() tdp.Type { Name: "Date", SchemaName: "date", }, + { + Name: "IsBeingSent", + SchemaName: "is_being_sent", + }, { Name: "IsBeingEdited", SchemaName: "is_being_edited", @@ -213,6 +232,10 @@ func (s *Story) TypeInfo() tdp.Type { Name: "InteractionInfo", SchemaName: "interaction_info", }, + { + Name: "ChosenReactionType", + SchemaName: "chosen_reaction_type", + }, { Name: "PrivacySettings", SchemaName: "privacy_settings", @@ -221,6 +244,10 @@ func (s *Story) TypeInfo() tdp.Type { Name: "Content", SchemaName: "content", }, + { + Name: "Areas", + SchemaName: "areas", + }, { Name: "Caption", SchemaName: "caption", @@ -232,7 +259,7 @@ func (s *Story) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *Story) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode story#352d729c as nil") + return fmt.Errorf("can't encode story#3198c7c0 as nil") } b.PutID(StoryTypeID) return s.EncodeBare(b) @@ -241,11 +268,12 @@ func (s *Story) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *Story) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode story#352d729c as nil") + return fmt.Errorf("can't encode story#3198c7c0 as nil") } b.PutInt32(s.ID) b.PutInt53(s.SenderChatID) b.PutInt32(s.Date) + b.PutBool(s.IsBeingSent) b.PutBool(s.IsBeingEdited) b.PutBool(s.IsEdited) b.PutBool(s.IsPinned) @@ -255,22 +283,34 @@ func (s *Story) EncodeBare(b *bin.Buffer) error { b.PutBool(s.CanGetViewers) b.PutBool(s.HasExpiredViewers) if err := s.InteractionInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field interaction_info: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field interaction_info: %w", err) + } + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode story#3198c7c0: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.Encode(b); err != nil { + return fmt.Errorf("unable to encode story#3198c7c0: field chosen_reaction_type: %w", err) } if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode story#352d729c: field privacy_settings is nil") + return fmt.Errorf("unable to encode story#3198c7c0: field privacy_settings is nil") } if err := s.PrivacySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field privacy_settings: %w", err) } if s.Content == nil { - return fmt.Errorf("unable to encode story#352d729c: field content is nil") + return fmt.Errorf("unable to encode story#3198c7c0: field content is nil") } if err := s.Content.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field content: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field content: %w", err) + } + b.PutInt(len(s.Areas)) + for idx, v := range s.Areas { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare story#3198c7c0: field areas element with index %d: %w", idx, err) + } } if err := s.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field caption: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field caption: %w", err) } return nil } @@ -278,10 +318,10 @@ func (s *Story) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *Story) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode story#352d729c to nil") + return fmt.Errorf("can't decode story#3198c7c0 to nil") } if err := b.ConsumeID(StoryTypeID); err != nil { - return fmt.Errorf("unable to decode story#352d729c: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: %w", err) } return s.DecodeBare(b) } @@ -289,107 +329,138 @@ func (s *Story) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *Story) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode story#352d729c to nil") + return fmt.Errorf("can't decode story#3198c7c0 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field id: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field id: %w", err) } s.ID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field sender_chat_id: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field sender_chat_id: %w", err) } s.SenderChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field date: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field date: %w", err) } s.Date = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_being_edited: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_being_sent: %w", err) + } + s.IsBeingSent = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field is_being_edited: %w", err) } s.IsBeingEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_edited: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_edited: %w", err) } s.IsEdited = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_pinned: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_pinned: %w", err) } s.IsPinned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_visible_only_for_self: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_visible_only_for_self: %w", err) } s.IsVisibleOnlyForSelf = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_be_forwarded: %w", err) } s.CanBeForwarded = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_be_replied: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_be_replied: %w", err) } s.CanBeReplied = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_get_viewers: %w", err) } s.CanGetViewers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field has_expired_viewers: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field has_expired_viewers: %w", err) } s.HasExpiredViewers = value } { if err := s.InteractionInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode story#352d729c: field interaction_info: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field interaction_info: %w", err) } } + { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field chosen_reaction_type: %w", err) + } + s.ChosenReactionType = value + } { value, err := DecodeStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field privacy_settings: %w", err) } s.PrivacySettings = value } { value, err := DecodeStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field content: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field content: %w", err) } s.Content = value } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field areas: %w", err) + } + + if headerLen > 0 { + s.Areas = make([]StoryArea, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value StoryArea + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare story#3198c7c0: field areas: %w", err) + } + s.Areas = append(s.Areas, value) + } + } { if err := s.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode story#352d729c: field caption: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field caption: %w", err) } } return nil @@ -398,7 +469,7 @@ func (s *Story) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode story#352d729c as nil") + return fmt.Errorf("can't encode story#3198c7c0 as nil") } b.ObjStart() b.PutID("story") @@ -412,6 +483,9 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("date") b.PutInt32(s.Date) b.Comma() + b.FieldStart("is_being_sent") + b.PutBool(s.IsBeingSent) + b.Comma() b.FieldStart("is_being_edited") b.PutBool(s.IsBeingEdited) b.Comma() @@ -438,28 +512,47 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("interaction_info") if err := s.InteractionInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field interaction_info: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field interaction_info: %w", err) + } + b.Comma() + b.FieldStart("chosen_reaction_type") + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode story#3198c7c0: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode story#3198c7c0: field chosen_reaction_type: %w", err) } b.Comma() b.FieldStart("privacy_settings") if s.PrivacySettings == nil { - return fmt.Errorf("unable to encode story#352d729c: field privacy_settings is nil") + return fmt.Errorf("unable to encode story#3198c7c0: field privacy_settings is nil") } if err := s.PrivacySettings.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field privacy_settings: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field privacy_settings: %w", err) } b.Comma() b.FieldStart("content") if s.Content == nil { - return fmt.Errorf("unable to encode story#352d729c: field content is nil") + return fmt.Errorf("unable to encode story#3198c7c0: field content is nil") } if err := s.Content.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field content: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field content: %w", err) + } + b.Comma() + b.FieldStart("areas") + b.ArrStart() + for idx, v := range s.Areas { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode story#3198c7c0: field areas element with index %d: %w", idx, err) + } + b.Comma() } + b.StripComma() + b.ArrEnd() b.Comma() b.FieldStart("caption") if err := s.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode story#352d729c: field caption: %w", err) + return fmt.Errorf("unable to encode story#3198c7c0: field caption: %w", err) } b.Comma() b.StripComma() @@ -470,100 +563,123 @@ func (s *Story) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *Story) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode story#352d729c to nil") + return fmt.Errorf("can't decode story#3198c7c0 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("story"); err != nil { - return fmt.Errorf("unable to decode story#352d729c: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: %w", err) } case "id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field id: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field id: %w", err) } s.ID = value case "sender_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field sender_chat_id: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field sender_chat_id: %w", err) } s.SenderChatID = value case "date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field date: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field date: %w", err) } s.Date = value + case "is_being_sent": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field is_being_sent: %w", err) + } + s.IsBeingSent = value case "is_being_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_being_edited: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_being_edited: %w", err) } s.IsBeingEdited = value case "is_edited": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_edited: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_edited: %w", err) } s.IsEdited = value case "is_pinned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_pinned: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_pinned: %w", err) } s.IsPinned = value case "is_visible_only_for_self": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field is_visible_only_for_self: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field is_visible_only_for_self: %w", err) } s.IsVisibleOnlyForSelf = value case "can_be_forwarded": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_be_forwarded: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_be_forwarded: %w", err) } s.CanBeForwarded = value case "can_be_replied": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_be_replied: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_be_replied: %w", err) } s.CanBeReplied = value case "can_get_viewers": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field can_get_viewers: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field can_get_viewers: %w", err) } s.CanGetViewers = value case "has_expired_viewers": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field has_expired_viewers: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field has_expired_viewers: %w", err) } s.HasExpiredViewers = value case "interaction_info": if err := s.InteractionInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#352d729c: field interaction_info: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field interaction_info: %w", err) + } + case "chosen_reaction_type": + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field chosen_reaction_type: %w", err) } + s.ChosenReactionType = value case "privacy_settings": value, err := DecodeTDLibJSONStoryPrivacySettings(b) if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field privacy_settings: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field privacy_settings: %w", err) } s.PrivacySettings = value case "content": value, err := DecodeTDLibJSONStoryContent(b) if err != nil { - return fmt.Errorf("unable to decode story#352d729c: field content: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field content: %w", err) } s.Content = value + case "areas": + if err := b.Arr(func(b tdjson.Decoder) error { + var value StoryArea + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field areas: %w", err) + } + s.Areas = append(s.Areas, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode story#3198c7c0: field areas: %w", err) + } case "caption": if err := s.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode story#352d729c: field caption: %w", err) + return fmt.Errorf("unable to decode story#3198c7c0: field caption: %w", err) } default: return b.Skip() @@ -596,6 +712,14 @@ func (s *Story) GetDate() (value int32) { return s.Date } +// GetIsBeingSent returns value of IsBeingSent field. +func (s *Story) GetIsBeingSent() (value bool) { + if s == nil { + return + } + return s.IsBeingSent +} + // GetIsBeingEdited returns value of IsBeingEdited field. func (s *Story) GetIsBeingEdited() (value bool) { if s == nil { @@ -668,6 +792,14 @@ func (s *Story) GetInteractionInfo() (value StoryInteractionInfo) { return s.InteractionInfo } +// GetChosenReactionType returns value of ChosenReactionType field. +func (s *Story) GetChosenReactionType() (value ReactionTypeClass) { + if s == nil { + return + } + return s.ChosenReactionType +} + // GetPrivacySettings returns value of PrivacySettings field. func (s *Story) GetPrivacySettings() (value StoryPrivacySettingsClass) { if s == nil { @@ -684,6 +816,14 @@ func (s *Story) GetContent() (value StoryContentClass) { return s.Content } +// GetAreas returns value of Areas field. +func (s *Story) GetAreas() (value []StoryArea) { + if s == nil { + return + } + return s.Areas +} + // GetCaption returns value of Caption field. func (s *Story) GetCaption() (value FormattedText) { if s == nil { diff --git a/tdapi/tl_story_interaction_info_gen.go b/tdapi/tl_story_interaction_info_gen.go index dcb9ad0c99..ffbc2d77b2 100644 --- a/tdapi/tl_story_interaction_info_gen.go +++ b/tdapi/tl_story_interaction_info_gen.go @@ -31,16 +31,18 @@ var ( _ = tdjson.Encoder{} ) -// StoryInteractionInfo represents TL type `storyInteractionInfo#853472cf`. +// StoryInteractionInfo represents TL type `storyInteractionInfo#e5109256`. type StoryInteractionInfo struct { // Number of times the story was viewed ViewCount int32 + // Number of reactions added to the story + ReactionCount int32 // Identifiers of at most 3 recent viewers of the story RecentViewerUserIDs []int64 } // StoryInteractionInfoTypeID is TL type id of StoryInteractionInfo. -const StoryInteractionInfoTypeID = 0x853472cf +const StoryInteractionInfoTypeID = 0xe5109256 // Ensuring interfaces in compile-time for StoryInteractionInfo. var ( @@ -57,6 +59,9 @@ func (s *StoryInteractionInfo) Zero() bool { if !(s.ViewCount == 0) { return false } + if !(s.ReactionCount == 0) { + return false + } if !(s.RecentViewerUserIDs == nil) { return false } @@ -100,6 +105,10 @@ func (s *StoryInteractionInfo) TypeInfo() tdp.Type { Name: "ViewCount", SchemaName: "view_count", }, + { + Name: "ReactionCount", + SchemaName: "reaction_count", + }, { Name: "RecentViewerUserIDs", SchemaName: "recent_viewer_user_ids", @@ -111,7 +120,7 @@ func (s *StoryInteractionInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StoryInteractionInfo) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyInteractionInfo#853472cf as nil") + return fmt.Errorf("can't encode storyInteractionInfo#e5109256 as nil") } b.PutID(StoryInteractionInfoTypeID) return s.EncodeBare(b) @@ -120,9 +129,10 @@ func (s *StoryInteractionInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StoryInteractionInfo) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyInteractionInfo#853472cf as nil") + return fmt.Errorf("can't encode storyInteractionInfo#e5109256 as nil") } b.PutInt32(s.ViewCount) + b.PutInt32(s.ReactionCount) b.PutInt(len(s.RecentViewerUserIDs)) for _, v := range s.RecentViewerUserIDs { b.PutInt53(v) @@ -133,10 +143,10 @@ func (s *StoryInteractionInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StoryInteractionInfo) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyInteractionInfo#853472cf to nil") + return fmt.Errorf("can't decode storyInteractionInfo#e5109256 to nil") } if err := b.ConsumeID(StoryInteractionInfoTypeID); err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: %w", err) } return s.DecodeBare(b) } @@ -144,19 +154,26 @@ func (s *StoryInteractionInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StoryInteractionInfo) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyInteractionInfo#853472cf to nil") + return fmt.Errorf("can't decode storyInteractionInfo#e5109256 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field view_count: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field view_count: %w", err) } s.ViewCount = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field reaction_count: %w", err) + } + s.ReactionCount = value + } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field recent_viewer_user_ids: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field recent_viewer_user_ids: %w", err) } if headerLen > 0 { @@ -165,7 +182,7 @@ func (s *StoryInteractionInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field recent_viewer_user_ids: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field recent_viewer_user_ids: %w", err) } s.RecentViewerUserIDs = append(s.RecentViewerUserIDs, value) } @@ -176,7 +193,7 @@ func (s *StoryInteractionInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StoryInteractionInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode storyInteractionInfo#853472cf as nil") + return fmt.Errorf("can't encode storyInteractionInfo#e5109256 as nil") } b.ObjStart() b.PutID("storyInteractionInfo") @@ -184,6 +201,9 @@ func (s *StoryInteractionInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("view_count") b.PutInt32(s.ViewCount) b.Comma() + b.FieldStart("reaction_count") + b.PutInt32(s.ReactionCount) + b.Comma() b.FieldStart("recent_viewer_user_ids") b.ArrStart() for _, v := range s.RecentViewerUserIDs { @@ -201,31 +221,37 @@ func (s *StoryInteractionInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StoryInteractionInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode storyInteractionInfo#853472cf to nil") + return fmt.Errorf("can't decode storyInteractionInfo#e5109256 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("storyInteractionInfo"); err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: %w", err) } case "view_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field view_count: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field view_count: %w", err) } s.ViewCount = value + case "reaction_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field reaction_count: %w", err) + } + s.ReactionCount = value case "recent_viewer_user_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field recent_viewer_user_ids: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field recent_viewer_user_ids: %w", err) } s.RecentViewerUserIDs = append(s.RecentViewerUserIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode storyInteractionInfo#853472cf: field recent_viewer_user_ids: %w", err) + return fmt.Errorf("unable to decode storyInteractionInfo#e5109256: field recent_viewer_user_ids: %w", err) } default: return b.Skip() @@ -242,6 +268,14 @@ func (s *StoryInteractionInfo) GetViewCount() (value int32) { return s.ViewCount } +// GetReactionCount returns value of ReactionCount field. +func (s *StoryInteractionInfo) GetReactionCount() (value int32) { + if s == nil { + return + } + return s.ReactionCount +} + // GetRecentViewerUserIDs returns value of RecentViewerUserIDs field. func (s *StoryInteractionInfo) GetRecentViewerUserIDs() (value []int64) { if s == nil { diff --git a/tdapi/tl_story_privacy_settings_gen.go b/tdapi/tl_story_privacy_settings_gen.go index c8b5b22b4d..a0e397d1a9 100644 --- a/tdapi/tl_story_privacy_settings_gen.go +++ b/tdapi/tl_story_privacy_settings_gen.go @@ -31,12 +31,15 @@ var ( _ = tdjson.Encoder{} ) -// StoryPrivacySettingsEveryone represents TL type `storyPrivacySettingsEveryone#a8204874`. +// StoryPrivacySettingsEveryone represents TL type `storyPrivacySettingsEveryone#22d1053a`. type StoryPrivacySettingsEveryone struct { + // Identifiers of the users that can't see the story; always unknown and empty for + // non-owned stories + ExceptUserIDs []int64 } // StoryPrivacySettingsEveryoneTypeID is TL type id of StoryPrivacySettingsEveryone. -const StoryPrivacySettingsEveryoneTypeID = 0xa8204874 +const StoryPrivacySettingsEveryoneTypeID = 0x22d1053a // construct implements constructor of StoryPrivacySettingsClass. func (s StoryPrivacySettingsEveryone) construct() StoryPrivacySettingsClass { return &s } @@ -55,6 +58,9 @@ func (s *StoryPrivacySettingsEveryone) Zero() bool { if s == nil { return true } + if !(s.ExceptUserIDs == nil) { + return false + } return true } @@ -90,14 +96,19 @@ func (s *StoryPrivacySettingsEveryone) TypeInfo() tdp.Type { typ.Null = true return typ } - typ.Fields = []tdp.Field{} + typ.Fields = []tdp.Field{ + { + Name: "ExceptUserIDs", + SchemaName: "except_user_ids", + }, + } return typ } // Encode implements bin.Encoder. func (s *StoryPrivacySettingsEveryone) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyPrivacySettingsEveryone#a8204874 as nil") + return fmt.Errorf("can't encode storyPrivacySettingsEveryone#22d1053a as nil") } b.PutID(StoryPrivacySettingsEveryoneTypeID) return s.EncodeBare(b) @@ -106,7 +117,11 @@ func (s *StoryPrivacySettingsEveryone) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StoryPrivacySettingsEveryone) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyPrivacySettingsEveryone#a8204874 as nil") + return fmt.Errorf("can't encode storyPrivacySettingsEveryone#22d1053a as nil") + } + b.PutInt(len(s.ExceptUserIDs)) + for _, v := range s.ExceptUserIDs { + b.PutInt53(v) } return nil } @@ -114,10 +129,10 @@ func (s *StoryPrivacySettingsEveryone) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StoryPrivacySettingsEveryone) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyPrivacySettingsEveryone#a8204874 to nil") + return fmt.Errorf("can't decode storyPrivacySettingsEveryone#22d1053a to nil") } if err := b.ConsumeID(StoryPrivacySettingsEveryoneTypeID); err != nil { - return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#a8204874: %w", err) + return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#22d1053a: %w", err) } return s.DecodeBare(b) } @@ -125,7 +140,24 @@ func (s *StoryPrivacySettingsEveryone) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StoryPrivacySettingsEveryone) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyPrivacySettingsEveryone#a8204874 to nil") + return fmt.Errorf("can't decode storyPrivacySettingsEveryone#22d1053a to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#22d1053a: field except_user_ids: %w", err) + } + + if headerLen > 0 { + s.ExceptUserIDs = 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 storyPrivacySettingsEveryone#22d1053a: field except_user_ids: %w", err) + } + s.ExceptUserIDs = append(s.ExceptUserIDs, value) + } } return nil } @@ -133,11 +165,20 @@ func (s *StoryPrivacySettingsEveryone) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StoryPrivacySettingsEveryone) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode storyPrivacySettingsEveryone#a8204874 as nil") + return fmt.Errorf("can't encode storyPrivacySettingsEveryone#22d1053a as nil") } b.ObjStart() b.PutID("storyPrivacySettingsEveryone") b.Comma() + b.FieldStart("except_user_ids") + b.ArrStart() + for _, v := range s.ExceptUserIDs { + b.PutInt53(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -146,14 +187,25 @@ func (s *StoryPrivacySettingsEveryone) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StoryPrivacySettingsEveryone) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode storyPrivacySettingsEveryone#a8204874 to nil") + return fmt.Errorf("can't decode storyPrivacySettingsEveryone#22d1053a to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("storyPrivacySettingsEveryone"); err != nil { - return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#a8204874: %w", err) + return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#22d1053a: %w", err) + } + case "except_user_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#22d1053a: field except_user_ids: %w", err) + } + s.ExceptUserIDs = append(s.ExceptUserIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode storyPrivacySettingsEveryone#22d1053a: field except_user_ids: %w", err) } default: return b.Skip() @@ -162,10 +214,18 @@ func (s *StoryPrivacySettingsEveryone) DecodeTDLibJSON(b tdjson.Decoder) error { }) } +// GetExceptUserIDs returns value of ExceptUserIDs field. +func (s *StoryPrivacySettingsEveryone) GetExceptUserIDs() (value []int64) { + if s == nil { + return + } + return s.ExceptUserIDs +} + // StoryPrivacySettingsContacts represents TL type `storyPrivacySettingsContacts#35515d71`. type StoryPrivacySettingsContacts struct { - // User identifiers of the contacts that can't see the story; always empty for non-owned - // stories + // User identifiers of the contacts that can't see the story; always unknown and empty + // for non-owned stories ExceptUserIDs []int64 } @@ -486,7 +546,7 @@ func (s *StoryPrivacySettingsCloseFriends) DecodeTDLibJSON(b tdjson.Decoder) err // StoryPrivacySettingsSelectedContacts represents TL type `storyPrivacySettingsSelectedContacts#25401fc7`. type StoryPrivacySettingsSelectedContacts struct { - // Identifiers of the users; always empty for non-owned stories + // Identifiers of the users; always unknown and empty for non-owned stories UserIDs []int64 } @@ -686,7 +746,7 @@ const StoryPrivacySettingsClassName = "StoryPrivacySettings" // panic(err) // } // switch v := g.(type) { -// case *tdapi.StoryPrivacySettingsEveryone: // storyPrivacySettingsEveryone#a8204874 +// case *tdapi.StoryPrivacySettingsEveryone: // storyPrivacySettingsEveryone#22d1053a // case *tdapi.StoryPrivacySettingsContacts: // storyPrivacySettingsContacts#35515d71 // case *tdapi.StoryPrivacySettingsCloseFriends: // storyPrivacySettingsCloseFriends#7cff8b60 // case *tdapi.StoryPrivacySettingsSelectedContacts: // storyPrivacySettingsSelectedContacts#25401fc7 @@ -722,7 +782,7 @@ func DecodeStoryPrivacySettings(buf *bin.Buffer) (StoryPrivacySettingsClass, err } switch id { case StoryPrivacySettingsEveryoneTypeID: - // Decoding storyPrivacySettingsEveryone#a8204874. + // Decoding storyPrivacySettingsEveryone#22d1053a. v := StoryPrivacySettingsEveryone{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StoryPrivacySettingsClass: %w", err) @@ -762,7 +822,7 @@ func DecodeTDLibJSONStoryPrivacySettings(buf tdjson.Decoder) (StoryPrivacySettin } switch id { case "storyPrivacySettingsEveryone": - // Decoding storyPrivacySettingsEveryone#a8204874. + // Decoding storyPrivacySettingsEveryone#22d1053a. v := StoryPrivacySettingsEveryone{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode StoryPrivacySettingsClass: %w", err) diff --git a/tdapi/tl_story_viewer_gen.go b/tdapi/tl_story_viewer_gen.go new file mode 100644 index 0000000000..499f10cd8a --- /dev/null +++ b/tdapi/tl_story_viewer_gen.go @@ -0,0 +1,315 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryViewer represents TL type `storyViewer#cf0fb132`. +type StoryViewer struct { + // User identifier of the viewer + UserID int64 + // Approximate point in time (Unix timestamp) when the story was viewed + ViewDate int32 + // Block list to which the user is added; may be null if none + BlockList BlockListClass + // Type of the reaction that was chosen by the user; may be null if none + ChosenReactionType ReactionTypeClass +} + +// StoryViewerTypeID is TL type id of StoryViewer. +const StoryViewerTypeID = 0xcf0fb132 + +// Ensuring interfaces in compile-time for StoryViewer. +var ( + _ bin.Encoder = &StoryViewer{} + _ bin.Decoder = &StoryViewer{} + _ bin.BareEncoder = &StoryViewer{} + _ bin.BareDecoder = &StoryViewer{} +) + +func (s *StoryViewer) Zero() bool { + if s == nil { + return true + } + if !(s.UserID == 0) { + return false + } + if !(s.ViewDate == 0) { + return false + } + if !(s.BlockList == nil) { + return false + } + if !(s.ChosenReactionType == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryViewer) String() string { + if s == nil { + return "StoryViewer(nil)" + } + type Alias StoryViewer + return fmt.Sprintf("StoryViewer%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryViewer) TypeID() uint32 { + return StoryViewerTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryViewer) TypeName() string { + return "storyViewer" +} + +// TypeInfo returns info about TL type. +func (s *StoryViewer) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyViewer", + ID: StoryViewerTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "ViewDate", + SchemaName: "view_date", + }, + { + Name: "BlockList", + SchemaName: "block_list", + }, + { + Name: "ChosenReactionType", + SchemaName: "chosen_reaction_type", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryViewer) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") + } + b.PutID(StoryViewerTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryViewer) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") + } + b.PutInt53(s.UserID) + b.PutInt32(s.ViewDate) + if s.BlockList == nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list is nil") + } + if err := s.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list: %w", err) + } + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryViewer) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") + } + if err := b.ConsumeID(StoryViewerTypeID); err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryViewer) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field user_id: %w", err) + } + s.UserID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field view_date: %w", err) + } + s.ViewDate = value + } + { + value, err := DecodeBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field block_list: %w", err) + } + s.BlockList = value + } + { + value, err := DecodeReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) + } + s.ChosenReactionType = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryViewer) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyViewer#cf0fb132 as nil") + } + b.ObjStart() + b.PutID("storyViewer") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(s.UserID) + b.Comma() + b.FieldStart("view_date") + b.PutInt32(s.ViewDate) + b.Comma() + b.FieldStart("block_list") + if s.BlockList == nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list is nil") + } + if err := s.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field block_list: %w", err) + } + b.Comma() + b.FieldStart("chosen_reaction_type") + if s.ChosenReactionType == nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type is nil") + } + if err := s.ChosenReactionType.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryViewer) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyViewer#cf0fb132 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyViewer"); err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field user_id: %w", err) + } + s.UserID = value + case "view_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field view_date: %w", err) + } + s.ViewDate = value + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field block_list: %w", err) + } + s.BlockList = value + case "chosen_reaction_type": + value, err := DecodeTDLibJSONReactionType(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewer#cf0fb132: field chosen_reaction_type: %w", err) + } + s.ChosenReactionType = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (s *StoryViewer) GetUserID() (value int64) { + if s == nil { + return + } + return s.UserID +} + +// GetViewDate returns value of ViewDate field. +func (s *StoryViewer) GetViewDate() (value int32) { + if s == nil { + return + } + return s.ViewDate +} + +// GetBlockList returns value of BlockList field. +func (s *StoryViewer) GetBlockList() (value BlockListClass) { + if s == nil { + return + } + return s.BlockList +} + +// GetChosenReactionType returns value of ChosenReactionType field. +func (s *StoryViewer) GetChosenReactionType() (value ReactionTypeClass) { + if s == nil { + return + } + return s.ChosenReactionType +} diff --git a/tdapi/tl_story_viewers_gen.go b/tdapi/tl_story_viewers_gen.go new file mode 100644 index 0000000000..dc40a06b3a --- /dev/null +++ b/tdapi/tl_story_viewers_gen.go @@ -0,0 +1,289 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryViewers represents TL type `storyViewers#b9fed56b`. +type StoryViewers struct { + // Approximate total number of story viewers found + TotalCount int32 + // List of story viewers + Viewers []StoryViewer + // The offset for the next request. If empty, there are no more results + NextOffset string +} + +// StoryViewersTypeID is TL type id of StoryViewers. +const StoryViewersTypeID = 0xb9fed56b + +// Ensuring interfaces in compile-time for StoryViewers. +var ( + _ bin.Encoder = &StoryViewers{} + _ bin.Decoder = &StoryViewers{} + _ bin.BareEncoder = &StoryViewers{} + _ bin.BareDecoder = &StoryViewers{} +) + +func (s *StoryViewers) Zero() bool { + if s == nil { + return true + } + if !(s.TotalCount == 0) { + return false + } + if !(s.Viewers == nil) { + return false + } + if !(s.NextOffset == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryViewers) String() string { + if s == nil { + return "StoryViewers(nil)" + } + type Alias StoryViewers + return fmt.Sprintf("StoryViewers%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryViewers) TypeID() uint32 { + return StoryViewersTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryViewers) TypeName() string { + return "storyViewers" +} + +// TypeInfo returns info about TL type. +func (s *StoryViewers) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyViewers", + ID: StoryViewersTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "TotalCount", + SchemaName: "total_count", + }, + { + Name: "Viewers", + SchemaName: "viewers", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryViewers) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewers#b9fed56b as nil") + } + b.PutID(StoryViewersTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryViewers) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewers#b9fed56b as nil") + } + b.PutInt32(s.TotalCount) + b.PutInt(len(s.Viewers)) + for idx, v := range s.Viewers { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare storyViewers#b9fed56b: field viewers element with index %d: %w", idx, err) + } + } + b.PutString(s.NextOffset) + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryViewers) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewers#b9fed56b to nil") + } + if err := b.ConsumeID(StoryViewersTypeID); err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryViewers) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewers#b9fed56b to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field total_count: %w", err) + } + s.TotalCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field viewers: %w", err) + } + + if headerLen > 0 { + s.Viewers = make([]StoryViewer, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value StoryViewer + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare storyViewers#b9fed56b: field viewers: %w", err) + } + s.Viewers = append(s.Viewers, value) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field next_offset: %w", err) + } + s.NextOffset = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StoryViewers) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode storyViewers#b9fed56b as nil") + } + b.ObjStart() + b.PutID("storyViewers") + b.Comma() + b.FieldStart("total_count") + b.PutInt32(s.TotalCount) + b.Comma() + b.FieldStart("viewers") + b.ArrStart() + for idx, v := range s.Viewers { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode storyViewers#b9fed56b: field viewers element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("next_offset") + b.PutString(s.NextOffset) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StoryViewers) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode storyViewers#b9fed56b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("storyViewers"); err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: %w", err) + } + case "total_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field total_count: %w", err) + } + s.TotalCount = value + case "viewers": + if err := b.Arr(func(b tdjson.Decoder) error { + var value StoryViewer + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field viewers: %w", err) + } + s.Viewers = append(s.Viewers, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field viewers: %w", err) + } + case "next_offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storyViewers#b9fed56b: field next_offset: %w", err) + } + s.NextOffset = value + default: + return b.Skip() + } + return nil + }) +} + +// GetTotalCount returns value of TotalCount field. +func (s *StoryViewers) GetTotalCount() (value int32) { + if s == nil { + return + } + return s.TotalCount +} + +// GetViewers returns value of Viewers field. +func (s *StoryViewers) GetViewers() (value []StoryViewer) { + if s == nil { + return + } + return s.Viewers +} + +// GetNextOffset returns value of NextOffset field. +func (s *StoryViewers) GetNextOffset() (value string) { + if s == nil { + return + } + return s.NextOffset +} diff --git a/tdapi/tl_toggle_message_sender_is_blocked_gen.go b/tdapi/tl_toggle_message_sender_is_blocked_gen.go deleted file mode 100644 index 7c7d557c48..0000000000 --- a/tdapi/tl_toggle_message_sender_is_blocked_gen.go +++ /dev/null @@ -1,247 +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{} -) - -// ToggleMessageSenderIsBlockedRequest represents TL type `toggleMessageSenderIsBlocked#884f0ed5`. -type ToggleMessageSenderIsBlockedRequest struct { - // Identifier of a message sender to block/unblock - SenderID MessageSenderClass - // New value of is_blocked - IsBlocked bool -} - -// ToggleMessageSenderIsBlockedRequestTypeID is TL type id of ToggleMessageSenderIsBlockedRequest. -const ToggleMessageSenderIsBlockedRequestTypeID = 0x884f0ed5 - -// Ensuring interfaces in compile-time for ToggleMessageSenderIsBlockedRequest. -var ( - _ bin.Encoder = &ToggleMessageSenderIsBlockedRequest{} - _ bin.Decoder = &ToggleMessageSenderIsBlockedRequest{} - _ bin.BareEncoder = &ToggleMessageSenderIsBlockedRequest{} - _ bin.BareDecoder = &ToggleMessageSenderIsBlockedRequest{} -) - -func (t *ToggleMessageSenderIsBlockedRequest) Zero() bool { - if t == nil { - return true - } - if !(t.SenderID == nil) { - return false - } - if !(t.IsBlocked == false) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (t *ToggleMessageSenderIsBlockedRequest) String() string { - if t == nil { - return "ToggleMessageSenderIsBlockedRequest(nil)" - } - type Alias ToggleMessageSenderIsBlockedRequest - return fmt.Sprintf("ToggleMessageSenderIsBlockedRequest%+v", Alias(*t)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ToggleMessageSenderIsBlockedRequest) TypeID() uint32 { - return ToggleMessageSenderIsBlockedRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*ToggleMessageSenderIsBlockedRequest) TypeName() string { - return "toggleMessageSenderIsBlocked" -} - -// TypeInfo returns info about TL type. -func (t *ToggleMessageSenderIsBlockedRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "toggleMessageSenderIsBlocked", - ID: ToggleMessageSenderIsBlockedRequestTypeID, - } - if t == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "SenderID", - SchemaName: "sender_id", - }, - { - Name: "IsBlocked", - SchemaName: "is_blocked", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (t *ToggleMessageSenderIsBlockedRequest) Encode(b *bin.Buffer) error { - if t == nil { - return fmt.Errorf("can't encode toggleMessageSenderIsBlocked#884f0ed5 as nil") - } - b.PutID(ToggleMessageSenderIsBlockedRequestTypeID) - return t.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (t *ToggleMessageSenderIsBlockedRequest) EncodeBare(b *bin.Buffer) error { - if t == nil { - return fmt.Errorf("can't encode toggleMessageSenderIsBlocked#884f0ed5 as nil") - } - if t.SenderID == nil { - return fmt.Errorf("unable to encode toggleMessageSenderIsBlocked#884f0ed5: field sender_id is nil") - } - if err := t.SenderID.Encode(b); err != nil { - return fmt.Errorf("unable to encode toggleMessageSenderIsBlocked#884f0ed5: field sender_id: %w", err) - } - b.PutBool(t.IsBlocked) - return nil -} - -// Decode implements bin.Decoder. -func (t *ToggleMessageSenderIsBlockedRequest) Decode(b *bin.Buffer) error { - if t == nil { - return fmt.Errorf("can't decode toggleMessageSenderIsBlocked#884f0ed5 to nil") - } - if err := b.ConsumeID(ToggleMessageSenderIsBlockedRequestTypeID); err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: %w", err) - } - return t.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (t *ToggleMessageSenderIsBlockedRequest) DecodeBare(b *bin.Buffer) error { - if t == nil { - return fmt.Errorf("can't decode toggleMessageSenderIsBlocked#884f0ed5 to nil") - } - { - value, err := DecodeMessageSender(b) - if err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: field sender_id: %w", err) - } - t.SenderID = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: field is_blocked: %w", err) - } - t.IsBlocked = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (t *ToggleMessageSenderIsBlockedRequest) EncodeTDLibJSON(b tdjson.Encoder) error { - if t == nil { - return fmt.Errorf("can't encode toggleMessageSenderIsBlocked#884f0ed5 as nil") - } - b.ObjStart() - b.PutID("toggleMessageSenderIsBlocked") - b.Comma() - b.FieldStart("sender_id") - if t.SenderID == nil { - return fmt.Errorf("unable to encode toggleMessageSenderIsBlocked#884f0ed5: field sender_id is nil") - } - if err := t.SenderID.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode toggleMessageSenderIsBlocked#884f0ed5: field sender_id: %w", err) - } - b.Comma() - b.FieldStart("is_blocked") - b.PutBool(t.IsBlocked) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (t *ToggleMessageSenderIsBlockedRequest) DecodeTDLibJSON(b tdjson.Decoder) error { - if t == nil { - return fmt.Errorf("can't decode toggleMessageSenderIsBlocked#884f0ed5 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("toggleMessageSenderIsBlocked"); err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: %w", err) - } - case "sender_id": - value, err := DecodeTDLibJSONMessageSender(b) - if err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: field sender_id: %w", err) - } - t.SenderID = value - case "is_blocked": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode toggleMessageSenderIsBlocked#884f0ed5: field is_blocked: %w", err) - } - t.IsBlocked = value - default: - return b.Skip() - } - return nil - }) -} - -// GetSenderID returns value of SenderID field. -func (t *ToggleMessageSenderIsBlockedRequest) GetSenderID() (value MessageSenderClass) { - if t == nil { - return - } - return t.SenderID -} - -// GetIsBlocked returns value of IsBlocked field. -func (t *ToggleMessageSenderIsBlockedRequest) GetIsBlocked() (value bool) { - if t == nil { - return - } - return t.IsBlocked -} - -// ToggleMessageSenderIsBlocked invokes method toggleMessageSenderIsBlocked#884f0ed5 returning error if any. -func (c *Client) ToggleMessageSenderIsBlocked(ctx context.Context, request *ToggleMessageSenderIsBlockedRequest) error { - var ok Ok - - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err - } - return nil -} diff --git a/tdapi/tl_update_gen.go b/tdapi/tl_update_gen.go index 35b9943493..98116df676 100644 --- a/tdapi/tl_update_gen.go +++ b/tdapi/tl_update_gen.go @@ -8117,38 +8117,38 @@ func (u *UpdateChatIsMarkedAsUnread) GetIsMarkedAsUnread() (value bool) { return u.IsMarkedAsUnread } -// UpdateChatIsBlocked represents TL type `updateChatIsBlocked#88da7e40`. -type UpdateChatIsBlocked struct { +// UpdateChatBlockList represents TL type `updateChatBlockList#872af48e`. +type UpdateChatBlockList struct { // Chat identifier ChatID int64 - // New value of is_blocked - IsBlocked bool + // Block list to which the chat is added; may be null if none + BlockList BlockListClass } -// UpdateChatIsBlockedTypeID is TL type id of UpdateChatIsBlocked. -const UpdateChatIsBlockedTypeID = 0x88da7e40 +// UpdateChatBlockListTypeID is TL type id of UpdateChatBlockList. +const UpdateChatBlockListTypeID = 0x872af48e // construct implements constructor of UpdateClass. -func (u UpdateChatIsBlocked) construct() UpdateClass { return &u } +func (u UpdateChatBlockList) construct() UpdateClass { return &u } -// Ensuring interfaces in compile-time for UpdateChatIsBlocked. +// Ensuring interfaces in compile-time for UpdateChatBlockList. var ( - _ bin.Encoder = &UpdateChatIsBlocked{} - _ bin.Decoder = &UpdateChatIsBlocked{} - _ bin.BareEncoder = &UpdateChatIsBlocked{} - _ bin.BareDecoder = &UpdateChatIsBlocked{} + _ bin.Encoder = &UpdateChatBlockList{} + _ bin.Decoder = &UpdateChatBlockList{} + _ bin.BareEncoder = &UpdateChatBlockList{} + _ bin.BareDecoder = &UpdateChatBlockList{} - _ UpdateClass = &UpdateChatIsBlocked{} + _ UpdateClass = &UpdateChatBlockList{} ) -func (u *UpdateChatIsBlocked) Zero() bool { +func (u *UpdateChatBlockList) Zero() bool { if u == nil { return true } if !(u.ChatID == 0) { return false } - if !(u.IsBlocked == false) { + if !(u.BlockList == nil) { return false } @@ -8156,31 +8156,31 @@ func (u *UpdateChatIsBlocked) Zero() bool { } // String implements fmt.Stringer. -func (u *UpdateChatIsBlocked) String() string { +func (u *UpdateChatBlockList) String() string { if u == nil { - return "UpdateChatIsBlocked(nil)" + return "UpdateChatBlockList(nil)" } - type Alias UpdateChatIsBlocked - return fmt.Sprintf("UpdateChatIsBlocked%+v", Alias(*u)) + type Alias UpdateChatBlockList + return fmt.Sprintf("UpdateChatBlockList%+v", Alias(*u)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*UpdateChatIsBlocked) TypeID() uint32 { - return UpdateChatIsBlockedTypeID +func (*UpdateChatBlockList) TypeID() uint32 { + return UpdateChatBlockListTypeID } // TypeName returns name of type in TL schema. -func (*UpdateChatIsBlocked) TypeName() string { - return "updateChatIsBlocked" +func (*UpdateChatBlockList) TypeName() string { + return "updateChatBlockList" } // TypeInfo returns info about TL type. -func (u *UpdateChatIsBlocked) TypeInfo() tdp.Type { +func (u *UpdateChatBlockList) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "updateChatIsBlocked", - ID: UpdateChatIsBlockedTypeID, + Name: "updateChatBlockList", + ID: UpdateChatBlockListTypeID, } if u == nil { typ.Null = true @@ -8192,78 +8192,88 @@ func (u *UpdateChatIsBlocked) TypeInfo() tdp.Type { SchemaName: "chat_id", }, { - Name: "IsBlocked", - SchemaName: "is_blocked", + Name: "BlockList", + SchemaName: "block_list", }, } return typ } // Encode implements bin.Encoder. -func (u *UpdateChatIsBlocked) Encode(b *bin.Buffer) error { +func (u *UpdateChatBlockList) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatIsBlocked#88da7e40 as nil") + return fmt.Errorf("can't encode updateChatBlockList#872af48e as nil") } - b.PutID(UpdateChatIsBlockedTypeID) + b.PutID(UpdateChatBlockListTypeID) return u.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (u *UpdateChatIsBlocked) EncodeBare(b *bin.Buffer) error { +func (u *UpdateChatBlockList) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatIsBlocked#88da7e40 as nil") + return fmt.Errorf("can't encode updateChatBlockList#872af48e as nil") } b.PutInt53(u.ChatID) - b.PutBool(u.IsBlocked) + if u.BlockList == nil { + return fmt.Errorf("unable to encode updateChatBlockList#872af48e: field block_list is nil") + } + if err := u.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateChatBlockList#872af48e: field block_list: %w", err) + } return nil } // Decode implements bin.Decoder. -func (u *UpdateChatIsBlocked) Decode(b *bin.Buffer) error { +func (u *UpdateChatBlockList) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatIsBlocked#88da7e40 to nil") + return fmt.Errorf("can't decode updateChatBlockList#872af48e to nil") } - if err := b.ConsumeID(UpdateChatIsBlockedTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: %w", err) + if err := b.ConsumeID(UpdateChatBlockListTypeID); err != nil { + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: %w", err) } return u.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (u *UpdateChatIsBlocked) DecodeBare(b *bin.Buffer) error { +func (u *UpdateChatBlockList) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatIsBlocked#88da7e40 to nil") + return fmt.Errorf("can't decode updateChatBlockList#872af48e to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: field chat_id: %w", err) } u.ChatID = value } { - value, err := b.Bool() + value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: field is_blocked: %w", err) + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: field block_list: %w", err) } - u.IsBlocked = value + u.BlockList = value } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (u *UpdateChatIsBlocked) EncodeTDLibJSON(b tdjson.Encoder) error { +func (u *UpdateChatBlockList) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateChatIsBlocked#88da7e40 as nil") + return fmt.Errorf("can't encode updateChatBlockList#872af48e as nil") } b.ObjStart() - b.PutID("updateChatIsBlocked") + b.PutID("updateChatBlockList") b.Comma() b.FieldStart("chat_id") b.PutInt53(u.ChatID) b.Comma() - b.FieldStart("is_blocked") - b.PutBool(u.IsBlocked) + b.FieldStart("block_list") + if u.BlockList == nil { + return fmt.Errorf("unable to encode updateChatBlockList#872af48e: field block_list is nil") + } + if err := u.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateChatBlockList#872af48e: field block_list: %w", err) + } b.Comma() b.StripComma() b.ObjEnd() @@ -8271,29 +8281,29 @@ func (u *UpdateChatIsBlocked) EncodeTDLibJSON(b tdjson.Encoder) error { } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (u *UpdateChatIsBlocked) DecodeTDLibJSON(b tdjson.Decoder) error { +func (u *UpdateChatBlockList) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateChatIsBlocked#88da7e40 to nil") + return fmt.Errorf("can't decode updateChatBlockList#872af48e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: - if err := b.ConsumeID("updateChatIsBlocked"); err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: %w", err) + if err := b.ConsumeID("updateChatBlockList"); err != nil { + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: field chat_id: %w", err) } u.ChatID = value - case "is_blocked": - value, err := b.Bool() + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) if err != nil { - return fmt.Errorf("unable to decode updateChatIsBlocked#88da7e40: field is_blocked: %w", err) + return fmt.Errorf("unable to decode updateChatBlockList#872af48e: field block_list: %w", err) } - u.IsBlocked = value + u.BlockList = value default: return b.Skip() } @@ -8302,19 +8312,19 @@ func (u *UpdateChatIsBlocked) DecodeTDLibJSON(b tdjson.Decoder) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatIsBlocked) GetChatID() (value int64) { +func (u *UpdateChatBlockList) GetChatID() (value int64) { if u == nil { return } return u.ChatID } -// GetIsBlocked returns value of IsBlocked field. -func (u *UpdateChatIsBlocked) GetIsBlocked() (value bool) { +// GetBlockList returns value of BlockList field. +func (u *UpdateChatBlockList) GetBlockList() (value BlockListClass) { if u == nil { return } - return u.IsBlocked + return u.BlockList } // UpdateChatHasScheduledMessages represents TL type `updateChatHasScheduledMessages#7b14c2d7`. @@ -16089,6 +16099,484 @@ func (u *UpdateStoryDeleted) GetStoryID() (value int32) { return u.StoryID } +// UpdateStorySendSucceeded represents TL type `updateStorySendSucceeded#b9269e57`. +type UpdateStorySendSucceeded struct { + // The sent story + Story Story + // The previous temporary story identifier + OldStoryID int32 +} + +// UpdateStorySendSucceededTypeID is TL type id of UpdateStorySendSucceeded. +const UpdateStorySendSucceededTypeID = 0xb9269e57 + +// construct implements constructor of UpdateClass. +func (u UpdateStorySendSucceeded) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateStorySendSucceeded. +var ( + _ bin.Encoder = &UpdateStorySendSucceeded{} + _ bin.Decoder = &UpdateStorySendSucceeded{} + _ bin.BareEncoder = &UpdateStorySendSucceeded{} + _ bin.BareDecoder = &UpdateStorySendSucceeded{} + + _ UpdateClass = &UpdateStorySendSucceeded{} +) + +func (u *UpdateStorySendSucceeded) Zero() bool { + if u == nil { + return true + } + if !(u.Story.Zero()) { + return false + } + if !(u.OldStoryID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateStorySendSucceeded) String() string { + if u == nil { + return "UpdateStorySendSucceeded(nil)" + } + type Alias UpdateStorySendSucceeded + return fmt.Sprintf("UpdateStorySendSucceeded%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateStorySendSucceeded) TypeID() uint32 { + return UpdateStorySendSucceededTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateStorySendSucceeded) TypeName() string { + return "updateStorySendSucceeded" +} + +// TypeInfo returns info about TL type. +func (u *UpdateStorySendSucceeded) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateStorySendSucceeded", + ID: UpdateStorySendSucceededTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Story", + SchemaName: "story", + }, + { + Name: "OldStoryID", + SchemaName: "old_story_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateStorySendSucceeded) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendSucceeded#b9269e57 as nil") + } + b.PutID(UpdateStorySendSucceededTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateStorySendSucceeded) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendSucceeded#b9269e57 as nil") + } + if err := u.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendSucceeded#b9269e57: field story: %w", err) + } + b.PutInt32(u.OldStoryID) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateStorySendSucceeded) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendSucceeded#b9269e57 to nil") + } + if err := b.ConsumeID(UpdateStorySendSucceededTypeID); err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateStorySendSucceeded) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendSucceeded#b9269e57 to nil") + } + { + if err := u.Story.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: field story: %w", err) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: field old_story_id: %w", err) + } + u.OldStoryID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateStorySendSucceeded) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendSucceeded#b9269e57 as nil") + } + b.ObjStart() + b.PutID("updateStorySendSucceeded") + b.Comma() + b.FieldStart("story") + if err := u.Story.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendSucceeded#b9269e57: field story: %w", err) + } + b.Comma() + b.FieldStart("old_story_id") + b.PutInt32(u.OldStoryID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateStorySendSucceeded) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendSucceeded#b9269e57 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateStorySendSucceeded"); err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: %w", err) + } + case "story": + if err := u.Story.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: field story: %w", err) + } + case "old_story_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendSucceeded#b9269e57: field old_story_id: %w", err) + } + u.OldStoryID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStory returns value of Story field. +func (u *UpdateStorySendSucceeded) GetStory() (value Story) { + if u == nil { + return + } + return u.Story +} + +// GetOldStoryID returns value of OldStoryID field. +func (u *UpdateStorySendSucceeded) GetOldStoryID() (value int32) { + if u == nil { + return + } + return u.OldStoryID +} + +// UpdateStorySendFailed represents TL type `updateStorySendFailed#4418bca2`. +type UpdateStorySendFailed struct { + // The failed to send story + Story Story + // The cause of the failure; may be null if unknown + Error CanSendStoryResultClass + // An error code + ErrorCode int32 + // Error message + ErrorMessage string +} + +// UpdateStorySendFailedTypeID is TL type id of UpdateStorySendFailed. +const UpdateStorySendFailedTypeID = 0x4418bca2 + +// construct implements constructor of UpdateClass. +func (u UpdateStorySendFailed) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateStorySendFailed. +var ( + _ bin.Encoder = &UpdateStorySendFailed{} + _ bin.Decoder = &UpdateStorySendFailed{} + _ bin.BareEncoder = &UpdateStorySendFailed{} + _ bin.BareDecoder = &UpdateStorySendFailed{} + + _ UpdateClass = &UpdateStorySendFailed{} +) + +func (u *UpdateStorySendFailed) Zero() bool { + if u == nil { + return true + } + if !(u.Story.Zero()) { + return false + } + if !(u.Error == nil) { + return false + } + if !(u.ErrorCode == 0) { + return false + } + if !(u.ErrorMessage == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateStorySendFailed) String() string { + if u == nil { + return "UpdateStorySendFailed(nil)" + } + type Alias UpdateStorySendFailed + return fmt.Sprintf("UpdateStorySendFailed%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateStorySendFailed) TypeID() uint32 { + return UpdateStorySendFailedTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateStorySendFailed) TypeName() string { + return "updateStorySendFailed" +} + +// TypeInfo returns info about TL type. +func (u *UpdateStorySendFailed) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateStorySendFailed", + ID: UpdateStorySendFailedTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Story", + SchemaName: "story", + }, + { + Name: "Error", + SchemaName: "error", + }, + { + Name: "ErrorCode", + SchemaName: "error_code", + }, + { + Name: "ErrorMessage", + SchemaName: "error_message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateStorySendFailed) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendFailed#4418bca2 as nil") + } + b.PutID(UpdateStorySendFailedTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateStorySendFailed) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendFailed#4418bca2 as nil") + } + if err := u.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field story: %w", err) + } + if u.Error == nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field error is nil") + } + if err := u.Error.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field error: %w", err) + } + b.PutInt32(u.ErrorCode) + b.PutString(u.ErrorMessage) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateStorySendFailed) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendFailed#4418bca2 to nil") + } + if err := b.ConsumeID(UpdateStorySendFailedTypeID); err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateStorySendFailed) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendFailed#4418bca2 to nil") + } + { + if err := u.Story.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field story: %w", err) + } + } + { + value, err := DecodeCanSendStoryResult(b) + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error: %w", err) + } + u.Error = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error_code: %w", err) + } + u.ErrorCode = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error_message: %w", err) + } + u.ErrorMessage = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateStorySendFailed) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateStorySendFailed#4418bca2 as nil") + } + b.ObjStart() + b.PutID("updateStorySendFailed") + b.Comma() + b.FieldStart("story") + if err := u.Story.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field story: %w", err) + } + b.Comma() + b.FieldStart("error") + if u.Error == nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field error is nil") + } + if err := u.Error.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode updateStorySendFailed#4418bca2: field error: %w", err) + } + b.Comma() + b.FieldStart("error_code") + b.PutInt32(u.ErrorCode) + b.Comma() + b.FieldStart("error_message") + b.PutString(u.ErrorMessage) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateStorySendFailed) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateStorySendFailed#4418bca2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateStorySendFailed"); err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: %w", err) + } + case "story": + if err := u.Story.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field story: %w", err) + } + case "error": + value, err := DecodeTDLibJSONCanSendStoryResult(b) + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error: %w", err) + } + u.Error = value + case "error_code": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error_code: %w", err) + } + u.ErrorCode = value + case "error_message": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode updateStorySendFailed#4418bca2: field error_message: %w", err) + } + u.ErrorMessage = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStory returns value of Story field. +func (u *UpdateStorySendFailed) GetStory() (value Story) { + if u == nil { + return + } + return u.Story +} + +// GetError returns value of Error field. +func (u *UpdateStorySendFailed) GetError() (value CanSendStoryResultClass) { + if u == nil { + return + } + return u.Error +} + +// GetErrorCode returns value of ErrorCode field. +func (u *UpdateStorySendFailed) GetErrorCode() (value int32) { + if u == nil { + return + } + return u.ErrorCode +} + +// GetErrorMessage returns value of ErrorMessage field. +func (u *UpdateStorySendFailed) GetErrorMessage() (value string) { + if u == nil { + return + } + return u.ErrorMessage +} + // UpdateChatActiveStories represents TL type `updateChatActiveStories#79786c2c`. type UpdateChatActiveStories struct { // The new list of active stories @@ -16465,6 +16953,207 @@ func (u *UpdateStoryListChatCount) GetChatCount() (value int32) { return u.ChatCount } +// UpdateStoryStealthMode represents TL type `updateStoryStealthMode#6ff7bd1a`. +type UpdateStoryStealthMode struct { + // Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled + ActiveUntilDate int32 + // Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is + // no active cooldown + CooldownUntilDate int32 +} + +// UpdateStoryStealthModeTypeID is TL type id of UpdateStoryStealthMode. +const UpdateStoryStealthModeTypeID = 0x6ff7bd1a + +// construct implements constructor of UpdateClass. +func (u UpdateStoryStealthMode) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateStoryStealthMode. +var ( + _ bin.Encoder = &UpdateStoryStealthMode{} + _ bin.Decoder = &UpdateStoryStealthMode{} + _ bin.BareEncoder = &UpdateStoryStealthMode{} + _ bin.BareDecoder = &UpdateStoryStealthMode{} + + _ UpdateClass = &UpdateStoryStealthMode{} +) + +func (u *UpdateStoryStealthMode) Zero() bool { + if u == nil { + return true + } + if !(u.ActiveUntilDate == 0) { + return false + } + if !(u.CooldownUntilDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateStoryStealthMode) String() string { + if u == nil { + return "UpdateStoryStealthMode(nil)" + } + type Alias UpdateStoryStealthMode + return fmt.Sprintf("UpdateStoryStealthMode%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateStoryStealthMode) TypeID() uint32 { + return UpdateStoryStealthModeTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateStoryStealthMode) TypeName() string { + return "updateStoryStealthMode" +} + +// TypeInfo returns info about TL type. +func (u *UpdateStoryStealthMode) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateStoryStealthMode", + ID: UpdateStoryStealthModeTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ActiveUntilDate", + SchemaName: "active_until_date", + }, + { + Name: "CooldownUntilDate", + SchemaName: "cooldown_until_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateStoryStealthMode) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStoryStealthMode#6ff7bd1a as nil") + } + b.PutID(UpdateStoryStealthModeTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateStoryStealthMode) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateStoryStealthMode#6ff7bd1a as nil") + } + b.PutInt32(u.ActiveUntilDate) + b.PutInt32(u.CooldownUntilDate) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateStoryStealthMode) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStoryStealthMode#6ff7bd1a to nil") + } + if err := b.ConsumeID(UpdateStoryStealthModeTypeID); err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateStoryStealthMode) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateStoryStealthMode#6ff7bd1a to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: field active_until_date: %w", err) + } + u.ActiveUntilDate = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: field cooldown_until_date: %w", err) + } + u.CooldownUntilDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UpdateStoryStealthMode) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode updateStoryStealthMode#6ff7bd1a as nil") + } + b.ObjStart() + b.PutID("updateStoryStealthMode") + b.Comma() + b.FieldStart("active_until_date") + b.PutInt32(u.ActiveUntilDate) + b.Comma() + b.FieldStart("cooldown_until_date") + b.PutInt32(u.CooldownUntilDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UpdateStoryStealthMode) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode updateStoryStealthMode#6ff7bd1a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("updateStoryStealthMode"); err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: %w", err) + } + case "active_until_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: field active_until_date: %w", err) + } + u.ActiveUntilDate = value + case "cooldown_until_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode updateStoryStealthMode#6ff7bd1a: field cooldown_until_date: %w", err) + } + u.CooldownUntilDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetActiveUntilDate returns value of ActiveUntilDate field. +func (u *UpdateStoryStealthMode) GetActiveUntilDate() (value int32) { + if u == nil { + return + } + return u.ActiveUntilDate +} + +// GetCooldownUntilDate returns value of CooldownUntilDate field. +func (u *UpdateStoryStealthMode) GetCooldownUntilDate() (value int32) { + if u == nil { + return + } + return u.CooldownUntilDate +} + // UpdateOption represents TL type `updateOption#35b17404`. type UpdateOption struct { // The option name @@ -24849,7 +25538,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateChatHasProtectedContent: // updateChatHasProtectedContent#6b50071b // case *tdapi.UpdateChatIsTranslatable: // updateChatIsTranslatable#7b031617 // case *tdapi.UpdateChatIsMarkedAsUnread: // updateChatIsMarkedAsUnread#57853334 -// case *tdapi.UpdateChatIsBlocked: // updateChatIsBlocked#88da7e40 +// case *tdapi.UpdateChatBlockList: // updateChatBlockList#872af48e // case *tdapi.UpdateChatHasScheduledMessages: // updateChatHasScheduledMessages#7b14c2d7 // case *tdapi.UpdateChatFolders: // updateChatFolders#71a4b3a // case *tdapi.UpdateChatOnlineMemberCount: // updateChatOnlineMemberCount#1d0caa9d @@ -24886,8 +25575,11 @@ const UpdateClassName = "Update" // case *tdapi.UpdateUnreadChatCount: // updateUnreadChatCount#76e19242 // case *tdapi.UpdateStory: // updateStory#1906572f // case *tdapi.UpdateStoryDeleted: // updateStoryDeleted#7007eb9d +// case *tdapi.UpdateStorySendSucceeded: // updateStorySendSucceeded#b9269e57 +// case *tdapi.UpdateStorySendFailed: // updateStorySendFailed#4418bca2 // case *tdapi.UpdateChatActiveStories: // updateChatActiveStories#79786c2c // case *tdapi.UpdateStoryListChatCount: // updateStoryListChatCount#8833cd3f +// case *tdapi.UpdateStoryStealthMode: // updateStoryStealthMode#6ff7bd1a // case *tdapi.UpdateOption: // updateOption#35b17404 // case *tdapi.UpdateStickerSet: // updateStickerSet#70035dcc // case *tdapi.UpdateInstalledStickerSets: // updateInstalledStickerSets#82cd5388 @@ -25221,9 +25913,9 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case UpdateChatIsBlockedTypeID: - // Decoding updateChatIsBlocked#88da7e40. - v := UpdateChatIsBlocked{} + case UpdateChatBlockListTypeID: + // Decoding updateChatBlockList#872af48e. + v := UpdateChatBlockList{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -25480,6 +26172,20 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateStorySendSucceededTypeID: + // Decoding updateStorySendSucceeded#b9269e57. + v := UpdateStorySendSucceeded{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdateStorySendFailedTypeID: + // Decoding updateStorySendFailed#4418bca2. + v := UpdateStorySendFailed{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case UpdateChatActiveStoriesTypeID: // Decoding updateChatActiveStories#79786c2c. v := UpdateChatActiveStories{} @@ -25494,6 +26200,13 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateStoryStealthModeTypeID: + // Decoding updateStoryStealthMode#6ff7bd1a. + v := UpdateStoryStealthMode{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case UpdateOptionTypeID: // Decoding updateOption#35b17404. v := UpdateOption{} @@ -26024,9 +26737,9 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil - case "updateChatIsBlocked": - // Decoding updateChatIsBlocked#88da7e40. - v := UpdateChatIsBlocked{} + case "updateChatBlockList": + // Decoding updateChatBlockList#872af48e. + v := UpdateChatBlockList{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } @@ -26283,6 +26996,20 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateStorySendSucceeded": + // Decoding updateStorySendSucceeded#b9269e57. + v := UpdateStorySendSucceeded{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case "updateStorySendFailed": + // Decoding updateStorySendFailed#4418bca2. + v := UpdateStorySendFailed{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case "updateChatActiveStories": // Decoding updateChatActiveStories#79786c2c. v := UpdateChatActiveStories{} @@ -26297,6 +27024,13 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case "updateStoryStealthMode": + // Decoding updateStoryStealthMode#6ff7bd1a. + v := UpdateStoryStealthMode{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil case "updateOption": // Decoding updateOption#35b17404. v := UpdateOption{} diff --git a/tdapi/tl_user_full_info_gen.go b/tdapi/tl_user_full_info_gen.go index 6b5816f5a7..60075d012a 100644 --- a/tdapi/tl_user_full_info_gen.go +++ b/tdapi/tl_user_full_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// UserFullInfo represents TL type `userFullInfo#bf73d22c`. +// UserFullInfo represents TL type `userFullInfo#a53c620b`. type UserFullInfo struct { // User profile photo set by the current user for the contact; may be null. If null and // user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -43,8 +43,8 @@ type UserFullInfo struct { // null. If null and user.profile_photo is null, then the photo is empty; otherwise, it // is unknown. PublicPhoto ChatPhoto - // True, if the user is blocked by the current user - IsBlocked bool + // Block list to which the user is added; may be null if none + BlockList BlockListClass // True, if the user can be called CanBeCalled bool // True, if a video call can be created with the user @@ -72,7 +72,7 @@ type UserFullInfo struct { } // UserFullInfoTypeID is TL type id of UserFullInfo. -const UserFullInfoTypeID = 0xbf73d22c +const UserFullInfoTypeID = 0xa53c620b // Ensuring interfaces in compile-time for UserFullInfo. var ( @@ -95,7 +95,7 @@ func (u *UserFullInfo) Zero() bool { if !(u.PublicPhoto.Zero()) { return false } - if !(u.IsBlocked == false) { + if !(u.BlockList == nil) { return false } if !(u.CanBeCalled == false) { @@ -180,8 +180,8 @@ func (u *UserFullInfo) TypeInfo() tdp.Type { SchemaName: "public_photo", }, { - Name: "IsBlocked", - SchemaName: "is_blocked", + Name: "BlockList", + SchemaName: "block_list", }, { Name: "CanBeCalled", @@ -234,7 +234,7 @@ func (u *UserFullInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UserFullInfo) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#bf73d22c as nil") + return fmt.Errorf("can't encode userFullInfo#a53c620b as nil") } b.PutID(UserFullInfoTypeID) return u.EncodeBare(b) @@ -243,18 +243,23 @@ func (u *UserFullInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#bf73d22c as nil") + return fmt.Errorf("can't encode userFullInfo#a53c620b as nil") } if err := u.PersonalPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field personal_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field personal_photo: %w", err) } if err := u.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field photo: %w", err) } if err := u.PublicPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field public_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field public_photo: %w", err) + } + if u.BlockList == nil { + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field block_list is nil") + } + if err := u.BlockList.Encode(b); err != nil { + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field block_list: %w", err) } - b.PutBool(u.IsBlocked) b.PutBool(u.CanBeCalled) b.PutBool(u.SupportsVideoCalls) b.PutBool(u.HasPrivateCalls) @@ -263,17 +268,17 @@ func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { b.PutBool(u.HasPinnedStories) b.PutBool(u.NeedPhoneNumberPrivacyException) if err := u.Bio.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field bio: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field bio: %w", err) } b.PutInt(len(u.PremiumGiftOptions)) for idx, v := range u.PremiumGiftOptions { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare userFullInfo#bf73d22c: field premium_gift_options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare userFullInfo#a53c620b: field premium_gift_options element with index %d: %w", idx, err) } } b.PutInt32(u.GroupInCommonCount) if err := u.BotInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field bot_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field bot_info: %w", err) } return nil } @@ -281,10 +286,10 @@ func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UserFullInfo) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#bf73d22c to nil") + return fmt.Errorf("can't decode userFullInfo#a53c620b to nil") } if err := b.ConsumeID(UserFullInfoTypeID); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: %w", err) } return u.DecodeBare(b) } @@ -292,88 +297,88 @@ func (u *UserFullInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#bf73d22c to nil") + return fmt.Errorf("can't decode userFullInfo#a53c620b to nil") } { if err := u.PersonalPhoto.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field personal_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field personal_photo: %w", err) } } { if err := u.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field photo: %w", err) } } { if err := u.PublicPhoto.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field public_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field public_photo: %w", err) } } { - value, err := b.Bool() + value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field is_blocked: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field block_list: %w", err) } - u.IsBlocked = value + u.BlockList = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field can_be_called: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field can_be_called: %w", err) } u.CanBeCalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field supports_video_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field supports_video_calls: %w", err) } u.SupportsVideoCalls = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_private_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_private_calls: %w", err) } u.HasPrivateCalls = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_private_forwards: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_private_forwards: %w", err) } u.HasPrivateForwards = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_restricted_voice_and_video_note_messages: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_restricted_voice_and_video_note_messages: %w", err) } u.HasRestrictedVoiceAndVideoNoteMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_pinned_stories: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_pinned_stories: %w", err) } u.HasPinnedStories = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field need_phone_number_privacy_exception: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field need_phone_number_privacy_exception: %w", err) } u.NeedPhoneNumberPrivacyException = value } { if err := u.Bio.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field bio: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field bio: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field premium_gift_options: %w", err) } if headerLen > 0 { @@ -382,7 +387,7 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value PremiumPaymentOption if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare userFullInfo#bf73d22c: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode bare userFullInfo#a53c620b: field premium_gift_options: %w", err) } u.PremiumGiftOptions = append(u.PremiumGiftOptions, value) } @@ -390,13 +395,13 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field group_in_common_count: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field group_in_common_count: %w", err) } u.GroupInCommonCount = value } { if err := u.BotInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field bot_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field bot_info: %w", err) } } return nil @@ -405,28 +410,33 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#bf73d22c as nil") + return fmt.Errorf("can't encode userFullInfo#a53c620b as nil") } b.ObjStart() b.PutID("userFullInfo") b.Comma() b.FieldStart("personal_photo") if err := u.PersonalPhoto.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field personal_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field personal_photo: %w", err) } b.Comma() b.FieldStart("photo") if err := u.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field photo: %w", err) } b.Comma() b.FieldStart("public_photo") if err := u.PublicPhoto.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field public_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field public_photo: %w", err) } b.Comma() - b.FieldStart("is_blocked") - b.PutBool(u.IsBlocked) + b.FieldStart("block_list") + if u.BlockList == nil { + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field block_list is nil") + } + if err := u.BlockList.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field block_list: %w", err) + } b.Comma() b.FieldStart("can_be_called") b.PutBool(u.CanBeCalled) @@ -451,14 +461,14 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("bio") if err := u.Bio.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field bio: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field bio: %w", err) } b.Comma() b.FieldStart("premium_gift_options") b.ArrStart() for idx, v := range u.PremiumGiftOptions { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field premium_gift_options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field premium_gift_options element with index %d: %w", idx, err) } b.Comma() } @@ -470,7 +480,7 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("bot_info") if err := u.BotInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#bf73d22c: field bot_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#a53c620b: field bot_info: %w", err) } b.Comma() b.StripComma() @@ -481,99 +491,99 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (u *UserFullInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#bf73d22c to nil") + return fmt.Errorf("can't decode userFullInfo#a53c620b to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("userFullInfo"); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: %w", err) } case "personal_photo": if err := u.PersonalPhoto.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field personal_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field personal_photo: %w", err) } case "photo": if err := u.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field photo: %w", err) } case "public_photo": if err := u.PublicPhoto.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field public_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field public_photo: %w", err) } - case "is_blocked": - value, err := b.Bool() + case "block_list": + value, err := DecodeTDLibJSONBlockList(b) if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field is_blocked: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field block_list: %w", err) } - u.IsBlocked = value + u.BlockList = value case "can_be_called": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field can_be_called: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field can_be_called: %w", err) } u.CanBeCalled = value case "supports_video_calls": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field supports_video_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field supports_video_calls: %w", err) } u.SupportsVideoCalls = value case "has_private_calls": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_private_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_private_calls: %w", err) } u.HasPrivateCalls = value case "has_private_forwards": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_private_forwards: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_private_forwards: %w", err) } u.HasPrivateForwards = value case "has_restricted_voice_and_video_note_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_restricted_voice_and_video_note_messages: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_restricted_voice_and_video_note_messages: %w", err) } u.HasRestrictedVoiceAndVideoNoteMessages = value case "has_pinned_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field has_pinned_stories: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field has_pinned_stories: %w", err) } u.HasPinnedStories = value case "need_phone_number_privacy_exception": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field need_phone_number_privacy_exception: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field need_phone_number_privacy_exception: %w", err) } u.NeedPhoneNumberPrivacyException = value case "bio": if err := u.Bio.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field bio: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field bio: %w", err) } case "premium_gift_options": if err := b.Arr(func(b tdjson.Decoder) error { var value PremiumPaymentOption if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field premium_gift_options: %w", err) } u.PremiumGiftOptions = append(u.PremiumGiftOptions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field premium_gift_options: %w", err) } case "group_in_common_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field group_in_common_count: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field group_in_common_count: %w", err) } u.GroupInCommonCount = value case "bot_info": if err := u.BotInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#bf73d22c: field bot_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#a53c620b: field bot_info: %w", err) } default: return b.Skip() @@ -606,12 +616,12 @@ func (u *UserFullInfo) GetPublicPhoto() (value ChatPhoto) { return u.PublicPhoto } -// GetIsBlocked returns value of IsBlocked field. -func (u *UserFullInfo) GetIsBlocked() (value bool) { +// GetBlockList returns value of BlockList field. +func (u *UserFullInfo) GetBlockList() (value BlockListClass) { if u == nil { return } - return u.IsBlocked + return u.BlockList } // GetCanBeCalled returns value of CanBeCalled field.