From 0b8a2f54dd941ce9cc036fcfc542dd38465528d5 Mon Sep 17 00:00:00 2001 From: c0re100 Date: Wed, 16 Aug 2023 02:28:13 +0800 Subject: [PATCH] Update to TDLib 1.8.16 --- client/function.go | 188 ++++++- client/type.go | 1172 +++++++++++++++++++++++++++++++++++++++-- client/unmarshaler.go | 582 +++++++++++++++++++- data/td_api.tl | 256 +++++++-- 4 files changed, 2089 insertions(+), 109 deletions(-) diff --git a/client/function.go b/client/function.go index dc0c71c..3fde614 100755 --- a/client/function.go +++ b/client/function.go @@ -3218,7 +3218,7 @@ type SendInlineQueryResultMessageRequest struct { Options *MessageSendOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` - // Identifier of the inline result + // Identifier of the inline query result ResultId string `json:"result_id"` // 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") HideViaBot bool `json:"hide_via_bot"` @@ -5110,7 +5110,7 @@ type GetInlineQueryResultsRequest struct { UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` - // 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 `json:"offset"` } @@ -8416,14 +8416,53 @@ func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { return UnmarshalStory(result.Data) } +// Checks whether the current user can send a story +func (client *Client) CanSendStory() (CanSendStoryResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canSendStory", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(result.Data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(result.Data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(result.Data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(result.Data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type SendStoryRequest struct { // Content of the story Content InputStoryContent `json:"content"` + // Clickable rectangle areas to be shown on the story media; pass null if none + Areas *InputStoryAreas `json:"areas"` // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters Caption *FormattedText `json:"caption"` // The privacy settings for the story PrivacySettings StoryPrivacySettings `json:"privacy_settings"` - // 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 + // 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 ActivePeriod int32 `json:"active_period"` // Pass true to keep the story accessible after expiration IsPinned bool `json:"is_pinned"` @@ -8431,7 +8470,7 @@ type SendStoryRequest struct { ProtectContent bool `json:"protect_content"` } -// Sends a new story. Returns a temporary story with identifier 0 +// Sends a new story. Returns a temporary story func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { result, err := client.Send(Request{ meta: meta{ @@ -8439,6 +8478,7 @@ func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { }, Data: map[string]interface{}{ "content": req.Content, + "areas": req.Areas, "caption": req.Caption, "privacy_settings": req.PrivacySettings, "active_period": req.ActivePeriod, @@ -8462,6 +8502,8 @@ type EditStoryRequest struct { StoryId int32 `json:"story_id"` // New content of the story; pass null to keep the current content Content InputStoryContent `json:"content"` + // 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 `json:"areas"` // New story caption; pass null to keep the current caption Caption *FormattedText `json:"caption"` } @@ -8475,6 +8517,7 @@ func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { Data: map[string]interface{}{ "story_id": req.StoryId, "content": req.Content, + "areas": req.Areas, "caption": req.Caption, }, }) @@ -8792,24 +8835,94 @@ func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetStoryAvailableReactionsRequest struct { + // Number of reaction per row, 5-25 + RowSize int32 `json:"row_size"` +} + +// Returns reactions, which can be chosen for a story +func (client *Client) GetStoryAvailableReactions(req *GetStoryAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryAvailableReactions", + }, + Data: map[string]interface{}{ + "row_size": req.RowSize, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAvailableReactions(result.Data) +} + +type SetStoryReactionRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` + // Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users + ReactionType ReactionType `json:"reaction_type"` + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool `json:"update_recent_reactions"` +} + +// Changes chosen reaction on a story +func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryReaction", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reaction_type": req.ReactionType, + "update_recent_reactions": req.UpdateRecentReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetStoryViewersRequest struct { // Story identifier StoryId int32 `json:"story_id"` - // A viewer from which to return next viewers; pass null to get results from the beginning - OffsetViewer *MessageViewer `json:"offset_viewer"` - // The maximum number of story viewers to return For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + // Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers + Query string `json:"query"` + // Pass true to get only contacts; pass false to get all relevant viewers + OnlyContacts bool `json:"only_contacts"` + // Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date + PreferWithReaction bool `json:"prefer_with_reaction"` + // 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 `json:"offset"` + // The maximum number of story viewers to return Limit int32 `json:"limit"` } -// 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) For optimal performance, the number of returned stories is chosen by TDLib -func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*MessageViewers, error) { +// Returns viewers of a story. The method can be called if story.can_get_viewers == true +func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewers, error) { result, err := client.Send(Request{ meta: meta{ Type: "getStoryViewers", }, Data: map[string]interface{}{ "story_id": req.StoryId, - "offset_viewer": req.OffsetViewer, + "query": req.Query, + "only_contacts": req.OnlyContacts, + "prefer_with_reaction": req.PreferWithReaction, + "offset": req.Offset, "limit": req.Limit, }, }) @@ -8821,7 +8934,7 @@ func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*MessageView return nil, buildResponseError(result.Data) } - return UnmarshalMessageViewers(result.Data) + return UnmarshalStoryViewers(result.Data) } type ReportStoryRequest struct { @@ -8859,6 +8972,25 @@ func (client *Client) ReportStory(req *ReportStoryRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +func (client *Client) ActivateStoryStealthMode() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "activateStoryStealthMode", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetAttachmentMenuBotRequest struct { // Bot's user identifier BotUserId int64 `json:"bot_user_id"` @@ -11198,22 +11330,22 @@ func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRe return UnmarshalFilePart(result.Data) } -type ToggleMessageSenderIsBlockedRequest struct { +type SetMessageSenderBlockListRequest struct { // Identifier of a message sender to block/unblock SenderId MessageSender `json:"sender_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` + // New block list for the message sender; pass null to unblock the message sender + BlockList BlockList `json:"block_list"` } -// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked -func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlockedRequest) (*Ok, error) { +// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked +func (client *Client) SetMessageSenderBlockList(req *SetMessageSenderBlockListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleMessageSenderIsBlocked", + Type: "setMessageSenderBlockList", }, Data: map[string]interface{}{ "sender_id": req.SenderId, - "is_blocked": req.IsBlocked, + "block_list": req.BlockList, }, }) if err != nil { @@ -11263,6 +11395,8 @@ func (client *Client) BlockMessageSenderFromReplies(req *BlockMessageSenderFromR } type GetBlockedMessageSendersRequest struct { + // Block list from which to return users + BlockList BlockList `json:"block_list"` // Number of users and chats to skip in the result; must be non-negative Offset int32 `json:"offset"` // The maximum number of users and chats to return; up to 100 @@ -11276,6 +11410,7 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ Type: "getBlockedMessageSenders", }, Data: map[string]interface{}{ + "block_list": req.BlockList, "offset": req.Offset, "limit": req.Limit, }, @@ -13166,7 +13301,7 @@ func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, } type SetDefaultGroupAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + // Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` } @@ -13192,7 +13327,7 @@ func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdm } type SetDefaultChannelAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to channels; may be null + // Default administrator rights for adding the bot to channels; pass null to remove default rights DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` } @@ -18410,8 +18545,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(result.Data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(result.Data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(result.Data) @@ -18521,12 +18656,21 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(result.Data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(result.Data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(result.Data) + case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(result.Data) case TypeUpdateStoryListChatCount: return UnmarshalUpdateStoryListChatCount(result.Data) + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) diff --git a/client/type.go b/client/type.go index 0b5c612..b618326 100755 --- a/client/type.go +++ b/client/type.go @@ -80,12 +80,14 @@ const ( ClassLanguagePackStringValue = "LanguagePackStringValue" ClassPremiumLimitType = "PremiumLimitType" ClassPremiumFeature = "PremiumFeature" + ClassPremiumStoryFeature = "PremiumStoryFeature" ClassPremiumSource = "PremiumSource" ClassStorePaymentPurpose = "StorePaymentPurpose" ClassDeviceToken = "DeviceToken" ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" ClassInputBackground = "InputBackground" + ClassCanSendStoryResult = "CanSendStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -103,9 +105,12 @@ const ( ClassReportReason = "ReportReason" ClassTargetChat = "TargetChat" ClassInternalLinkType = "InternalLinkType" + ClassStoryAreaType = "StoryAreaType" + ClassInputStoryAreaType = "InputStoryAreaType" ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" + ClassBlockList = "BlockList" ClassFileType = "FileType" ClassNetworkType = "NetworkType" ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" @@ -363,6 +368,12 @@ const ( ClassConnectedWebsites = "ConnectedWebsites" ClassMessageLink = "MessageLink" ClassMessageLinkInfo = "MessageLinkInfo" + ClassStoryViewer = "StoryViewer" + ClassStoryViewers = "StoryViewers" + ClassStoryAreaPosition = "StoryAreaPosition" + ClassStoryArea = "StoryArea" + ClassInputStoryArea = "InputStoryArea" + ClassInputStoryAreas = "InputStoryAreas" ClassStoryVideo = "StoryVideo" ClassStoryInteractionInfo = "StoryInteractionInfo" ClassStory = "Story" @@ -1175,6 +1186,9 @@ const ( TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount" TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount" + TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount" + TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" + TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -1190,10 +1204,18 @@ const ( TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon" TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" TypePremiumFeatureRealTimeChatTranslation = "premiumFeatureRealTimeChatTranslation" + TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" + TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" + TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" + TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" + TypePremiumStoryFeatureCustomExpirationDuration = "premiumStoryFeatureCustomExpirationDuration" + TypePremiumStoryFeatureSaveStories = "premiumStoryFeatureSaveStories" + TypePremiumStoryFeatureLinksAndFormatting = "premiumStoryFeatureLinksAndFormatting" TypePremiumLimit = "premiumLimit" TypePremiumFeatures = "premiumFeatures" TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" TypePremiumSourceFeature = "premiumSourceFeature" + TypePremiumSourceStoryFeature = "premiumSourceStoryFeature" TypePremiumSourceLink = "premiumSourceLink" TypePremiumSourceSettings = "premiumSourceSettings" TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" @@ -1225,6 +1247,11 @@ const ( TypeThemeSettings = "themeSettings" TypeChatTheme = "chatTheme" TypeHashtags = "hashtags" + TypeCanSendStoryResultOk = "canSendStoryResultOk" + TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded" + TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded" + TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded" + TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" @@ -1399,6 +1426,17 @@ const ( TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" + TypeStoryViewer = "storyViewer" + TypeStoryViewers = "storyViewers" + TypeStoryAreaPosition = "storyAreaPosition" + TypeStoryAreaTypeLocation = "storyAreaTypeLocation" + TypeStoryAreaTypeVenue = "storyAreaTypeVenue" + TypeStoryArea = "storyArea" + TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" + TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" + TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" + TypeInputStoryArea = "inputStoryArea" + TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" TypeStoryContentPhoto = "storyContentPhoto" TypeStoryContentVideo = "storyContentVideo" @@ -1412,6 +1450,8 @@ const ( TypeStories = "stories" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" + TypeBlockListMain = "blockListMain" + TypeBlockListStories = "blockListStories" TypeFilePart = "filePart" TypeFileTypeNone = "fileTypeNone" TypeFileTypeAnimation = "fileTypeAnimation" @@ -1554,7 +1594,7 @@ const ( TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" TypeUpdateChatIsTranslatable = "updateChatIsTranslatable" TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatIsBlocked = "updateChatIsBlocked" + TypeUpdateChatBlockList = "updateChatBlockList" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" TypeUpdateChatFolders = "updateChatFolders" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" @@ -1591,8 +1631,11 @@ const ( TypeUpdateUnreadChatCount = "updateUnreadChatCount" TypeUpdateStory = "updateStory" TypeUpdateStoryDeleted = "updateStoryDeleted" + TypeUpdateStorySendSucceeded = "updateStorySendSucceeded" + TypeUpdateStorySendFailed = "updateStorySendFailed" TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" + TypeUpdateStoryStealthMode = "updateStoryStealthMode" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -2010,6 +2053,11 @@ type PremiumFeature interface { PremiumFeatureType() string } +// Describes a story feature available to Premium users +type PremiumStoryFeature interface { + PremiumStoryFeatureType() string +} + // Describes a source from which the Premium features screen is opened type PremiumSource interface { PremiumSourceType() string @@ -2040,6 +2088,11 @@ type InputBackground interface { InputBackgroundType() string } +// Represents result of checking whether the current user can send a story +type CanSendStoryResult interface { + CanSendStoryResultType() string +} + // Represents result of checking whether the current session can be used to transfer a chat ownership to another user type CanTransferOwnershipResult interface { CanTransferOwnershipResultType() string @@ -2125,6 +2178,16 @@ type InternalLinkType interface { InternalLinkTypeType() string } +// Describes type of a clickable rectangle area on a story media +type StoryAreaType interface { + StoryAreaTypeType() string +} + +// Describes type of a clickable rectangle area on a story media to be added +type InputStoryAreaType interface { + InputStoryAreaTypeType() string +} + // Contains the content of a story type StoryContent interface { StoryContentType() string @@ -2140,6 +2203,11 @@ type StoryList interface { StoryListType() string } +// Describes a type of a block list +type BlockList interface { + BlockListType() string +} + // Represents the type of a file type FileType interface { FileTypeType() string @@ -3557,7 +3625,7 @@ func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { return TypeThumbnailFormatJpeg } -// The thumbnail is in static GIF format. It will be used only for some bot inline results +// The thumbnail is in static GIF format. It will be used only for some bot inline query results type ThumbnailFormatGif struct{ meta } @@ -6127,8 +6195,8 @@ type UserFullInfo struct { Photo *ChatPhoto `json:"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. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos PublicPhoto *ChatPhoto `json:"public_photo"` - // True, if the user is blocked by the current user - IsBlocked bool `json:"is_blocked"` + // Block list to which the user is added; may be null if none + BlockList BlockList `json:"block_list"` // True, if the user can be called CanBeCalled bool `json:"can_be_called"` // True, if a video call can be created with the user @@ -6149,7 +6217,7 @@ type UserFullInfo struct { PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // For bots, information about the bot; may be null + // For bots, information about the bot; may be null if the user isn't a bot BotInfo *BotInfo `json:"bot_info"` } @@ -6169,6 +6237,51 @@ func (*UserFullInfo) GetType() string { return TypeUserFullInfo } +func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + PersonalPhoto *ChatPhoto `json:"personal_photo"` + Photo *ChatPhoto `json:"photo"` + PublicPhoto *ChatPhoto `json:"public_photo"` + BlockList json.RawMessage `json:"block_list"` + CanBeCalled bool `json:"can_be_called"` + SupportsVideoCalls bool `json:"supports_video_calls"` + HasPrivateCalls bool `json:"has_private_calls"` + HasPrivateForwards bool `json:"has_private_forwards"` + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + HasPinnedStories bool `json:"has_pinned_stories"` + NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` + Bio *FormattedText `json:"bio"` + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` + GroupInCommonCount int32 `json:"group_in_common_count"` + BotInfo *BotInfo `json:"bot_info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + userFullInfo.PersonalPhoto = tmp.PersonalPhoto + userFullInfo.Photo = tmp.Photo + userFullInfo.PublicPhoto = tmp.PublicPhoto + userFullInfo.CanBeCalled = tmp.CanBeCalled + userFullInfo.SupportsVideoCalls = tmp.SupportsVideoCalls + userFullInfo.HasPrivateCalls = tmp.HasPrivateCalls + userFullInfo.HasPrivateForwards = tmp.HasPrivateForwards + userFullInfo.HasRestrictedVoiceAndVideoNoteMessages = tmp.HasRestrictedVoiceAndVideoNoteMessages + userFullInfo.HasPinnedStories = tmp.HasPinnedStories + userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException + userFullInfo.Bio = tmp.Bio + userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions + userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount + userFullInfo.BotInfo = tmp.BotInfo + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + userFullInfo.BlockList = fieldBlockList + + return nil +} + // Represents a list of users type Users struct { meta @@ -7459,7 +7572,7 @@ type SupergroupFullInfo struct { HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` // Identifier of the supergroup sticker set; 0 if none StickerSetId JsonInt64 `json:"sticker_set_id"` - // Location to which the supergroup is connected; may be null + // Location to which the supergroup is connected; may be null if none Location *ChatLocation `json:"location"` // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` @@ -8404,9 +8517,9 @@ type Message struct { SenderId MessageSender `json:"sender_id"` // Chat identifier ChatId int64 `json:"chat_id"` - // The sending state of the message; may be null + // The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent SendingState MessageSendingState `json:"sending_state"` - // The scheduling state of the message; may be null + // The scheduling state of the message; may be null if the message isn't scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` // True, if the message is outgoing IsOutgoing bool `json:"is_outgoing"` @@ -8446,9 +8559,9 @@ type Message struct { Date int32 `json:"date"` // Point in time (Unix timestamp) when the message was last edited EditDate int32 `json:"edit_date"` - // Information about the initial message sender; may be null + // Information about the initial message sender; may be null if none or unknown ForwardInfo *MessageForwardInfo `json:"forward_info"` - // Information about interactions with the message; may be null + // Information about interactions with the message; may be null if none InteractionInfo *MessageInteractionInfo `json:"interaction_info"` // Information about unread reactions added to the message UnreadReactions []*UnreadReaction `json:"unread_reactions"` @@ -8472,7 +8585,7 @@ type Message struct { RestrictionReason string `json:"restriction_reason"` // Content of the message Content MessageContent `json:"content"` - // Reply markup for the message; may be null + // Reply markup for the message; may be null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -10327,20 +10440,20 @@ type Chat struct { Photo *ChatPhotoInfo `json:"photo"` // Actions that non-administrator chat members are allowed to take in the chat Permissions *ChatPermissions `json:"permissions"` - // Last message in the chat; may be null + // Last message in the chat; may be null if none or unknown LastMessage *Message `json:"last_message"` // Positions of the chat in chat lists Positions []*ChatPosition `json:"positions"` // 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 MessageSender `json:"message_sender_id"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` // True, if chat content can't be saved locally, forwarded, or copied HasProtectedContent bool `json:"has_protected_content"` // True, if translation of all messages in the chat must be suggested to the user IsTranslatable bool `json:"is_translatable"` // True, if the chat is marked as unread IsMarkedAsUnread bool `json:"is_marked_as_unread"` - // True, if the chat is blocked by the current user and private messages from the chat can't be received - IsBlocked bool `json:"is_blocked"` // True, if the chat has scheduled messages HasScheduledMessages bool `json:"has_scheduled_messages"` // True, if the chat messages can be deleted only for the current user while other users will continue to see the messages @@ -10371,15 +10484,15 @@ type Chat struct { Background *ChatBackground `json:"background"` // If non-empty, name of a theme, set for the chat ThemeName string `json:"theme_name"` - // Information about actions which must be possible to do through the chat action bar; may be null + // Information about actions which must be possible to do through the chat action bar; may be null if none ActionBar ChatActionBar `json:"action_bar"` // Information about video chat of the chat VideoChat *VideoChat `json:"video_chat"` - // Information about pending join requests; may be null + // Information about pending join requests; may be null if none PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` // Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` - // A draft of a message in the chat; may be null + // A draft of a message in the chat; may be null if none DraftMessage *DraftMessage `json:"draft_message"` // 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 ClientData string `json:"client_data"` @@ -10411,10 +10524,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastMessage *Message `json:"last_message"` Positions []*ChatPosition `json:"positions"` MessageSenderId json.RawMessage `json:"message_sender_id"` + BlockList json.RawMessage `json:"block_list"` HasProtectedContent bool `json:"has_protected_content"` IsTranslatable bool `json:"is_translatable"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` - IsBlocked bool `json:"is_blocked"` HasScheduledMessages bool `json:"has_scheduled_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` @@ -10452,7 +10565,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.HasProtectedContent = tmp.HasProtectedContent chat.IsTranslatable = tmp.IsTranslatable chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread - chat.IsBlocked = tmp.IsBlocked chat.HasScheduledMessages = tmp.HasScheduledMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers @@ -10479,6 +10591,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) chat.MessageSenderId = fieldMessageSenderId + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + chat.BlockList = fieldBlockList + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) chat.AvailableReactions = fieldAvailableReactions @@ -10690,7 +10805,7 @@ func (*ChatActionBarInviteMembers) ChatActionBarType() string { return TypeChatActionBarInviteMembers } -// 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, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +// 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, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportAddBlock struct { meta // 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 @@ -11610,7 +11725,7 @@ type MessageThreadInfo struct { UnreadMessageCount int32 `json:"unread_message_count"` // The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) Messages []*Message `json:"messages"` - // A draft of a message in the message thread; may be null + // A draft of a message in the message thread; may be null if none DraftMessage *DraftMessage `json:"draft_message"` } @@ -11748,7 +11863,7 @@ type ForumTopic struct { UnreadReactionCount int32 `json:"unread_reaction_count"` // Notification settings for the topic NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // A draft of a message in the topic; may be null + // A draft of a message in the topic; may be null if none DraftMessage *DraftMessage `json:"draft_message"` } @@ -27675,6 +27790,81 @@ func (*PremiumLimitTypeActiveStoryCount) PremiumLimitTypeType() string { return TypePremiumLimitTypeActiveStoryCount } +// The maximum number of stories sent per week +type PremiumLimitTypeWeeklySentStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeWeeklySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeWeeklySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +func (*PremiumLimitTypeWeeklySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +// The maximum number of stories sent per month +type PremiumLimitTypeMonthlySentStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeMonthlySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeMonthlySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +func (*PremiumLimitTypeMonthlySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +// The maximum length of captions of sent stories +type PremiumLimitTypeStoryCaptionLength struct{ + meta +} + +func (entity *PremiumLimitTypeStoryCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStoryCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStoryCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStoryCaptionLength) GetType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + +func (*PremiumLimitTypeStoryCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + // Increased limits type PremiumFeatureIncreasedLimits struct{ meta @@ -27925,7 +28115,7 @@ func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { return TypePremiumFeatureProfileBadge } -// A emoji status shown along with the user's name +// An emoji status shown along with the user's name type PremiumFeatureEmojiStatus struct{ meta } @@ -28050,6 +28240,181 @@ func (*PremiumFeatureRealTimeChatTranslation) PremiumFeatureType() string { return TypePremiumFeatureRealTimeChatTranslation } +// Allowed to use many additional features for stories +type PremiumFeatureUpgradedStories struct{ + meta +} + +func (entity *PremiumFeatureUpgradedStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUpgradedStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUpgradedStories) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUpgradedStories) GetType() string { + return TypePremiumFeatureUpgradedStories +} + +func (*PremiumFeatureUpgradedStories) PremiumFeatureType() string { + return TypePremiumFeatureUpgradedStories +} + +// User stories are displayed before stories of non-premium contacts +type PremiumStoryFeaturePriorityOrder struct{ + meta +} + +func (entity *PremiumStoryFeaturePriorityOrder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePriorityOrder + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePriorityOrder) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePriorityOrder) GetType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +func (*PremiumStoryFeaturePriorityOrder) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +// The ability to hide the fact that the user viewed other's stories +type PremiumStoryFeatureStealthMode struct{ + meta +} + +func (entity *PremiumStoryFeatureStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureStealthMode) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureStealthMode) GetType() string { + return TypePremiumStoryFeatureStealthMode +} + +func (*PremiumStoryFeatureStealthMode) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureStealthMode +} + +// The ability to check who opened the current user's stories after they expire +type PremiumStoryFeaturePermanentViewsHistory struct{ + meta +} + +func (entity *PremiumStoryFeaturePermanentViewsHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePermanentViewsHistory + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +func (*PremiumStoryFeaturePermanentViewsHistory) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +// The ability to set custom expiration duration for stories +type PremiumStoryFeatureCustomExpirationDuration struct{ + meta +} + +func (entity *PremiumStoryFeatureCustomExpirationDuration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureCustomExpirationDuration + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +func (*PremiumStoryFeatureCustomExpirationDuration) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +// The ability to save other's unprotected stories +type PremiumStoryFeatureSaveStories struct{ + meta +} + +func (entity *PremiumStoryFeatureSaveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureSaveStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureSaveStories) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureSaveStories) GetType() string { + return TypePremiumStoryFeatureSaveStories +} + +func (*PremiumStoryFeatureSaveStories) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureSaveStories +} + +// The ability to use links and formatting in story caption +type PremiumStoryFeatureLinksAndFormatting struct{ + meta +} + +func (entity *PremiumStoryFeatureLinksAndFormatting) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureLinksAndFormatting + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + +func (*PremiumStoryFeatureLinksAndFormatting) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + // Contains information about a limit, increased for Premium users type PremiumLimit struct { meta @@ -28234,6 +28599,49 @@ func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) err return nil } +// A user tried to use a Premium story feature +type PremiumSourceStoryFeature struct { + meta + // The used feature + Feature PremiumStoryFeature `json:"feature"` +} + +func (entity *PremiumSourceStoryFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceStoryFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceStoryFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceStoryFeature) GetType() string { + return TypePremiumSourceStoryFeature +} + +func (*PremiumSourceStoryFeature) PremiumSourceType() string { + return TypePremiumSourceStoryFeature +} + +func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumStoryFeature(tmp.Feature) + premiumSourceStoryFeature.Feature = fieldFeature + + return nil +} + // A user opened an internal link of the type internalLinkTypePremiumFeatures type PremiumSourceLink struct { meta @@ -29194,6 +29602,135 @@ func (*Hashtags) GetType() string { return TypeHashtags } +// A story can be sent +type CanSendStoryResultOk struct{ + meta +} + +func (entity *CanSendStoryResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultOk) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultOk) GetType() string { + return TypeCanSendStoryResultOk +} + +func (*CanSendStoryResultOk) CanSendStoryResultType() string { + return TypeCanSendStoryResultOk +} + +// The user must subscribe to Telegram Premium to be able to post stories +type CanSendStoryResultPremiumNeeded struct{ + meta +} + +func (entity *CanSendStoryResultPremiumNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultPremiumNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultPremiumNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultPremiumNeeded) GetType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +func (*CanSendStoryResultPremiumNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +// 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 +type CanSendStoryResultActiveStoryLimitExceeded struct{ + meta +} + +func (entity *CanSendStoryResultActiveStoryLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultActiveStoryLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultWeeklyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultWeeklyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultWeeklyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +func (*CanSendStoryResultWeeklyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultMonthlyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultMonthlyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultMonthlyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded +} + +func (*CanSendStoryResultMonthlyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded +} + // The session can be used type CanTransferOwnershipResultOk struct{ meta @@ -31327,8 +31864,10 @@ func (*JsonValueObject) JsonValueType() string { } // The story can be viewed by everyone -type StoryPrivacySettingsEveryone struct{ +type StoryPrivacySettingsEveryone struct { meta + // Identifiers of the users that can't see the story; always unknown and empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` } func (entity *StoryPrivacySettingsEveryone) MarshalJSON() ([]byte, error) { @@ -31354,7 +31893,7 @@ func (*StoryPrivacySettingsEveryone) StoryPrivacySettingsType() string { // The story can be viewed by all contacts except chosen users type StoryPrivacySettingsContacts struct { meta - // 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 `json:"except_user_ids"` } @@ -31406,7 +31945,7 @@ func (*StoryPrivacySettingsCloseFriends) StoryPrivacySettingsType() string { // The story can be viewed by certain specified users type StoryPrivacySettingsSelectedContacts struct { meta - // Identifiers of the users; always empty for non-owned stories + // Identifiers of the users; always unknown and empty for non-owned stories UserIds []int64 `json:"user_ids"` } @@ -34119,6 +34658,368 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } +// Represents a viewer of a story +type StoryViewer struct { + meta + // User identifier of the viewer + UserId int64 `json:"user_id"` + // Approximate point in time (Unix timestamp) when the story was viewed + ViewDate int32 `json:"view_date"` + // Block list to which the user is added; may be null if none + BlockList BlockList `json:"block_list"` + // Type of the reaction that was chosen by the user; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` +} + +func (entity *StoryViewer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryViewer + + return json.Marshal((*stub)(entity)) +} + +func (*StoryViewer) GetClass() string { + return ClassStoryViewer +} + +func (*StoryViewer) GetType() string { + return TypeStoryViewer +} + +func (storyViewer *StoryViewer) UnmarshalJSON(data []byte) error { + var tmp struct { + UserId int64 `json:"user_id"` + ViewDate int32 `json:"view_date"` + BlockList json.RawMessage `json:"block_list"` + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyViewer.UserId = tmp.UserId + storyViewer.ViewDate = tmp.ViewDate + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + storyViewer.BlockList = fieldBlockList + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + storyViewer.ChosenReactionType = fieldChosenReactionType + + return nil +} + +// Represents a list of story viewers +type StoryViewers struct { + meta + // Approximate total number of story viewers found + TotalCount int32 `json:"total_count"` + // List of story viewers + Viewers []*StoryViewer `json:"viewers"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *StoryViewers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryViewers + + return json.Marshal((*stub)(entity)) +} + +func (*StoryViewers) GetClass() string { + return ClassStoryViewers +} + +func (*StoryViewers) GetType() string { + return TypeStoryViewers +} + +// Describes position of a clickable rectangle area on a story media +type StoryAreaPosition struct { + meta + // The abscissa of the rectangle's center, as a percentage of the media width + XPercentage float64 `json:"x_percentage"` + // The ordinate of the rectangle's center, as a percentage of the media height + YPercentage float64 `json:"y_percentage"` + // The width of the rectangle, as a percentage of the media width + WidthPercentage float64 `json:"width_percentage"` + // The ordinate of the rectangle's center, as a percentage of the media height + HeightPercentage float64 `json:"height_percentage"` + // Clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 `json:"rotation_angle"` +} + +func (entity *StoryAreaPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaPosition + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaPosition) GetClass() string { + return ClassStoryAreaPosition +} + +func (*StoryAreaPosition) GetType() string { + return TypeStoryAreaPosition +} + +// An area pointing to a location +type StoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeLocation) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeLocation) GetType() string { + return TypeStoryAreaTypeLocation +} + +func (*StoryAreaTypeLocation) StoryAreaTypeType() string { + return TypeStoryAreaTypeLocation +} + +// An area pointing to a venue +type StoryAreaTypeVenue struct { + meta + // Information about the venue + Venue *Venue `json:"venue"` +} + +func (entity *StoryAreaTypeVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeVenue + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeVenue) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeVenue) GetType() string { + return TypeStoryAreaTypeVenue +} + +func (*StoryAreaTypeVenue) StoryAreaTypeType() string { + return TypeStoryAreaTypeVenue +} + +// Describes a clickable rectangle area on a story media +type StoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type StoryAreaType `json:"type"` +} + +func (entity *StoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*StoryArea) GetClass() string { + return ClassStoryArea +} + +func (*StoryArea) GetType() string { + return TypeStoryArea +} + +func (storyArea *StoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyArea.Position = tmp.Position + + fieldType, _ := UnmarshalStoryAreaType(tmp.Type) + storyArea.Type = fieldType + + return nil +} + +// An area pointing to a location +type InputStoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *InputStoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeLocation) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeLocation) GetType() string { + return TypeInputStoryAreaTypeLocation +} + +func (*InputStoryAreaTypeLocation) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeLocation +} + +// An area pointing to a venue found by the bot getOption("venue_search_bot_username") +type InputStoryAreaTypeFoundVenue struct { + meta + // Identifier of the inline query, used to found the venue + QueryId JsonInt64 `json:"query_id"` + // Identifier of the inline query result + ResultId string `json:"result_id"` +} + +func (entity *InputStoryAreaTypeFoundVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeFoundVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeFoundVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeFoundVenue) GetType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +func (*InputStoryAreaTypeFoundVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +// An area pointing to a venue already added to the story +type InputStoryAreaTypePreviousVenue struct { + meta + // Provider of the venue + VenueProvider string `json:"venue_provider"` + // Identifier of the venue in the provider database + VenueId string `json:"venue_id"` +} + +func (entity *InputStoryAreaTypePreviousVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypePreviousVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypePreviousVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypePreviousVenue) GetType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +func (*InputStoryAreaTypePreviousVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +// Describes a clickable rectangle area on a story media to be added +type InputStoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type InputStoryAreaType `json:"type"` +} + +func (entity *InputStoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryArea) GetClass() string { + return ClassInputStoryArea +} + +func (*InputStoryArea) GetType() string { + return TypeInputStoryArea +} + +func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryArea.Position = tmp.Position + + fieldType, _ := UnmarshalInputStoryAreaType(tmp.Type) + inputStoryArea.Type = fieldType + + return nil +} + +// Contains a list of story areas to be added +type InputStoryAreas struct { + meta + // List of 0-10 input story areas + Areas []*InputStoryArea `json:"areas"` +} + +func (entity *InputStoryAreas) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreas + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreas) GetClass() string { + return ClassInputStoryAreas +} + +func (*InputStoryAreas) GetType() string { + return TypeInputStoryAreas +} + // Describes a video file sent in a story type StoryVideo struct { meta @@ -34398,6 +35299,8 @@ type StoryInteractionInfo struct { meta // Number of times the story was viewed ViewCount int32 `json:"view_count"` + // Number of reactions added to the story + ReactionCount int32 `json:"reaction_count"` // Identifiers of at most 3 recent viewers of the story RecentViewerUserIds []int64 `json:"recent_viewer_user_ids"` } @@ -34427,6 +35330,8 @@ type Story struct { SenderChatId int64 `json:"sender_chat_id"` // Point in time (Unix timestamp) when the story was published Date int32 `json:"date"` + // True, if the story is being sent by the current user + IsBeingSent bool `json:"is_being_sent"` // True, if the story is being edited by the current user IsBeingEdited bool `json:"is_being_edited"` // True, if the story was edited @@ -34445,10 +35350,14 @@ type Story struct { HasExpiredViewers bool `json:"has_expired_viewers"` // Information about interactions with the story; may be null if the story isn't owned or there were no interactions InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + // Type of the chosen reaction; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` // Privacy rules affecting story visibility; may be approximate for non-owned stories PrivacySettings StoryPrivacySettings `json:"privacy_settings"` // Content of the story Content StoryContent `json:"content"` + // Clickable areas to be shown on the story content + Areas []*StoryArea `json:"areas"` // Caption of the story Caption *FormattedText `json:"caption"` } @@ -34474,6 +35383,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { Id int32 `json:"id"` SenderChatId int64 `json:"sender_chat_id"` Date int32 `json:"date"` + IsBeingSent bool `json:"is_being_sent"` IsBeingEdited bool `json:"is_being_edited"` IsEdited bool `json:"is_edited"` IsPinned bool `json:"is_pinned"` @@ -34483,8 +35393,10 @@ func (story *Story) UnmarshalJSON(data []byte) error { CanGetViewers bool `json:"can_get_viewers"` HasExpiredViewers bool `json:"has_expired_viewers"` InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` PrivacySettings json.RawMessage `json:"privacy_settings"` Content json.RawMessage `json:"content"` + Areas []*StoryArea `json:"areas"` Caption *FormattedText `json:"caption"` } @@ -34496,6 +35408,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.Id = tmp.Id story.SenderChatId = tmp.SenderChatId story.Date = tmp.Date + story.IsBeingSent = tmp.IsBeingSent story.IsBeingEdited = tmp.IsBeingEdited story.IsEdited = tmp.IsEdited story.IsPinned = tmp.IsPinned @@ -34505,8 +35418,12 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.CanGetViewers = tmp.CanGetViewers story.HasExpiredViewers = tmp.HasExpiredViewers story.InteractionInfo = tmp.InteractionInfo + story.Areas = tmp.Areas story.Caption = tmp.Caption + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + story.ChosenReactionType = fieldChosenReactionType + fieldPrivacySettings, _ := UnmarshalStoryPrivacySettings(tmp.PrivacySettings) story.PrivacySettings = fieldPrivacySettings @@ -34624,6 +35541,56 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { return nil } +// The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +type BlockListMain struct{ + meta +} + +func (entity *BlockListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListMain + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListMain) GetClass() string { + return ClassBlockList +} + +func (*BlockListMain) GetType() string { + return TypeBlockListMain +} + +func (*BlockListMain) BlockListType() string { + return TypeBlockListMain +} + +// The block list that disallows viewing of stories of the current user +type BlockListStories struct{ + meta +} + +func (entity *BlockListStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListStories + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListStories) GetClass() string { + return ClassBlockList +} + +func (*BlockListStories) GetType() string { + return TypeBlockListStories +} + +func (*BlockListStories) BlockListType() string { + return TypeBlockListStories +} + // Contains a part of a file type FilePart struct { meta @@ -38929,32 +39896,51 @@ func (*UpdateChatIsMarkedAsUnread) UpdateType() string { } // A chat was blocked or unblocked -type UpdateChatIsBlocked struct { +type UpdateChatBlockList struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` } -func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatBlockList) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatIsBlocked + type stub UpdateChatBlockList return json.Marshal((*stub)(entity)) } -func (*UpdateChatIsBlocked) GetClass() string { +func (*UpdateChatBlockList) GetClass() string { return ClassUpdate } -func (*UpdateChatIsBlocked) GetType() string { - return TypeUpdateChatIsBlocked +func (*UpdateChatBlockList) GetType() string { + return TypeUpdateChatBlockList } -func (*UpdateChatIsBlocked) UpdateType() string { - return TypeUpdateChatIsBlocked +func (*UpdateChatBlockList) UpdateType() string { + return TypeUpdateChatBlockList +} + +func (updateChatBlockList *UpdateChatBlockList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + BlockList json.RawMessage `json:"block_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatBlockList.ChatId = tmp.ChatId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + updateChatBlockList.BlockList = fieldBlockList + + return nil } // A chat's has_scheduled_messages field has changed @@ -40201,6 +41187,91 @@ func (*UpdateStoryDeleted) UpdateType() string { return TypeUpdateStoryDeleted } +// A story has been successfully sent +type UpdateStorySendSucceeded struct { + meta + // The sent story + Story *Story `json:"story"` + // The previous temporary story identifier + OldStoryId int32 `json:"old_story_id"` +} + +func (entity *UpdateStorySendSucceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendSucceeded + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendSucceeded) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendSucceeded) GetType() string { + return TypeUpdateStorySendSucceeded +} + +func (*UpdateStorySendSucceeded) UpdateType() string { + return TypeUpdateStorySendSucceeded +} + +// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +type UpdateStorySendFailed struct { + meta + // The failed to send story + Story *Story `json:"story"` + // The cause of the failure; may be null if unknown + Error CanSendStoryResult `json:"error"` + // An error code + ErrorCode int32 `json:"error_code"` + // Error message + ErrorMessage string `json:"error_message"` +} + +func (entity *UpdateStorySendFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendFailed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendFailed) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendFailed) GetType() string { + return TypeUpdateStorySendFailed +} + +func (*UpdateStorySendFailed) UpdateType() string { + return TypeUpdateStorySendFailed +} + +func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) error { + var tmp struct { + Story *Story `json:"story"` + Error json.RawMessage `json:"error"` + ErrorCode int32 `json:"error_code"` + ErrorMessage string `json:"error_message"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStorySendFailed.Story = tmp.Story + updateStorySendFailed.ErrorCode = tmp.ErrorCode + updateStorySendFailed.ErrorMessage = tmp.ErrorMessage + + fieldError, _ := UnmarshalCanSendStoryResult(tmp.Error) + updateStorySendFailed.Error = fieldError + + return nil +} + // The list of active stories posted by a specific chat has changed type UpdateChatActiveStories struct { meta @@ -40276,6 +41347,35 @@ func (updateStoryListChatCount *UpdateStoryListChatCount) UnmarshalJSON(data []b return nil } +// Story stealth mode settings have changed +type UpdateStoryStealthMode struct { + meta + // Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled + ActiveUntilDate int32 `json:"active_until_date"` + // Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *UpdateStoryStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryStealthMode) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryStealthMode) GetType() string { + return TypeUpdateStoryStealthMode +} + +func (*UpdateStoryStealthMode) UpdateType() string { + return TypeUpdateStoryStealthMode +} + // An option changed its value type UpdateOption struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index e1c1f78..ced4391 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -3633,6 +3633,15 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeActiveStoryCount: return UnmarshalPremiumLimitTypeActiveStoryCount(data) + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) + + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) + + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3706,6 +3715,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureRealTimeChatTranslation: return UnmarshalPremiumFeatureRealTimeChatTranslation(data) + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3725,6 +3737,52 @@ func UnmarshalListOfPremiumFeature(dataList []json.RawMessage) ([]PremiumFeature return list, nil } +func UnmarshalPremiumStoryFeature(data json.RawMessage) (PremiumStoryFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) + + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) + + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) + + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) + + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) + + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumStoryFeature(dataList []json.RawMessage) ([]PremiumStoryFeature, error) { + list := []PremiumStoryFeature{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumStoryFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { var meta meta @@ -3740,6 +3798,9 @@ func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { case TypePremiumSourceFeature: return UnmarshalPremiumSourceFeature(data) + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) + case TypePremiumSourceLink: return UnmarshalPremiumSourceLink(data) @@ -3974,6 +4035,49 @@ func UnmarshalListOfInputBackground(dataList []json.RawMessage) ([]InputBackgrou return list, nil } +func UnmarshalCanSendStoryResult(data json.RawMessage) (CanSendStoryResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCanSendStoryResult(dataList []json.RawMessage) ([]CanSendStoryResult, error) { + list := []CanSendStoryResult{} + + for _, data := range dataList { + entity, err := UnmarshalCanSendStoryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { var meta meta @@ -4930,6 +5034,77 @@ func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLink return list, nil } +func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) + + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryAreaType(dataList []json.RawMessage) ([]StoryAreaType, error) { + list := []StoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) + + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) + + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStoryAreaType, error) { + list := []InputStoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { var meta meta @@ -5035,6 +5210,40 @@ func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { return list, nil } +func UnmarshalBlockList(data json.RawMessage) (BlockList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBlockList(dataList []json.RawMessage) ([]BlockList, error) { + list := []BlockList{} + + for _, data := range dataList { + entity, err := UnmarshalBlockList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalFileType(data json.RawMessage) (FileType, error) { var meta meta @@ -5772,8 +5981,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) @@ -5883,12 +6092,21 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) + case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(data) case TypeUpdateStoryListChatCount: return UnmarshalUpdateStoryListChatCount(data) + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -12149,6 +12367,30 @@ func UnmarshalPremiumLimitTypeActiveStoryCount(data json.RawMessage) (*PremiumLi return &resp, err } +func UnmarshalPremiumLimitTypeWeeklySentStoryCount(data json.RawMessage) (*PremiumLimitTypeWeeklySentStoryCount, error) { + var resp PremiumLimitTypeWeeklySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeMonthlySentStoryCount(data json.RawMessage) (*PremiumLimitTypeMonthlySentStoryCount, error) { + var resp PremiumLimitTypeMonthlySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeStoryCaptionLength(data json.RawMessage) (*PremiumLimitTypeStoryCaptionLength, error) { + var resp PremiumLimitTypeStoryCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { var resp PremiumFeatureIncreasedLimits @@ -12269,6 +12511,62 @@ func UnmarshalPremiumFeatureRealTimeChatTranslation(data json.RawMessage) (*Prem return &resp, err } +func UnmarshalPremiumFeatureUpgradedStories(data json.RawMessage) (*PremiumFeatureUpgradedStories, error) { + var resp PremiumFeatureUpgradedStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { + var resp PremiumStoryFeaturePriorityOrder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureStealthMode(data json.RawMessage) (*PremiumStoryFeatureStealthMode, error) { + var resp PremiumStoryFeatureStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePermanentViewsHistory(data json.RawMessage) (*PremiumStoryFeaturePermanentViewsHistory, error) { + var resp PremiumStoryFeaturePermanentViewsHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureCustomExpirationDuration(data json.RawMessage) (*PremiumStoryFeatureCustomExpirationDuration, error) { + var resp PremiumStoryFeatureCustomExpirationDuration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureSaveStories(data json.RawMessage) (*PremiumStoryFeatureSaveStories, error) { + var resp PremiumStoryFeatureSaveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureLinksAndFormatting(data json.RawMessage) (*PremiumStoryFeatureLinksAndFormatting, error) { + var resp PremiumStoryFeatureLinksAndFormatting + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumLimit(data json.RawMessage) (*PremiumLimit, error) { var resp PremiumLimit @@ -12301,6 +12599,14 @@ func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, return &resp, err } +func UnmarshalPremiumSourceStoryFeature(data json.RawMessage) (*PremiumSourceStoryFeature, error) { + var resp PremiumSourceStoryFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumSourceLink(data json.RawMessage) (*PremiumSourceLink, error) { var resp PremiumSourceLink @@ -12549,6 +12855,46 @@ func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { return &resp, err } +func UnmarshalCanSendStoryResultOk(data json.RawMessage) (*CanSendStoryResultOk, error) { + var resp CanSendStoryResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultPremiumNeeded(data json.RawMessage) (*CanSendStoryResultPremiumNeeded, error) { + var resp CanSendStoryResultPremiumNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanSendStoryResultActiveStoryLimitExceeded, error) { + var resp CanSendStoryResultActiveStoryLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultWeeklyLimitExceeded(data json.RawMessage) (*CanSendStoryResultWeeklyLimitExceeded, error) { + var resp CanSendStoryResultWeeklyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultMonthlyLimitExceeded(data json.RawMessage) (*CanSendStoryResultMonthlyLimitExceeded, error) { + var resp CanSendStoryResultMonthlyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { var resp CanTransferOwnershipResultOk @@ -13941,6 +14287,94 @@ func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) { return &resp, err } +func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) { + var resp StoryViewer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) { + var resp StoryViewers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { + var resp StoryAreaPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) { + var resp StoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, error) { + var resp StoryAreaTypeVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { + var resp StoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaTypeLocation, error) { + var resp InputStoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) { + var resp InputStoryAreaTypeFoundVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) { + var resp InputStoryAreaTypePreviousVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { + var resp InputStoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreas(data json.RawMessage) (*InputStoryAreas, error) { + var resp InputStoryAreas + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { var resp StoryVideo @@ -14045,6 +14479,22 @@ func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error return &resp, err } +func UnmarshalBlockListMain(data json.RawMessage) (*BlockListMain, error) { + var resp BlockListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBlockListStories(data json.RawMessage) (*BlockListStories, error) { + var resp BlockListStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFilePart(data json.RawMessage) (*FilePart, error) { var resp FilePart @@ -15181,8 +15631,8 @@ func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMar return &resp, err } -func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { - var resp UpdateChatIsBlocked +func UnmarshalUpdateChatBlockList(data json.RawMessage) (*UpdateChatBlockList, error) { + var resp UpdateChatBlockList err := json.Unmarshal(data, &resp) @@ -15477,6 +15927,22 @@ func UnmarshalUpdateStoryDeleted(data json.RawMessage) (*UpdateStoryDeleted, err return &resp, err } +func UnmarshalUpdateStorySendSucceeded(data json.RawMessage) (*UpdateStorySendSucceeded, error) { + var resp UpdateStorySendSucceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStorySendFailed(data json.RawMessage) (*UpdateStorySendFailed, error) { + var resp UpdateStorySendFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatActiveStories(data json.RawMessage) (*UpdateChatActiveStories, error) { var resp UpdateChatActiveStories @@ -15493,6 +15959,14 @@ func UnmarshalUpdateStoryListChatCount(data json.RawMessage) (*UpdateStoryListCh return &resp, err } +func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthMode, error) { + var resp UpdateStoryStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { var resp UpdateOption @@ -18188,6 +18662,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeActiveStoryCount: return UnmarshalPremiumLimitTypeActiveStoryCount(data) + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) + + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) + + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + case TypePremiumFeatureIncreasedLimits: return UnmarshalPremiumFeatureIncreasedLimits(data) @@ -18233,6 +18716,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureRealTimeChatTranslation: return UnmarshalPremiumFeatureRealTimeChatTranslation(data) + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) + + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) + + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) + + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) + + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) + + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) + + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) + case TypePremiumLimit: return UnmarshalPremiumLimit(data) @@ -18245,6 +18749,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumSourceFeature: return UnmarshalPremiumSourceFeature(data) + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) + case TypePremiumSourceLink: return UnmarshalPremiumSourceLink(data) @@ -18338,6 +18845,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeHashtags: return UnmarshalHashtags(data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) + case TypeCanTransferOwnershipResultOk: return UnmarshalCanTransferOwnershipResultOk(data) @@ -18860,6 +19382,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageLinkInfo: return UnmarshalMessageLinkInfo(data) + case TypeStoryViewer: + return UnmarshalStoryViewer(data) + + case TypeStoryViewers: + return UnmarshalStoryViewers(data) + + case TypeStoryAreaPosition: + return UnmarshalStoryAreaPosition(data) + + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) + + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) + + case TypeStoryArea: + return UnmarshalStoryArea(data) + + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) + + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) + + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) + + case TypeInputStoryArea: + return UnmarshalInputStoryArea(data) + + case TypeInputStoryAreas: + return UnmarshalInputStoryAreas(data) + case TypeStoryVideo: return UnmarshalStoryVideo(data) @@ -18899,6 +19454,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActiveStories: return UnmarshalChatActiveStories(data) + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + case TypeFilePart: return UnmarshalFilePart(data) @@ -19325,8 +19886,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) @@ -19436,12 +19997,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) + case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(data) case TypeUpdateStoryListChatCount: return UnmarshalUpdateStoryListChatCount(data) + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) diff --git a/data/td_api.tl b/data/td_api.tl index 0da63c6..d69567b 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -251,7 +251,7 @@ minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; //@description The thumbnail is in JPEG format thumbnailFormatJpeg = 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 = ThumbnailFormat; //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos @@ -751,7 +751,7 @@ botInfo short_description:string description:string photo:photo animation:animat //-If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo //@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. //-If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos -//@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 @@ -762,8 +762,8 @@ botInfo short_description:string description:string photo:photo animation:animat //@bio A short user bio; may be null for bots //@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 -userFullInfo 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; +//@bot_info For bots, information about the bot; may be null if the user isn't a bot +userFullInfo 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 @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -997,7 +997,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators //@sticker_set_id Identifier of the supergroup sticker set; 0 if none -//@location Location to which the supergroup is connected; may be null +//@location Location to which the supergroup is connected; may be null if none //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none @@ -1154,8 +1154,8 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message //@chat_id Chat identifier -//@sending_state The sending state of the message; may be null -//@scheduling_state The scheduling state of the message; may be null +//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent +//@scheduling_state The scheduling state of the message; may be null if the message isn't scheduled //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application @@ -1175,8 +1175,8 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited -//@forward_info Information about the initial message sender; may be null -//@interaction_info Information about interactions with the message; may be null +//@forward_info Information about the initial message sender; may be null if none or unknown +//@interaction_info Information about interactions with the message; may be null if none //@unread_reactions Information about unread reactions added to the message //@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs @@ -1188,7 +1188,7 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message -//@reply_markup Reply markup for the message; may be null +//@reply_markup Reply markup for the message; may be null if none message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null @@ -1477,13 +1477,13 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@title Chat title //@photo Chat photo; may be null //@permissions Actions that non-administrator chat members are allowed to take in the chat -//@last_message Last message in the chat; may be null +//@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 @@ -1499,13 +1499,13 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date //@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat -//@action_bar Information about actions which must be possible to do through the chat action bar; may be null +//@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none //@video_chat Information about video chat of the chat -//@pending_join_requests Information about pending join requests; may be null +//@pending_join_requests Information about pending join requests; may be null if none //@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 +//@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 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 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 @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1539,7 +1539,7 @@ chatActionBarReportUnrelatedLocation = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited chatActionBarInviteMembers = 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, //-or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@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 @@ -1689,7 +1689,7 @@ webAppInfo launch_id:int64 url:string = WebAppInfo; //@reply_info Information about the message thread; may be null for forum topic threads //@unread_message_count Approximate number of unread messages in the message thread //@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) -//@draft_message A draft of a message in the message thread; may be null +//@draft_message A draft of a message in the message thread; may be null if none messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; @@ -1718,7 +1718,7 @@ forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_ //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic //@notification_settings Notification settings for the topic -//@draft_message A draft of a message in the topic; may be null +//@draft_message A draft of a message in the topic; may be null if none forumTopic info:forumTopicInfo last_message:message is_pinned: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 draft_message:draftMessage = ForumTopic; //@description Describes a list of forum topics @@ -3991,6 +3991,15 @@ premiumLimitTypeShareableChatFolderCount = PremiumLimitType; //@description The maximum number of active stories premiumLimitTypeActiveStoryCount = PremiumLimitType; +//@description The maximum number of stories sent per week +premiumLimitTypeWeeklySentStoryCount = PremiumLimitType; + +//@description The maximum number of stories sent per month +premiumLimitTypeMonthlySentStoryCount = PremiumLimitType; + +//@description The maximum length of captions of sent stories +premiumLimitTypeStoryCaptionLength = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -4024,7 +4033,7 @@ premiumFeatureAdvancedChatManagement = PremiumFeature; //@description A badge in the user's profile premiumFeatureProfileBadge = PremiumFeature; -//@description A emoji status shown along with the user's name +//@description An emoji status shown along with the user's name premiumFeatureEmojiStatus = PremiumFeature; //@description Profile photo animation on message and chat screens @@ -4039,6 +4048,30 @@ premiumFeatureAppIcons = PremiumFeature; //@description Allowed to translate chat messages real-time premiumFeatureRealTimeChatTranslation = PremiumFeature; +//@description Allowed to use many additional features for stories +premiumFeatureUpgradedStories = PremiumFeature; + + +//@class PremiumStoryFeature @description Describes a story feature available to Premium users + +//@description User stories are displayed before stories of non-premium contacts +premiumStoryFeaturePriorityOrder = PremiumStoryFeature; + +//@description The ability to hide the fact that the user viewed other's stories +premiumStoryFeatureStealthMode = PremiumStoryFeature; + +//@description The ability to check who opened the current user's stories after they expire +premiumStoryFeaturePermanentViewsHistory = PremiumStoryFeature; + +//@description The ability to set custom expiration duration for stories +premiumStoryFeatureCustomExpirationDuration = PremiumStoryFeature; + +//@description The ability to save other's unprotected stories +premiumStoryFeatureSaveStories = PremiumStoryFeature; + +//@description The ability to use links and formatting in story caption +premiumStoryFeatureLinksAndFormatting = PremiumStoryFeature; + //@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; @@ -4058,6 +4091,9 @@ premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource; //@description A user tried to use a Premium feature @feature The used feature premiumSourceFeature feature:PremiumFeature = PremiumSource; +//@description A user tried to use a Premium story feature @feature The used feature +premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; + //@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link premiumSourceLink referrer:string = PremiumSource; @@ -4196,6 +4232,24 @@ chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = hashtags 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 = CanSendStoryResult; + +//@description The user must subscribe to Telegram Premium to be able to post stories +canSendStoryResultPremiumNeeded = 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 = 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 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 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 @@ -4497,16 +4551,16 @@ jsonValueObject members:vector = JsonValue; //@class StoryPrivacySettings @description Describes privacy settings of a story -//@description The story can be viewed by everyone -storyPrivacySettingsEveryone = StoryPrivacySettings; +//@description The story can be viewed by everyone @except_user_ids Identifiers of the users that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsEveryone 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 +//@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 unknown and empty for non-owned stories storyPrivacySettingsContacts except_user_ids:vector = StoryPrivacySettings; //@description The story can be viewed by all close friends storyPrivacySettingsCloseFriends = StoryPrivacySettings; -//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always empty for non-owned stories +//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always unknown and empty for non-owned stories storyPrivacySettingsSelectedContacts user_ids:vector = StoryPrivacySettings; @@ -4907,6 +4961,65 @@ messageLink link:string is_public:Bool = MessageLink; messageLinkInfo 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 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 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 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 location:location = StoryAreaType; + +//@description An area pointing to a venue @venue Information about the venue +storyAreaTypeVenue venue:venue = StoryAreaType; + + +//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area +storyArea 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 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 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 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 position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; + +//@description Contains a list of story areas to be added @areas List of 0-10 input story areas +inputStoryAreas areas:vector = InputStoryAreas; + + //@description Describes a video file sent in a story //@duration Duration of the video, in seconds //@width Video width @@ -4958,13 +5071,15 @@ storyListArchive = 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 view_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; +storyInteractionInfo 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 @@ -4974,10 +5089,12 @@ storyInteractionInfo view_count:int32 recent_viewer_user_ids:vector = Sto //@can_get_viewers True, if users viewed the story can be received through getStoryViewers //@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago //@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions +//@chosen_reaction_type Type of the chosen reaction; may be null if none //@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories //@content Content of the story +//@areas Clickable areas to be shown on the story content //@caption Caption of the story -story id:int32 sender_chat_id:int53 date:int32 is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo privacy_settings:StoryPrivacySettings content:StoryContent caption:formattedText = Story; +story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; //@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories stories total_count:int32 stories:vector = Stories; @@ -4997,6 +5114,15 @@ storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; chatActiveStories 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 = BlockList; + +//@description The block list that disallows viewing of stories of the current user +blockListStories = BlockList; + + //@description Contains a part of a file @data File bytes filePart data:bytes = FilePart; @@ -5608,8 +5734,8 @@ updateChatIsTranslatable chat_id:int53 is_translatable:Bool = Update; //@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; -//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked -updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; +//@description A chat was blocked or unblocked @chat_id Chat identifier @block_list Block list to which the chat is added; may be null if none +updateChatBlockList chat_id:int53 block_list:BlockList = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; @@ -5764,6 +5890,16 @@ updateStory story:story = Update; //@description A story became inaccessible @story_sender_chat_id Identifier of the chat that posted the story @story_id Story identifier updateStoryDeleted 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 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 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 active_stories:chatActiveStories = Update; @@ -5771,6 +5907,11 @@ updateChatActiveStories active_stories:chatActiveStories = Update; //@description Number of chats in a story list has changed @story_list The story list @chat_count Approximate total number of chats with active stories in the list updateStoryListChatCount 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 active_until_date:int32 cooldown_until_date:int32 = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -6505,7 +6646,7 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@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 chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; @@ -6831,7 +6972,7 @@ shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:i //@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 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 @@ -7309,20 +7450,25 @@ readChatList chat_list:ChatList = Ok; //@only_local Pass true to get only locally available information without sending network requests getStory 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 = 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 content:InputStoryContent caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; +sendStory 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 story_id:int32 content:InputStoryContent caption:formattedText = Ok; +editStory 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 @privacy_settings The new privacy settigs for the story setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; @@ -7372,13 +7518,24 @@ openStory story_sender_chat_id:int53 story_id:int32 = Ok; //@story_id The identifier of the story closeStory 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) -//-For optimal performance, the number of returned stories is chosen by TDLib +//@description Returns reactions, which can be chosen for a story @row_size Number of reaction per row, 5-25 +getStoryAvailableReactions 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 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 -//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit -getStoryViewers story_id:int32 offset_viewer:messageViewer limit:int32 = MessageViewers; +getStoryViewers 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 @@ -7387,6 +7544,10 @@ getStoryViewers story_id:int32 offset_viewer:messageViewer limit:int32 = Message //@text Additional report details; 0-1024 characters reportStory 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 +//-and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +activateStoryStealthMode = Ok; + //@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; @@ -7761,8 +7922,10 @@ getGroupCallStreams group_call_id:int32 = GroupCallStreams; getGroupCallStreamSegment 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 @sender_id Identifier of a message sender to block/unblock @is_blocked New value of is_blocked -toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; +//@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 +//@block_list New block list for the message sender; pass null to unblock the message sender +setMessageSenderBlockList 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 @@ -7771,8 +7934,11 @@ toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@report_spam Pass true to report the sender to the Telegram moderators blockMessageSenderFromReplies 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 @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 offset:int32 limit:int32 = MessageSenders; +//@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 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 @@ -8040,10 +8206,10 @@ setMenuButton user_id:int53 menu_button:botMenuButton = Ok; //@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button getMenuButton user_id:int53 = BotMenuButton; -//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok; -//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; pass null to remove default rights setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok;