diff --git a/client/function.go b/client/function.go index 52c8bcb..4b0f21c 100755 --- a/client/function.go +++ b/client/function.go @@ -1313,7 +1313,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1729,6 +1729,61 @@ func (client *Client) SearchChatsNearby(req *SearchChatsNearbyRequest) (*ChatsNe return UnmarshalChatsNearby(result.Data) } +type GetChatSimilarChatsRequest struct { + // Identifier of the target chat; must be an identifier of a channel chat + ChatId int64 `json:"chat_id"` +} + +// Returns a list of chats similar to the given chat +func (client *Client) GetChatSimilarChats(req *GetChatSimilarChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSimilarChats", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type GetChatSimilarChatCountRequest struct { + // Identifier of the target chat; must be an identifier of a channel chat + ChatId int64 `json:"chat_id"` + // Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally + ReturnLocal bool `json:"return_local"` +} + +// Returns approximate number of chats similar to the given chat +func (client *Client) GetChatSimilarChatCount(req *GetChatSimilarChatCountRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSimilarChatCount", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "return_local": req.ReturnLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + type GetTopChatsRequest struct { // Category of chats to be returned Category TopChatCategory `json:"category"` @@ -2949,7 +3004,7 @@ type RecognizeSpeechRequest struct { MessageId int64 `json:"message_id"` } -// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +// Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3263,7 +3318,7 @@ type ResendMessagesRequest struct { // Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` // New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false - Quote *FormattedText `json:"quote"` + Quote *InputTextQuote `json:"quote"` } // Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -7270,15 +7325,17 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e type SetChatBackgroundRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // The input background to use; pass null to create a new filled background or to remove the current background + // The input background to use; pass null to create a new filled background Background InputBackground `json:"background"` - // Background type; pass null to remove the current background + // Background type; pass null to use default background type for the chosen background Type BackgroundType `json:"type"` // Dimming of the background in dark themes, as a percentage; 0-100 DarkThemeDimming int32 `json:"dark_theme_dimming"` + // Pass true to set background only for self; pass false to set background for both chat users. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious + OnlyForSelf bool `json:"only_for_self"` } -// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +// Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7289,6 +7346,36 @@ func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, err "background": req.Background, "type": req.Type, "dark_theme_dimming": req.DarkThemeDimming, + "only_for_self": req.OnlyForSelf, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteChatBackgroundRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. Supposed to be used from messageChatSetBackground messages with the currently set background that was set for both sides by the other user + RestorePrevious bool `json:"restore_previous"` +} + +// Deletes background in a specific chat +func (client *Client) DeleteChatBackground(req *DeleteChatBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatBackground", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "restore_previous": req.RestorePrevious, }, }) if err != nil { @@ -7421,6 +7508,35 @@ func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedC return UnmarshalOk(result.Data) } +type ToggleChatViewAsTopicsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of view_as_topics + ViewAsTopics bool `json:"view_as_topics"` +} + +// Changes the view_as_topics setting of a forum chat +func (client *Client) ToggleChatViewAsTopics(req *ToggleChatViewAsTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatViewAsTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "view_as_topics": req.ViewAsTopics, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleChatIsTranslatableRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -7428,7 +7544,7 @@ type ToggleChatIsTranslatableRequest struct { IsTranslatable bool `json:"is_translatable"` } -// Changes the translatable state of a chat; for Telegram Premium users only +// Changes the translatable state of a chat func (client *Client) ToggleChatIsTranslatable(req *ToggleChatIsTranslatableRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7511,7 +7627,7 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul type SetChatAvailableReactionsRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Reactions available in the chat. All emoji reactions must be active + // Reactions available in the chat. All explicitly specified emoji reactions must be active. Up to the chat's boost level custom emoji reactions can be explicitly specified AvailableReactions ChatAvailableReactions `json:"available_reactions"` } @@ -8561,6 +8677,8 @@ type SendStoryRequest struct { 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, or 2 * 86400 for Telegram Premium users, and 86400 otherwise ActivePeriod int32 `json:"active_period"` + // Full identifier of the original story, which content was used to create the story + FromStoryFullId *StoryFullId `json:"from_story_full_id"` // Pass true to keep the story accessible after expiration IsPinned bool `json:"is_pinned"` // Pass true if the content of the story must be protected from forwarding and screenshotting @@ -8580,6 +8698,7 @@ func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { "caption": req.Caption, "privacy_settings": req.PrivacySettings, "active_period": req.ActivePeriod, + "from_story_full_id": req.FromStoryFullId, "is_pinned": req.IsPinned, "protect_content": req.ProtectContent, }, @@ -9104,6 +9223,41 @@ func (client *Client) ActivateStoryStealthMode() (*Ok, error) { return UnmarshalOk(result.Data) } +type GetStoryPublicForwardsRequest 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"` + // 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 messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) (*StoryPublicForwards, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryPublicForwards", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryPublicForwards(result.Data) +} + // Returns the list of available chat boost slots for the current user func (client *Client) GetAvailableChatBoostSlots() (*ChatBoostSlots, error) { result, err := client.Send(Request{ @@ -9562,7 +9716,7 @@ type PreliminaryUploadFileRequest struct { Priority int32 `json:"priority"` } -// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -10946,7 +11100,7 @@ type ToggleGroupCallEnabledStartNotificationRequest struct { EnabledStartNotification bool `json:"enabled_start_notification"` } -// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +// Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only func (client *Client) ToggleGroupCallEnabledStartNotification(req *ToggleGroupCallEnabledStartNotificationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12438,17 +12592,20 @@ func (client *Client) SearchInstalledStickerSets(req *SearchInstalledStickerSets } type SearchStickerSetsRequest struct { + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // Query to search for Query string `json:"query"` } -// Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results +// Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results func (client *Client) SearchStickerSets(req *SearchStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchStickerSets", }, Data: map[string]interface{}{ + "sticker_type": req.StickerType, "query": req.Query, }, }) @@ -13237,6 +13394,35 @@ func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetProfileAccentColorRequest struct { + // Identifier of the accent color to use for profile; pass -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown in the on the user's profile photo background; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only +func (client *Client) SetProfileAccentColor(req *SetProfileAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setProfileAccentColor", + }, + Data: map[string]interface{}{ + "profile_accent_color_id": req.ProfileAccentColorId, + "profile_background_custom_emoji_id": req.ProfileBackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetNameRequest struct { // The new value of the first name for the current user; 1-64 characters FirstName string `json:"first_name"` @@ -16098,6 +16284,38 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ return UnmarshalFoundMessages(result.Data) } +type GetStoryStatisticsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true +func (client *Client) GetStoryStatistics(req *GetStoryStatisticsRequest) (*StoryStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryStatistics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_id": req.StoryId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryStatistics(result.Data) +} + type GetStatisticalGraphRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -19270,6 +19488,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(result.Data) + case TypeUpdateChatBlockList: return UnmarshalUpdateChatBlockList(result.Data) @@ -19429,6 +19650,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(result.Data) + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -19456,6 +19680,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(result.Data) + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) diff --git a/client/type.go b/client/type.go index 1c74660..f03324f 100755 --- a/client/type.go +++ b/client/type.go @@ -74,6 +74,8 @@ const ( ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" + ClassStoryOrigin = "StoryOrigin" + ClassStoryPublicForward = "StoryPublicForward" ClassChatBoostSource = "ChatBoostSource" ClassCallDiscardReason = "CallDiscardReason" ClassCallServerType = "CallServerType" @@ -130,6 +132,7 @@ const ( ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" ClassStatisticalGraph = "StatisticalGraph" + ClassChatStatisticsObjectType = "ChatStatisticsObjectType" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" ClassBotCommandScope = "BotCommandScope" @@ -191,6 +194,8 @@ const ( ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions" ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo" ClassAccentColor = "AccentColor" + ClassProfileAccentColors = "ProfileAccentColors" + ClassProfileAccentColor = "ProfileAccentColor" ClassEmojiStatus = "EmojiStatus" ClassEmojiStatuses = "EmojiStatuses" ClassUsernames = "Usernames" @@ -228,6 +233,8 @@ const ( ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" ClassUnreadReaction = "UnreadReaction" + ClassTextQuote = "TextQuote" + ClassInputTextQuote = "InputTextQuote" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" @@ -329,11 +336,14 @@ const ( ClassInputStoryArea = "InputStoryArea" ClassInputStoryAreas = "InputStoryAreas" ClassStoryVideo = "StoryVideo" + ClassStoryRepostInfo = "StoryRepostInfo" ClassStoryInteractionInfo = "StoryInteractionInfo" ClassStory = "Story" ClassStories = "Stories" + ClassStoryFullId = "StoryFullId" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" + ClassStoryPublicForwards = "StoryPublicForwards" ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" ClassChatBoostStatus = "ChatBoostStatus" ClassChatBoost = "ChatBoost" @@ -430,11 +440,12 @@ const ( ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" - ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" + ClassChatStatisticsInteractionInfo = "ChatStatisticsInteractionInfo" ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo" ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo" ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo" ClassMessageStatistics = "MessageStatistics" + ClassStoryStatistics = "StoryStatistics" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -574,6 +585,8 @@ const ( TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing" TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted" TypeAccentColor = "accentColor" + TypeProfileAccentColors = "profileAccentColors" + TypeProfileAccentColor = "profileAccentColor" TypeEmojiStatus = "emojiStatus" TypeEmojiStatuses = "emojiStatuses" TypeUsernames = "usernames" @@ -648,6 +661,8 @@ const ( TypeUnreadReaction = "unreadReaction" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeTextQuote = "textQuote" + TypeInputTextQuote = "inputTextQuote" TypeMessageReplyToMessage = "messageReplyToMessage" TypeMessageReplyToStory = "messageReplyToStory" TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" @@ -671,6 +686,7 @@ const ( TypeMessageSourceScreenshot = "messageSourceScreenshot" TypeMessageSourceOther = "messageSourceOther" TypeMessageSponsorTypeBot = "messageSponsorTypeBot" + TypeMessageSponsorTypeWebApp = "messageSponsorTypeWebApp" TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel" TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel" TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite" @@ -971,6 +987,7 @@ const ( TypeMessagePremiumGiftCode = "messagePremiumGiftCode" TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" TypeMessagePremiumGiveaway = "messagePremiumGiveaway" + TypeMessagePremiumGiveawayCompleted = "messagePremiumGiveawayCompleted" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageUserShared = "messageUserShared" TypeMessageChatShared = "messageChatShared" @@ -1097,11 +1114,18 @@ const ( TypeInputStoryContentVideo = "inputStoryContentVideo" TypeStoryListMain = "storyListMain" TypeStoryListArchive = "storyListArchive" + TypeStoryOriginPublicStory = "storyOriginPublicStory" + TypeStoryOriginHiddenUser = "storyOriginHiddenUser" + TypeStoryRepostInfo = "storyRepostInfo" TypeStoryInteractionInfo = "storyInteractionInfo" TypeStory = "story" TypeStories = "stories" + TypeStoryFullId = "storyFullId" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" + TypeStoryPublicForwardMessage = "storyPublicForwardMessage" + TypeStoryPublicForwardStory = "storyPublicForwardStory" + TypeStoryPublicForwards = "storyPublicForwards" TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway" TypeChatBoostSourcePremium = "chatBoostSourcePremium" @@ -1281,6 +1305,7 @@ const ( TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" + TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -1299,6 +1324,7 @@ const ( TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" TypePremiumFeatureChatBoost = "premiumFeatureChatBoost" TypePremiumFeatureAccentColor = "premiumFeatureAccentColor" + TypePremiumFeatureBackgroundForBoth = "premiumFeatureBackgroundForBoth" TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" @@ -1624,13 +1650,16 @@ const ( TypeStatisticalGraphData = "statisticalGraphData" TypeStatisticalGraphAsync = "statisticalGraphAsync" TypeStatisticalGraphError = "statisticalGraphError" - TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo" + TypeChatStatisticsObjectTypeMessage = "chatStatisticsObjectTypeMessage" + TypeChatStatisticsObjectTypeStory = "chatStatisticsObjectTypeStory" + TypeChatStatisticsInteractionInfo = "chatStatisticsInteractionInfo" TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" TypeChatStatisticsChannel = "chatStatisticsChannel" TypeMessageStatistics = "messageStatistics" + TypeStoryStatistics = "storyStatistics" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -1681,6 +1710,7 @@ const ( TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" TypeUpdateChatIsTranslatable = "updateChatIsTranslatable" TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" + TypeUpdateChatViewAsTopics = "updateChatViewAsTopics" TypeUpdateChatBlockList = "updateChatBlockList" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" TypeUpdateChatFolders = "updateChatFolders" @@ -1734,6 +1764,7 @@ const ( TypeUpdateSelectedBackground = "updateSelectedBackground" TypeUpdateChatThemes = "updateChatThemes" TypeUpdateAccentColors = "updateAccentColors" + TypeUpdateProfileAccentColors = "updateProfileAccentColors" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" @@ -1743,6 +1774,7 @@ const ( TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" TypeUpdateDefaultReactionType = "updateDefaultReactionType" + TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" @@ -2113,6 +2145,16 @@ type StoryList interface { StoryListType() string } +// Contains information about the origin of a story that was reposted +type StoryOrigin interface { + StoryOriginType() string +} + +// Describes a public forward or repost of a story +type StoryPublicForward interface { + StoryPublicForwardType() string +} + // Describes source of a chat boost type ChatBoostSource interface { ChatBoostSourceType() string @@ -2393,6 +2435,11 @@ type StatisticalGraph interface { StatisticalGraphType() string } +// Describes type of an object, for which statistics are provided +type ChatStatisticsObjectType interface { + ChatStatisticsObjectTypeType() string +} + // Contains a detailed statistics about a chat type ChatStatistics interface { ChatStatisticsType() string @@ -6088,7 +6135,7 @@ type PremiumGiftCodeInfo struct { CreationDate int32 `json:"creation_date"` // True, if the gift code was created for a giveaway IsFromGiveaway bool `json:"is_from_giveaway"` - // Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message + // Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` // Number of month the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` @@ -6392,6 +6439,60 @@ func (*AccentColor) GetType() string { return TypeAccentColor } +// Contains information about supported accent colors for user profile photo background in RGB format +type ProfileAccentColors struct { + meta + // The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings + PaletteColors []int32 `json:"palette_colors"` + // The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background + BackgroundColors []int32 `json:"background_colors"` + // The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo + StoryColors []int32 `json:"story_colors"` +} + +func (entity *ProfileAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileAccentColors) GetClass() string { + return ClassProfileAccentColors +} + +func (*ProfileAccentColors) GetType() string { + return TypeProfileAccentColors +} + +// Contains information about supported accent color for user profile photo background +type ProfileAccentColor struct { + meta + // Profile accent color identifier + Id int32 `json:"id"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + LightThemeColors *ProfileAccentColors `json:"light_theme_colors"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes + DarkThemeColors *ProfileAccentColors `json:"dark_theme_colors"` +} + +func (entity *ProfileAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileAccentColor) GetClass() string { + return ClassProfileAccentColor +} + +func (*ProfileAccentColor) GetType() string { + return TypeProfileAccentColor +} + // Describes a custom emoji to be shown instead of the Telegram Premium badge type EmojiStatus struct { meta @@ -6486,10 +6587,14 @@ type User struct { Status UserStatus `json:"status"` // Profile photo of the user; may be null ProfilePhoto *ProfilePhoto `json:"profile_photo"` - // Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview + // Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only AccentColorId int32 `json:"accent_color_id"` // Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only EmojiStatus *EmojiStatus `json:"emoji_status"` // The user is a contact of the current user @@ -6552,6 +6657,8 @@ func (user *User) UnmarshalJSON(data []byte) error { ProfilePhoto *ProfilePhoto `json:"profile_photo"` AccentColorId int32 `json:"accent_color_id"` BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` EmojiStatus *EmojiStatus `json:"emoji_status"` IsContact bool `json:"is_contact"` IsMutualContact bool `json:"is_mutual_contact"` @@ -6584,6 +6691,8 @@ func (user *User) UnmarshalJSON(data []byte) error { user.ProfilePhoto = tmp.ProfilePhoto user.AccentColorId = tmp.AccentColorId user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + user.ProfileAccentColorId = tmp.ProfileAccentColorId + user.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId user.EmojiStatus = tmp.EmojiStatus user.IsContact = tmp.IsContact user.IsMutualContact = tmp.IsMutualContact @@ -6724,6 +6833,8 @@ type UserFullInfo struct { HasPinnedStories bool `json:"has_pinned_stories"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` + // True, if the user set chat background for both chat users and it wasn't reverted yet + SetChatBackground bool `json:"set_chat_background"` // A short user bio; may be null for bots Bio *FormattedText `json:"bio"` // The list of available options for gifting Telegram Premium to the user @@ -6763,6 +6874,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` HasPinnedStories bool `json:"has_pinned_stories"` NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` + SetChatBackground bool `json:"set_chat_background"` Bio *FormattedText `json:"bio"` PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` GroupInCommonCount int32 `json:"group_in_common_count"` @@ -6784,6 +6896,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.HasRestrictedVoiceAndVideoNoteMessages = tmp.HasRestrictedVoiceAndVideoNoteMessages userFullInfo.HasPinnedStories = tmp.HasPinnedStories userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException + userFullInfo.SetChatBackground = tmp.SetChatBackground userFullInfo.Bio = tmp.Bio userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount @@ -8036,7 +8149,7 @@ type Supergroup struct { Date int32 `json:"date"` // Status of the current user in the supergroup or channel; custom title will always be empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or for public chats in which where sent messages and posted stories from storyPublicForwards, or for public chats in which where sent messages from getMessagePublicForwards response MemberCount int32 `json:"member_count"` // True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel HasLinkedChat bool `json:"has_linked_chat"` @@ -8054,7 +8167,7 @@ type Supergroup struct { IsChannel bool `json:"is_channel"` // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members IsBroadcastGroup bool `json:"is_broadcast_group"` - // True, if the supergroup must be shown as a forum by default + // True, if the supergroup is a forum with topics IsForum bool `json:"is_forum"` // True, if the supergroup or channel is verified IsVerified bool `json:"is_verified"` @@ -8450,7 +8563,7 @@ func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { // Represents a message sender, which can be used to send messages in a chat type ChatMessageSender struct { meta - // Available message senders + // The message sender Sender MessageSender `json:"sender"` // True, if Telegram Premium is needed to use the message sender NeedsPremium bool `json:"needs_premium"` @@ -8876,7 +8989,7 @@ type MessageReaction struct { TotalCount int32 `json:"total_count"` // True, if the reaction is chosen by the current user IsChosen bool `json:"is_chosen"` - // Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen + // Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen UsedSenderId MessageSender `json:"used_sender_id"` // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats RecentSenderIds []MessageSender `json:"recent_sender_ids"` @@ -9070,6 +9183,58 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { return TypeMessageSendingStateFailed } +// Describes manually or automatically chosen quote from another message +type TextQuote struct { + meta + // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text + Text *FormattedText `json:"text"` + // Approximate quote position in the original message in UTF-16 code units + Position int32 `json:"position"` + // True, if the quote was manually chosen by the message sender + IsManual bool `json:"is_manual"` +} + +func (entity *TextQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextQuote + + return json.Marshal((*stub)(entity)) +} + +func (*TextQuote) GetClass() string { + return ClassTextQuote +} + +func (*TextQuote) GetType() string { + return TypeTextQuote +} + +// Describes manually chosen quote from another message +type InputTextQuote struct { + meta + // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote + Text *FormattedText `json:"text"` + // Quote position in the original message in UTF-16 code units + Position int32 `json:"position"` +} + +func (entity *InputTextQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputTextQuote + + return json.Marshal((*stub)(entity)) +} + +func (*InputTextQuote) GetClass() string { + return ClassInputTextQuote +} + +func (*InputTextQuote) GetType() string { + return TypeInputTextQuote +} + // Describes a message replied by a given message type MessageReplyToMessage struct { meta @@ -9077,15 +9242,13 @@ type MessageReplyToMessage struct { ChatId int64 `json:"chat_id"` // The identifier of the message; may be 0 if the replied message is in unknown chat MessageId int64 `json:"message_id"` - // Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote - Quote *FormattedText `json:"quote"` - // True, if the quote was manually chosen by the message sender - IsQuoteManual bool `json:"is_quote_manual"` - // Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat + // Chosen quote from the replied message; may be null if none + Quote *TextQuote `json:"quote"` + // Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat Origin MessageOrigin `json:"origin"` - // Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat + // Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat OriginSendDate int32 `json:"origin_send_date"` - // Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote + // Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote Content MessageContent `json:"content"` } @@ -9113,8 +9276,7 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e var tmp struct { ChatId int64 `json:"chat_id"` MessageId int64 `json:"message_id"` - Quote *FormattedText `json:"quote"` - IsQuoteManual bool `json:"is_quote_manual"` + Quote *TextQuote `json:"quote"` Origin json.RawMessage `json:"origin"` OriginSendDate int32 `json:"origin_send_date"` Content json.RawMessage `json:"content"` @@ -9128,7 +9290,6 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e messageReplyToMessage.ChatId = tmp.ChatId messageReplyToMessage.MessageId = tmp.MessageId messageReplyToMessage.Quote = tmp.Quote - messageReplyToMessage.IsQuoteManual = tmp.IsQuoteManual messageReplyToMessage.OriginSendDate = tmp.OriginSendDate fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) @@ -9172,12 +9333,12 @@ func (*MessageReplyToStory) MessageReplyToType() string { // Describes a message to be replied type InputMessageReplyToMessage struct { meta - // The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat + // The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat ChatId int64 `json:"chat_id"` // The identifier of the message to be replied in the same or the specified chat MessageId int64 `json:"message_id"` - // Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote - Quote *FormattedText `json:"quote"` + // Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats + Quote *InputTextQuote `json:"quote"` } func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { @@ -9250,7 +9411,7 @@ type Message struct { CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded CanBeForwarded bool `json:"can_be_forwarded"` - // True, if the message can be replied in another chat + // True, if the message can be replied in another chat or topic CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` // True, if content of the message can be saved locally or copied CanBeSaved bool `json:"can_be_saved"` @@ -9469,7 +9630,7 @@ type FoundMessages struct { TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -9916,6 +10077,54 @@ func (messageSponsorTypeBot *MessageSponsorTypeBot) UnmarshalJSON(data []byte) e return nil } +// The sponsor is a web app +type MessageSponsorTypeWebApp struct { + meta + // Web App title + WebAppTitle string `json:"web_app_title"` + // An internal link to be opened when the sponsored message is clicked + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeWebApp) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeWebApp) GetType() string { + return TypeMessageSponsorTypeWebApp +} + +func (*MessageSponsorTypeWebApp) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeWebApp +} + +func (messageSponsorTypeWebApp *MessageSponsorTypeWebApp) UnmarshalJSON(data []byte) error { + var tmp struct { + WebAppTitle string `json:"web_app_title"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypeWebApp.WebAppTitle = tmp.WebAppTitle + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypeWebApp.Link = fieldLink + + return nil +} + // The sponsor is a public channel chat type MessageSponsorTypePublicChannel struct { meta @@ -10081,6 +10290,8 @@ type SponsoredMessage struct { Content MessageContent `json:"content"` // Information about the sponsor of the message Sponsor *MessageSponsor `json:"sponsor"` + // If non-empty, text for the message action button + ButtonText string `json:"button_text"` // If non-empty, additional information about the sponsored message to be shown along with the message AdditionalInfo string `json:"additional_info"` } @@ -10107,6 +10318,7 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { IsRecommended bool `json:"is_recommended"` Content json.RawMessage `json:"content"` Sponsor *MessageSponsor `json:"sponsor"` + ButtonText string `json:"button_text"` AdditionalInfo string `json:"additional_info"` } @@ -10118,6 +10330,7 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { sponsoredMessage.MessageId = tmp.MessageId sponsoredMessage.IsRecommended = tmp.IsRecommended sponsoredMessage.Sponsor = tmp.Sponsor + sponsoredMessage.ButtonText = tmp.ButtonText sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo fieldContent, _ := UnmarshalMessageContent(tmp.Content) @@ -10216,7 +10429,7 @@ type FoundFileDownloads struct { TotalCounts *DownloadedFileCounts `json:"total_counts"` // The list of files Files []*FileDownload `json:"files"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -10314,7 +10527,7 @@ func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() st // Contains information about notification settings for a chat or a forum topic type ChatNotificationSettings struct { meta - // If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of mute_for UseDefaultMuteFor bool `json:"use_default_mute_for"` // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` @@ -10322,11 +10535,11 @@ type ChatNotificationSettings struct { UseDefaultSound bool `json:"use_default_sound"` // Identifier of the notification sound to be played for messages; 0 if sound is disabled SoundId JsonInt64 `json:"sound_id"` - // If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of show_preview UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` - // If true, mute_stories is ignored and the value for the relevant type of chat is used instead + // If true, the value for the relevant type of chat is used instead of mute_stories UseDefaultMuteStories bool `json:"use_default_mute_stories"` // True, if story notifications are disabled for the chat MuteStories bool `json:"mute_stories"` @@ -10334,15 +10547,15 @@ type ChatNotificationSettings struct { UseDefaultStorySound bool `json:"use_default_story_sound"` // Identifier of the notification sound to be played for stories; 0 if sound is disabled StorySoundId JsonInt64 `json:"story_sound_id"` - // If true, show_story_sender is ignored and the value for the relevant type of chat is used instead + // If true, the value for the relevant type of chat is used instead of show_story_sender UseDefaultShowStorySender bool `json:"use_default_show_story_sender"` // True, if the sender of stories must be displayed in notifications ShowStorySender bool `json:"show_story_sender"` - // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` // If true, notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` - // If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"` // If true, notifications for messages with mentions will be created as for an ordinary unread message DisableMentionNotifications bool `json:"disable_mention_notifications"` @@ -10373,9 +10586,9 @@ type ScopeNotificationSettings struct { SoundId JsonInt64 `json:"sound_id"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` - // If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers + // If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories UseDefaultMuteStories bool `json:"use_default_mute_stories"` - // True, if story notifications are disabled for the chat + // True, if story notifications are disabled MuteStories bool `json:"mute_stories"` // Identifier of the notification sound to be played for stories; 0 if sound is disabled StorySoundId JsonInt64 `json:"story_sound_id"` @@ -10541,7 +10754,7 @@ type ChatTypeSecret struct { meta // Secret chat identifier SecretChatId int32 `json:"secret_chat_id"` - // User identifier of the secret chat peer + // User identifier of the other user in the secret chat UserId int64 `json:"user_id"` } @@ -11191,6 +11404,8 @@ type Chat struct { 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 a forum supergroup that must be shown in the "View as topics" mode + ViewAsTopics bool `json:"view_as_topics"` // 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 @@ -11267,6 +11482,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { HasProtectedContent bool `json:"has_protected_content"` IsTranslatable bool `json:"is_translatable"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` + ViewAsTopics bool `json:"view_as_topics"` HasScheduledMessages bool `json:"has_scheduled_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` @@ -11306,6 +11522,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.HasProtectedContent = tmp.HasProtectedContent chat.IsTranslatable = tmp.IsTranslatable chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread + chat.ViewAsTopics = tmp.ViewAsTopics chat.HasScheduledMessages = tmp.HasScheduledMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers @@ -11551,7 +11768,7 @@ 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 CanUnarchive bool `json:"can_unarchive"` - // If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users + // If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users Distance int32 `json:"distance"` } @@ -15034,9 +15251,9 @@ type WebPage struct { Duration int32 `json:"duration"` // Author of the content Author string `json:"author"` - // True, if the preview has large media and its appearance can be changed + // True, if size of media in the preview can be changed HasLargeMedia bool `json:"has_large_media"` - // True, if large media preview must be shown + // True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos ShowLargeMedia bool `json:"show_large_media"` // True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear SkipConfirmation bool `json:"skip_confirmation"` @@ -18257,7 +18474,7 @@ type MessageText struct { Text *FormattedText `json:"text"` // A link preview attached to the message; may be null WebPage *WebPage `json:"web_page"` - // Options which was used for generation of the link preview; may be null if default options were used + // Options which were used for generation of the link preview; may be null if default options were used LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } @@ -19442,6 +19659,8 @@ type MessageChatSetBackground struct { OldBackgroundMessageId int64 `json:"old_background_message_id"` // The new background Background *ChatBackground `json:"background"` + // True, if the background was set only for self + OnlyForSelf bool `json:"only_for_self"` } func (entity *MessageChatSetBackground) MarshalJSON() ([]byte, error) { @@ -19962,6 +20181,37 @@ func (*MessagePremiumGiveaway) MessageContentType() string { return TypeMessagePremiumGiveaway } +// A Telegram Premium giveaway has been completed for the chat +type MessagePremiumGiveawayCompleted struct { + meta + // Identifier of the message with the giveaway, can be an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Number of undistributed prizes + UnclaimedPrizeCount int32 `json:"unclaimed_prize_count"` +} + +func (entity *MessagePremiumGiveawayCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayCompleted) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayCompleted) GetType() string { + return TypeMessagePremiumGiveawayCompleted +} + +func (*MessagePremiumGiveawayCompleted) MessageContentType() string { + return TypeMessagePremiumGiveawayCompleted +} + // A contact has registered with Telegram type MessageContactRegistered struct{ meta @@ -20905,7 +21155,7 @@ func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string { return TypeMessageSchedulingStateSendAtDate } -// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +// The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known type MessageSchedulingStateSendWhenOnline struct{ meta } @@ -21247,7 +21497,7 @@ type InputMessageDocument struct { Document InputFile `json:"document"` // Document thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` - // If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats + // True, if automatic file type detection is disabled and the document must be sent as a file. Always true for files sent to secret chats DisableContentTypeDetection bool `json:"disable_content_type_detection"` // Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` @@ -23427,7 +23677,7 @@ type StoryViewers struct { TotalReactionCount int32 `json:"total_reaction_count"` // List of story viewers Viewers []*StoryViewer `json:"viewers"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -24110,6 +24360,106 @@ func (*StoryListArchive) StoryListType() string { return TypeStoryListArchive } +// The original story was a public story with known sender +type StoryOriginPublicStory struct { + meta + // Identifier of the chat that posted original story + ChatId int64 `json:"chat_id"` + // Story identifier of the original story + StoryId int32 `json:"story_id"` +} + +func (entity *StoryOriginPublicStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryOriginPublicStory + + return json.Marshal((*stub)(entity)) +} + +func (*StoryOriginPublicStory) GetClass() string { + return ClassStoryOrigin +} + +func (*StoryOriginPublicStory) GetType() string { + return TypeStoryOriginPublicStory +} + +func (*StoryOriginPublicStory) StoryOriginType() string { + return TypeStoryOriginPublicStory +} + +// The original story was sent by an unknown user +type StoryOriginHiddenUser struct { + meta + // Name of the story sender + SenderName string `json:"sender_name"` +} + +func (entity *StoryOriginHiddenUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryOriginHiddenUser + + return json.Marshal((*stub)(entity)) +} + +func (*StoryOriginHiddenUser) GetClass() string { + return ClassStoryOrigin +} + +func (*StoryOriginHiddenUser) GetType() string { + return TypeStoryOriginHiddenUser +} + +func (*StoryOriginHiddenUser) StoryOriginType() string { + return TypeStoryOriginHiddenUser +} + +// Contains information about original story that was reposted +type StoryRepostInfo struct { + meta + // Origin of the story that was reposted + Origin StoryOrigin `json:"origin"` + // True, if story content was modified during reposting; otherwise, story wasn't modified + IsContentModified bool `json:"is_content_modified"` +} + +func (entity *StoryRepostInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryRepostInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryRepostInfo) GetClass() string { + return ClassStoryRepostInfo +} + +func (*StoryRepostInfo) GetType() string { + return TypeStoryRepostInfo +} + +func (storyRepostInfo *StoryRepostInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Origin json.RawMessage `json:"origin"` + IsContentModified bool `json:"is_content_modified"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyRepostInfo.IsContentModified = tmp.IsContentModified + + fieldOrigin, _ := UnmarshalStoryOrigin(tmp.Origin) + storyRepostInfo.Origin = fieldOrigin + + return nil +} + // Contains information about interactions with a story type StoryInteractionInfo struct { meta @@ -24168,10 +24518,14 @@ type Story struct { CanBeReplied bool `json:"can_be_replied"` // True, if the story's is_pinned value can be changed CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + // True, if the story statistics are available through getStoryStatistics + CanGetStatistics bool `json:"can_get_statistics"` // True, if users viewed the story can be received through getStoryViewers CanGetViewers bool `json:"can_get_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 HasExpiredViewers bool `json:"has_expired_viewers"` + // Information about the original story; may be null if the story wasn't reposted + RepostInfo *StoryRepostInfo `json:"repost_info"` // 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 @@ -24217,8 +24571,10 @@ func (story *Story) UnmarshalJSON(data []byte) error { CanBeForwarded bool `json:"can_be_forwarded"` CanBeReplied bool `json:"can_be_replied"` CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + CanGetStatistics bool `json:"can_get_statistics"` CanGetViewers bool `json:"can_get_viewers"` HasExpiredViewers bool `json:"has_expired_viewers"` + RepostInfo *StoryRepostInfo `json:"repost_info"` InteractionInfo *StoryInteractionInfo `json:"interaction_info"` ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` PrivacySettings json.RawMessage `json:"privacy_settings"` @@ -24245,8 +24601,10 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.CanBeForwarded = tmp.CanBeForwarded story.CanBeReplied = tmp.CanBeReplied story.CanToggleIsPinned = tmp.CanToggleIsPinned + story.CanGetStatistics = tmp.CanGetStatistics story.CanGetViewers = tmp.CanGetViewers story.HasExpiredViewers = tmp.HasExpiredViewers + story.RepostInfo = tmp.RepostInfo story.InteractionInfo = tmp.InteractionInfo story.Areas = tmp.Areas story.Caption = tmp.Caption @@ -24288,6 +24646,31 @@ func (*Stories) GetType() string { return TypeStories } +// Contains identifier of a story along with identifier of its sender +type StoryFullId struct { + meta + // Identifier of the chat that posted the story + SenderChatId int64 `json:"sender_chat_id"` + // Unique story identifier among stories of the given sender + StoryId int32 `json:"story_id"` +} + +func (entity *StoryFullId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryFullId + + return json.Marshal((*stub)(entity)) +} + +func (*StoryFullId) GetClass() string { + return ClassStoryFullId +} + +func (*StoryFullId) GetType() string { + return TypeStoryFullId +} + // Contains basic information about a story type StoryInfo struct { meta @@ -24371,6 +24754,108 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { return nil } +// Contains a public forward of a story as a message +type StoryPublicForwardMessage struct { + meta + // Information about the message with the story + Message *Message `json:"message"` +} + +func (entity *StoryPublicForwardMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPublicForwardMessage + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPublicForwardMessage) GetClass() string { + return ClassStoryPublicForward +} + +func (*StoryPublicForwardMessage) GetType() string { + return TypeStoryPublicForwardMessage +} + +func (*StoryPublicForwardMessage) StoryPublicForwardType() string { + return TypeStoryPublicForwardMessage +} + +// Contains a public repost of a story as a story +type StoryPublicForwardStory struct { + meta + // Information about the reposted story + Story *Story `json:"story"` +} + +func (entity *StoryPublicForwardStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPublicForwardStory + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPublicForwardStory) GetClass() string { + return ClassStoryPublicForward +} + +func (*StoryPublicForwardStory) GetType() string { + return TypeStoryPublicForwardStory +} + +func (*StoryPublicForwardStory) StoryPublicForwardType() string { + return TypeStoryPublicForwardStory +} + +// Represents a list of public forwards and reposts of a story +type StoryPublicForwards struct { + meta + // Approximate total number of messages and stories found + TotalCount int32 `json:"total_count"` + // List of found public forwards and reposts + Forwards []StoryPublicForward `json:"forwards"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *StoryPublicForwards) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPublicForwards + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPublicForwards) GetClass() string { + return ClassStoryPublicForwards +} + +func (*StoryPublicForwards) GetType() string { + return TypeStoryPublicForwards +} + +func (storyPublicForwards *StoryPublicForwards) UnmarshalJSON(data []byte) error { + var tmp struct { + TotalCount int32 `json:"total_count"` + Forwards []json.RawMessage `json:"forwards"` + NextOffset string `json:"next_offset"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyPublicForwards.TotalCount = tmp.TotalCount + storyPublicForwards.NextOffset = tmp.NextOffset + + fieldForwards, _ := UnmarshalListOfStoryPublicForward(tmp.Forwards) + storyPublicForwards.Forwards = fieldForwards + + return nil +} + // The chat created a Telegram Premium gift code for a user type ChatBoostSourceGiftCode struct { meta @@ -24593,7 +25078,7 @@ type FoundChatBoosts struct { TotalCount int32 `json:"total_count"` // List of boosts Boosts []*ChatBoost `json:"boosts"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -25044,7 +25529,7 @@ func (*CallStateExchangingKeys) CallStateType() string { // The call is ready to use type CallStateReady struct { meta - // Call protocols supported by the peer + // Call protocols supported by the other call participant Protocol *CallProtocol `json:"protocol"` // List of available call servers Servers []*CallServer `json:"servers"` @@ -25389,7 +25874,7 @@ type GroupCall struct { Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended ScheduledStartDate int32 `json:"scheduled_start_date"` - // True, if the group call is scheduled and the current user will receive a notification when the group call will start + // True, if the group call is scheduled and the current user will receive a notification when the group call starts EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active IsActive bool `json:"is_active"` @@ -25833,7 +26318,7 @@ type Call struct { meta // Call identifier, not persistent Id int32 `json:"id"` - // Peer user identifier + // User identifier of the other call participant UserId int64 `json:"user_id"` // True, if the call is outgoing IsOutgoing bool `json:"is_outgoing"` @@ -26059,7 +26544,7 @@ type AddedReactions struct { TotalCount int32 `json:"total_count"` // The list of added reactions Reactions []*AddedReaction `json:"reactions"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -26132,7 +26617,7 @@ type AvailableReactions struct { RecentReactions []*AvailableReaction `json:"recent_reactions"` // List of popular reactions PopularReactions []*AvailableReaction `json:"popular_reactions"` - // True, if custom emoji reactions could be added by Telegram Premium subscribers + // True, if any custom emoji reaction can be added by Telegram Premium subscribers AllowCustomEmoji bool `json:"allow_custom_emoji"` } @@ -26360,7 +26845,7 @@ func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { // The speech recognition failed type SpeechRecognitionResultError struct { meta - // Recognition error + // Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized Error *Error `json:"error"` } @@ -28028,7 +28513,7 @@ type InlineQueryResults struct { Button *InlineQueryResultsButton `json:"button"` // Results of the query Results []InlineQueryResult `json:"results"` - // The offset for the next request. If empty, there are no more results + // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` } @@ -28823,7 +29308,7 @@ func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { return TypeChatEventMessageAutoDeleteTimeChanged } -// The chat permissions was changed +// The chat permissions were changed type ChatEventPermissionsChanged struct { meta // Previous chat permissions @@ -30447,6 +30932,31 @@ func (*PremiumLimitTypeStorySuggestedReactionAreaCount) PremiumLimitTypeType() s return TypePremiumLimitTypeStorySuggestedReactionAreaCount } +// The maximum number of received similar chats +type PremiumLimitTypeSimilarChatCount struct{ + meta +} + +func (entity *PremiumLimitTypeSimilarChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSimilarChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSimilarChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSimilarChatCount) GetType() string { + return TypePremiumLimitTypeSimilarChatCount +} + +func (*PremiumLimitTypeSimilarChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSimilarChatCount +} + // Increased limits type PremiumFeatureIncreasedLimits struct{ meta @@ -30872,7 +31382,7 @@ func (*PremiumFeatureChatBoost) PremiumFeatureType() string { return TypePremiumFeatureChatBoost } -// The ability to choose accent color +// The ability to choose accent color for replies and user profile type PremiumFeatureAccentColor struct{ meta } @@ -30897,6 +31407,31 @@ func (*PremiumFeatureAccentColor) PremiumFeatureType() string { return TypePremiumFeatureAccentColor } +// The ability to set private chat background for both users +type PremiumFeatureBackgroundForBoth struct{ + meta +} + +func (entity *PremiumFeatureBackgroundForBoth) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureBackgroundForBoth + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureBackgroundForBoth) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureBackgroundForBoth) GetType() string { + return TypePremiumFeatureBackgroundForBoth +} + +func (*PremiumFeatureBackgroundForBoth) PremiumFeatureType() string { + return TypePremiumFeatureBackgroundForBoth +} + // User stories are displayed before stories of non-premium contacts and channels type PremiumStoryFeaturePriorityOrder struct{ meta @@ -32930,7 +33465,7 @@ func (*ResetPasswordResultDeclined) ResetPasswordResultType() string { return TypeResetPasswordResultDeclined } -// The messages was exported from a private chat +// The messages were exported from a private chat type MessageFileTypePrivate struct { meta // Name of the other party; may be empty if unrecognized @@ -32957,7 +33492,7 @@ func (*MessageFileTypePrivate) MessageFileTypeType() string { return TypeMessageFileTypePrivate } -// The messages was exported from a group chat +// The messages were exported from a group chat type MessageFileTypeGroup struct { meta // Title of the group chat; may be empty if unrecognized @@ -32984,7 +33519,7 @@ func (*MessageFileTypeGroup) MessageFileTypeType() string { return TypeMessageFileTypeGroup } -// The messages was exported from a chat of unknown type +// The messages were exported from a chat of unknown type type MessageFileTypeUnknown struct{ meta } @@ -38907,7 +39442,7 @@ func (*AutosaveSettings) GetType() string { return TypeAutosaveSettings } -// Currently waiting for the network to become available. Use setNetworkType to change the available network type +// Waiting for the network to become available. Use setNetworkType to change the available network type type ConnectionStateWaitingForNetwork struct{ meta } @@ -38932,7 +39467,7 @@ func (*ConnectionStateWaitingForNetwork) ConnectionStateType() string { return TypeConnectionStateWaitingForNetwork } -// Currently establishing a connection with a proxy server +// Establishing a connection with a proxy server type ConnectionStateConnectingToProxy struct{ meta } @@ -38957,7 +39492,7 @@ func (*ConnectionStateConnectingToProxy) ConnectionStateType() string { return TypeConnectionStateConnectingToProxy } -// Currently establishing a connection to the Telegram servers +// Establishing a connection to the Telegram servers type ConnectionStateConnecting struct{ meta } @@ -38982,7 +39517,7 @@ func (*ConnectionStateConnecting) ConnectionStateType() string { return TypeConnectionStateConnecting } -// Downloading data received while the application was offline +// Downloading data supposed to be received while the application was offline type ConnectionStateUpdating struct{ meta } @@ -40185,31 +40720,110 @@ func (*StatisticalGraphError) StatisticalGraphType() string { return TypeStatisticalGraphError } -// Contains statistics about interactions with a message -type ChatStatisticsMessageInteractionInfo struct { +// Describes a message sent in the chat +type ChatStatisticsObjectTypeMessage struct { meta // Message identifier MessageId int64 `json:"message_id"` - // Number of times the message was viewed - ViewCount int32 `json:"view_count"` - // Number of times the message was forwarded - ForwardCount int32 `json:"forward_count"` } -func (entity *ChatStatisticsMessageInteractionInfo) MarshalJSON() ([]byte, error) { +func (entity *ChatStatisticsObjectTypeMessage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatStatisticsMessageInteractionInfo + type stub ChatStatisticsObjectTypeMessage return json.Marshal((*stub)(entity)) } -func (*ChatStatisticsMessageInteractionInfo) GetClass() string { - return ClassChatStatisticsMessageInteractionInfo +func (*ChatStatisticsObjectTypeMessage) GetClass() string { + return ClassChatStatisticsObjectType } -func (*ChatStatisticsMessageInteractionInfo) GetType() string { - return TypeChatStatisticsMessageInteractionInfo +func (*ChatStatisticsObjectTypeMessage) GetType() string { + return TypeChatStatisticsObjectTypeMessage +} + +func (*ChatStatisticsObjectTypeMessage) ChatStatisticsObjectTypeType() string { + return TypeChatStatisticsObjectTypeMessage +} + +// Describes a story sent by the chat +type ChatStatisticsObjectTypeStory struct { + meta + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *ChatStatisticsObjectTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsObjectTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsObjectTypeStory) GetClass() string { + return ClassChatStatisticsObjectType +} + +func (*ChatStatisticsObjectTypeStory) GetType() string { + return TypeChatStatisticsObjectTypeStory +} + +func (*ChatStatisticsObjectTypeStory) ChatStatisticsObjectTypeType() string { + return TypeChatStatisticsObjectTypeStory +} + +// Contains statistics about interactions with a message sent in the chat or a story sent by the chat +type ChatStatisticsInteractionInfo struct { + meta + // Type of the object + ObjectType ChatStatisticsObjectType `json:"object_type"` + // Number of times the object was viewed + ViewCount int32 `json:"view_count"` + // Number of times the object was forwarded + ForwardCount int32 `json:"forward_count"` + // Number of times reactions were added to the object + ReactionCount int32 `json:"reaction_count"` +} + +func (entity *ChatStatisticsInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsInteractionInfo) GetClass() string { + return ClassChatStatisticsInteractionInfo +} + +func (*ChatStatisticsInteractionInfo) GetType() string { + return TypeChatStatisticsInteractionInfo +} + +func (chatStatisticsInteractionInfo *ChatStatisticsInteractionInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + ObjectType json.RawMessage `json:"object_type"` + ViewCount int32 `json:"view_count"` + ForwardCount int32 `json:"forward_count"` + ReactionCount int32 `json:"reaction_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatStatisticsInteractionInfo.ViewCount = tmp.ViewCount + chatStatisticsInteractionInfo.ForwardCount = tmp.ForwardCount + chatStatisticsInteractionInfo.ReactionCount = tmp.ReactionCount + + fieldObjectType, _ := UnmarshalChatStatisticsObjectType(tmp.ObjectType) + chatStatisticsInteractionInfo.ObjectType = fieldObjectType + + return nil } // Contains statistics about messages sent by a user @@ -40418,10 +41032,18 @@ type ChatStatisticsChannel struct { Period *DateRange `json:"period"` // Number of members in the chat MemberCount *StatisticalValue `json:"member_count"` - // Mean number of times the recently sent messages was viewed - MeanViewCount *StatisticalValue `json:"mean_view_count"` - // Mean number of times the recently sent messages was shared - MeanShareCount *StatisticalValue `json:"mean_share_count"` + // Mean number of times the recently sent messages were viewed + MeanMessageViewCount *StatisticalValue `json:"mean_message_view_count"` + // Mean number of times the recently sent messages were shared + MeanMessageShareCount *StatisticalValue `json:"mean_message_share_count"` + // Mean number of times reactions were added to the recently sent messages + MeanMessageReactionCount *StatisticalValue `json:"mean_message_reaction_count"` + // Mean number of times the recently sent stories were viewed + MeanStoryViewCount *StatisticalValue `json:"mean_story_view_count"` + // Mean number of times the recently sent stories were shared + MeanStoryShareCount *StatisticalValue `json:"mean_story_share_count"` + // Mean number of times reactions were added to the recently sent stories + MeanStoryReactionCount *StatisticalValue `json:"mean_story_reaction_count"` // A percentage of users with enabled notifications for the chat; 0-100 EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` // A graph containing number of members in the chat @@ -40440,10 +41062,16 @@ type ChatStatisticsChannel struct { LanguageGraph StatisticalGraph `json:"language_graph"` // A graph containing number of chat message views and shares MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` + // A graph containing number of reactions on messages + MessageReactionGraph StatisticalGraph `json:"message_reaction_graph"` + // A graph containing number of story views and shares + StoryInteractionGraph StatisticalGraph `json:"story_interaction_graph"` + // A graph containing number of reactions on stories + StoryReactionGraph StatisticalGraph `json:"story_reaction_graph"` // A graph containing number of views of associated with the chat instant views InstantViewInteractionGraph StatisticalGraph `json:"instant_view_interaction_graph"` - // Detailed statistics about number of views and shares of recently sent messages - RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"` + // Detailed statistics about number of views and shares of recently sent messages and stories + RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` } func (entity *ChatStatisticsChannel) MarshalJSON() ([]byte, error) { @@ -40470,8 +41098,12 @@ func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) e var tmp struct { Period *DateRange `json:"period"` MemberCount *StatisticalValue `json:"member_count"` - MeanViewCount *StatisticalValue `json:"mean_view_count"` - MeanShareCount *StatisticalValue `json:"mean_share_count"` + MeanMessageViewCount *StatisticalValue `json:"mean_message_view_count"` + MeanMessageShareCount *StatisticalValue `json:"mean_message_share_count"` + MeanMessageReactionCount *StatisticalValue `json:"mean_message_reaction_count"` + MeanStoryViewCount *StatisticalValue `json:"mean_story_view_count"` + MeanStoryShareCount *StatisticalValue `json:"mean_story_share_count"` + MeanStoryReactionCount *StatisticalValue `json:"mean_story_reaction_count"` EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` MemberCountGraph json.RawMessage `json:"member_count_graph"` JoinGraph json.RawMessage `json:"join_graph"` @@ -40481,8 +41113,11 @@ func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) e JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"` LanguageGraph json.RawMessage `json:"language_graph"` MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` + MessageReactionGraph json.RawMessage `json:"message_reaction_graph"` + StoryInteractionGraph json.RawMessage `json:"story_interaction_graph"` + StoryReactionGraph json.RawMessage `json:"story_reaction_graph"` InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"` - RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"` + RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` } err := json.Unmarshal(data, &tmp) @@ -40492,10 +41127,14 @@ func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) e chatStatisticsChannel.Period = tmp.Period chatStatisticsChannel.MemberCount = tmp.MemberCount - chatStatisticsChannel.MeanViewCount = tmp.MeanViewCount - chatStatisticsChannel.MeanShareCount = tmp.MeanShareCount + chatStatisticsChannel.MeanMessageViewCount = tmp.MeanMessageViewCount + chatStatisticsChannel.MeanMessageShareCount = tmp.MeanMessageShareCount + chatStatisticsChannel.MeanMessageReactionCount = tmp.MeanMessageReactionCount + chatStatisticsChannel.MeanStoryViewCount = tmp.MeanStoryViewCount + chatStatisticsChannel.MeanStoryShareCount = tmp.MeanStoryShareCount + chatStatisticsChannel.MeanStoryReactionCount = tmp.MeanStoryReactionCount chatStatisticsChannel.EnabledNotificationsPercentage = tmp.EnabledNotificationsPercentage - chatStatisticsChannel.RecentMessageInteractions = tmp.RecentMessageInteractions + chatStatisticsChannel.RecentInteractions = tmp.RecentInteractions fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph @@ -40521,6 +41160,15 @@ func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) e fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph + fieldMessageReactionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageReactionGraph) + chatStatisticsChannel.MessageReactionGraph = fieldMessageReactionGraph + + fieldStoryInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryInteractionGraph) + chatStatisticsChannel.StoryInteractionGraph = fieldStoryInteractionGraph + + fieldStoryReactionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryReactionGraph) + chatStatisticsChannel.StoryReactionGraph = fieldStoryReactionGraph + fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph) chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph @@ -40532,6 +41180,8 @@ type MessageStatistics struct { meta // A graph containing number of message views and shares MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` + // A graph containing number of message reactions + MessageReactionGraph StatisticalGraph `json:"message_reaction_graph"` } func (entity *MessageStatistics) MarshalJSON() ([]byte, error) { @@ -40553,6 +41203,7 @@ func (*MessageStatistics) GetType() string { func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error { var tmp struct { MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` + MessageReactionGraph json.RawMessage `json:"message_reaction_graph"` } err := json.Unmarshal(data, &tmp) @@ -40563,6 +41214,54 @@ func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error { fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph + fieldMessageReactionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageReactionGraph) + messageStatistics.MessageReactionGraph = fieldMessageReactionGraph + + return nil +} + +// A detailed statistics about a story +type StoryStatistics struct { + meta + // A graph containing number of story views and shares + StoryInteractionGraph StatisticalGraph `json:"story_interaction_graph"` + // A graph containing number of story reactions + StoryReactionGraph StatisticalGraph `json:"story_reaction_graph"` +} + +func (entity *StoryStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*StoryStatistics) GetClass() string { + return ClassStoryStatistics +} + +func (*StoryStatistics) GetType() string { + return TypeStoryStatistics +} + +func (storyStatistics *StoryStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + StoryInteractionGraph json.RawMessage `json:"story_interaction_graph"` + StoryReactionGraph json.RawMessage `json:"story_reaction_graph"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldStoryInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryInteractionGraph) + storyStatistics.StoryInteractionGraph = fieldStoryInteractionGraph + + fieldStoryReactionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryReactionGraph) + storyStatistics.StoryReactionGraph = fieldStoryReactionGraph + return nil } @@ -40902,7 +41601,7 @@ func (*UpdateNewMessage) UpdateType() string { return TypeUpdateNewMessage } -// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message +// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message type UpdateMessageSendAcknowledged struct { meta // The chat identifier of the sent message @@ -41402,7 +42101,7 @@ type UpdateChatBackgroundCustomEmoji struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new tdentifier of a custom emoji to be shown on the reply header background + // The new identifier of a custom emoji to be shown on the reply header background; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` } @@ -41426,7 +42125,7 @@ func (*UpdateChatBackgroundCustomEmoji) UpdateType() string { return TypeUpdateChatBackgroundCustomEmoji } -// Chat permissions was changed +// Chat permissions were changed type UpdateChatPermissions struct { meta // Chat identifier @@ -42127,6 +42826,35 @@ func (*UpdateChatIsMarkedAsUnread) UpdateType() string { return TypeUpdateChatIsMarkedAsUnread } +// A chat default appearance has changed +type UpdateChatViewAsTopics struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of view_as_topics + ViewAsTopics bool `json:"view_as_topics"` +} + +func (entity *UpdateChatViewAsTopics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatViewAsTopics + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatViewAsTopics) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatViewAsTopics) GetType() string { + return TypeUpdateChatViewAsTopics +} + +func (*UpdateChatViewAsTopics) UpdateType() string { + return TypeUpdateChatViewAsTopics +} + // A chat was blocked or unblocked type UpdateChatBlockList struct { meta @@ -42233,7 +42961,7 @@ func (*UpdateChatFolders) UpdateType() string { return TypeUpdateChatFolders } -// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed +// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it is sent just after the number of online users has changed type UpdateChatOnlineMemberCount struct { meta // Identifier of the chat @@ -42440,7 +43168,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt return nil } -// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update +// Contains active notifications that were shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update type UpdateActiveNotifications struct { meta // Lists of active notification groups @@ -43858,7 +44586,7 @@ func (*UpdateSavedAnimations) UpdateType() string { return TypeUpdateSavedAnimations } -// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time +// The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time type UpdateSavedNotificationSounds struct { meta // The new list of identifiers of saved notification sounds @@ -43970,6 +44698,35 @@ func (*UpdateAccentColors) UpdateType() string { return TypeUpdateAccentColors } +// The list of supported accent colors for user profiles has changed +type UpdateProfileAccentColors struct { + meta + // Information about supported colors + Colors []*ProfileAccentColor `json:"colors"` + // The list of accent color identifiers, which can be set through setProfileAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` +} + +func (entity *UpdateProfileAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateProfileAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateProfileAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateProfileAccentColors) GetType() string { + return TypeUpdateProfileAccentColors +} + +func (*UpdateProfileAccentColors) UpdateType() string { + return TypeUpdateProfileAccentColors +} + // Some language pack strings have been updated type UpdateLanguagePackStrings struct { meta @@ -44251,6 +45008,39 @@ func (updateDefaultReactionType *UpdateDefaultReactionType) UnmarshalJSON(data [ return nil } +// The parameters of speech recognition without Telegram Premium subscription has changed +type UpdateSpeechRecognitionTrial struct { + meta + // The maximum allowed duration of media for speech recognition without Telegram Premium subscription + MaxMediaDuration int32 `json:"max_media_duration"` + // The total number of allowed speech recognitions per week; 0 if none + WeeklyCount int32 `json:"weekly_count"` + // Number of left speech recognition attempts this week + LeftCount int32 `json:"left_count"` + // Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown + NextResetDate int32 `json:"next_reset_date"` +} + +func (entity *UpdateSpeechRecognitionTrial) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSpeechRecognitionTrial + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSpeechRecognitionTrial) GetClass() string { + return ClassUpdate +} + +func (*UpdateSpeechRecognitionTrial) GetType() string { + return TypeUpdateSpeechRecognitionTrial +} + +func (*UpdateSpeechRecognitionTrial) UpdateType() string { + return TypeUpdateSpeechRecognitionTrial +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -44903,7 +45693,7 @@ type UpdateChatMember struct { ChatId int64 `json:"chat_id"` // Identifier of the user, changing the rights ActorUserId int64 `json:"actor_user_id"` - // Point in time (Unix timestamp) when the user rights was changed + // Point in time (Unix timestamp) when the user rights were changed Date int32 `json:"date"` // If user has joined the chat using an invite link, the invite link; may be null InviteLink *ChatInviteLink `json:"invite_link"` diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 3af611e..08fb7f7 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -1160,6 +1160,9 @@ func UnmarshalMessageSponsorType(data json.RawMessage) (MessageSponsorType, erro case TypeMessageSponsorTypeBot: return UnmarshalMessageSponsorTypeBot(data) + case TypeMessageSponsorTypeWebApp: + return UnmarshalMessageSponsorTypeWebApp(data) + case TypeMessageSponsorTypePublicChannel: return UnmarshalMessageSponsorTypePublicChannel(data) @@ -2535,6 +2538,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePremiumGiveaway: return UnmarshalMessagePremiumGiveaway(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -3242,6 +3248,74 @@ func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { return list, nil } +func UnmarshalStoryOrigin(data json.RawMessage) (StoryOrigin, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryOriginPublicStory: + return UnmarshalStoryOriginPublicStory(data) + + case TypeStoryOriginHiddenUser: + return UnmarshalStoryOriginHiddenUser(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryOrigin(dataList []json.RawMessage) ([]StoryOrigin, error) { + list := []StoryOrigin{} + + for _, data := range dataList { + entity, err := UnmarshalStoryOrigin(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryPublicForward(data json.RawMessage) (StoryPublicForward, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryPublicForwardMessage: + return UnmarshalStoryPublicForwardMessage(data) + + case TypeStoryPublicForwardStory: + return UnmarshalStoryPublicForwardStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryPublicForward(dataList []json.RawMessage) ([]StoryPublicForward, error) { + list := []StoryPublicForward{} + + for _, data := range dataList { + entity, err := UnmarshalStoryPublicForward(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatBoostSource(data json.RawMessage) (ChatBoostSource, error) { var meta meta @@ -4101,6 +4175,9 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeStorySuggestedReactionAreaCount: return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + case TypePremiumLimitTypeSimilarChatCount: + return UnmarshalPremiumLimitTypeSimilarChatCount(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4183,6 +4260,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureAccentColor: return UnmarshalPremiumFeatureAccentColor(data) + case TypePremiumFeatureBackgroundForBoth: + return UnmarshalPremiumFeatureBackgroundForBoth(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6088,6 +6168,40 @@ func UnmarshalListOfStatisticalGraph(dataList []json.RawMessage) ([]StatisticalG return list, nil } +func UnmarshalChatStatisticsObjectType(data json.RawMessage) (ChatStatisticsObjectType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatStatisticsObjectTypeMessage: + return UnmarshalChatStatisticsObjectTypeMessage(data) + + case TypeChatStatisticsObjectTypeStory: + return UnmarshalChatStatisticsObjectTypeStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatStatisticsObjectType(dataList []json.RawMessage) ([]ChatStatisticsObjectType, error) { + list := []ChatStatisticsObjectType{} + + for _, data := range dataList { + entity, err := UnmarshalChatStatisticsObjectType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatStatistics(data json.RawMessage) (ChatStatistics, error) { var meta meta @@ -6334,6 +6448,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) + case TypeUpdateChatBlockList: return UnmarshalUpdateChatBlockList(data) @@ -6493,6 +6610,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -6520,6 +6640,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -7625,6 +7748,22 @@ func UnmarshalAccentColor(data json.RawMessage) (*AccentColor, error) { return &resp, err } +func UnmarshalProfileAccentColors(data json.RawMessage) (*ProfileAccentColors, error) { + var resp ProfileAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, error) { + var resp ProfileAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { var resp EmojiStatus @@ -8217,6 +8356,22 @@ func UnmarshalMessageSendingStateFailed(data json.RawMessage) (*MessageSendingSt return &resp, err } +func UnmarshalTextQuote(data json.RawMessage) (*TextQuote, error) { + var resp TextQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputTextQuote(data json.RawMessage) (*InputTextQuote, error) { + var resp InputTextQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageReplyToMessage(data json.RawMessage) (*MessageReplyToMessage, error) { var resp MessageReplyToMessage @@ -8401,6 +8556,14 @@ func UnmarshalMessageSponsorTypeBot(data json.RawMessage) (*MessageSponsorTypeBo return &resp, err } +func UnmarshalMessageSponsorTypeWebApp(data json.RawMessage) (*MessageSponsorTypeWebApp, error) { + var resp MessageSponsorTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSponsorTypePublicChannel(data json.RawMessage) (*MessageSponsorTypePublicChannel, error) { var resp MessageSponsorTypePublicChannel @@ -10801,6 +10964,14 @@ func UnmarshalMessagePremiumGiveaway(data json.RawMessage) (*MessagePremiumGivea return &resp, err } +func UnmarshalMessagePremiumGiveawayCompleted(data json.RawMessage) (*MessagePremiumGiveawayCompleted, error) { + var resp MessagePremiumGiveawayCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -11809,6 +11980,30 @@ func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) return &resp, err } +func UnmarshalStoryOriginPublicStory(data json.RawMessage) (*StoryOriginPublicStory, error) { + var resp StoryOriginPublicStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryOriginHiddenUser(data json.RawMessage) (*StoryOriginHiddenUser, error) { + var resp StoryOriginHiddenUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryRepostInfo(data json.RawMessage) (*StoryRepostInfo, error) { + var resp StoryRepostInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) { var resp StoryInteractionInfo @@ -11833,6 +12028,14 @@ func UnmarshalStories(data json.RawMessage) (*Stories, error) { return &resp, err } +func UnmarshalStoryFullId(data json.RawMessage) (*StoryFullId, error) { + var resp StoryFullId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) { var resp StoryInfo @@ -11849,6 +12052,30 @@ func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error return &resp, err } +func UnmarshalStoryPublicForwardMessage(data json.RawMessage) (*StoryPublicForwardMessage, error) { + var resp StoryPublicForwardMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPublicForwardStory(data json.RawMessage) (*StoryPublicForwardStory, error) { + var resp StoryPublicForwardStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPublicForwards(data json.RawMessage) (*StoryPublicForwards, error) { + var resp StoryPublicForwards + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatBoostSourceGiftCode(data json.RawMessage) (*ChatBoostSourceGiftCode, error) { var resp ChatBoostSourceGiftCode @@ -13281,6 +13508,14 @@ func UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data json.RawMessa return &resp, err } +func UnmarshalPremiumLimitTypeSimilarChatCount(data json.RawMessage) (*PremiumLimitTypeSimilarChatCount, error) { + var resp PremiumLimitTypeSimilarChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { var resp PremiumFeatureIncreasedLimits @@ -13425,6 +13660,14 @@ func UnmarshalPremiumFeatureAccentColor(data json.RawMessage) (*PremiumFeatureAc return &resp, err } +func UnmarshalPremiumFeatureBackgroundForBoth(data json.RawMessage) (*PremiumFeatureBackgroundForBoth, error) { + var resp PremiumFeatureBackgroundForBoth + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { var resp PremiumStoryFeaturePriorityOrder @@ -16025,8 +16268,24 @@ func UnmarshalStatisticalGraphError(data json.RawMessage) (*StatisticalGraphErro return &resp, err } -func UnmarshalChatStatisticsMessageInteractionInfo(data json.RawMessage) (*ChatStatisticsMessageInteractionInfo, error) { - var resp ChatStatisticsMessageInteractionInfo +func UnmarshalChatStatisticsObjectTypeMessage(data json.RawMessage) (*ChatStatisticsObjectTypeMessage, error) { + var resp ChatStatisticsObjectTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsObjectTypeStory(data json.RawMessage) (*ChatStatisticsObjectTypeStory, error) { + var resp ChatStatisticsObjectTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsInteractionInfo(data json.RawMessage) (*ChatStatisticsInteractionInfo, error) { + var resp ChatStatisticsInteractionInfo err := json.Unmarshal(data, &resp) @@ -16081,6 +16340,14 @@ func UnmarshalMessageStatistics(data json.RawMessage) (*MessageStatistics, error return &resp, err } +func UnmarshalStoryStatistics(data json.RawMessage) (*StoryStatistics, error) { + var resp StoryStatistics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPoint(data json.RawMessage) (*Point, error) { var resp Point @@ -16481,6 +16748,14 @@ func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMar return &resp, err } +func UnmarshalUpdateChatViewAsTopics(data json.RawMessage) (*UpdateChatViewAsTopics, error) { + var resp UpdateChatViewAsTopics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatBlockList(data json.RawMessage) (*UpdateChatBlockList, error) { var resp UpdateChatBlockList @@ -16905,6 +17180,14 @@ func UnmarshalUpdateAccentColors(data json.RawMessage) (*UpdateAccentColors, err return &resp, err } +func UnmarshalUpdateProfileAccentColors(data json.RawMessage) (*UpdateProfileAccentColors, error) { + var resp UpdateProfileAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { var resp UpdateLanguagePackStrings @@ -16977,6 +17260,14 @@ func UnmarshalUpdateDefaultReactionType(data json.RawMessage) (*UpdateDefaultRea return &resp, err } +func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) { + var resp UpdateSpeechRecognitionTrial + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -17622,6 +17913,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAccentColor: return UnmarshalAccentColor(data) + case TypeProfileAccentColors: + return UnmarshalProfileAccentColors(data) + + case TypeProfileAccentColor: + return UnmarshalProfileAccentColor(data) + case TypeEmojiStatus: return UnmarshalEmojiStatus(data) @@ -17844,6 +18141,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSendingStateFailed: return UnmarshalMessageSendingStateFailed(data) + case TypeTextQuote: + return UnmarshalTextQuote(data) + + case TypeInputTextQuote: + return UnmarshalInputTextQuote(data) + case TypeMessageReplyToMessage: return UnmarshalMessageReplyToMessage(data) @@ -17913,6 +18216,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSponsorTypeBot: return UnmarshalMessageSponsorTypeBot(data) + case TypeMessageSponsorTypeWebApp: + return UnmarshalMessageSponsorTypeWebApp(data) + case TypeMessageSponsorTypePublicChannel: return UnmarshalMessageSponsorTypePublicChannel(data) @@ -18813,6 +19119,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePremiumGiveaway: return UnmarshalMessagePremiumGiveaway(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -19191,6 +19500,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryListArchive: return UnmarshalStoryListArchive(data) + case TypeStoryOriginPublicStory: + return UnmarshalStoryOriginPublicStory(data) + + case TypeStoryOriginHiddenUser: + return UnmarshalStoryOriginHiddenUser(data) + + case TypeStoryRepostInfo: + return UnmarshalStoryRepostInfo(data) + case TypeStoryInteractionInfo: return UnmarshalStoryInteractionInfo(data) @@ -19200,12 +19518,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStories: return UnmarshalStories(data) + case TypeStoryFullId: + return UnmarshalStoryFullId(data) + case TypeStoryInfo: return UnmarshalStoryInfo(data) case TypeChatActiveStories: return UnmarshalChatActiveStories(data) + case TypeStoryPublicForwardMessage: + return UnmarshalStoryPublicForwardMessage(data) + + case TypeStoryPublicForwardStory: + return UnmarshalStoryPublicForwardStory(data) + + case TypeStoryPublicForwards: + return UnmarshalStoryPublicForwards(data) + case TypeChatBoostSourceGiftCode: return UnmarshalChatBoostSourceGiftCode(data) @@ -19743,6 +20073,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeStorySuggestedReactionAreaCount: return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + case TypePremiumLimitTypeSimilarChatCount: + return UnmarshalPremiumLimitTypeSimilarChatCount(data) + case TypePremiumFeatureIncreasedLimits: return UnmarshalPremiumFeatureIncreasedLimits(data) @@ -19797,6 +20130,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureAccentColor: return UnmarshalPremiumFeatureAccentColor(data) + case TypePremiumFeatureBackgroundForBoth: + return UnmarshalPremiumFeatureBackgroundForBoth(data) + case TypePremiumStoryFeaturePriorityOrder: return UnmarshalPremiumStoryFeaturePriorityOrder(data) @@ -20772,8 +21108,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStatisticalGraphError: return UnmarshalStatisticalGraphError(data) - case TypeChatStatisticsMessageInteractionInfo: - return UnmarshalChatStatisticsMessageInteractionInfo(data) + case TypeChatStatisticsObjectTypeMessage: + return UnmarshalChatStatisticsObjectTypeMessage(data) + + case TypeChatStatisticsObjectTypeStory: + return UnmarshalChatStatisticsObjectTypeStory(data) + + case TypeChatStatisticsInteractionInfo: + return UnmarshalChatStatisticsInteractionInfo(data) case TypeChatStatisticsMessageSenderInfo: return UnmarshalChatStatisticsMessageSenderInfo(data) @@ -20793,6 +21135,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageStatistics: return UnmarshalMessageStatistics(data) + case TypeStoryStatistics: + return UnmarshalStoryStatistics(data) + case TypePoint: return UnmarshalPoint(data) @@ -20943,6 +21288,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) + case TypeUpdateChatBlockList: return UnmarshalUpdateChatBlockList(data) @@ -21102,6 +21450,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -21129,6 +21480,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) diff --git a/data/td_api.tl b/data/td_api.tl index b14df9a..f55b5ba 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -703,7 +703,7 @@ premiumGiftCodePaymentOptions options:vector = Pre //@creator_id Identifier of a chat or a user that created the gift code //@creation_date Point in time (Unix timestamp) when the code was created //@is_from_giveaway True, if the gift code was created for a giveaway -//@giveaway_message_id Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message +//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message //@month_count Number of month the Telegram Premium subscription will be active after code activation //@user_id Identifier of a user for which the code was created; 0 if none //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none @@ -754,6 +754,18 @@ premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:i //@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; +//@description Contains information about supported accent colors for user profile photo background in RGB format +//@palette_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings +//@background_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background +//@story_colors The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo +profileAccentColors palette_colors:vector background_colors:vector story_colors:vector = ProfileAccentColors; + +//@description Contains information about supported accent color for user profile photo background +//@id Profile accent color identifier +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors = ProfileAccentColor; + //@description Describes a custom emoji to be shown instead of the Telegram Premium badge //@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format //@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never @@ -779,8 +791,10 @@ usernames active_usernames:vector disabled_usernames:vector edit //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null -//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only //@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only +//@profile_accent_color_id Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user @@ -797,7 +811,7 @@ usernames active_usernames:vector disabled_usernames:vector edit //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -830,11 +844,12 @@ botInfo short_description:string description:string photo:photo animation:animat //@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user //@has_pinned_stories True, if the user has pinned stories //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used +//@set_chat_background True, if the user set chat background for both chat users and it wasn't reverted yet //@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 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; +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 set_chat_background: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; @@ -1048,8 +1063,10 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@usernames Usernames of the supergroup or channel; may be null //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will always be empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received -//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through +//-getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, +//-searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or for public chats in which where sent messages and posted stories from storyPublicForwards, +//-or for public chats in which where sent messages from getMessagePublicForwards response //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels @@ -1058,7 +1075,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members -//@is_forum True, if the supergroup must be shown as a forum by default +//@is_forum True, if the supergroup is a forum with topics //@is_verified True, if the supergroup or channel is verified //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam @@ -1134,7 +1151,7 @@ messageSenderChat chat_id:int53 = MessageSender; messageSenders total_count:int32 senders:vector = MessageSenders; -//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +//@description Represents a message sender, which can be used to send messages in a chat @sender The message sender @needs_premium True, if Telegram Premium is needed to use the message sender chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; //@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders @@ -1202,7 +1219,7 @@ messageReplyInfo reply_count:int32 recent_replier_ids:vector last //@type Type of the reaction //@total_count Number of times the reaction was added //@is_chosen True, if the reaction is chosen by the current user -//@used_sender_id Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen +//@used_sender_id Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen //@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats messageReaction type:ReactionType total_count:int32 is_chosen:Bool used_sender_id:MessageSender recent_sender_ids:vector = MessageReaction; @@ -1236,19 +1253,30 @@ messageSendingStatePending sending_id:int32 = MessageSendingState; messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; +//@description Describes manually or automatically chosen quote from another message +//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text +//@position Approximate quote position in the original message in UTF-16 code units +//@is_manual True, if the quote was manually chosen by the message sender +textQuote text:formattedText position:int32 is_manual:Bool = TextQuote; + +//@description Describes manually chosen quote from another message +//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +//@position Quote position in the original message in UTF-16 code units +inputTextQuote text:formattedText position:int32 = InputTextQuote; + + //@class MessageReplyTo @description Contains information about the message or the story a message is replying to //@description Describes a message replied by a given message //@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat //@message_id The identifier of the message; may be 0 if the replied message is in unknown chat -//@quote Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote -//@is_quote_manual True, if the quote was manually chosen by the message sender -//@origin Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat -//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat -//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. +//@quote Chosen quote from the replied message; may be null if none +//@origin Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat +//@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. //-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, //-messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote -messageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; +messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; //@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; @@ -1257,11 +1285,10 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@class InputMessageReplyTo @description Contains information about the message or the story to be replied //@description Describes a message to be replied -//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat +//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat //@message_id The identifier of the message to be replied in the same or the specified chat -//@quote Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. -//-Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote -inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo; +//@quote Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats +inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:inputTextQuote = InputMessageReplyTo; //@description Describes a story to be replied @story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the story inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; @@ -1277,7 +1304,7 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag //@is_pinned True, if the message is pinned //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded -//@can_be_replied_in_another_chat True, if the message can be replied in another chat +//@can_be_replied_in_another_chat True, if the message can be replied in another chat or topic //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users @@ -1313,7 +1340,7 @@ message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSend //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, then there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; //@description Contains a list of messages found by a search in a given chat @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_from_message_id The offset for the next request. If 0, there are no more results @@ -1370,6 +1397,9 @@ messageSourceOther = MessageSource; //@description The sponsor is a bot @bot_user_id User identifier of the bot @link An internal link to be opened when the sponsored message is clicked messageSponsorTypeBot bot_user_id:int53 link:InternalLinkType = MessageSponsorType; +//@description The sponsor is a web app @web_app_title Web App title @link An internal link to be opened when the sponsored message is clicked +messageSponsorTypeWebApp web_app_title:string link:InternalLinkType = MessageSponsorType; + //@description The sponsor is a public channel chat @chat_id Sponsor chat identifier @link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead messageSponsorTypePublicChannel chat_id:int53 link:InternalLinkType = MessageSponsorType; @@ -1391,8 +1421,9 @@ messageSponsor type:MessageSponsorType photo:chatPhotoInfo info:string = Message //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" //@content Content of the message. Currently, can be only of the type messageText //@sponsor Information about the sponsor of the message +//@button_text If non-empty, text for the message action button //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message -sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor additional_info:string = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor button_text:string additional_info:string = SponsoredMessage; //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; @@ -1415,7 +1446,7 @@ downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 //@description Contains a list of downloaded files, found by a search //@total_counts Total number of suitable files, ignoring offset //@files The list of files -//@next_offset The offset for the next request. If empty, there are no more results +//@next_offset The offset for the next request. If empty, then there are no more results foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; @@ -1432,21 +1463,21 @@ notificationSettingsScopeChannelChats = NotificationSettingsScope; //@description Contains information about notification settings for a chat or a forum topic -//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_mute_for If true, the value for the relevant type of chat or the forum chat is used instead of mute_for //@mute_for Time left before notifications will be unmuted, in seconds //@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id //@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled -//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_show_preview If true, the value for the relevant type of chat or the forum chat is used instead of show_preview //@show_preview True, if message content must be displayed in notifications -//@use_default_mute_stories If true, mute_stories is ignored and the value for the relevant type of chat is used instead +//@use_default_mute_stories If true, the value for the relevant type of chat is used instead of mute_stories //@mute_stories True, if story notifications are disabled for the chat //@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id //@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled -//@use_default_show_story_sender If true, show_story_sender is ignored and the value for the relevant type of chat is used instead +//@use_default_show_story_sender If true, the value for the relevant type of chat is used instead of show_story_sender //@show_story_sender True, if the sender of stories must be displayed in notifications -//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_disable_pinned_message_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications //@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message -//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_disable_mention_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications //@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_sender:Bool show_story_sender:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; @@ -1454,8 +1485,8 @@ chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_so //@mute_for Time left before notifications will be unmuted, in seconds //@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications -//@use_default_mute_stories If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers -//@mute_stories True, if story notifications are disabled for the chat +//@use_default_mute_stories If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories +//@mute_stories True, if story notifications are disabled //@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled //@show_story_sender True, if the sender of stories must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message @@ -1481,7 +1512,7 @@ chatTypeBasicGroup basic_group_id:int53 = ChatType; //@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; -//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer +//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the other user in the secret chat chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; @@ -1605,6 +1636,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@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 +//@view_as_topics True, if the chat is a forum supergroup that must be shown in the "View as topics" mode //@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 @@ -1626,7 +1658,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@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; @@ -1663,7 +1695,7 @@ 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 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 +//@distance If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar; //@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact @@ -2133,8 +2165,8 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@embed_height Height of the embedded preview //@duration Duration of the content, in seconds //@author Author of the content -//@has_large_media True, if the preview has large media and its appearance can be changed -//@show_large_media True, if large media preview must be shown +//@has_large_media True, if size of media in the preview can be changed +//@show_large_media True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos //@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear //@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text //@animation Preview of the content as an animation, if available; may be null @@ -2639,7 +2671,7 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@description A text message //@text Text of the message //@web_page A link preview attached to the message; may be null -//@link_preview_options Options which was used for generation of the link preview; may be null if default options were used +//@link_preview_options Options which were used for generation of the link preview; may be null if default options were used messageText text:formattedText web_page:webPage link_preview_options:linkPreviewOptions = MessageContent; //@description An animation message (GIF-style). @@ -2788,8 +2820,11 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; -//@description A new background was set in the chat @old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message @background The new background -messageChatSetBackground old_background_message_id:int53 background:chatBackground = MessageContent; +//@description A new background was set in the chat +//@old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message +//@background The new background +//@only_for_self True, if the background was set only for self +messageChatSetBackground old_background_message_id:int53 background:chatBackground only_for_self:Bool = MessageContent; //@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one messageChatSetTheme theme_name:string = MessageContent; @@ -2872,6 +2907,12 @@ messagePremiumGiveawayCreated = MessageContent; //@sticker A sticker to be shown in the message; may be null if unknown messagePremiumGiveaway parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent; +//@description A Telegram Premium giveaway has been completed for the chat +//@giveaway_message_id Identifier of the message with the giveaway, can be an identifier of a deleted message +//@winner_count Number of winners in the giveaway +//@unclaimed_prize_count Number of undistributed prizes +messagePremiumGiveawayCompleted giveaway_message_id:int53 winner_count:int32 unclaimed_prize_count:int32 = MessageContent; + //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -2981,7 +3022,7 @@ inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; //@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; -//@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +//@description The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known messageSchedulingStateSendWhenOnline = MessageSchedulingState; @@ -3042,7 +3083,7 @@ inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration: //@description A document message (general file) //@document Document to be sent //@thumbnail Document thumbnail; pass null to skip thumbnail uploading -//@disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats +//@disable_content_type_detection True, if automatic file type detection is disabled and the document must be sent as a file. Always true for files sent to secret chats //@caption Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; @@ -3353,7 +3394,7 @@ storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_t //@total_count Approximate total number of story viewers found //@total_reaction_count Approximate total number of reactions set by found story viewers //@viewers List of story viewers -//@next_offset The offset for the next request. If empty, there are no more results +//@next_offset The offset for the next request. If empty, then there are no more results storyViewers total_count:int32 total_reaction_count:int32 viewers:vector next_offset:string = StoryViewers; @@ -3464,6 +3505,20 @@ storyListMain = StoryList; storyListArchive = StoryList; +//@class StoryOrigin @description Contains information about the origin of a story that was reposted + +//@description The original story was a public story with known sender @chat_id Identifier of the chat that posted original story @story_id Story identifier of the original story +storyOriginPublicStory chat_id:int53 story_id:int32 = StoryOrigin; + +//@description The original story was sent by an unknown user @sender_name Name of the story sender +storyOriginHiddenUser sender_name:string = StoryOrigin; + + +//@description Contains information about original story that was reposted +//@origin Origin of the story that was reposted +//@is_content_modified True, if story content was modified during reposting; otherwise, story wasn't modified +storyRepostInfo origin:StoryOrigin is_content_modified:Bool = StoryRepostInfo; + //@description Contains information about interactions with a story //@view_count Number of times the story was viewed //@forward_count Number of times the story was forwarded; 0 if none or unknown @@ -3485,19 +3540,26 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden //@can_be_replied True, if the story can be replied in the chat with the story sender //@can_toggle_is_pinned True, if the story's is_pinned value can be changed +//@can_get_statistics True, if the story statistics are available through getStoryStatistics //@can_get_viewers True, if users viewed the story can be received through getStoryViewers //@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago +//@repost_info Information about the original story; may be null if the story wasn't reposted //@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions //@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_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector 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_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_statistics:Bool can_get_viewers:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; //@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; +//@description Contains identifier of a story along with identifier of its sender +//@sender_chat_id Identifier of the chat that posted the story +//@story_id Unique story identifier among stories of the given sender +storyFullId sender_chat_id:int53 story_id:int32 = StoryFullId; + //@description Contains basic information about a story //@story_id Unique story identifier among stories of the given sender //@date Point in time (Unix timestamp) when the story was published @@ -3513,6 +3575,22 @@ 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 StoryPublicForward @description Describes a public forward or repost of a story + +//@description Contains a public forward of a story as a message @message Information about the message with the story +storyPublicForwardMessage message:message = StoryPublicForward; + +//@description Contains a public repost of a story as a story @story Information about the reposted story +storyPublicForwardStory story:story = StoryPublicForward; + + +//@description Represents a list of public forwards and reposts of a story +//@total_count Approximate total number of messages and stories found +//@forwards List of found public forwards and reposts +//@next_offset The offset for the next request. If empty, then there are no more results +storyPublicForwards total_count:int32 forwards:vector next_offset:string = StoryPublicForwards; + + //@class ChatBoostSource @description Describes source of a chat boost //@description The chat created a Telegram Premium gift code for a user @@ -3560,7 +3638,7 @@ chatBoostStatus boost_url:string applied_slot_ids:vector level:int32 gift //@expiration_date Point in time (Unix timestamp) when the boost will expire chatBoost id:string count:int32 source:ChatBoostSource start_date:int32 expiration_date:int32 = ChatBoost; -//@description Contains a list of boosts applied to a chat @total_count Total number of boosts applied to the chat @boosts List of boosts @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of boosts applied to a chat @total_count Total number of boosts applied to the chat @boosts List of boosts @next_offset The offset for the next request. If empty, then there are no more results foundChatBoosts total_count:int32 boosts:vector next_offset:string = FoundChatBoosts; //@description Describes a slot for chat boost @@ -3640,7 +3718,7 @@ callStatePending is_created:Bool is_received:Bool = CallState; callStateExchangingKeys = CallState; //@description The call is ready to use -//@protocol Call protocols supported by the peer +//@protocol Call protocols supported by the other call participant //@servers List of available call servers //@config A JSON-encoded call config //@encryption_key Call encryption key @@ -3694,7 +3772,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@id Group call identifier //@title Group call title //@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended -//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start +//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts //@is_active True, if the call is active //@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat //@is_joined True, if the call is joined @@ -3777,7 +3855,7 @@ callProblemPixelatedVideo = CallProblem; //@description Describes a call //@id Call identifier, not persistent -//@user_id Peer user identifier +//@user_id User identifier of the other call participant //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state @@ -3810,7 +3888,7 @@ phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool i //@date Point in time (Unix timestamp) when the reaction was added addedReaction type:ReactionType sender_id:MessageSender is_outgoing:Bool date:int32 = AddedReaction; -//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results +//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, then there are no more results addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; //@description Represents an available reaction @type Type of the reaction @needs_premium True, if Telegram Premium is needed to send the reaction @@ -3820,7 +3898,7 @@ availableReaction type:ReactionType needs_premium:Bool = AvailableReaction; //@top_reactions List of reactions to be shown at the top //@recent_reactions List of recently used reactions //@popular_reactions List of popular reactions -//@allow_custom_emoji True, if custom emoji reactions could be added by Telegram Premium subscribers +//@allow_custom_emoji True, if any custom emoji reaction can be added by Telegram Premium subscribers availableReactions top_reactions:vector recent_reactions:vector popular_reactions:vector allow_custom_emoji:Bool = AvailableReactions; //@description Contains information about a emoji reaction @@ -3869,7 +3947,7 @@ speechRecognitionResultPending partial_text:string = SpeechRecognitionResult; //@description The speech recognition successfully finished @text Recognized text speechRecognitionResultText text:string = SpeechRecognitionResult; -//@description The speech recognition failed @error Recognition error +//@description The speech recognition failed @error Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized speechRecognitionResultError error:error = SpeechRecognitionResult; @@ -4161,7 +4239,7 @@ inlineQueryResultsButton text:string type:InlineQueryResultsButtonType = InlineQ //@inline_query_id Unique identifier of the inline query //@button Button to be shown above inline query results; may be null //@results Results of the query -//@next_offset The offset for the next request. If empty, there are no more results +//@next_offset The offset for the next request. If empty, then there are no more results inlineQueryResults inline_query_id:int64 button:inlineQueryResultsButton results:vector next_offset:string = InlineQueryResults; @@ -4245,7 +4323,7 @@ chatEventLocationChanged old_location:chatLocation new_location:chatLocation = C //@description The message auto-delete timer was changed @old_message_auto_delete_time Previous value of message_auto_delete_time @new_message_auto_delete_time New value of message_auto_delete_time chatEventMessageAutoDeleteTimeChanged old_message_auto_delete_time:int32 new_message_auto_delete_time:int32 = ChatEventAction; -//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions +//@description The chat permissions were changed @old_permissions Previous chat permissions @new_permissions New chat permissions chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; //@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null @@ -4456,6 +4534,9 @@ premiumLimitTypeStoryCaptionLength = PremiumLimitType; //@description The maximum number of suggested reaction areas on a story premiumLimitTypeStorySuggestedReactionAreaCount = PremiumLimitType; +//@description The maximum number of received similar chats +premiumLimitTypeSimilarChatCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -4510,9 +4591,12 @@ premiumFeatureUpgradedStories = PremiumFeature; //@description The ability to boost chats premiumFeatureChatBoost = PremiumFeature; -//@description The ability to choose accent color +//@description The ability to choose accent color for replies and user profile premiumFeatureAccentColor = PremiumFeature; +//@description The ability to set private chat background for both users +premiumFeatureBackgroundForBoth = PremiumFeature; + //@class PremiumStoryFeature @description Describes a story feature available to Premium users @@ -4809,13 +4893,13 @@ resetPasswordResultDeclined retry_date:int32 = ResetPasswordResult; //@class MessageFileType @description Contains information about a file with messages exported from another app -//@description The messages was exported from a private chat @name Name of the other party; may be empty if unrecognized +//@description The messages were exported from a private chat @name Name of the other party; may be empty if unrecognized messageFileTypePrivate name:string = MessageFileType; -//@description The messages was exported from a group chat @title Title of the group chat; may be empty if unrecognized +//@description The messages were exported from a group chat @title Title of the group chat; may be empty if unrecognized messageFileTypeGroup title:string = MessageFileType; -//@description The messages was exported from a chat of unknown type +//@description The messages were exported from a chat of unknown type messageFileTypeUnknown = MessageFileType; @@ -5702,16 +5786,16 @@ autosaveSettings private_chat_settings:scopeAutosaveSettings group_settings:scop //@class ConnectionState @description Describes the current state of the connection to Telegram servers -//@description Currently waiting for the network to become available. Use setNetworkType to change the available network type +//@description Waiting for the network to become available. Use setNetworkType to change the available network type connectionStateWaitingForNetwork = ConnectionState; -//@description Currently establishing a connection with a proxy server +//@description Establishing a connection with a proxy server connectionStateConnectingToProxy = ConnectionState; -//@description Currently establishing a connection to the Telegram servers +//@description Establishing a connection to the Telegram servers connectionStateConnecting = ConnectionState; -//@description Downloading data received while the application was offline +//@description Downloading data supposed to be received while the application was offline connectionStateUpdating = ConnectionState; //@description There is a working connection to the Telegram servers @@ -5882,11 +5966,21 @@ statisticalGraphAsync token:string = StatisticalGraph; statisticalGraphError error_message:string = StatisticalGraph; -//@description Contains statistics about interactions with a message -//@message_id Message identifier -//@view_count Number of times the message was viewed -//@forward_count Number of times the message was forwarded -chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_count:int32 = ChatStatisticsMessageInteractionInfo; +//@class ChatStatisticsObjectType @description Describes type of an object, for which statistics are provided + +//@description Describes a message sent in the chat @message_id Message identifier +chatStatisticsObjectTypeMessage message_id:int53 = ChatStatisticsObjectType; + +//@description Describes a story sent by the chat @story_id Story identifier +chatStatisticsObjectTypeStory story_id:int32 = ChatStatisticsObjectType; + + +//@description Contains statistics about interactions with a message sent in the chat or a story sent by the chat +//@object_type Type of the object +//@view_count Number of times the object was viewed +//@forward_count Number of times the object was forwarded +//@reaction_count Number of times reactions were added to the object +chatStatisticsInteractionInfo object_type:ChatStatisticsObjectType view_count:int32 forward_count:int32 reaction_count:int32 = ChatStatisticsInteractionInfo; //@description Contains statistics about messages sent by a user //@user_id User identifier @@ -5931,8 +6025,12 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@description A detailed statistics about a channel chat //@period A period to which the statistics applies //@member_count Number of members in the chat -//@mean_view_count Mean number of times the recently sent messages was viewed -//@mean_share_count Mean number of times the recently sent messages was shared +//@mean_message_view_count Mean number of times the recently sent messages were viewed +//@mean_message_share_count Mean number of times the recently sent messages were shared +//@mean_message_reaction_count Mean number of times reactions were added to the recently sent messages +//@mean_story_view_count Mean number of times the recently sent stories were viewed +//@mean_story_share_count Mean number of times the recently sent stories were shared +//@mean_story_reaction_count Mean number of times reactions were added to the recently sent stories //@enabled_notifications_percentage A percentage of users with enabled notifications for the chat; 0-100 //@member_count_graph A graph containing number of members in the chat //@join_graph A graph containing number of members joined and left the chat @@ -5942,13 +6040,23 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@join_by_source_graph A graph containing number of new member joins per source //@language_graph A graph containing number of users viewed chat messages per language //@message_interaction_graph A graph containing number of chat message views and shares +//@message_reaction_graph A graph containing number of reactions on messages +//@story_interaction_graph A graph containing number of story views and shares +//@story_reaction_graph A graph containing number of reactions on stories //@instant_view_interaction_graph A graph containing number of views of associated with the chat instant views -//@recent_message_interactions Detailed statistics about number of views and shares of recently sent messages -chatStatisticsChannel period:dateRange member_count:statisticalValue mean_view_count:statisticalValue mean_share_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_message_interactions:vector = ChatStatistics; +//@recent_interactions Detailed statistics about number of views and shares of recently sent messages and stories +chatStatisticsChannel period:dateRange member_count:statisticalValue mean_message_view_count:statisticalValue mean_message_share_count:statisticalValue mean_message_reaction_count:statisticalValue mean_story_view_count:statisticalValue mean_story_share_count:statisticalValue mean_story_reaction_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph message_reaction_graph:StatisticalGraph story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_interactions:vector = ChatStatistics; -//@description A detailed statistics about a message @message_interaction_graph A graph containing number of message views and shares -messageStatistics message_interaction_graph:StatisticalGraph = MessageStatistics; +//@description A detailed statistics about a message +//@message_interaction_graph A graph containing number of message views and shares +//@message_reaction_graph A graph containing number of message reactions +messageStatistics message_interaction_graph:StatisticalGraph message_reaction_graph:StatisticalGraph = MessageStatistics; + +//@description A detailed statistics about a story +//@story_interaction_graph A graph containing number of story views and shares +//@story_reaction_graph A graph containing number of story reactions +storyStatistics story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph = StoryStatistics; //@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate @@ -5996,8 +6104,8 @@ updateAuthorizationState authorization_state:AuthorizationState = Update; //@description A new message was received; can also be an outgoing message @message The new message updateNewMessage message:message = Update; -//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. -//-This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message +//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. +//-This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message //@chat_id The chat identifier of the sent message //@message_id A temporary message identifier updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update; @@ -6057,10 +6165,10 @@ updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update; //@description A chat accent color has changed @chat_id Chat identifier @accent_color_id The new chat accent color identifier updateChatAccentColor chat_id:int53 accent_color_id:int32 = Update; -//@description A chat's custom emoji for reply background has changed @chat_id Chat identifier @background_custom_emoji_id The new tdentifier of a custom emoji to be shown on the reply header background +//@description A chat's custom emoji for reply background has changed @chat_id Chat identifier @background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header background; 0 if none updateChatBackgroundCustomEmoji chat_id:int53 background_custom_emoji_id:int64 = Update; -//@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions +//@description Chat permissions were changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; //@description The last message of a chat was changed @@ -6136,6 +6244,9 @@ 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 default appearance has changed @chat_id Chat identifier @view_as_topics New value of view_as_topics +updateChatViewAsTopics chat_id:int53 view_as_topics: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; @@ -6146,7 +6257,7 @@ updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Updat updateChatFolders chat_folders:vector main_chat_list_position:int32 = Update; //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. -//-There is no guarantee that it will be sent just after the number of online users has changed +//-There is no guarantee that it is sent just after the number of online users has changed //@chat_id Identifier of the chat //@online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; @@ -6171,7 +6282,7 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@removed_notification_ids Identifiers of removed group notifications, sorted by notification identifier updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; -//@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups +//@description Contains active notifications that were shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector = Update; //@description Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications @@ -6334,7 +6445,7 @@ updateFavoriteStickers sticker_ids:vector = Update; //@description The list of saved animations was updated @animation_ids The new list of file identifiers of saved animations updateSavedAnimations animation_ids:vector = Update; -//@description The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds +//@description The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds updateSavedNotificationSounds notification_sound_ids:vector = Update; //@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null @@ -6349,6 +6460,11 @@ updateChatThemes chat_themes:vector = Update; //@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order updateAccentColors colors:vector available_accent_color_ids:vector = Update; +//@description The list of supported accent colors for user profiles has changed +//@colors Information about supported colors +//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor. The colors must be shown in the specififed order +updateProfileAccentColors colors:vector available_accent_color_ids:vector = Update; + //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector = Update; @@ -6376,6 +6492,13 @@ updateActiveEmojiReactions emojis:vector = Update; //@description The type of default reaction has changed @reaction_type The new type of the default reaction updateDefaultReactionType reaction_type:ReactionType = Update; +//@description The parameters of speech recognition without Telegram Premium subscription has changed +//@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription +//@weekly_count The total number of allowed speech recognitions per week; 0 if none +//@left_count Number of left speech recognition attempts this week +//@next_reset_date Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown +updateSpeechRecognitionTrial max_media_duration:int32 weekly_count:int32 left_count:int32 next_reset_date:int32 = Update; + //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; @@ -6466,7 +6589,7 @@ updatePollAnswer poll_id:int64 voter_id:MessageSender option_ids:vector = //@description User rights changed in a chat; for bots only //@chat_id Chat identifier //@actor_user_id Identifier of the user, changing the rights -//@date Point in time (Unix timestamp) when the user rights was changed +//@date Point in time (Unix timestamp) when the user rights were changed //@invite_link If user has joined the chat using an invite link, the invite link; may be null //@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder //@old_chat_member Previous chat member @@ -6729,8 +6852,9 @@ getMessage chat_id:int53 message_id:int53 = Message; //@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessageLocally chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages -//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively +//@description Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, +//-the message with a previously set same background, and the topic creation message for messages of the types +//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message getRepliedMessage chat_id:int53 message_id:int53 = Message; @@ -6792,6 +6916,14 @@ searchChatsOnServer query:string limit:int32 = Chats; //@location Current user location searchChatsNearby location:location = ChatsNearby; +//@description Returns a list of chats similar to the given chat @chat_id Identifier of the target chat; must be an identifier of a channel chat +getChatSimilarChats chat_id:int53 = Chats; + +//@description Returns approximate number of chats similar to the given chat +//@chat_id Identifier of the target chat; must be an identifier of a channel chat +//@return_local Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally +getChatSimilarChatCount chat_id:int53 return_local:Bool = Count; + //@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 getTopChats category:TopChatCategory limit:int32 = Chats; @@ -7009,7 +7141,7 @@ translateText text:formattedText to_language_code:string = FormattedText; //-"st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; -//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message recognizeSpeech chat_id:int53 message_id:int53 = Ok; @@ -7072,7 +7204,7 @@ forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message //@chat_id Identifier of the chat to send messages //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order //@quote New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false -resendMessages chat_id:int53 message_ids:vector quote:formattedText = Messages; +resendMessages chat_id:int53 message_ids:vector quote:inputTextQuote = Messages; //@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier sendChatScreenshotTakenNotification chat_id:int53 = Ok; @@ -7696,12 +7828,19 @@ setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok; //@permissions New non-administrator members permissions in the chat setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; -//@description Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +//@description Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users //@chat_id Chat identifier -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to remove the current background +//@background The input background to use; pass null to create a new filled background +//@type Background type; pass null to use default background type for the chosen background //@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 -setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 = Ok; +//@only_for_self Pass true to set background only for self; pass false to set background for both chat users. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious +setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 only_for_self:Bool = Ok; + +//@description Deletes background in a specific chat +//@chat_id Chat identifier +//@restore_previous Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. +//-Supposed to be used from messageChatSetBackground messages with the currently set background that was set for both sides by the other user +deleteChatBackground chat_id:int53 restore_previous:Bool = Ok; //@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme setChatTheme chat_id:int53 theme_name:string = Ok; @@ -7719,7 +7858,10 @@ setChatNotificationSettings chat_id:int53 notification_settings:chatNotification //@has_protected_content New value of has_protected_content toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; -//@description Changes the translatable state of a chat; for Telegram Premium users only @chat_id Chat identifier @is_translatable New value of is_translatable +//@description Changes the view_as_topics setting of a forum chat @chat_id Chat identifier @view_as_topics New value of view_as_topics +toggleChatViewAsTopics chat_id:int53 view_as_topics:Bool = Ok; + +//@description Changes the translatable state of a chat @chat_id Chat identifier @is_translatable New value of is_translatable toggleChatIsTranslatable chat_id:int53 is_translatable:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -7728,7 +7870,9 @@ toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok; //@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok; -//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions Reactions available in the chat. All emoji reactions must be active +//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +//@chat_id Identifier of the chat +//@available_reactions Reactions available in the chat. All explicitly specified emoji reactions must be active. Up to the chat's boost level custom emoji reactions can be explicitly specified setChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Ok; //@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data @@ -7885,9 +8029,10 @@ canSendStory chat_id:int53 = CanSendStoryResult; //@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, or 2 * 86400 for Telegram Premium users, and 86400 otherwise +//@from_story_full_id Full identifier of the original story, which content was used to create the story //@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 chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; +sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 from_story_full_id:storyFullId is_pinned:Bool protect_content:Bool = Story; //@description Changes content and caption of a story. Can be called only if story.can_be_edited == true //@story_sender_chat_id Identifier of the chat that posted the story @@ -7984,6 +8129,14 @@ reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:s //-and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only activateStoryStealthMode = Ok; +//@description Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. +//-For optimal performance, the number of returned messages and stories is chosen by TDLib +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getStoryPublicForwards story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = StoryPublicForwards; + //@description Returns the list of available chat boost slots for the current user getAvailableChatBoostSlots = ChatBoostSlots; @@ -8054,7 +8207,7 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; getSuggestedFileName file_id:int32 directory:string = Text; //@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used -//-to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +//-to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message //@file File to upload //@file_type File type; pass null if unknown //@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first @@ -8275,7 +8428,7 @@ getGroupCall group_call_id:int32 = GroupCall; //@description Starts a scheduled group call @group_call_id Group call identifier startScheduledGroupCall group_call_id:int32 = Ok; -//@description Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +//@description Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only //@group_call_id Group call identifier //@enabled_start_notification New value of the enabled_start_notification setting toggleGroupCallEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok; @@ -8507,8 +8660,10 @@ searchStickerSet name:string = StickerSet; //@description Searches for installed sticker sets by looking for specified query in their title and name @sticker_type Type of the sticker sets to search for @query Query to search for @limit The maximum number of sticker sets to return searchInstalledStickerSets sticker_type:StickerType query:string limit:int32 = StickerSets; -//@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for -searchStickerSets query:string = StickerSets; +//@description Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results +//@sticker_type Type of the sticker sets to return +//@query Query to search for +searchStickerSets sticker_type:StickerType query:string = StickerSets; //@description Installs/uninstalls or activates/archives a sticker set @set_id Identifier of the sticker set @is_installed The new value of is_installed @is_archived The new value of is_archived. A sticker set can't be installed and archived simultaneously changeStickerSet set_id:int64 is_installed:Bool is_archived:Bool = Ok; @@ -8620,6 +8775,11 @@ deleteProfilePhoto profile_photo_id:int64 = Ok; //@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none setAccentColor accent_color_id:int32 background_custom_emoji_id:int64 = Ok; +//@description Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown in the on the user's profile photo background; 0 if none +setProfileAccentColor profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; + //@description Changes the first and last name of the current user @first_name The new value of the first name for the current user; 1-64 characters @last_name The new value of the optional last name for the current user; 0-64 characters setName first_name:string last_name:string = Ok; @@ -9052,6 +9212,9 @@ getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatis //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; +//@description Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true @chat_id Chat identifier @story_id Story identifier @is_dark Pass true if a dark theme is used by the application +getStoryStatistics chat_id:int53 story_id:int32 is_dark:Bool = StoryStatistics; + //@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph;