diff --git a/Makefile b/Makefile index cff0e7d..adddb19 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := 3870c29b158b75ca5e48e0eebd6b5c3a7994a000 +TAG := 5bbfc1cf5dab94f82e02f3430ded7241d4653551 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 606405f..f7e0a5b 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, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted 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,90 @@ 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 OpenChatSimilarChatRequest struct { + // Identifier of the original chat, which similar chats were requested + ChatId int64 `json:"chat_id"` + // Identifier of the opened chat + OpenedChatId int64 `json:"opened_chat_id"` +} + +// Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +func (client *Client) OpenChatSimilarChat(req *OpenChatSimilarChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openChatSimilarChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "opened_chat_id": req.OpenedChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetTopChatsRequest struct { // Category of chats to be returned Category TopChatCategory `json:"category"` @@ -2949,7 +3033,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 +3347,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 @@ -4333,6 +4417,41 @@ func (client *Client) RemoveMessageReaction(req *RemoveMessageReactionRequest) ( return UnmarshalOk(result.Data) } +type SetMessageReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Types of the reaction to set + ReactionTypes []ReactionType `json:"reaction_types"` + // Pass true if the reactions are added with a big animation + IsBig bool `json:"is_big"` +} + +// Sets reactions on a message; for bots only +func (client *Client) SetMessageReactions(req *SetMessageReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMessageReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_types": req.ReactionTypes, + "is_big": req.IsBig, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetMessageAddedReactionsRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -5036,31 +5155,31 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { return UnmarshalHttpUrl(result.Data) } -type ShareUserWithBotRequest struct { +type ShareUsersWithBotRequest struct { // Identifier of the chat with the bot ChatId int64 `json:"chat_id"` // Identifier of the message with the button MessageId int64 `json:"message_id"` // Identifier of the button ButtonId int32 `json:"button_id"` - // Identifier of the shared user - SharedUserId int64 `json:"shared_user_id"` - // Pass true to check that the user can be shared by the button instead of actually sharing them + // Identifiers of the shared users + SharedUserIds []int64 `json:"shared_user_ids"` + // Pass true to check that the users can be shared by the button instead of actually sharing them OnlyCheck bool `json:"only_check"` } -// Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot -func (client *Client) ShareUserWithBot(req *ShareUserWithBotRequest) (*Ok, error) { +// Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot +func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "shareUserWithBot", + Type: "shareUsersWithBot", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "button_id": req.ButtonId, - "shared_user_id": req.SharedUserId, - "only_check": req.OnlyCheck, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "shared_user_ids": req.SharedUserIds, + "only_check": req.OnlyCheck, }, }) if err != nil { @@ -6032,6 +6151,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(result.Data) + case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) @@ -7167,13 +7289,13 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { type SetChatAccentColorRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the accent color to use + // Identifier of the accent color to use. The chat must have at least accentColor.min_chat_boost_level boost level to pass the corresponding color AccentColorId int32 `json:"accent_color_id"` - // Identifier of a custom emoji to be shown on the reply header background; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` } -// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +// Changes accent color and background custom emoji of a chat. Requires can_change_info administrator right func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7196,6 +7318,38 @@ func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatProfileAccentColorRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding color + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for profile of a chat. Requires can_change_info administrator right +func (client *Client) SetChatProfileAccentColor(req *SetChatProfileAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatProfileAccentColor", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "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 SetChatMessageAutoDeleteTimeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -7225,6 +7379,35 @@ func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDelete return UnmarshalOk(result.Data) } +type SetChatEmojiStatusRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New emoji status; pass null to remove emoji status + EmojiStatus *EmojiStatus `json:"emoji_status"` +} + +// Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right +func (client *Client) SetChatEmojiStatus(req *SetChatEmojiStatusRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatEmojiStatus", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "emoji_status": req.EmojiStatus, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatPermissionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -7257,15 +7440,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 or chat theme 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; backgroundTypeChatTheme isn't supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat Type BackgroundType `json:"type"` - // Dimming of the background in dark themes, as a percentage; 0-100 + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background DarkThemeDimming int32 `json:"dark_theme_dimming"` + // Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious + OnlyForSelf bool `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, and in chats with sufficient boost level and can_change_info administrator right func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7276,6 +7461,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 { @@ -7408,6 +7623,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"` @@ -7415,7 +7659,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{ @@ -7498,7 +7742,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"` } @@ -8548,6 +8792,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 @@ -8561,14 +8807,15 @@ func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { Type: "sendStory", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "content": req.Content, - "areas": req.Areas, - "caption": req.Caption, - "privacy_settings": req.PrivacySettings, - "active_period": req.ActivePeriod, - "is_pinned": req.IsPinned, - "protect_content": req.ProtectContent, + "chat_id": req.ChatId, + "content": req.Content, + "areas": req.Areas, + "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, }, }) if err != nil { @@ -8996,31 +9243,34 @@ func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error return UnmarshalOk(result.Data) } -type GetStoryViewersRequest struct { +type GetStoryInteractionsRequest struct { // Story identifier StoryId int32 `json:"story_id"` - // Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers + // Query to search for in names, usernames and titles; may be empty to get all relevant interactions Query string `json:"query"` - // Pass true to get only contacts; pass false to get all relevant viewers + // Pass true to get only interactions by contacts; pass false to get all relevant interactions OnlyContacts bool `json:"only_contacts"` - // Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date + // Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date + PreferForwards bool `json:"prefer_forwards"` + // Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true PreferWithReaction bool `json:"prefer_with_reaction"` // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` - // The maximum number of story viewers to return + // The maximum number of story interactions to return Limit int32 `json:"limit"` } -// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user -func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewers, error) { +// Returns interactions with a story. The method can be called only for stories posted on behalf of the current user +func (client *Client) GetStoryInteractions(req *GetStoryInteractionsRequest) (*StoryInteractions, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getStoryViewers", + Type: "getStoryInteractions", }, Data: map[string]interface{}{ "story_id": req.StoryId, "query": req.Query, "only_contacts": req.OnlyContacts, + "prefer_forwards": req.PreferForwards, "prefer_with_reaction": req.PreferWithReaction, "offset": req.Offset, "limit": req.Limit, @@ -9034,7 +9284,48 @@ func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewer return nil, buildResponseError(result.Data) } - return UnmarshalStoryViewers(result.Data) + return UnmarshalStoryInteractions(result.Data) +} + +type GetChatStoryInteractionsRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions + ReactionType ReactionType `json:"reaction_type"` + // Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date + PreferForwards bool `json:"prefer_forwards"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of story interactions to return + Limit int32 `json:"limit"` +} + +// Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat +func (client *Client) GetChatStoryInteractions(req *GetChatStoryInteractionsRequest) (*StoryInteractions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatStoryInteractions", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reaction_type": req.ReactionType, + "prefer_forwards": req.PreferForwards, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryInteractions(result.Data) } type ReportStoryRequest struct { @@ -9091,6 +9382,86 @@ 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) (*PublicForwards, 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 UnmarshalPublicForwards(result.Data) +} + +type GetChatBoostLevelFeaturesRequest struct { + // Chat boost level + Level int32 `json:"level"` +} + +// Returns list of features available on the specific chat boost level; this is an offline request +func (client *Client) GetChatBoostLevelFeatures(req *GetChatBoostLevelFeaturesRequest) (*ChatBoostLevelFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLevelFeatures", + }, + Data: map[string]interface{}{ + "level": req.Level, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLevelFeatures(result.Data) +} + +// Returns list of features available on the first 10 chat boost levels; this is an offline request +func (client *Client) GetChatBoostFeatures() (*ChatBoostFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostFeatures", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostFeatures(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{ @@ -9339,7 +9710,7 @@ func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAt return UnmarshalOk(result.Data) } -// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -9358,7 +9729,7 @@ func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Returns recent emoji statuses +// Returns recent emoji statuses for self status func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -9377,7 +9748,7 @@ func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Returns default emoji statuses +// Returns default emoji statuses for self status func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -9396,7 +9767,7 @@ func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Clears the list of recently used emoji statuses +// Clears the list of recently used emoji statuses for self status func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9415,6 +9786,63 @@ func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { return UnmarshalOk(result.Data) } +// Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats +func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getThemedChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns default emoji statuses for chats +func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true +func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDisallowedChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` @@ -9549,7 +9977,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{ @@ -10933,7 +11361,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{ @@ -12425,18 +12853,21 @@ 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{}{ - "query": req.Query, + "sticker_type": req.StickerType, + "query": req.Query, }, }) if err != nil { @@ -13198,7 +13629,7 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e type SetAccentColorRequest struct { // Identifier of the accent color to use AccentColorId int32 `json:"accent_color_id"` - // Identifier of a custom emoji to be shown on the reply header background; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` } @@ -13224,6 +13655,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 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"` @@ -15090,36 +15550,10 @@ func (client *Client) GetSupportUser() (*User, error) { return UnmarshalUser(result.Data) } -type GetBackgroundsRequest struct { - // Pass true to order returned backgrounds for a dark theme - ForDarkTheme bool `json:"for_dark_theme"` -} - -// Returns backgrounds installed by the user -func (client *Client) GetBackgrounds(req *GetBackgroundsRequest) (*Backgrounds, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getBackgrounds", - }, - Data: map[string]interface{}{ - "for_dark_theme": req.ForDarkTheme, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalBackgrounds(result.Data) -} - type GetBackgroundUrlRequest struct { // Background name Name string `json:"name"` - // Background type + // Background type; backgroundTypeChatTheme isn't supported Type BackgroundType `json:"type"` } @@ -15171,20 +15605,20 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun return UnmarshalBackground(result.Data) } -type SetBackgroundRequest struct { - // The input background to use; pass null to create a new filled background or to remove the current background +type SetDefaultBackgroundRequest struct { + // The input background to use; pass null to create a new filled background Background InputBackground `json:"background"` - // Background type; pass null to use the default type of the remote background or to remove the current background + // Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported Type BackgroundType `json:"type"` - // Pass true if the background is changed for a dark theme + // Pass true if the background is set for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } -// Changes the background selected by the user; adds background to the list of installed backgrounds -func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, error) { +// Sets default background for chats; adds the background to the list of installed backgrounds +func (client *Client) SetDefaultBackground(req *SetDefaultBackgroundRequest) (*Background, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setBackground", + Type: "setDefaultBackground", }, Data: map[string]interface{}{ "background": req.Background, @@ -15203,16 +15637,68 @@ func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, err return UnmarshalBackground(result.Data) } -type RemoveBackgroundRequest struct { +type DeleteDefaultBackgroundRequest struct { + // Pass true if the background is deleted for a dark theme + ForDarkTheme bool `json:"for_dark_theme"` +} + +// Deletes default background for chats +func (client *Client) DeleteDefaultBackground(req *DeleteDefaultBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteDefaultBackground", + }, + Data: map[string]interface{}{ + "for_dark_theme": req.ForDarkTheme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetInstalledBackgroundsRequest struct { + // Pass true to order returned backgrounds for a dark theme + ForDarkTheme bool `json:"for_dark_theme"` +} + +// Returns backgrounds installed by the user +func (client *Client) GetInstalledBackgrounds(req *GetInstalledBackgroundsRequest) (*Backgrounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInstalledBackgrounds", + }, + Data: map[string]interface{}{ + "for_dark_theme": req.ForDarkTheme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBackgrounds(result.Data) +} + +type RemoveInstalledBackgroundRequest struct { // The background identifier BackgroundId JsonInt64 `json:"background_id"` } // Removes background from the list of installed backgrounds -func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error) { +func (client *Client) RemoveInstalledBackground(req *RemoveInstalledBackgroundRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "removeBackground", + Type: "removeInstalledBackground", }, Data: map[string]interface{}{ "background_id": req.BackgroundId, @@ -15230,10 +15716,10 @@ func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error } // Resets list of installed backgrounds to its default value -func (client *Client) ResetBackgrounds() (*Ok, error) { +func (client *Client) ResetInstalledBackgrounds() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "resetBackgrounds", + Type: "resetInstalledBackgrounds", }, Data: map[string]interface{}{}, }) @@ -16059,12 +16545,12 @@ type GetMessagePublicForwardsRequest struct { MessageId int64 `json:"message_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 to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { +// Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*PublicForwards, error) { result, err := client.Send(Request{ meta: meta{ Type: "getMessagePublicForwards", @@ -16084,7 +16570,39 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ return nil, buildResponseError(result.Data) } - return UnmarshalFoundMessages(result.Data) + return UnmarshalPublicForwards(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 { @@ -17795,7 +18313,7 @@ func (client *Client) LaunchPrepaidPremiumGiveaway(req *LaunchPrepaidPremiumGive type GetPremiumGiveawayInfoRequest struct { // Identifier of the channel chat which started the giveaway ChatId int64 `json:"chat_id"` - // Identifier of the giveaway message in the chat + // Identifier of the giveaway or a giveaway winners message in the chat MessageId int64 `json:"message_id"` } @@ -18236,32 +18754,6 @@ func (client *Client) GetApplicationConfig() (JsonValue, error) { } } -type AddApplicationChangelogRequest struct { - // The previous application version - PreviousApplicationVersion string `json:"previous_application_version"` -} - -// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed -func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addApplicationChangelog", - }, - Data: map[string]interface{}{ - "previous_application_version": req.PreviousApplicationVersion, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SaveApplicationLogEventRequest struct { // Event type Type string `json:"type"` @@ -19197,11 +19689,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(result.Data) - case TypeUpdateChatAccentColor: - return UnmarshalUpdateChatAccentColor(result.Data) - - case TypeUpdateChatBackgroundCustomEmoji: - return UnmarshalUpdateChatBackgroundCustomEmoji(result.Data) + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(result.Data) case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(result.Data) @@ -19227,6 +19716,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(result.Data) + case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(result.Data) @@ -19269,6 +19761,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) @@ -19419,8 +19914,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedNotificationSounds: return UnmarshalUpdateSavedNotificationSounds(result.Data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(result.Data) + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(result.Data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(result.Data) @@ -19428,6 +19923,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) @@ -19455,6 +19953,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) @@ -19512,6 +20013,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatBoost: return UnmarshalUpdateChatBoost(result.Data) + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(result.Data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/type.go b/client/type.go index 4fabcbe..2effd4f 100755 --- a/client/type.go +++ b/client/type.go @@ -74,6 +74,9 @@ const ( ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" + ClassStoryOrigin = "StoryOrigin" + ClassStoryInteractionType = "StoryInteractionType" + ClassPublicForward = "PublicForward" ClassChatBoostSource = "ChatBoostSource" ClassCallDiscardReason = "CallDiscardReason" ClassCallServerType = "CallServerType" @@ -130,6 +133,7 @@ const ( ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" ClassStatisticalGraph = "StatisticalGraph" + ClassChatStatisticsObjectType = "ChatStatisticsObjectType" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" ClassBotCommandScope = "BotCommandScope" @@ -191,6 +195,8 @@ const ( ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions" ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo" ClassAccentColor = "AccentColor" + ClassProfileAccentColors = "ProfileAccentColors" + ClassProfileAccentColor = "ProfileAccentColor" ClassEmojiStatus = "EmojiStatus" ClassEmojiStatuses = "EmojiStatuses" ClassUsernames = "Usernames" @@ -228,6 +234,8 @@ const ( ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" ClassUnreadReaction = "UnreadReaction" + ClassTextQuote = "TextQuote" + ClassInputTextQuote = "InputTextQuote" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" @@ -322,18 +330,23 @@ const ( ClassTrendingStickerSets = "TrendingStickerSets" ClassEmojiCategory = "EmojiCategory" ClassEmojiCategories = "EmojiCategories" - ClassStoryViewer = "StoryViewer" - ClassStoryViewers = "StoryViewers" ClassStoryAreaPosition = "StoryAreaPosition" ClassStoryArea = "StoryArea" ClassInputStoryArea = "InputStoryArea" ClassInputStoryAreas = "InputStoryAreas" ClassStoryVideo = "StoryVideo" + ClassStoryRepostInfo = "StoryRepostInfo" ClassStoryInteractionInfo = "StoryInteractionInfo" ClassStory = "Story" ClassStories = "Stories" + ClassStoryFullId = "StoryFullId" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" + ClassStoryInteraction = "StoryInteraction" + ClassStoryInteractions = "StoryInteractions" + ClassPublicForwards = "PublicForwards" + ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures" + ClassChatBoostFeatures = "ChatBoostFeatures" ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" ClassChatBoostStatus = "ChatBoostStatus" ClassChatBoost = "ChatBoost" @@ -430,11 +443,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 +588,8 @@ const ( TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing" TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted" TypeAccentColor = "accentColor" + TypeProfileAccentColors = "profileAccentColors" + TypeProfileAccentColor = "profileAccentColor" TypeEmojiStatus = "emojiStatus" TypeEmojiStatuses = "emojiStatuses" TypeUsernames = "usernames" @@ -648,6 +664,8 @@ const ( TypeUnreadReaction = "unreadReaction" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeTextQuote = "textQuote" + TypeInputTextQuote = "inputTextQuote" TypeMessageReplyToMessage = "messageReplyToMessage" TypeMessageReplyToStory = "messageReplyToStory" TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" @@ -671,6 +689,7 @@ const ( TypeMessageSourceScreenshot = "messageSourceScreenshot" TypeMessageSourceOther = "messageSourceOther" TypeMessageSponsorTypeBot = "messageSponsorTypeBot" + TypeMessageSponsorTypeWebApp = "messageSponsorTypeWebApp" TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel" TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel" TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite" @@ -726,7 +745,7 @@ const ( TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" - TypeKeyboardButtonTypeRequestUser = "keyboardButtonTypeRequestUser" + TypeKeyboardButtonTypeRequestUsers = "keyboardButtonTypeRequestUsers" TypeKeyboardButtonTypeRequestChat = "keyboardButtonTypeRequestChat" TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" TypeKeyboardButton = "keyboardButton" @@ -971,8 +990,10 @@ const ( TypeMessagePremiumGiftCode = "messagePremiumGiftCode" TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" TypeMessagePremiumGiveaway = "messagePremiumGiveaway" + TypeMessagePremiumGiveawayCompleted = "messagePremiumGiveawayCompleted" + TypeMessagePremiumGiveawayWinners = "messagePremiumGiveawayWinners" TypeMessageContactRegistered = "messageContactRegistered" - TypeMessageUserShared = "messageUserShared" + TypeMessageUsersShared = "messageUsersShared" TypeMessageChatShared = "messageChatShared" TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" TypeMessageWebAppDataSent = "messageWebAppDataSent" @@ -1076,17 +1097,17 @@ const ( TypeEmojiCategoryTypeDefault = "emojiCategoryTypeDefault" TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus" TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto" - TypeStoryViewer = "storyViewer" - TypeStoryViewers = "storyViewers" TypeStoryAreaPosition = "storyAreaPosition" TypeStoryAreaTypeLocation = "storyAreaTypeLocation" TypeStoryAreaTypeVenue = "storyAreaTypeVenue" TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" + TypeStoryAreaTypeMessage = "storyAreaTypeMessage" TypeStoryArea = "storyArea" TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" + TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage" TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" @@ -1097,11 +1118,25 @@ 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" + TypeStoryInteractionTypeView = "storyInteractionTypeView" + TypeStoryInteractionTypeForward = "storyInteractionTypeForward" + TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost" + TypeStoryInteraction = "storyInteraction" + TypeStoryInteractions = "storyInteractions" + TypePublicForwardMessage = "publicForwardMessage" + TypePublicForwardStory = "publicForwardStory" + TypePublicForwards = "publicForwards" + TypeChatBoostLevelFeatures = "chatBoostLevelFeatures" + TypeChatBoostFeatures = "chatBoostFeatures" TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway" TypeChatBoostSourcePremium = "chatBoostSourcePremium" @@ -1221,7 +1256,9 @@ const ( TypeChatEventMemberPromoted = "chatEventMemberPromoted" TypeChatEventMemberRestricted = "chatEventMemberRestricted" TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged" + TypeChatEventBackgroundChanged = "chatEventBackgroundChanged" TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" + TypeChatEventEmojiStatusChanged = "chatEventEmojiStatusChanged" TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" TypeChatEventLocationChanged = "chatEventLocationChanged" TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged" @@ -1233,7 +1270,7 @@ const ( TypeChatEventUsernameChanged = "chatEventUsernameChanged" TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" TypeChatEventAccentColorChanged = "chatEventAccentColorChanged" - TypeChatEventBackgroundCustomEmojiChanged = "chatEventBackgroundCustomEmojiChanged" + TypeChatEventProfileAccentColorChanged = "chatEventProfileAccentColorChanged" TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" TypeChatEventInvitesToggled = "chatEventInvitesToggled" TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" @@ -1281,6 +1318,7 @@ const ( TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" + TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -1299,6 +1337,7 @@ const ( TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" TypePremiumFeatureChatBoost = "premiumFeatureChatBoost" TypePremiumFeatureAccentColor = "premiumFeatureAccentColor" + TypePremiumFeatureBackgroundForBoth = "premiumFeatureBackgroundForBoth" TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" @@ -1339,6 +1378,7 @@ const ( TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" TypeBackgroundTypePattern = "backgroundTypePattern" TypeBackgroundTypeFill = "backgroundTypeFill" + TypeBackgroundTypeChatTheme = "backgroundTypeChatTheme" TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" TypeInputBackgroundPrevious = "inputBackgroundPrevious" @@ -1511,6 +1551,7 @@ const ( TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" @@ -1606,6 +1647,7 @@ const ( TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium" TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium" TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium" + TypeSuggestedActionGiftPremiumForChristmas = "suggestedActionGiftPremiumForChristmas" TypeCount = "count" TypeText = "text" TypeSeconds = "seconds" @@ -1624,13 +1666,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" @@ -1657,8 +1702,7 @@ const ( TypeUpdateNewChat = "updateNewChat" TypeUpdateChatTitle = "updateChatTitle" TypeUpdateChatPhoto = "updateChatPhoto" - TypeUpdateChatAccentColor = "updateChatAccentColor" - TypeUpdateChatBackgroundCustomEmoji = "updateChatBackgroundCustomEmoji" + TypeUpdateChatAccentColors = "updateChatAccentColors" TypeUpdateChatPermissions = "updateChatPermissions" TypeUpdateChatLastMessage = "updateChatLastMessage" TypeUpdateChatPosition = "updateChatPosition" @@ -1667,6 +1711,7 @@ const ( TypeUpdateChatActionBar = "updateChatActionBar" TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatEmojiStatus = "updateChatEmojiStatus" TypeUpdateChatMessageSender = "updateChatMessageSender" TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime" TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" @@ -1681,6 +1726,7 @@ const ( TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" TypeUpdateChatIsTranslatable = "updateChatIsTranslatable" TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" + TypeUpdateChatViewAsTopics = "updateChatViewAsTopics" TypeUpdateChatBlockList = "updateChatBlockList" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" TypeUpdateChatFolders = "updateChatFolders" @@ -1731,9 +1777,10 @@ const ( TypeUpdateFavoriteStickers = "updateFavoriteStickers" TypeUpdateSavedAnimations = "updateSavedAnimations" TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" - TypeUpdateSelectedBackground = "updateSelectedBackground" + TypeUpdateDefaultBackground = "updateDefaultBackground" TypeUpdateChatThemes = "updateChatThemes" TypeUpdateAccentColors = "updateAccentColors" + TypeUpdateProfileAccentColors = "updateProfileAccentColors" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" @@ -1743,6 +1790,7 @@ const ( TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" TypeUpdateDefaultReactionType = "updateDefaultReactionType" + TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" @@ -1762,6 +1810,8 @@ const ( TypeUpdateChatMember = "updateChatMember" TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" TypeUpdateChatBoost = "updateChatBoost" + TypeUpdateMessageReaction = "updateMessageReaction" + TypeUpdateMessageReactions = "updateMessageReactions" TypeUpdates = "updates" TypeLogStreamDefault = "logStreamDefault" TypeLogStreamFile = "logStreamFile" @@ -2113,6 +2163,21 @@ type StoryList interface { StoryListType() string } +// Contains information about the origin of a story that was reposted +type StoryOrigin interface { + StoryOriginType() string +} + +// Describes type of interaction with a story +type StoryInteractionType interface { + StoryInteractionTypeType() string +} + +// Describes a public forward or repost of a story +type PublicForward interface { + PublicForwardType() string +} + // Describes source of a chat boost type ChatBoostSource interface { ChatBoostSourceType() string @@ -2393,6 +2458,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 @@ -5118,7 +5188,7 @@ type Background struct { IsDark bool `json:"is_dark"` // Unique background name Name string `json:"name"` - // Document with the background; may be null. Null only for filled backgrounds + // Document with the background; may be null. Null only for filled and chat theme backgrounds Document *Document `json:"document"` // Type of the background Type BackgroundType `json:"type"` @@ -5195,7 +5265,7 @@ type ChatBackground struct { meta // The background Background *Background `json:"background"` - // Dimming of the background in dark themes, as a percentage; 0-100 + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background DarkThemeDimming int32 `json:"dark_theme_dimming"` } @@ -5829,7 +5899,7 @@ func (*InputChatPhotoSticker) InputChatPhotoType() string { // Describes actions that a user is allowed to take in a chat type ChatPermissions struct { meta - // True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues + // True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues CanSendBasicMessages bool `json:"can_send_basic_messages"` // True, if the user can send music files CanSendAudios bool `json:"can_send_audios"` @@ -5935,7 +6005,7 @@ type PremiumPaymentOption struct { Amount int64 `json:"amount"` // The discount associated with this option, as a percentage DiscountPercentage int32 `json:"discount_percentage"` - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` // Identifier of the store product associated with the option StoreProductId string `json:"store_product_id"` @@ -6024,7 +6094,7 @@ type PremiumGiftCodePaymentOption struct { Amount int64 `json:"amount"` // Number of users which will be able to activate the gift codes UserCount int32 `json:"user_count"` - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` // Identifier of the store product associated with the option; may be empty if none StoreProductId string `json:"store_product_id"` @@ -6074,15 +6144,15 @@ func (*PremiumGiftCodePaymentOptions) GetType() string { // Contains information about a Telegram Premium gift code type PremiumGiftCodeInfo struct { meta - // Identifier of a chat or a user that created the gift code + // Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used CreatorId MessageSender `json:"creator_id"` // Point in time (Unix timestamp) when the code was created 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 + // Number of months the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` // Identifier of a user for which the code was created; 0 if none UserId int64 `json:"user_id"` @@ -6366,6 +6436,8 @@ type AccentColor struct { LightThemeColors []int32 `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 []int32 `json:"dark_theme_colors"` + // The minimum chat boost level required to use the color + MinChatBoostLevel int32 `json:"min_chat_boost_level"` } func (entity *AccentColor) MarshalJSON() ([]byte, error) { @@ -6384,6 +6456,62 @@ 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"` + // Accent colors expected to be used in light themes + LightThemeColors *ProfileAccentColors `json:"light_theme_colors"` + // Accent colors expected to be used in dark themes + DarkThemeColors *ProfileAccentColors `json:"dark_theme_colors"` + // The minimum chat boost level required to use the color + MinChatBoostLevel int32 `json:"min_chat_boost_level"` +} + +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 @@ -6409,7 +6537,7 @@ func (*EmojiStatus) GetType() string { return TypeEmojiStatus } -// Contains a list of custom emoji identifiers, which can be set as emoji statuses +// Contains a list of custom emoji identifiers for emoji statuses type EmojiStatuses struct { meta // The list of custom emoji identifiers @@ -6476,10 +6604,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 + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only BackgroundCustomEmojiId 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 @@ -6532,31 +6664,33 @@ func (*User) GetType() string { func (user *User) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Usernames *Usernames `json:"usernames"` - PhoneNumber string `json:"phone_number"` - Status json.RawMessage `json:"status"` - ProfilePhoto *ProfilePhoto `json:"profile_photo"` - AccentColorId int32 `json:"accent_color_id"` - BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - EmojiStatus *EmojiStatus `json:"emoji_status"` - IsContact bool `json:"is_contact"` - IsMutualContact bool `json:"is_mutual_contact"` - IsCloseFriend bool `json:"is_close_friend"` - IsVerified bool `json:"is_verified"` - IsPremium bool `json:"is_premium"` - IsSupport bool `json:"is_support"` - RestrictionReason string `json:"restriction_reason"` - IsScam bool `json:"is_scam"` - IsFake bool `json:"is_fake"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` - HaveAccess bool `json:"have_access"` - Type json.RawMessage `json:"type"` - LanguageCode string `json:"language_code"` - AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` + Id int64 `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Usernames *Usernames `json:"usernames"` + PhoneNumber string `json:"phone_number"` + Status json.RawMessage `json:"status"` + 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"` + IsCloseFriend bool `json:"is_close_friend"` + IsVerified bool `json:"is_verified"` + IsPremium bool `json:"is_premium"` + IsSupport bool `json:"is_support"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + HaveAccess bool `json:"have_access"` + Type json.RawMessage `json:"type"` + LanguageCode string `json:"language_code"` + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` } err := json.Unmarshal(data, &tmp) @@ -6572,6 +6706,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 @@ -6712,6 +6848,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 @@ -6751,6 +6889,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"` @@ -6772,6 +6911,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 @@ -8018,8 +8158,10 @@ 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 publicForwards, or for public chats in which where sent messages from getMessagePublicForwards response MemberCount int32 `json:"member_count"` + // Approximate boost level for the chat + BoostLevel int32 `json:"boost_level"` // 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"` // True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup @@ -8036,7 +8178,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"` @@ -8075,6 +8217,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { Date int32 `json:"date"` Status json.RawMessage `json:"status"` MemberCount int32 `json:"member_count"` + BoostLevel int32 `json:"boost_level"` HasLinkedChat bool `json:"has_linked_chat"` HasLocation bool `json:"has_location"` SignMessages bool `json:"sign_messages"` @@ -8101,6 +8244,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.Usernames = tmp.Usernames supergroup.Date = tmp.Date supergroup.MemberCount = tmp.MemberCount + supergroup.BoostLevel = tmp.BoostLevel supergroup.HasLinkedChat = tmp.HasLinkedChat supergroup.HasLocation = tmp.HasLocation supergroup.SignMessages = tmp.SignMessages @@ -8430,7 +8574,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"` @@ -8856,7 +9000,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"` @@ -9050,6 +9194,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 as specified by the message sender + 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 @@ -9057,15 +9253,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, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote Content MessageContent `json:"content"` } @@ -9093,8 +9287,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"` @@ -9108,7 +9301,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) @@ -9152,12 +9344,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) { @@ -9230,7 +9422,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"` @@ -9449,7 +9641,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"` } @@ -9896,6 +10088,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 @@ -10061,6 +10301,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"` } @@ -10087,6 +10329,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"` } @@ -10098,6 +10341,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) @@ -10196,7 +10440,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"` } @@ -10294,7 +10538,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"` @@ -10302,11 +10546,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"` @@ -10314,15 +10558,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"` @@ -10353,9 +10597,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"` @@ -10521,7 +10765,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"` } @@ -11153,8 +11397,12 @@ type Chat struct { Photo *ChatPhotoInfo `json:"photo"` // Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview AccentColorId int32 `json:"accent_color_id"` - // Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none + // Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Identifier of the profile accent color for the chat's profile; -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` // Actions that non-administrator chat members are allowed to take in the chat Permissions *ChatPermissions `json:"permissions"` // Last message in the chat; may be null if none or unknown @@ -11171,6 +11419,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 @@ -11197,6 +11447,8 @@ type Chat struct { AvailableReactions ChatAvailableReactions `json:"available_reactions"` // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Emoji status to be shown along with chat title; may be null + EmojiStatus *EmojiStatus `json:"emoji_status"` // Background set for the chat; may be null if none Background *ChatBackground `json:"background"` // If non-empty, name of a theme, set for the chat @@ -11233,41 +11485,45 @@ func (*Chat) GetType() string { func (chat *Chat) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - Type json.RawMessage `json:"type"` - Title string `json:"title"` - Photo *ChatPhotoInfo `json:"photo"` - AccentColorId int32 `json:"accent_color_id"` - BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - Permissions *ChatPermissions `json:"permissions"` - LastMessage *Message `json:"last_message"` - Positions []*ChatPosition `json:"positions"` - MessageSenderId json.RawMessage `json:"message_sender_id"` - BlockList json.RawMessage `json:"block_list"` - HasProtectedContent bool `json:"has_protected_content"` - IsTranslatable bool `json:"is_translatable"` - IsMarkedAsUnread bool `json:"is_marked_as_unread"` - HasScheduledMessages bool `json:"has_scheduled_messages"` - CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` - CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - CanBeReported bool `json:"can_be_reported"` - DefaultDisableNotification bool `json:"default_disable_notification"` - UnreadCount int32 `json:"unread_count"` - LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` - LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` - UnreadMentionCount int32 `json:"unread_mention_count"` - UnreadReactionCount int32 `json:"unread_reaction_count"` - NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - AvailableReactions json.RawMessage `json:"available_reactions"` - MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - Background *ChatBackground `json:"background"` - ThemeName string `json:"theme_name"` - ActionBar json.RawMessage `json:"action_bar"` - VideoChat *VideoChat `json:"video_chat"` - PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` - ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` - DraftMessage *DraftMessage `json:"draft_message"` - ClientData string `json:"client_data"` + Id int64 `json:"id"` + Type json.RawMessage `json:"type"` + Title string `json:"title"` + Photo *ChatPhotoInfo `json:"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"` + Permissions *ChatPermissions `json:"permissions"` + LastMessage *Message `json:"last_message"` + Positions []*ChatPosition `json:"positions"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + BlockList json.RawMessage `json:"block_list"` + HasProtectedContent bool `json:"has_protected_content"` + IsTranslatable bool `json:"is_translatable"` + IsMarkedAsUnread bool `json:"is_marked_as_unread"` + 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"` + CanBeReported bool `json:"can_be_reported"` + DefaultDisableNotification bool `json:"default_disable_notification"` + UnreadCount int32 `json:"unread_count"` + LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` + LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` + UnreadMentionCount int32 `json:"unread_mention_count"` + UnreadReactionCount int32 `json:"unread_reaction_count"` + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + AvailableReactions json.RawMessage `json:"available_reactions"` + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + EmojiStatus *EmojiStatus `json:"emoji_status"` + Background *ChatBackground `json:"background"` + ThemeName string `json:"theme_name"` + ActionBar json.RawMessage `json:"action_bar"` + VideoChat *VideoChat `json:"video_chat"` + PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` + ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` + DraftMessage *DraftMessage `json:"draft_message"` + ClientData string `json:"client_data"` } err := json.Unmarshal(data, &tmp) @@ -11280,12 +11536,15 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Photo = tmp.Photo chat.AccentColorId = tmp.AccentColorId chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + chat.ProfileAccentColorId = tmp.ProfileAccentColorId + chat.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId chat.Permissions = tmp.Permissions chat.LastMessage = tmp.LastMessage chat.Positions = tmp.Positions 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 @@ -11298,6 +11557,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime + chat.EmojiStatus = tmp.EmojiStatus chat.Background = tmp.Background chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat @@ -11531,7 +11791,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"` } @@ -11740,39 +12000,41 @@ func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestPoll } -// A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request -type KeyboardButtonTypeRequestUser struct { +// A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request +type KeyboardButtonTypeRequestUsers struct { meta // Unique button identifier Id int32 `json:"id"` - // True, if the shared user must or must not be a bot + // True, if the shared users must or must not be bots RestrictUserIsBot bool `json:"restrict_user_is_bot"` - // True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false + // True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false UserIsBot bool `json:"user_is_bot"` - // True, if the shared user must or must not be a Telegram Premium user + // True, if the shared users must or must not be Telegram Premium users RestrictUserIsPremium bool `json:"restrict_user_is_premium"` - // True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false + // True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false UserIsPremium bool `json:"user_is_premium"` + // The maximum number of users to share + MaxQuantity int32 `json:"max_quantity"` } -func (entity *KeyboardButtonTypeRequestUser) MarshalJSON() ([]byte, error) { +func (entity *KeyboardButtonTypeRequestUsers) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub KeyboardButtonTypeRequestUser + type stub KeyboardButtonTypeRequestUsers return json.Marshal((*stub)(entity)) } -func (*KeyboardButtonTypeRequestUser) GetClass() string { +func (*KeyboardButtonTypeRequestUsers) GetClass() string { return ClassKeyboardButtonType } -func (*KeyboardButtonTypeRequestUser) GetType() string { - return TypeKeyboardButtonTypeRequestUser +func (*KeyboardButtonTypeRequestUsers) GetType() string { + return TypeKeyboardButtonTypeRequestUsers } -func (*KeyboardButtonTypeRequestUser) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeRequestUser +func (*KeyboardButtonTypeRequestUsers) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestUsers } // A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request @@ -15014,9 +15276,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"` @@ -15543,6 +15805,8 @@ type PaymentProviderSmartGlocal struct { meta // Public payment token PublicToken string `json:"public_token"` + // URL for sending card tokenization requests + TokenizeUrl string `json:"tokenize_url"` } func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) { @@ -16059,10 +16323,14 @@ type PremiumGiveawayParameters struct { AdditionalChatIds []int64 `json:"additional_chat_ids"` // Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways WinnersSelectionDate int32 `json:"winners_selection_date"` - // True, if only new subscribers of the chats will be eligible for the giveaway + // True, if only new members of the chats will be eligible for the giveaway OnlyNewMembers bool `json:"only_new_members"` + // True, if the list of winners of the giveaway will be available to everyone + HasPublicWinners bool `json:"has_public_winners"` // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list CountryCodes []string `json:"country_codes"` + // Additional description of the giveaway prize; 0-128 characters + PrizeDescription string `json:"prize_description"` } func (entity *PremiumGiveawayParameters) MarshalJSON() ([]byte, error) { @@ -18237,7 +18505,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"` } @@ -19422,6 +19690,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) { @@ -19792,9 +20062,9 @@ type MessageGiftedPremium struct { Amount int64 `json:"amount"` // Cryptocurrency used to pay for the gift; may be empty if none Cryptocurrency string `json:"cryptocurrency"` - // The paid amount, in the smallest units of the cryptocurrency + // The paid amount, in the smallest units of the cryptocurrency; 0 if none CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` - // Number of month the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -19823,13 +20093,21 @@ func (*MessageGiftedPremium) MessageContentType() string { // A Telegram Premium gift code was created for the user type MessagePremiumGiftCode struct { meta - // Identifier of a chat or a user that created the gift code + // Identifier of a chat or a user that created the gift code; may be null if unknown CreatorId MessageSender `json:"creator_id"` // True, if the gift code was created for a giveaway IsFromGiveaway bool `json:"is_from_giveaway"` // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen IsUnclaimed bool `json:"is_unclaimed"` - // Number of month the Telegram Premium subscription will be active after code activation + // Currency for the paid amount; empty if unknown + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency; 0 if unknown + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none or unknown + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency; 0 if unknown + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Number of months the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -19859,12 +20137,16 @@ func (*MessagePremiumGiftCode) MessageContentType() string { func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) error { var tmp struct { - CreatorId json.RawMessage `json:"creator_id"` - IsFromGiveaway bool `json:"is_from_giveaway"` - IsUnclaimed bool `json:"is_unclaimed"` - MonthCount int32 `json:"month_count"` - Sticker *Sticker `json:"sticker"` - Code string `json:"code"` + CreatorId json.RawMessage `json:"creator_id"` + IsFromGiveaway bool `json:"is_from_giveaway"` + IsUnclaimed bool `json:"is_unclaimed"` + Currency string `json:"currency"` + Amount int64 `json:"amount"` + Cryptocurrency string `json:"cryptocurrency"` + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + MonthCount int32 `json:"month_count"` + Sticker *Sticker `json:"sticker"` + Code string `json:"code"` } err := json.Unmarshal(data, &tmp) @@ -19874,6 +20156,10 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) messagePremiumGiftCode.IsFromGiveaway = tmp.IsFromGiveaway messagePremiumGiftCode.IsUnclaimed = tmp.IsUnclaimed + messagePremiumGiftCode.Currency = tmp.Currency + messagePremiumGiftCode.Amount = tmp.Amount + messagePremiumGiftCode.Cryptocurrency = tmp.Cryptocurrency + messagePremiumGiftCode.CryptocurrencyAmount = tmp.CryptocurrencyAmount messagePremiumGiftCode.MonthCount = tmp.MonthCount messagePremiumGiftCode.Sticker = tmp.Sticker messagePremiumGiftCode.Code = tmp.Code @@ -19916,7 +20202,7 @@ type MessagePremiumGiveaway struct { Parameters *PremiumGiveawayParameters `json:"parameters"` // Number of users which will receive Telegram Premium subscription gift codes WinnerCount int32 `json:"winner_count"` - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -19942,6 +20228,84 @@ func (*MessagePremiumGiveaway) MessageContentType() string { return TypeMessagePremiumGiveaway } +// A Telegram Premium giveaway without public winners has been completed for the chat +type MessagePremiumGiveawayCompleted struct { + meta + // Identifier of the message with the giveaway; can be 0 if the message was deleted + 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 Telegram Premium giveaway with public winners has been completed for the chat +type MessagePremiumGiveawayWinners struct { + meta + // Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription + BoostedChatId int64 `json:"boosted_chat_id"` + // Identifier of the message with the giveaway in the boosted chat + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of other chats that participated in the giveaway + AdditionalChatCount int32 `json:"additional_chat_count"` + // Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"` + // True, if only new members of the chats were eligible for the giveaway + OnlyNewMembers bool `json:"only_new_members"` + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool `json:"was_refunded"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Additional description of the giveaway prize + PrizeDescription string `json:"prize_description"` + // Total number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Up to 100 user identifiers of the winners of the giveaway + WinnerUserIds []int64 `json:"winner_user_ids"` + // Number of undistributed prizes + UnclaimedPrizeCount int32 `json:"unclaimed_prize_count"` +} + +func (entity *MessagePremiumGiveawayWinners) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayWinners + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayWinners) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayWinners) GetType() string { + return TypeMessagePremiumGiveawayWinners +} + +func (*MessagePremiumGiveawayWinners) MessageContentType() string { + return TypeMessagePremiumGiveawayWinners +} + // A contact has registered with Telegram type MessageContactRegistered struct { meta @@ -19967,33 +20331,33 @@ func (*MessageContactRegistered) MessageContentType() string { return TypeMessageContactRegistered } -// The current user shared a user, which was requested by the bot -type MessageUserShared struct { +// The current user shared users, which were requested by the bot +type MessageUsersShared struct { meta - // Identifier of the shared user - UserId int64 `json:"user_id"` + // Identifier of the shared users + UserIds []int64 `json:"user_ids"` // Identifier of the keyboard button with the request ButtonId int32 `json:"button_id"` } -func (entity *MessageUserShared) MarshalJSON() ([]byte, error) { +func (entity *MessageUsersShared) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageUserShared + type stub MessageUsersShared return json.Marshal((*stub)(entity)) } -func (*MessageUserShared) GetClass() string { +func (*MessageUsersShared) GetClass() string { return ClassMessageContent } -func (*MessageUserShared) GetType() string { - return TypeMessageUserShared +func (*MessageUsersShared) GetType() string { + return TypeMessageUsersShared } -func (*MessageUserShared) MessageContentType() string { - return TypeMessageUserShared +func (*MessageUsersShared) MessageContentType() string { + return TypeMessageUsersShared } // The current user shared a chat, which was requested by the bot @@ -20885,7 +21249,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 } @@ -21026,7 +21390,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return nil } -// Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied +// Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied type MessageCopyOptions struct { meta // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local @@ -21227,7 +21591,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 + // Pass true to disable automatic file type detection and send the document 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"` @@ -23004,6 +23368,8 @@ type StickerSet struct { StickerType StickerType `json:"sticker_type"` // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only NeedsRepainting bool `json:"needs_repainting"` + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -23030,20 +23396,21 @@ func (*StickerSet) GetType() string { func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { var tmp struct { - Id JsonInt64 `json:"id"` - Title string `json:"title"` - Name string `json:"name"` - Thumbnail *Thumbnail `json:"thumbnail"` - ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` - IsInstalled bool `json:"is_installed"` - IsArchived bool `json:"is_archived"` - IsOfficial bool `json:"is_official"` - StickerFormat json.RawMessage `json:"sticker_format"` - StickerType json.RawMessage `json:"sticker_type"` - NeedsRepainting bool `json:"needs_repainting"` - IsViewed bool `json:"is_viewed"` - Stickers []*Sticker `json:"stickers"` - Emojis []*Emojis `json:"emojis"` + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + IsViewed bool `json:"is_viewed"` + Stickers []*Sticker `json:"stickers"` + Emojis []*Emojis `json:"emojis"` } err := json.Unmarshal(data, &tmp) @@ -23060,6 +23427,7 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { stickerSet.IsArchived = tmp.IsArchived stickerSet.IsOfficial = tmp.IsOfficial stickerSet.NeedsRepainting = tmp.NeedsRepainting + stickerSet.IsAllowedAsChatEmojiStatus = tmp.IsAllowedAsChatEmojiStatus stickerSet.IsViewed = tmp.IsViewed stickerSet.Stickers = tmp.Stickers stickerSet.Emojis = tmp.Emojis @@ -23082,7 +23450,7 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -23098,6 +23466,8 @@ type StickerSetInfo struct { StickerType StickerType `json:"sticker_type"` // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only NeedsRepainting bool `json:"needs_repainting"` + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -23124,20 +23494,21 @@ func (*StickerSetInfo) GetType() string { func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { var tmp struct { - Id JsonInt64 `json:"id"` - Title string `json:"title"` - Name string `json:"name"` - Thumbnail *Thumbnail `json:"thumbnail"` - ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` - IsInstalled bool `json:"is_installed"` - IsArchived bool `json:"is_archived"` - IsOfficial bool `json:"is_official"` - StickerFormat json.RawMessage `json:"sticker_format"` - StickerType json.RawMessage `json:"sticker_type"` - NeedsRepainting bool `json:"needs_repainting"` - IsViewed bool `json:"is_viewed"` - Size int32 `json:"size"` - Covers []*Sticker `json:"covers"` + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + IsViewed bool `json:"is_viewed"` + Size int32 `json:"size"` + Covers []*Sticker `json:"covers"` } err := json.Unmarshal(data, &tmp) @@ -23154,6 +23525,7 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { stickerSetInfo.IsArchived = tmp.IsArchived stickerSetInfo.IsOfficial = tmp.IsOfficial stickerSetInfo.NeedsRepainting = tmp.NeedsRepainting + stickerSetInfo.IsAllowedAsChatEmojiStatus = tmp.IsAllowedAsChatEmojiStatus stickerSetInfo.IsViewed = tmp.IsViewed stickerSetInfo.Size = tmp.Size stickerSetInfo.Covers = tmp.Covers @@ -23344,89 +23716,6 @@ func (*EmojiCategoryTypeChatPhoto) EmojiCategoryTypeType() string { return TypeEmojiCategoryTypeChatPhoto } -// Represents a viewer of a story -type StoryViewer struct { - meta - // User identifier of the viewer - UserId int64 `json:"user_id"` - // Approximate point in time (Unix timestamp) when the story was viewed - ViewDate int32 `json:"view_date"` - // Block list to which the user is added; may be null if none - BlockList BlockList `json:"block_list"` - // Type of the reaction that was chosen by the user; may be null if none - ChosenReactionType ReactionType `json:"chosen_reaction_type"` -} - -func (entity *StoryViewer) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryViewer - - return json.Marshal((*stub)(entity)) -} - -func (*StoryViewer) GetClass() string { - return ClassStoryViewer -} - -func (*StoryViewer) GetType() string { - return TypeStoryViewer -} - -func (storyViewer *StoryViewer) UnmarshalJSON(data []byte) error { - var tmp struct { - UserId int64 `json:"user_id"` - ViewDate int32 `json:"view_date"` - BlockList json.RawMessage `json:"block_list"` - ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - storyViewer.UserId = tmp.UserId - storyViewer.ViewDate = tmp.ViewDate - - fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) - storyViewer.BlockList = fieldBlockList - - fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) - storyViewer.ChosenReactionType = fieldChosenReactionType - - return nil -} - -// Represents a list of story viewers -type StoryViewers struct { - meta - // Approximate total number of story viewers found - TotalCount int32 `json:"total_count"` - // Approximate total number of reactions set by found story viewers - 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 - NextOffset string `json:"next_offset"` -} - -func (entity *StoryViewers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryViewers - - return json.Marshal((*stub)(entity)) -} - -func (*StoryViewers) GetClass() string { - return ClassStoryViewers -} - -func (*StoryViewers) GetType() string { - return TypeStoryViewers -} - // Describes position of a clickable rectangle area on a story media type StoryAreaPosition struct { meta @@ -23568,6 +23857,35 @@ func (storyAreaTypeSuggestedReaction *StoryAreaTypeSuggestedReaction) UnmarshalJ return nil } +// An area pointing to a message +type StoryAreaTypeMessage struct { + meta + // Identifier of the chat with the message + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +func (entity *StoryAreaTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeMessage) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeMessage) GetType() string { + return TypeStoryAreaTypeMessage +} + +func (*StoryAreaTypeMessage) StoryAreaTypeType() string { + return TypeStoryAreaTypeMessage +} + // Describes a clickable rectangle area on a story media type StoryArea struct { meta @@ -23749,6 +24067,35 @@ func (inputStoryAreaTypeSuggestedReaction *InputStoryAreaTypeSuggestedReaction) return nil } +// An area pointing to a message +type InputStoryAreaTypeMessage struct { + meta + // Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat + ChatId int64 `json:"chat_id"` + // Identifier of the message. Only successfully sent non-scheduled messages can be specified + MessageId int64 `json:"message_id"` +} + +func (entity *InputStoryAreaTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeMessage) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeMessage) GetType() string { + return TypeInputStoryAreaTypeMessage +} + +func (*InputStoryAreaTypeMessage) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeMessage +} + // Describes a clickable rectangle area on a story media to be added type InputStoryArea struct { meta @@ -23796,7 +24143,7 @@ func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { // Contains a list of story areas to be added type InputStoryAreas struct { meta - // List of 0-10 input story areas + // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area Areas []*InputStoryArea `json:"areas"` } @@ -24090,6 +24437,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 @@ -24148,10 +24595,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 users viewed the story can be received through getStoryViewers - CanGetViewers bool `json:"can_get_viewers"` + // True, if the story statistics are available through getStoryStatistics + CanGetStatistics bool `json:"can_get_statistics"` + // True, if interactions with the story can be received through getStoryInteractions + CanGetInteractions bool `json:"can_get_interactions"` // 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 @@ -24197,8 +24648,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"` - CanGetViewers bool `json:"can_get_viewers"` + CanGetStatistics bool `json:"can_get_statistics"` + CanGetInteractions bool `json:"can_get_interactions"` 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"` @@ -24225,8 +24678,10 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.CanBeForwarded = tmp.CanBeForwarded story.CanBeReplied = tmp.CanBeReplied story.CanToggleIsPinned = tmp.CanToggleIsPinned - story.CanGetViewers = tmp.CanGetViewers + story.CanGetStatistics = tmp.CanGetStatistics + story.CanGetInteractions = tmp.CanGetInteractions story.HasExpiredViewers = tmp.HasExpiredViewers + story.RepostInfo = tmp.RepostInfo story.InteractionInfo = tmp.InteractionInfo story.Areas = tmp.Areas story.Caption = tmp.Caption @@ -24268,6 +24723,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 @@ -24351,6 +24831,358 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { return nil } +// A view of the story +type StoryInteractionTypeView struct { + meta + // Type of the reaction that was chosen by the viewer; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` +} + +func (entity *StoryInteractionTypeView) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeView + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeView) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeView) GetType() string { + return TypeStoryInteractionTypeView +} + +func (*StoryInteractionTypeView) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeView +} + +func (storyInteractionTypeView *StoryInteractionTypeView) UnmarshalJSON(data []byte) error { + var tmp struct { + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + storyInteractionTypeView.ChosenReactionType = fieldChosenReactionType + + return nil +} + +// A forward of the story as a message +type StoryInteractionTypeForward struct { + meta + // The message with story forward + Message *Message `json:"message"` +} + +func (entity *StoryInteractionTypeForward) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeForward + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeForward) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeForward) GetType() string { + return TypeStoryInteractionTypeForward +} + +func (*StoryInteractionTypeForward) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeForward +} + +// A repost of the story as a story +type StoryInteractionTypeRepost struct { + meta + // The reposted story + Story *Story `json:"story"` +} + +func (entity *StoryInteractionTypeRepost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeRepost + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeRepost) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeRepost) GetType() string { + return TypeStoryInteractionTypeRepost +} + +func (*StoryInteractionTypeRepost) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeRepost +} + +// Represents interaction with a story +type StoryInteraction struct { + meta + // Identifier of the user or chat that made the interaction + ActorId MessageSender `json:"actor_id"` + // Approximate point in time (Unix timestamp) when the interaction happened + InteractionDate int32 `json:"interaction_date"` + // Block list to which the actor is added; may be null if none or for chat stories + BlockList BlockList `json:"block_list"` + // Type of the interaction + Type StoryInteractionType `json:"type"` +} + +func (entity *StoryInteraction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteraction + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteraction) GetClass() string { + return ClassStoryInteraction +} + +func (*StoryInteraction) GetType() string { + return TypeStoryInteraction +} + +func (storyInteraction *StoryInteraction) UnmarshalJSON(data []byte) error { + var tmp struct { + ActorId json.RawMessage `json:"actor_id"` + InteractionDate int32 `json:"interaction_date"` + BlockList json.RawMessage `json:"block_list"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyInteraction.InteractionDate = tmp.InteractionDate + + fieldActorId, _ := UnmarshalMessageSender(tmp.ActorId) + storyInteraction.ActorId = fieldActorId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + storyInteraction.BlockList = fieldBlockList + + fieldType, _ := UnmarshalStoryInteractionType(tmp.Type) + storyInteraction.Type = fieldType + + return nil +} + +// Represents a list of interactions with a story +type StoryInteractions struct { + meta + // Approximate total number of interactions found + TotalCount int32 `json:"total_count"` + // Approximate total number of found forwards and reposts; always 0 for chat stories + TotalForwardCount int32 `json:"total_forward_count"` + // Approximate total number of found reactions; always 0 for chat stories + TotalReactionCount int32 `json:"total_reaction_count"` + // List of story interactions + Interactions []*StoryInteraction `json:"interactions"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *StoryInteractions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractions + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractions) GetClass() string { + return ClassStoryInteractions +} + +func (*StoryInteractions) GetType() string { + return TypeStoryInteractions +} + +// Contains a public forward as a message +type PublicForwardMessage struct { + meta + // Information about the message + Message *Message `json:"message"` +} + +func (entity *PublicForwardMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwardMessage + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwardMessage) GetClass() string { + return ClassPublicForward +} + +func (*PublicForwardMessage) GetType() string { + return TypePublicForwardMessage +} + +func (*PublicForwardMessage) PublicForwardType() string { + return TypePublicForwardMessage +} + +// Contains a public repost to a story +type PublicForwardStory struct { + meta + // Information about the story + Story *Story `json:"story"` +} + +func (entity *PublicForwardStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwardStory + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwardStory) GetClass() string { + return ClassPublicForward +} + +func (*PublicForwardStory) GetType() string { + return TypePublicForwardStory +} + +func (*PublicForwardStory) PublicForwardType() string { + return TypePublicForwardStory +} + +// Represents a list of public forwards and reposts as a story of a message or a story +type PublicForwards struct { + meta + // Approximate total number of messages and stories found + TotalCount int32 `json:"total_count"` + // List of found public forwards and reposts + Forwards []PublicForward `json:"forwards"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *PublicForwards) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwards + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwards) GetClass() string { + return ClassPublicForwards +} + +func (*PublicForwards) GetType() string { + return TypePublicForwards +} + +func (publicForwards *PublicForwards) 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 + } + + publicForwards.TotalCount = tmp.TotalCount + publicForwards.NextOffset = tmp.NextOffset + + fieldForwards, _ := UnmarshalListOfPublicForward(tmp.Forwards) + publicForwards.Forwards = fieldForwards + + return nil +} + +// Contains a list of features available on a specific chat boost level +type ChatBoostLevelFeatures struct { + meta + // Target chat boost level + Level int32 `json:"level"` + // Number of stories that the chat can publish daily + StoryPerDayCount int32 `json:"story_per_day_count"` + // Number of custom emoji reactions that can be added to the list of available reactions + CustomEmojiReactionCount int32 `json:"custom_emoji_reaction_count"` + // Number of custom colors for chat title + TitleColorCount int32 `json:"title_color_count"` + // Number of custom colors for profile photo background + ProfileAccentColorCount int32 `json:"profile_accent_color_count"` + // True, if custom emoji for profile background can be set + CanSetProfileBackgroundCustomEmoji bool `json:"can_set_profile_background_custom_emoji"` + // Number of custom colors for background of empty chat photo, replies to messages and link previews + AccentColorCount int32 `json:"accent_color_count"` + // True, if custom emoji for reply header and link preview background can be set + CanSetBackgroundCustomEmoji bool `json:"can_set_background_custom_emoji"` + // True, if emoji status can be set + CanSetEmojiStatus bool `json:"can_set_emoji_status"` + // Number of chat theme backgrounds that can be set as chat background + ChatThemeBackgroundCount int32 `json:"chat_theme_background_count"` + // True, if custom background can be set in the chat for all users + CanSetCustomBackground bool `json:"can_set_custom_background"` +} + +func (entity *ChatBoostLevelFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLevelFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLevelFeatures) GetClass() string { + return ClassChatBoostLevelFeatures +} + +func (*ChatBoostLevelFeatures) GetType() string { + return TypeChatBoostLevelFeatures +} + +// Contains a list of features available on the first chat boost levels +type ChatBoostFeatures struct { + meta + // The list of features + Features []*ChatBoostLevelFeatures `json:"features"` +} + +func (entity *ChatBoostFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostFeatures) GetClass() string { + return ClassChatBoostFeatures +} + +func (*ChatBoostFeatures) GetType() string { + return TypeChatBoostFeatures +} + // The chat created a Telegram Premium gift code for a user type ChatBoostSourceGiftCode struct { meta @@ -24447,7 +25279,7 @@ type PrepaidPremiumGiveaway struct { Id JsonInt64 `json:"id"` // Number of users which will receive Telegram Premium subscription gift codes WinnerCount int32 `json:"winner_count"` - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` // Point in time (Unix timestamp) when the giveaway was paid PaymentDate int32 `json:"payment_date"` @@ -24573,7 +25405,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"` } @@ -25024,7 +25856,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"` @@ -25369,7 +26201,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"` @@ -25813,7 +26645,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"` @@ -26039,7 +26871,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"` } @@ -26112,7 +26944,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"` } @@ -26340,7 +27172,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"` } @@ -28008,7 +28840,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"` } @@ -28687,6 +29519,35 @@ func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) Un return nil } +// The chat background was changed +type ChatEventBackgroundChanged struct { + meta + // Previous background; may be null if none + OldBackground *ChatBackground `json:"old_background"` + // New background; may be null if none + NewBackground *ChatBackground `json:"new_background"` +} + +func (entity *ChatEventBackgroundChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventBackgroundChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventBackgroundChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventBackgroundChanged) GetType() string { + return TypeChatEventBackgroundChanged +} + +func (*ChatEventBackgroundChanged) ChatEventActionType() string { + return TypeChatEventBackgroundChanged +} + // The chat description was changed type ChatEventDescriptionChanged struct { meta @@ -28716,6 +29577,35 @@ func (*ChatEventDescriptionChanged) ChatEventActionType() string { return TypeChatEventDescriptionChanged } +// The chat emoji status was changed +type ChatEventEmojiStatusChanged struct { + meta + // Previous emoji status; may be null if none + OldEmojiStatus *EmojiStatus `json:"old_emoji_status"` + // New emoji status; may be null if none + NewEmojiStatus *EmojiStatus `json:"new_emoji_status"` +} + +func (entity *ChatEventEmojiStatusChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventEmojiStatusChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventEmojiStatusChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventEmojiStatusChanged) GetType() string { + return TypeChatEventEmojiStatusChanged +} + +func (*ChatEventEmojiStatusChanged) ChatEventActionType() string { + return TypeChatEventEmojiStatusChanged +} + // The linked chat of a supergroup was changed type ChatEventLinkedChatChanged struct { meta @@ -28803,7 +29693,7 @@ func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { return TypeChatEventMessageAutoDeleteTimeChanged } -// The chat permissions was changed +// The chat permissions were changed type ChatEventPermissionsChanged struct { meta // Previous chat permissions @@ -29006,13 +29896,17 @@ func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { return TypeChatEventActiveUsernamesChanged } -// The chat accent color was changed +// The chat accent color or background custom emoji were changed type ChatEventAccentColorChanged struct { meta // Previous identifier of chat accent color OldAccentColorId int32 `json:"old_accent_color_id"` + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiId JsonInt64 `json:"old_background_custom_emoji_id"` // New identifier of chat accent color NewAccentColorId int32 `json:"new_accent_color_id"` + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiId JsonInt64 `json:"new_background_custom_emoji_id"` } func (entity *ChatEventAccentColorChanged) MarshalJSON() ([]byte, error) { @@ -29035,33 +29929,37 @@ func (*ChatEventAccentColorChanged) ChatEventActionType() string { return TypeChatEventAccentColorChanged } -// The chat's custom emoji for reply background was changed -type ChatEventBackgroundCustomEmojiChanged struct { +// The chat's profile accent color or profile background custom emoji were changed +type ChatEventProfileAccentColorChanged struct { meta + // Previous identifier of chat's profile accent color; -1 if none + OldProfileAccentColorId int32 `json:"old_profile_accent_color_id"` // Previous identifier of the custom emoji; 0 if none - OldBackgroundCustomEmojiId JsonInt64 `json:"old_background_custom_emoji_id"` + OldProfileBackgroundCustomEmojiId JsonInt64 `json:"old_profile_background_custom_emoji_id"` + // New identifier of chat's profile accent color; -1 if none + NewProfileAccentColorId int32 `json:"new_profile_accent_color_id"` // New identifier of the custom emoji; 0 if none - NewBackgroundCustomEmojiId JsonInt64 `json:"new_background_custom_emoji_id"` + NewProfileBackgroundCustomEmojiId JsonInt64 `json:"new_profile_background_custom_emoji_id"` } -func (entity *ChatEventBackgroundCustomEmojiChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventProfileAccentColorChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventBackgroundCustomEmojiChanged + type stub ChatEventProfileAccentColorChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventBackgroundCustomEmojiChanged) GetClass() string { +func (*ChatEventProfileAccentColorChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventBackgroundCustomEmojiChanged) GetType() string { - return TypeChatEventBackgroundCustomEmojiChanged +func (*ChatEventProfileAccentColorChanged) GetType() string { + return TypeChatEventProfileAccentColorChanged } -func (*ChatEventBackgroundCustomEmojiChanged) ChatEventActionType() string { - return TypeChatEventBackgroundCustomEmojiChanged +func (*ChatEventProfileAccentColorChanged) ChatEventActionType() string { + return TypeChatEventProfileAccentColorChanged } // The has_protected_content setting of a channel was toggled @@ -30427,6 +31325,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 @@ -30852,7 +31775,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 } @@ -30877,6 +31800,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 @@ -31512,7 +32460,7 @@ type TelegramPaymentPurposePremiumGiftCodes struct { Amount int64 `json:"amount"` // Identifiers of the users which can activate the gift codes UserIds []int64 `json:"user_ids"` - // Number of month the Telegram Premium subscription will be active for the users + // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 `json:"month_count"` } @@ -31547,7 +32495,7 @@ type TelegramPaymentPurposePremiumGiveaway struct { Amount int64 `json:"amount"` // Number of users which will be able to activate the gift codes WinnerCount int32 `json:"winner_count"` - // Number of month the Telegram Premium subscription will be active for the users + // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 `json:"month_count"` } @@ -32145,6 +33093,33 @@ func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { return nil } +// A background from a chat theme; can be used only as a chat background in channels +type BackgroundTypeChatTheme struct { + meta + // Name of the chat theme + ThemeName string `json:"theme_name"` +} + +func (entity *BackgroundTypeChatTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundTypeChatTheme + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundTypeChatTheme) GetClass() string { + return ClassBackgroundType +} + +func (*BackgroundTypeChatTheme) GetType() string { + return TypeBackgroundTypeChatTheme +} + +func (*BackgroundTypeChatTheme) BackgroundTypeType() string { + return TypeBackgroundTypeChatTheme +} + // A background from a local file type InputBackgroundLocal struct { meta @@ -32910,7 +33885,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 @@ -32937,7 +33912,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 @@ -32964,7 +33939,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 } @@ -33344,7 +34319,7 @@ func (*PushMessageContentPoll) PushMessageContentType() string { // A message with a Telegram Premium gift code created for the user type PushMessageContentPremiumGiftCode struct { meta - // Number of month the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation MonthCount int32 `json:"month_count"` } @@ -33373,7 +34348,7 @@ type PushMessageContentPremiumGiveaway struct { meta // Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message WinnerCount int32 `json:"winner_count"` - // Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message + // Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message MonthCount int32 `json:"month_count"` // True, if the message is a pinned message with the specified content IsPinned bool `json:"is_pinned"` @@ -36341,7 +37316,7 @@ func (targetChatInternalLink *TargetChatInternalLink) UnmarshalJSON(data []byte) return nil } -// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link +// The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user type InternalLinkTypeActiveSessions struct { meta } @@ -36445,7 +37420,7 @@ func (*InternalLinkTypeAuthenticationCode) InternalLinkTypeType() string { return TypeInternalLinkTypeAuthenticationCode } -// The link is a link to a background. Call searchBackground with the given background name to process the link +// The link is a link to a background. Call searchBackground with the given background name to process the link If background is found and the user wants to apply it, then call setDefaultBackground type InternalLinkTypeBackground struct { meta // Name of the background @@ -36615,7 +37590,7 @@ func (*InternalLinkTypeChatBoost) InternalLinkTypeType() string { return TypeInternalLinkTypeChatBoost } -// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link +// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink type InternalLinkTypeChatFolderInvite struct { meta // Internal representation of the invite link @@ -36667,7 +37642,7 @@ func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeChatFolderSettings } -// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link +// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink type InternalLinkTypeChatInvite struct { meta // Internal representation of the invite link @@ -36773,7 +37748,7 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string { return TypeInternalLinkTypeGame } -// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link +// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser type InternalLinkTypeInstantView struct { meta // URL to be passed to getWebPageInstantView @@ -36829,7 +37804,7 @@ func (*InternalLinkTypeInvoice) InternalLinkTypeType() string { return TypeInternalLinkTypeInvoice } -// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link +// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id" type InternalLinkTypeLanguagePack struct { meta // Language pack identifier @@ -36881,7 +37856,7 @@ func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguageSettings } -// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link +// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there type InternalLinkTypeMessage struct { meta // URL to be passed to getMessageLinkInfo @@ -36972,7 +37947,7 @@ func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string { return TypeInternalLinkTypePassportDataRequest } -// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link +// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it type InternalLinkTypePhoneNumberConfirmation struct { meta // Hash value from the link @@ -37028,6 +38003,33 @@ func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { return TypeInternalLinkTypePremiumFeatures } +// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases +type InternalLinkTypePremiumGift struct { + meta + // Referrer specified in the link + Referrer string `json:"referrer"` +} + +func (entity *InternalLinkTypePremiumGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGift + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGift) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGift) GetType() string { + return TypeInternalLinkTypePremiumGift +} + +func (*InternalLinkTypePremiumGift) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGift +} + // The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode type InternalLinkTypePremiumGiftCode struct { meta @@ -37132,7 +38134,7 @@ func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) e return nil } -// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link +// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself type InternalLinkTypePublicChat struct { meta // Username of the chat @@ -37234,7 +38236,7 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } -// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL +// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App type InternalLinkTypeSideMenuBot struct { meta // Username of the bot @@ -37263,7 +38265,7 @@ func (*InternalLinkTypeSideMenuBot) InternalLinkTypeType() string { return TypeInternalLinkTypeSideMenuBot } -// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set +// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet type InternalLinkTypeStickerSet struct { meta // Name of the sticker set @@ -37292,7 +38294,7 @@ func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { return TypeInternalLinkTypeStickerSet } -// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier +// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received type InternalLinkTypeStory struct { meta // Username of the sender of the story @@ -37425,7 +38427,7 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat type InternalLinkTypeUserPhoneNumber struct { meta // Phone number of the user @@ -37452,7 +38454,7 @@ func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { return TypeInternalLinkTypeUserPhoneNumber } -// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link +// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat type InternalLinkTypeUserToken struct { meta // The token @@ -38887,7 +39889,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 } @@ -38912,7 +39914,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 } @@ -38937,7 +39939,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 } @@ -38962,7 +39964,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 } @@ -39639,6 +40641,31 @@ func (*SuggestedActionSubscribeToAnnualPremium) SuggestedActionType() string { return TypeSuggestedActionSubscribeToAnnualPremium } +// Suggests the user to gift Telegram Premium to friends for Christmas +type SuggestedActionGiftPremiumForChristmas struct { + meta +} + +func (entity *SuggestedActionGiftPremiumForChristmas) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionGiftPremiumForChristmas + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionGiftPremiumForChristmas) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionGiftPremiumForChristmas) GetType() string { + return TypeSuggestedActionGiftPremiumForChristmas +} + +func (*SuggestedActionGiftPremiumForChristmas) SuggestedActionType() string { + return TypeSuggestedActionGiftPremiumForChristmas +} + // Contains a counter type Count struct { meta @@ -40165,31 +41192,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 @@ -40398,10 +41504,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 @@ -40420,10 +41534,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) { @@ -40448,21 +41568,28 @@ func (*ChatStatisticsChannel) ChatStatisticsType() string { func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) error { var tmp struct { - Period *DateRange `json:"period"` - MemberCount *StatisticalValue `json:"member_count"` - MeanViewCount *StatisticalValue `json:"mean_view_count"` - MeanShareCount *StatisticalValue `json:"mean_share_count"` - EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` - MemberCountGraph json.RawMessage `json:"member_count_graph"` - JoinGraph json.RawMessage `json:"join_graph"` - MuteGraph json.RawMessage `json:"mute_graph"` - ViewCountByHourGraph json.RawMessage `json:"view_count_by_hour_graph"` - ViewCountBySourceGraph json.RawMessage `json:"view_count_by_source_graph"` - JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"` - LanguageGraph json.RawMessage `json:"language_graph"` - MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` - InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"` - RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"` + Period *DateRange `json:"period"` + MemberCount *StatisticalValue `json:"member_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"` + MuteGraph json.RawMessage `json:"mute_graph"` + ViewCountByHourGraph json.RawMessage `json:"view_count_by_hour_graph"` + ViewCountBySourceGraph json.RawMessage `json:"view_count_by_source_graph"` + 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"` + RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` } err := json.Unmarshal(data, &tmp) @@ -40472,10 +41599,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 @@ -40501,6 +41632,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 @@ -40512,6 +41652,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) { @@ -40533,6 +41675,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) @@ -40543,6 +41686,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 } @@ -40882,7 +42073,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 @@ -41348,65 +42539,42 @@ func (*UpdateChatPhoto) UpdateType() string { return TypeUpdateChatPhoto } -// A chat accent color has changed -type UpdateChatAccentColor struct { +// Chat accent colors have changed +type UpdateChatAccentColors struct { meta // Chat identifier ChatId int64 `json:"chat_id"` // The new chat accent color identifier AccentColorId int32 `json:"accent_color_id"` -} - -func (entity *UpdateChatAccentColor) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatAccentColor - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatAccentColor) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatAccentColor) GetType() string { - return TypeUpdateChatAccentColor -} - -func (*UpdateChatAccentColor) UpdateType() string { - return TypeUpdateChatAccentColor -} - -// A chat's custom emoji for reply background has changed -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 and link preview background; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // The new chat profile accent color identifier; -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // The new identifier of a custom emoji to be shown on the profile background; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` } -func (entity *UpdateChatBackgroundCustomEmoji) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatAccentColors) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatBackgroundCustomEmoji + type stub UpdateChatAccentColors return json.Marshal((*stub)(entity)) } -func (*UpdateChatBackgroundCustomEmoji) GetClass() string { +func (*UpdateChatAccentColors) GetClass() string { return ClassUpdate } -func (*UpdateChatBackgroundCustomEmoji) GetType() string { - return TypeUpdateChatBackgroundCustomEmoji +func (*UpdateChatAccentColors) GetType() string { + return TypeUpdateChatAccentColors } -func (*UpdateChatBackgroundCustomEmoji) UpdateType() string { - return TypeUpdateChatBackgroundCustomEmoji +func (*UpdateChatAccentColors) UpdateType() string { + return TypeUpdateChatAccentColors } -// Chat permissions was changed +// Chat permissions were changed type UpdateChatPermissions struct { meta // Chat identifier @@ -41682,6 +42850,35 @@ func (*UpdateChatDraftMessage) UpdateType() string { return TypeUpdateChatDraftMessage } +// Chat emoji status has changed +type UpdateChatEmojiStatus struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat emoji status; may be null + EmojiStatus *EmojiStatus `json:"emoji_status"` +} + +func (entity *UpdateChatEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatEmojiStatus) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatEmojiStatus) GetType() string { + return TypeUpdateChatEmojiStatus +} + +func (*UpdateChatEmojiStatus) UpdateType() string { + return TypeUpdateChatEmojiStatus +} + // The message sender that is selected to send messages in a chat has changed type UpdateChatMessageSender struct { meta @@ -42107,6 +43304,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 @@ -42213,7 +43439,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 @@ -42420,7 +43646,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 @@ -43838,7 +45064,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 @@ -43865,33 +45091,33 @@ func (*UpdateSavedNotificationSounds) UpdateType() string { return TypeUpdateSavedNotificationSounds } -// The selected background has changed -type UpdateSelectedBackground struct { +// The default background has changed +type UpdateDefaultBackground struct { meta - // True, if background for dark theme has changed + // True, if default background for dark theme has changed ForDarkTheme bool `json:"for_dark_theme"` - // The new selected background; may be null + // The new default background; may be null Background *Background `json:"background"` } -func (entity *UpdateSelectedBackground) MarshalJSON() ([]byte, error) { +func (entity *UpdateDefaultBackground) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateSelectedBackground + type stub UpdateDefaultBackground return json.Marshal((*stub)(entity)) } -func (*UpdateSelectedBackground) GetClass() string { +func (*UpdateDefaultBackground) GetClass() string { return ClassUpdate } -func (*UpdateSelectedBackground) GetType() string { - return TypeUpdateSelectedBackground +func (*UpdateDefaultBackground) GetType() string { + return TypeUpdateDefaultBackground } -func (*UpdateSelectedBackground) UpdateType() string { - return TypeUpdateSelectedBackground +func (*UpdateDefaultBackground) UpdateType() string { + return TypeUpdateDefaultBackground } // The list of available chat themes has changed @@ -43950,6 +45176,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 and setChatProfileAccentColor. 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 @@ -44231,6 +45486,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 @@ -44883,7 +46171,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"` @@ -44977,6 +46265,107 @@ func (*UpdateChatBoost) UpdateType() string { return TypeUpdateChatBoost } +// User changed its reactions on a message with public reactions; for bots only +type UpdateMessageReaction struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Identifier of the user or chat that changed reactions + ActorId MessageSender `json:"actor_id"` + // Point in time (Unix timestamp) when the reactions were changed + Date int32 `json:"date"` + // Old list of chosen reactions + OldReactionTypes []ReactionType `json:"old_reaction_types"` + // New list of chosen reactions + NewReactionTypes []ReactionType `json:"new_reaction_types"` +} + +func (entity *UpdateMessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageReaction) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageReaction) GetType() string { + return TypeUpdateMessageReaction +} + +func (*UpdateMessageReaction) UpdateType() string { + return TypeUpdateMessageReaction +} + +func (updateMessageReaction *UpdateMessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + ActorId json.RawMessage `json:"actor_id"` + Date int32 `json:"date"` + OldReactionTypes []json.RawMessage `json:"old_reaction_types"` + NewReactionTypes []json.RawMessage `json:"new_reaction_types"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateMessageReaction.ChatId = tmp.ChatId + updateMessageReaction.MessageId = tmp.MessageId + updateMessageReaction.Date = tmp.Date + + fieldActorId, _ := UnmarshalMessageSender(tmp.ActorId) + updateMessageReaction.ActorId = fieldActorId + + fieldOldReactionTypes, _ := UnmarshalListOfReactionType(tmp.OldReactionTypes) + updateMessageReaction.OldReactionTypes = fieldOldReactionTypes + + fieldNewReactionTypes, _ := UnmarshalListOfReactionType(tmp.NewReactionTypes) + updateMessageReaction.NewReactionTypes = fieldNewReactionTypes + + return nil +} + +// Reactions added to a message with anonymous reactions have changed; for bots only +type UpdateMessageReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Point in time (Unix timestamp) when the reactions were changed + Date int32 `json:"date"` + // The list of reactions added to the message + Reactions []*MessageReaction `json:"reactions"` +} + +func (entity *UpdateMessageReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageReactions) GetType() string { + return TypeUpdateMessageReactions +} + +func (*UpdateMessageReactions) UpdateType() string { + return TypeUpdateMessageReactions +} + // Contains a list of updates type Updates struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 780ddcd..37516c0 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) @@ -1474,8 +1477,8 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeKeyboardButtonTypeRequestUser: - return UnmarshalKeyboardButtonTypeRequestUser(data) + case TypeKeyboardButtonTypeRequestUsers: + return UnmarshalKeyboardButtonTypeRequestUsers(data) case TypeKeyboardButtonTypeRequestChat: return UnmarshalKeyboardButtonTypeRequestChat(data) @@ -2535,11 +2538,17 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePremiumGiveaway: return UnmarshalMessagePremiumGiveaway(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) + + case TypeMessagePremiumGiveawayWinners: + return UnmarshalMessagePremiumGiveawayWinners(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) - case TypeMessageUserShared: - return UnmarshalMessageUserShared(data) + case TypeMessageUsersShared: + return UnmarshalMessageUsersShared(data) case TypeMessageChatShared: return UnmarshalMessageChatShared(data) @@ -3078,6 +3087,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { case TypeStoryAreaTypeSuggestedReaction: return UnmarshalStoryAreaTypeSuggestedReaction(data) + case TypeStoryAreaTypeMessage: + return UnmarshalStoryAreaTypeMessage(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3118,6 +3130,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro case TypeInputStoryAreaTypeSuggestedReaction: return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + case TypeInputStoryAreaTypeMessage: + return UnmarshalInputStoryAreaTypeMessage(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3242,6 +3257,111 @@ 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 UnmarshalStoryInteractionType(data json.RawMessage) (StoryInteractionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryInteractionTypeView: + return UnmarshalStoryInteractionTypeView(data) + + case TypeStoryInteractionTypeForward: + return UnmarshalStoryInteractionTypeForward(data) + + case TypeStoryInteractionTypeRepost: + return UnmarshalStoryInteractionTypeRepost(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryInteractionType(dataList []json.RawMessage) ([]StoryInteractionType, error) { + list := []StoryInteractionType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryInteractionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPublicForward(data json.RawMessage) (PublicForward, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePublicForwardMessage: + return UnmarshalPublicForwardMessage(data) + + case TypePublicForwardStory: + return UnmarshalPublicForwardStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPublicForward(dataList []json.RawMessage) ([]PublicForward, error) { + list := []PublicForward{} + + for _, data := range dataList { + entity, err := UnmarshalPublicForward(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatBoostSource(data json.RawMessage) (ChatBoostSource, error) { var meta meta @@ -3886,9 +4006,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventAvailableReactionsChanged: return UnmarshalChatEventAvailableReactionsChanged(data) + case TypeChatEventBackgroundChanged: + return UnmarshalChatEventBackgroundChanged(data) + case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) + case TypeChatEventEmojiStatusChanged: + return UnmarshalChatEventEmojiStatusChanged(data) + case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) @@ -3922,8 +4048,8 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventAccentColorChanged: return UnmarshalChatEventAccentColorChanged(data) - case TypeChatEventBackgroundCustomEmojiChanged: - return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + case TypeChatEventProfileAccentColorChanged: + return UnmarshalChatEventProfileAccentColorChanged(data) case TypeChatEventHasProtectedContentToggled: return UnmarshalChatEventHasProtectedContentToggled(data) @@ -4101,6 +4227,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 +4312,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) } @@ -4484,6 +4616,9 @@ func UnmarshalBackgroundType(data json.RawMessage) (BackgroundType, error) { case TypeBackgroundTypeFill: return UnmarshalBackgroundTypeFill(data) + case TypeBackgroundTypeChatTheme: + return UnmarshalBackgroundTypeChatTheme(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -5484,6 +5619,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) @@ -5961,6 +6099,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionSubscribeToAnnualPremium: return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + case TypeSuggestedActionGiftPremiumForChristmas: + return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6088,6 +6229,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 @@ -6262,11 +6437,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) - case TypeUpdateChatAccentColor: - return UnmarshalUpdateChatAccentColor(data) - - case TypeUpdateChatBackgroundCustomEmoji: - return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(data) case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -6292,6 +6464,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(data) + case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) @@ -6334,6 +6509,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) + case TypeUpdateChatBlockList: return UnmarshalUpdateChatBlockList(data) @@ -6484,8 +6662,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedNotificationSounds: return UnmarshalUpdateSavedNotificationSounds(data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(data) + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) @@ -6493,6 +6671,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 +6701,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -6577,6 +6761,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatBoost: return UnmarshalUpdateChatBoost(data) + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -7625,6 +7815,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 +8423,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 +8623,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 @@ -8841,8 +9071,8 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt return &resp, err } -func UnmarshalKeyboardButtonTypeRequestUser(data json.RawMessage) (*KeyboardButtonTypeRequestUser, error) { - var resp KeyboardButtonTypeRequestUser +func UnmarshalKeyboardButtonTypeRequestUsers(data json.RawMessage) (*KeyboardButtonTypeRequestUsers, error) { + var resp KeyboardButtonTypeRequestUsers err := json.Unmarshal(data, &resp) @@ -10801,6 +11031,22 @@ 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 UnmarshalMessagePremiumGiveawayWinners(data json.RawMessage) (*MessagePremiumGiveawayWinners, error) { + var resp MessagePremiumGiveawayWinners + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -10809,8 +11055,8 @@ func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactReg return &resp, err } -func UnmarshalMessageUserShared(data json.RawMessage) (*MessageUserShared, error) { - var resp MessageUserShared +func UnmarshalMessageUsersShared(data json.RawMessage) (*MessageUsersShared, error) { + var resp MessageUsersShared err := json.Unmarshal(data, &resp) @@ -11641,22 +11887,6 @@ func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTy return &resp, err } -func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) { - var resp StoryViewer - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) { - var resp StoryViewers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { var resp StoryAreaPosition @@ -11689,6 +11919,14 @@ func UnmarshalStoryAreaTypeSuggestedReaction(data json.RawMessage) (*StoryAreaTy return &resp, err } +func UnmarshalStoryAreaTypeMessage(data json.RawMessage) (*StoryAreaTypeMessage, error) { + var resp StoryAreaTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { var resp StoryArea @@ -11729,6 +11967,14 @@ func UnmarshalInputStoryAreaTypeSuggestedReaction(data json.RawMessage) (*InputS return &resp, err } +func UnmarshalInputStoryAreaTypeMessage(data json.RawMessage) (*InputStoryAreaTypeMessage, error) { + var resp InputStoryAreaTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { var resp InputStoryArea @@ -11809,6 +12055,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 +12103,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 +12127,86 @@ func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error return &resp, err } +func UnmarshalStoryInteractionTypeView(data json.RawMessage) (*StoryInteractionTypeView, error) { + var resp StoryInteractionTypeView + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionTypeForward(data json.RawMessage) (*StoryInteractionTypeForward, error) { + var resp StoryInteractionTypeForward + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionTypeRepost(data json.RawMessage) (*StoryInteractionTypeRepost, error) { + var resp StoryInteractionTypeRepost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteraction(data json.RawMessage) (*StoryInteraction, error) { + var resp StoryInteraction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractions(data json.RawMessage) (*StoryInteractions, error) { + var resp StoryInteractions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) { + var resp PublicForwardMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwardStory(data json.RawMessage) (*PublicForwardStory, error) { + var resp PublicForwardStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwards(data json.RawMessage) (*PublicForwards, error) { + var resp PublicForwards + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostLevelFeatures(data json.RawMessage) (*ChatBoostLevelFeatures, error) { + var resp ChatBoostLevelFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostFeatures(data json.RawMessage) (*ChatBoostFeatures, error) { + var resp ChatBoostFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatBoostSourceGiftCode(data json.RawMessage) (*ChatBoostSourceGiftCode, error) { var resp ChatBoostSourceGiftCode @@ -12801,6 +13159,14 @@ func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEve return &resp, err } +func UnmarshalChatEventBackgroundChanged(data json.RawMessage) (*ChatEventBackgroundChanged, error) { + var resp ChatEventBackgroundChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) { var resp ChatEventDescriptionChanged @@ -12809,6 +13175,14 @@ func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescr return &resp, err } +func UnmarshalChatEventEmojiStatusChanged(data json.RawMessage) (*ChatEventEmojiStatusChanged, error) { + var resp ChatEventEmojiStatusChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { var resp ChatEventLinkedChatChanged @@ -12897,8 +13271,8 @@ func UnmarshalChatEventAccentColorChanged(data json.RawMessage) (*ChatEventAccen return &resp, err } -func UnmarshalChatEventBackgroundCustomEmojiChanged(data json.RawMessage) (*ChatEventBackgroundCustomEmojiChanged, error) { - var resp ChatEventBackgroundCustomEmojiChanged +func UnmarshalChatEventProfileAccentColorChanged(data json.RawMessage) (*ChatEventProfileAccentColorChanged, error) { + var resp ChatEventProfileAccentColorChanged err := json.Unmarshal(data, &resp) @@ -13281,6 +13655,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 +13807,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 @@ -13745,6 +14135,14 @@ func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, err return &resp, err } +func UnmarshalBackgroundTypeChatTheme(data json.RawMessage) (*BackgroundTypeChatTheme, error) { + var resp BackgroundTypeChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputBackgroundLocal(data json.RawMessage) (*InputBackgroundLocal, error) { var resp InputBackgroundLocal @@ -15121,6 +15519,14 @@ func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) { + var resp InternalLinkTypePremiumGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLinkTypePremiumGiftCode, error) { var resp InternalLinkTypePremiumGiftCode @@ -15881,6 +16287,14 @@ func UnmarshalSuggestedActionSubscribeToAnnualPremium(data json.RawMessage) (*Su return &resp, err } +func UnmarshalSuggestedActionGiftPremiumForChristmas(data json.RawMessage) (*SuggestedActionGiftPremiumForChristmas, error) { + var resp SuggestedActionGiftPremiumForChristmas + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -16025,8 +16439,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 +16511,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 @@ -16289,16 +16727,8 @@ func UnmarshalUpdateChatPhoto(data json.RawMessage) (*UpdateChatPhoto, error) { return &resp, err } -func UnmarshalUpdateChatAccentColor(data json.RawMessage) (*UpdateChatAccentColor, error) { - var resp UpdateChatAccentColor - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatBackgroundCustomEmoji(data json.RawMessage) (*UpdateChatBackgroundCustomEmoji, error) { - var resp UpdateChatBackgroundCustomEmoji +func UnmarshalUpdateChatAccentColors(data json.RawMessage) (*UpdateChatAccentColors, error) { + var resp UpdateChatAccentColors err := json.Unmarshal(data, &resp) @@ -16369,6 +16799,14 @@ func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMess return &resp, err } +func UnmarshalUpdateChatEmojiStatus(data json.RawMessage) (*UpdateChatEmojiStatus, error) { + var resp UpdateChatEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageSender, error) { var resp UpdateChatMessageSender @@ -16481,6 +16919,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 @@ -16881,8 +17327,8 @@ func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedN return &resp, err } -func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { - var resp UpdateSelectedBackground +func UnmarshalUpdateDefaultBackground(data json.RawMessage) (*UpdateDefaultBackground, error) { + var resp UpdateDefaultBackground err := json.Unmarshal(data, &resp) @@ -16905,6 +17351,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 +17431,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 @@ -17129,6 +17591,22 @@ func UnmarshalUpdateChatBoost(data json.RawMessage) (*UpdateChatBoost, error) { return &resp, err } +func UnmarshalUpdateMessageReaction(data json.RawMessage) (*UpdateMessageReaction, error) { + var resp UpdateMessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateMessageReactions(data json.RawMessage) (*UpdateMessageReactions, error) { + var resp UpdateMessageReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { var resp Updates @@ -17622,6 +18100,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 +18328,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 +18403,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSponsorTypeBot: return UnmarshalMessageSponsorTypeBot(data) + case TypeMessageSponsorTypeWebApp: + return UnmarshalMessageSponsorTypeWebApp(data) + case TypeMessageSponsorTypePublicChannel: return UnmarshalMessageSponsorTypePublicChannel(data) @@ -18078,8 +18571,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeKeyboardButtonTypeRequestUser: - return UnmarshalKeyboardButtonTypeRequestUser(data) + case TypeKeyboardButtonTypeRequestUsers: + return UnmarshalKeyboardButtonTypeRequestUsers(data) case TypeKeyboardButtonTypeRequestChat: return UnmarshalKeyboardButtonTypeRequestChat(data) @@ -18813,11 +19306,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePremiumGiveaway: return UnmarshalMessagePremiumGiveaway(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) + + case TypeMessagePremiumGiveawayWinners: + return UnmarshalMessagePremiumGiveawayWinners(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) - case TypeMessageUserShared: - return UnmarshalMessageUserShared(data) + case TypeMessageUsersShared: + return UnmarshalMessageUsersShared(data) case TypeMessageChatShared: return UnmarshalMessageChatShared(data) @@ -19128,12 +19627,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeEmojiCategoryTypeChatPhoto: return UnmarshalEmojiCategoryTypeChatPhoto(data) - case TypeStoryViewer: - return UnmarshalStoryViewer(data) - - case TypeStoryViewers: - return UnmarshalStoryViewers(data) - case TypeStoryAreaPosition: return UnmarshalStoryAreaPosition(data) @@ -19146,6 +19639,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryAreaTypeSuggestedReaction: return UnmarshalStoryAreaTypeSuggestedReaction(data) + case TypeStoryAreaTypeMessage: + return UnmarshalStoryAreaTypeMessage(data) + case TypeStoryArea: return UnmarshalStoryArea(data) @@ -19161,6 +19657,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputStoryAreaTypeSuggestedReaction: return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + case TypeInputStoryAreaTypeMessage: + return UnmarshalInputStoryAreaTypeMessage(data) + case TypeInputStoryArea: return UnmarshalInputStoryArea(data) @@ -19191,6 +19690,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 +19708,45 @@ 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 TypeStoryInteractionTypeView: + return UnmarshalStoryInteractionTypeView(data) + + case TypeStoryInteractionTypeForward: + return UnmarshalStoryInteractionTypeForward(data) + + case TypeStoryInteractionTypeRepost: + return UnmarshalStoryInteractionTypeRepost(data) + + case TypeStoryInteraction: + return UnmarshalStoryInteraction(data) + + case TypeStoryInteractions: + return UnmarshalStoryInteractions(data) + + case TypePublicForwardMessage: + return UnmarshalPublicForwardMessage(data) + + case TypePublicForwardStory: + return UnmarshalPublicForwardStory(data) + + case TypePublicForwards: + return UnmarshalPublicForwards(data) + + case TypeChatBoostLevelFeatures: + return UnmarshalChatBoostLevelFeatures(data) + + case TypeChatBoostFeatures: + return UnmarshalChatBoostFeatures(data) + case TypeChatBoostSourceGiftCode: return UnmarshalChatBoostSourceGiftCode(data) @@ -19563,9 +20104,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventAvailableReactionsChanged: return UnmarshalChatEventAvailableReactionsChanged(data) + case TypeChatEventBackgroundChanged: + return UnmarshalChatEventBackgroundChanged(data) + case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) + case TypeChatEventEmojiStatusChanged: + return UnmarshalChatEventEmojiStatusChanged(data) + case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) @@ -19599,8 +20146,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventAccentColorChanged: return UnmarshalChatEventAccentColorChanged(data) - case TypeChatEventBackgroundCustomEmojiChanged: - return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + case TypeChatEventProfileAccentColorChanged: + return UnmarshalChatEventProfileAccentColorChanged(data) case TypeChatEventHasProtectedContentToggled: return UnmarshalChatEventHasProtectedContentToggled(data) @@ -19743,6 +20290,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 +20347,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureAccentColor: return UnmarshalPremiumFeatureAccentColor(data) + case TypePremiumFeatureBackgroundForBoth: + return UnmarshalPremiumFeatureBackgroundForBoth(data) + case TypePremiumStoryFeaturePriorityOrder: return UnmarshalPremiumStoryFeaturePriorityOrder(data) @@ -19917,6 +20470,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBackgroundTypeFill: return UnmarshalBackgroundTypeFill(data) + case TypeBackgroundTypeChatTheme: + return UnmarshalBackgroundTypeChatTheme(data) + case TypeInputBackgroundLocal: return UnmarshalInputBackgroundLocal(data) @@ -20433,6 +20989,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) @@ -20718,6 +21277,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionSubscribeToAnnualPremium: return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + case TypeSuggestedActionGiftPremiumForChristmas: + return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + case TypeCount: return UnmarshalCount(data) @@ -20772,8 +21334,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 +21361,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageStatistics: return UnmarshalMessageStatistics(data) + case TypeStoryStatistics: + return UnmarshalStoryStatistics(data) + case TypePoint: return UnmarshalPoint(data) @@ -20871,11 +21442,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) - case TypeUpdateChatAccentColor: - return UnmarshalUpdateChatAccentColor(data) - - case TypeUpdateChatBackgroundCustomEmoji: - return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(data) case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -20901,6 +21469,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(data) + case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) @@ -20943,6 +21514,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) + case TypeUpdateChatBlockList: return UnmarshalUpdateChatBlockList(data) @@ -21093,8 +21667,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedNotificationSounds: return UnmarshalUpdateSavedNotificationSounds(data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(data) + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) @@ -21102,6 +21676,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 +21706,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -21186,6 +21766,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatBoost: return UnmarshalUpdateChatBoost(data) + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(data) + case TypeUpdates: return UnmarshalUpdates(data) diff --git a/data/td_api.json b/data/td_api.json index 161a708..8130707 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -1710,7 +1710,7 @@ { "name": "document", "type": "document", - "description": "Document with the background; may be null. Null only for filled backgrounds" + "description": "Document with the background; may be null. Null only for filled and chat theme backgrounds" }, { "name": "type", @@ -1744,7 +1744,7 @@ { "name": "dark_theme_dimming", "type": "int32", - "description": "Dimming of the background in dark themes, as a percentage; 0-100" + "description": "Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background" } ] }, @@ -2133,7 +2133,7 @@ { "name": "can_send_basic_messages", "type": "Bool", - "description": "True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues" + "description": "True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues" }, { "name": "can_send_audios", @@ -2307,7 +2307,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active" + "description": "Number of months the Telegram Premium subscription will be active" }, { "name": "store_product_id", @@ -2371,7 +2371,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active" + "description": "Number of months the Telegram Premium subscription will be active" }, { "name": "store_product_id", @@ -2405,7 +2405,7 @@ { "name": "creator_id", "type": "MessageSender", - "description": "Identifier of a chat or a user that created the gift code" + "description": "Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used" }, { "name": "creation_date", @@ -2420,12 +2420,12 @@ { "name": "giveaway_message_id", "type": "int53", - "description": "Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message" + "description": "Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message" }, { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation" + "description": "Number of months the Telegram Premium subscription will be active after code activation" }, { "name": "user_id", @@ -2570,6 +2570,60 @@ "name": "dark_theme_colors", "type": "vector\u003cint32\u003e", "description": "The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes" + }, + { + "name": "min_chat_boost_level", + "type": "int32", + "description": "The minimum chat boost level required to use the color" + } + ] + }, + { + "name": "profileAccentColors", + "description": "Contains information about supported accent colors for user profile photo background in RGB format", + "class": "ProfileAccentColors", + "properties": [ + { + "name": "palette_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings" + }, + { + "name": "background_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background" + }, + { + "name": "story_colors", + "type": "vector\u003cint32\u003e", + "description": "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" + } + ] + }, + { + "name": "profileAccentColor", + "description": "Contains information about supported accent color for user profile photo background", + "class": "ProfileAccentColor", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Profile accent color identifier" + }, + { + "name": "light_theme_colors", + "type": "profileAccentColors", + "description": "Accent colors expected to be used in light themes" + }, + { + "name": "dark_theme_colors", + "type": "profileAccentColors", + "description": "Accent colors expected to be used in dark themes" + }, + { + "name": "min_chat_boost_level", + "type": "int32", + "description": "The minimum chat boost level required to use the color" } ] }, @@ -2592,7 +2646,7 @@ }, { "name": "emojiStatuses", - "description": "Contains a list of custom emoji identifiers, which can be set as emoji statuses", + "description": "Contains a list of custom emoji identifiers for emoji statuses", "class": "EmojiStatuses", "properties": [ { @@ -2667,12 +2721,22 @@ { "name": "accent_color_id", "type": "int32", - "description": "Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview" + "description": "Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only" }, { "name": "background_custom_emoji_id", "type": "int64", - "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only" + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only" }, { "name": "emoji_status", @@ -2883,6 +2947,11 @@ "type": "Bool", "description": "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used" }, + { + "name": "set_chat_background", + "type": "Bool", + "description": "True, if the user set chat background for both chat users and it wasn't reverted yet" + }, { "name": "bio", "type": "formattedText", @@ -3641,7 +3710,12 @@ { "name": "member_count", "type": "int32", - "description": "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" + "description": "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 publicForwards, or for public chats in which where sent messages from getMessagePublicForwards response" + }, + { + "name": "boost_level", + "type": "int32", + "description": "Approximate boost level for the chat" }, { "name": "has_linked_chat", @@ -3686,7 +3760,7 @@ { "name": "is_forum", "type": "Bool", - "description": "True, if the supergroup must be shown as a forum by default" + "description": "True, if the supergroup is a forum with topics" }, { "name": "is_verified", @@ -3956,7 +4030,7 @@ { "name": "sender", "type": "MessageSender", - "description": "Available message senders" + "description": "The message sender" }, { "name": "needs_premium", @@ -4197,7 +4271,7 @@ { "name": "used_sender_id", "type": "MessageSender", - "description": "Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen" + "description": "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" }, { "name": "recent_sender_ids", @@ -4304,6 +4378,45 @@ } ] }, + { + "name": "textQuote", + "description": "Describes manually or automatically chosen quote from another message", + "class": "TextQuote", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text" + }, + { + "name": "position", + "type": "int32", + "description": "Approximate quote position in the original message in UTF-16 code units as specified by the message sender" + }, + { + "name": "is_manual", + "type": "Bool", + "description": "True, if the quote was manually chosen by the message sender" + } + ] + }, + { + "name": "inputTextQuote", + "description": "Describes manually chosen quote from another message", + "class": "InputTextQuote", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "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" + }, + { + "name": "position", + "type": "int32", + "description": "Quote position in the original message in UTF-16 code units" + } + ] + }, { "name": "messageReplyToMessage", "description": "Describes a message replied by a given message", @@ -4321,28 +4434,23 @@ }, { "name": "quote", - "type": "formattedText", - "description": "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" - }, - { - "name": "is_quote_manual", - "type": "Bool", - "description": "True, if the quote was manually chosen by the message sender" + "type": "textQuote", + "description": "Chosen quote from the replied message; may be null if none" }, { "name": "origin", "type": "MessageOrigin", - "description": "Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat" + "description": "Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat" }, { "name": "origin_send_date", "type": "int32", - "description": "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" + "description": "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" }, { "name": "content", "type": "MessageContent", - "description": "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" + "description": "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, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote" } ] }, @@ -4371,7 +4479,7 @@ { "name": "chat_id", "type": "int53", - "description": "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" + "description": "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" }, { "name": "message_id", @@ -4380,8 +4488,8 @@ }, { "name": "quote", - "type": "formattedText", - "description": "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" + "type": "inputTextQuote", + "description": "Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats" } ] }, @@ -4455,7 +4563,7 @@ { "name": "can_be_replied_in_another_chat", "type": "Bool", - "description": "True, if the message can be replied in another chat" + "description": "True, if the message can be replied in another chat or topic" }, { "name": "can_be_saved", @@ -4644,7 +4752,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -4820,6 +4928,23 @@ } ] }, + { + "name": "messageSponsorTypeWebApp", + "description": "The sponsor is a web app", + "class": "MessageSponsorType", + "properties": [ + { + "name": "web_app_title", + "type": "string", + "description": "Web App title" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked" + } + ] + }, { "name": "messageSponsorTypePublicChannel", "description": "The sponsor is a public channel chat", @@ -4918,6 +5043,11 @@ "type": "messageSponsor", "description": "Information about the sponsor of the message" }, + { + "name": "button_text", + "type": "string", + "description": "If non-empty, text for the message action button" + }, { "name": "additional_info", "type": "string", @@ -5014,7 +5144,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -5044,7 +5174,7 @@ { "name": "use_default_mute_for", "type": "Bool", - "description": "If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of mute_for" }, { "name": "mute_for", @@ -5064,7 +5194,7 @@ { "name": "use_default_show_preview", "type": "Bool", - "description": "If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of show_preview" }, { "name": "show_preview", @@ -5074,7 +5204,7 @@ { "name": "use_default_mute_stories", "type": "Bool", - "description": "If true, mute_stories is ignored and the value for the relevant type of chat is used instead" + "description": "If true, the value for the relevant type of chat is used instead of mute_stories" }, { "name": "mute_stories", @@ -5094,7 +5224,7 @@ { "name": "use_default_show_story_sender", "type": "Bool", - "description": "If true, show_story_sender is ignored and the value for the relevant type of chat is used instead" + "description": "If true, the value for the relevant type of chat is used instead of show_story_sender" }, { "name": "show_story_sender", @@ -5104,7 +5234,7 @@ { "name": "use_default_disable_pinned_message_notifications", "type": "Bool", - "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications" }, { "name": "disable_pinned_message_notifications", @@ -5114,7 +5244,7 @@ { "name": "use_default_disable_mention_notifications", "type": "Bool", - "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications" }, { "name": "disable_mention_notifications", @@ -5146,12 +5276,12 @@ { "name": "use_default_mute_stories", "type": "Bool", - "description": "If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers" + "description": "If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories" }, { "name": "mute_stories", "type": "Bool", - "description": "True, if story notifications are disabled for the chat" + "description": "True, if story notifications are disabled" }, { "name": "story_sound_id", @@ -5251,7 +5381,7 @@ { "name": "user_id", "type": "int53", - "description": "User identifier of the secret chat peer" + "description": "User identifier of the other user in the secret chat" } ] }, @@ -5642,7 +5772,17 @@ { "name": "background_custom_emoji_id", "type": "int64", - "description": "Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none" + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the profile accent color for the chat's profile; -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none" }, { "name": "permissions", @@ -5684,6 +5824,11 @@ "type": "Bool", "description": "True, if the chat is marked as unread" }, + { + "name": "view_as_topics", + "type": "Bool", + "description": "True, if the chat is a forum supergroup that must be shown in the \"View as topics\" mode" + }, { "name": "has_scheduled_messages", "type": "Bool", @@ -5749,6 +5894,11 @@ "type": "int32", "description": "Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date" }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "Emoji status to be shown along with chat title; may be null" + }, { "name": "background", "type": "chatBackground", @@ -5891,7 +6041,7 @@ { "name": "distance", "type": "int32", - "description": "If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users" + "description": "If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users" } ] }, @@ -5965,8 +6115,8 @@ ] }, { - "name": "keyboardButtonTypeRequestUser", - "description": "A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request", + "name": "keyboardButtonTypeRequestUsers", + "description": "A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request", "class": "KeyboardButtonType", "properties": [ { @@ -5977,22 +6127,27 @@ { "name": "restrict_user_is_bot", "type": "Bool", - "description": "True, if the shared user must or must not be a bot" + "description": "True, if the shared users must or must not be bots" }, { "name": "user_is_bot", "type": "Bool", - "description": "True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false" + "description": "True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false" }, { "name": "restrict_user_is_premium", "type": "Bool", - "description": "True, if the shared user must or must not be a Telegram Premium user" + "description": "True, if the shared users must or must not be Telegram Premium users" }, { "name": "user_is_premium", "type": "Bool", - "description": "True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false" + "description": "True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false" + }, + { + "name": "max_quantity", + "type": "int32", + "description": "The maximum number of users to share" } ] }, @@ -7648,12 +7803,12 @@ { "name": "has_large_media", "type": "Bool", - "description": "True, if the preview has large media and its appearance can be changed" + "description": "True, if size of media in the preview can be changed" }, { "name": "show_large_media", "type": "Bool", - "description": "True, if large media preview must be shown" + "description": "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" }, { "name": "skip_confirmation", @@ -8153,6 +8308,11 @@ "name": "public_token", "type": "string", "description": "Public payment token" + }, + { + "name": "tokenize_url", + "type": "string", + "description": "URL for sending card tokenization requests" } ] }, @@ -8522,12 +8682,22 @@ { "name": "only_new_members", "type": "Bool", - "description": "True, if only new subscribers of the chats will be eligible for the giveaway" + "description": "True, if only new members of the chats will be eligible for the giveaway" + }, + { + "name": "has_public_winners", + "type": "Bool", + "description": "True, if the list of winners of the giveaway will be available to everyone" }, { "name": "country_codes", "type": "vector\u003cstring\u003e", "description": "The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption(\"giveaway_country_count_max\") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code \"FT\" must not be specified in the list" + }, + { + "name": "prize_description", + "type": "string", + "description": "Additional description of the giveaway prize; 0-128 characters" } ] }, @@ -9536,7 +9706,7 @@ { "name": "link_preview_options", "type": "linkPreviewOptions", - "description": "Options which was used for generation of the link preview; may be null if default options were used" + "description": "Options which were used for generation of the link preview; may be null if default options were used" } ] }, @@ -10172,6 +10342,11 @@ "name": "background", "type": "chatBackground", "description": "The new background" + }, + { + "name": "only_for_self", + "type": "Bool", + "description": "True, if the background was set only for self" } ] }, @@ -10435,12 +10610,12 @@ { "name": "cryptocurrency_amount", "type": "int64", - "description": "The paid amount, in the smallest units of the cryptocurrency" + "description": "The paid amount, in the smallest units of the cryptocurrency; 0 if none" }, { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active" + "description": "Number of months the Telegram Premium subscription will be active" }, { "name": "sticker", @@ -10457,7 +10632,7 @@ { "name": "creator_id", "type": "MessageSender", - "description": "Identifier of a chat or a user that created the gift code" + "description": "Identifier of a chat or a user that created the gift code; may be null if unknown" }, { "name": "is_from_giveaway", @@ -10469,10 +10644,30 @@ "type": "Bool", "description": "True, if the winner for the corresponding Telegram Premium subscription wasn't chosen" }, + { + "name": "currency", + "type": "string", + "description": "Currency for the paid amount; empty if unknown" + }, + { + "name": "amount", + "type": "int53", + "description": "The paid amount, in the smallest units of the currency; 0 if unknown" + }, + { + "name": "cryptocurrency", + "type": "string", + "description": "Cryptocurrency used to pay for the gift; may be empty if none or unknown" + }, + { + "name": "cryptocurrency_amount", + "type": "int64", + "description": "The paid amount, in the smallest units of the cryptocurrency; 0 if unknown" + }, { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation" + "description": "Number of months the Telegram Premium subscription will be active after code activation" }, { "name": "sticker", @@ -10510,7 +10705,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation" + "description": "Number of months the Telegram Premium subscription will be active after code activation" }, { "name": "sticker", @@ -10519,6 +10714,90 @@ } ] }, + { + "name": "messagePremiumGiveawayCompleted", + "description": "A Telegram Premium giveaway without public winners has been completed for the chat", + "class": "MessageContent", + "properties": [ + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the message with the giveaway; can be 0 if the message was deleted" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of winners in the giveaway" + }, + { + "name": "unclaimed_prize_count", + "type": "int32", + "description": "Number of undistributed prizes" + } + ] + }, + { + "name": "messagePremiumGiveawayWinners", + "description": "A Telegram Premium giveaway with public winners has been completed for the chat", + "class": "MessageContent", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the message with the giveaway in the boosted chat" + }, + { + "name": "additional_chat_count", + "type": "int32", + "description": "Number of other chats that participated in the giveaway" + }, + { + "name": "actual_winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway" + }, + { + "name": "only_new_members", + "type": "Bool", + "description": "True, if only new members of the chats were eligible for the giveaway" + }, + { + "name": "was_refunded", + "type": "Bool", + "description": "True, if the giveaway was canceled and was fully refunded" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "prize_description", + "type": "string", + "description": "Additional description of the giveaway prize" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Total number of winners in the giveaway" + }, + { + "name": "winner_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Up to 100 user identifiers of the winners of the giveaway" + }, + { + "name": "unclaimed_prize_count", + "type": "int32", + "description": "Number of undistributed prizes" + } + ] + }, { "name": "messageContactRegistered", "description": "A contact has registered with Telegram", @@ -10526,14 +10805,14 @@ "properties": [] }, { - "name": "messageUserShared", - "description": "The current user shared a user, which was requested by the bot", + "name": "messageUsersShared", + "description": "The current user shared users, which were requested by the bot", "class": "MessageContent", "properties": [ { - "name": "user_id", - "type": "int53", - "description": "Identifier of the shared user" + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifier of the shared users" }, { "name": "button_id", @@ -10849,7 +11128,7 @@ }, { "name": "messageSchedulingStateSendWhenOnline", - "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", "class": "MessageSchedulingState", "properties": [] }, @@ -10915,7 +11194,7 @@ }, { "name": "messageCopyOptions", - "description": "Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied", + "description": "Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied", "class": "MessageCopyOptions", "properties": [ { @@ -11059,7 +11338,7 @@ { "name": "disable_content_type_detection", "type": "Bool", - "description": "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" + "description": "Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats" }, { "name": "caption", @@ -11856,6 +12135,11 @@ "type": "Bool", "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" }, + { + "name": "is_allowed_as_chat_emoji_status", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only" + }, { "name": "is_viewed", "type": "Bool", @@ -11896,7 +12180,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" }, { "name": "thumbnail_outline", @@ -11933,6 +12217,11 @@ "type": "Bool", "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" }, + { + "name": "is_allowed_as_chat_emoji_status", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only" + }, { "name": "is_viewed", "type": "Bool", @@ -12041,60 +12330,6 @@ "class": "EmojiCategoryType", "properties": [] }, - { - "name": "storyViewer", - "description": "Represents a viewer of a story", - "class": "StoryViewer", - "properties": [ - { - "name": "user_id", - "type": "int53", - "description": "User identifier of the viewer" - }, - { - "name": "view_date", - "type": "int32", - "description": "Approximate point in time (Unix timestamp) when the story was viewed" - }, - { - "name": "block_list", - "type": "BlockList", - "description": "Block list to which the user is added; may be null if none" - }, - { - "name": "chosen_reaction_type", - "type": "ReactionType", - "description": "Type of the reaction that was chosen by the user; may be null if none" - } - ] - }, - { - "name": "storyViewers", - "description": "Represents a list of story viewers", - "class": "StoryViewers", - "properties": [ - { - "name": "total_count", - "type": "int32", - "description": "Approximate total number of story viewers found" - }, - { - "name": "total_reaction_count", - "type": "int32", - "description": "Approximate total number of reactions set by found story viewers" - }, - { - "name": "viewers", - "type": "vector\u003cstoryViewer\u003e", - "description": "List of story viewers" - }, - { - "name": "next_offset", - "type": "string", - "description": "The offset for the next request. If empty, there are no more results" - } - ] - }, { "name": "storyAreaPosition", "description": "Describes position of a clickable rectangle area on a story media", @@ -12178,6 +12413,23 @@ } ] }, + { + "name": "storyAreaTypeMessage", + "description": "An area pointing to a message", + "class": "StoryAreaType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ] + }, { "name": "storyArea", "description": "Describes a clickable rectangle area on a story media", @@ -12263,6 +12515,23 @@ } ] }, + { + "name": "inputStoryAreaTypeMessage", + "description": "An area pointing to a message", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message. Only successfully sent non-scheduled messages can be specified" + } + ] + }, { "name": "inputStoryArea", "description": "Describes a clickable rectangle area on a story media to be added", @@ -12288,7 +12557,7 @@ { "name": "areas", "type": "vector\u003cinputStoryArea\u003e", - "description": "List of 0-10 input story areas" + "description": "List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption(\"story_suggested_reaction_area_count_max\") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area" } ] }, @@ -12435,6 +12704,52 @@ "class": "StoryList", "properties": [] }, + { + "name": "storyOriginPublicStory", + "description": "The original story was a public story with known sender", + "class": "StoryOrigin", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted original story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier of the original story" + } + ] + }, + { + "name": "storyOriginHiddenUser", + "description": "The original story was sent by an unknown user", + "class": "StoryOrigin", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the story sender" + } + ] + }, + { + "name": "storyRepostInfo", + "description": "Contains information about original story that was reposted", + "class": "StoryRepostInfo", + "properties": [ + { + "name": "origin", + "type": "StoryOrigin", + "description": "Origin of the story that was reposted" + }, + { + "name": "is_content_modified", + "type": "Bool", + "description": "True, if story content was modified during reposting; otherwise, story wasn't modified" + } + ] + }, { "name": "storyInteractionInfo", "description": "Contains information about interactions with a story", @@ -12533,15 +12848,25 @@ "description": "True, if the story's is_pinned value can be changed" }, { - "name": "can_get_viewers", + "name": "can_get_statistics", "type": "Bool", - "description": "True, if users viewed the story can be received through getStoryViewers" + "description": "True, if the story statistics are available through getStoryStatistics" + }, + { + "name": "can_get_interactions", + "type": "Bool", + "description": "True, if interactions with the story can be received through getStoryInteractions" }, { "name": "has_expired_viewers", "type": "Bool", "description": "True, if users viewed the story can't be received, because the story has expired more than getOption(\"story_viewers_expiration_delay\") seconds ago" }, + { + "name": "repost_info", + "type": "storyRepostInfo", + "description": "Information about the original story; may be null if the story wasn't reposted" + }, { "name": "interaction_info", "type": "storyInteractionInfo", @@ -12591,6 +12916,23 @@ } ] }, + { + "name": "storyFullId", + "description": "Contains identifier of a story along with identifier of its sender", + "class": "StoryFullId", + "properties": [ + { + "name": "sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + } + ] + }, { "name": "storyInfo", "description": "Contains basic information about a story", @@ -12645,6 +12987,221 @@ } ] }, + { + "name": "storyInteractionTypeView", + "description": "A view of the story", + "class": "StoryInteractionType", + "properties": [ + { + "name": "chosen_reaction_type", + "type": "ReactionType", + "description": "Type of the reaction that was chosen by the viewer; may be null if none" + } + ] + }, + { + "name": "storyInteractionTypeForward", + "description": "A forward of the story as a message", + "class": "StoryInteractionType", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with story forward" + } + ] + }, + { + "name": "storyInteractionTypeRepost", + "description": "A repost of the story as a story", + "class": "StoryInteractionType", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The reposted story" + } + ] + }, + { + "name": "storyInteraction", + "description": "Represents interaction with a story", + "class": "StoryInteraction", + "properties": [ + { + "name": "actor_id", + "type": "MessageSender", + "description": "Identifier of the user or chat that made the interaction" + }, + { + "name": "interaction_date", + "type": "int32", + "description": "Approximate point in time (Unix timestamp) when the interaction happened" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the actor is added; may be null if none or for chat stories" + }, + { + "name": "type", + "type": "StoryInteractionType", + "description": "Type of the interaction" + } + ] + }, + { + "name": "storyInteractions", + "description": "Represents a list of interactions with a story", + "class": "StoryInteractions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of interactions found" + }, + { + "name": "total_forward_count", + "type": "int32", + "description": "Approximate total number of found forwards and reposts; always 0 for chat stories" + }, + { + "name": "total_reaction_count", + "type": "int32", + "description": "Approximate total number of found reactions; always 0 for chat stories" + }, + { + "name": "interactions", + "type": "vector\u003cstoryInteraction\u003e", + "description": "List of story interactions" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, then there are no more results" + } + ] + }, + { + "name": "publicForwardMessage", + "description": "Contains a public forward as a message", + "class": "PublicForward", + "properties": [ + { + "name": "message", + "type": "message", + "description": "Information about the message" + } + ] + }, + { + "name": "publicForwardStory", + "description": "Contains a public repost to a story", + "class": "PublicForward", + "properties": [ + { + "name": "story", + "type": "story", + "description": "Information about the story" + } + ] + }, + { + "name": "publicForwards", + "description": "Represents a list of public forwards and reposts as a story of a message or a story", + "class": "PublicForwards", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of messages and stories found" + }, + { + "name": "forwards", + "type": "vector\u003cPublicForward\u003e", + "description": "List of found public forwards and reposts" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, then there are no more results" + } + ] + }, + { + "name": "chatBoostLevelFeatures", + "description": "Contains a list of features available on a specific chat boost level", + "class": "ChatBoostLevelFeatures", + "properties": [ + { + "name": "level", + "type": "int32", + "description": "Target chat boost level" + }, + { + "name": "story_per_day_count", + "type": "int32", + "description": "Number of stories that the chat can publish daily" + }, + { + "name": "custom_emoji_reaction_count", + "type": "int32", + "description": "Number of custom emoji reactions that can be added to the list of available reactions" + }, + { + "name": "title_color_count", + "type": "int32", + "description": "Number of custom colors for chat title" + }, + { + "name": "profile_accent_color_count", + "type": "int32", + "description": "Number of custom colors for profile photo background" + }, + { + "name": "can_set_profile_background_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji for profile background can be set" + }, + { + "name": "accent_color_count", + "type": "int32", + "description": "Number of custom colors for background of empty chat photo, replies to messages and link previews" + }, + { + "name": "can_set_background_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji for reply header and link preview background can be set" + }, + { + "name": "can_set_emoji_status", + "type": "Bool", + "description": "True, if emoji status can be set" + }, + { + "name": "chat_theme_background_count", + "type": "int32", + "description": "Number of chat theme backgrounds that can be set as chat background" + }, + { + "name": "can_set_custom_background", + "type": "Bool", + "description": "True, if custom background can be set in the chat for all users" + } + ] + }, + { + "name": "chatBoostFeatures", + "description": "Contains a list of features available on the first chat boost levels", + "class": "ChatBoostFeatures", + "properties": [ + { + "name": "features", + "type": "vector\u003cchatBoostLevelFeatures\u003e", + "description": "The list of features" + } + ] + }, { "name": "chatBoostSourceGiftCode", "description": "The chat created a Telegram Premium gift code for a user", @@ -12719,7 +13276,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation" + "description": "Number of months the Telegram Premium subscription will be active after code activation" }, { "name": "payment_date", @@ -12835,7 +13392,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -13076,7 +13633,7 @@ { "name": "protocol", "type": "callProtocol", - "description": "Call protocols supported by the peer" + "description": "Call protocols supported by the other call participant" }, { "name": "servers", @@ -13259,7 +13816,7 @@ { "name": "enabled_start_notification", "type": "Bool", - "description": "True, if the group call is scheduled and the current user will receive a notification when the group call will start" + "description": "True, if the group call is scheduled and the current user will receive a notification when the group call starts" }, { "name": "is_active", @@ -13551,7 +14108,7 @@ { "name": "user_id", "type": "int53", - "description": "Peer user identifier" + "description": "User identifier of the other call participant" }, { "name": "is_outgoing", @@ -13675,7 +14232,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -13719,7 +14276,7 @@ { "name": "allow_custom_emoji", "type": "Bool", - "description": "True, if custom emoji reactions could be added by Telegram Premium subscribers" + "description": "True, if any custom emoji reaction can be added by Telegram Premium subscribers" } ] }, @@ -13885,7 +14442,7 @@ { "name": "error", "type": "error", - "description": "Recognition error" + "description": "Recognition error. An error with a message \"MSG_VOICE_TOO_LONG\" is returned when media duration is too big to be recognized" } ] }, @@ -15022,7 +15579,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -15329,6 +15886,23 @@ } ] }, + { + "name": "chatEventBackgroundChanged", + "description": "The chat background was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_background", + "type": "chatBackground", + "description": "Previous background; may be null if none" + }, + { + "name": "new_background", + "type": "chatBackground", + "description": "New background; may be null if none" + } + ] + }, { "name": "chatEventDescriptionChanged", "description": "The chat description was changed", @@ -15346,6 +15920,23 @@ } ] }, + { + "name": "chatEventEmojiStatusChanged", + "description": "The chat emoji status was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_emoji_status", + "type": "emojiStatus", + "description": "Previous emoji status; may be null if none" + }, + { + "name": "new_emoji_status", + "type": "emojiStatus", + "description": "New emoji status; may be null if none" + } + ] + }, { "name": "chatEventLinkedChatChanged", "description": "The linked chat of a supergroup was changed", @@ -15399,7 +15990,7 @@ }, { "name": "chatEventPermissionsChanged", - "description": "The chat permissions was changed", + "description": "The chat permissions were changed", "class": "ChatEventAction", "properties": [ { @@ -15518,7 +16109,7 @@ }, { "name": "chatEventAccentColorChanged", - "description": "The chat accent color was changed", + "description": "The chat accent color or background custom emoji were changed", "class": "ChatEventAction", "properties": [ { @@ -15526,23 +16117,16 @@ "type": "int32", "description": "Previous identifier of chat accent color" }, - { - "name": "new_accent_color_id", - "type": "int32", - "description": "New identifier of chat accent color" - } - ] - }, - { - "name": "chatEventBackgroundCustomEmojiChanged", - "description": "The chat's custom emoji for reply background was changed", - "class": "ChatEventAction", - "properties": [ { "name": "old_background_custom_emoji_id", "type": "int64", "description": "Previous identifier of the custom emoji; 0 if none" }, + { + "name": "new_accent_color_id", + "type": "int32", + "description": "New identifier of chat accent color" + }, { "name": "new_background_custom_emoji_id", "type": "int64", @@ -15550,6 +16134,33 @@ } ] }, + { + "name": "chatEventProfileAccentColorChanged", + "description": "The chat's profile accent color or profile background custom emoji were changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_profile_accent_color_id", + "type": "int32", + "description": "Previous identifier of chat's profile accent color; -1 if none" + }, + { + "name": "old_profile_background_custom_emoji_id", + "type": "int64", + "description": "Previous identifier of the custom emoji; 0 if none" + }, + { + "name": "new_profile_accent_color_id", + "type": "int32", + "description": "New identifier of chat's profile accent color; -1 if none" + }, + { + "name": "new_profile_background_custom_emoji_id", + "type": "int64", + "description": "New identifier of the custom emoji; 0 if none" + } + ] + }, { "name": "chatEventHasProtectedContentToggled", "description": "The has_protected_content setting of a channel was toggled", @@ -16196,6 +16807,12 @@ "class": "PremiumLimitType", "properties": [] }, + { + "name": "premiumLimitTypeSimilarChatCount", + "description": "The maximum number of received similar chats", + "class": "PremiumLimitType", + "properties": [] + }, { "name": "premiumFeatureIncreasedLimits", "description": "Increased limits", @@ -16300,7 +16917,13 @@ }, { "name": "premiumFeatureAccentColor", - "description": "The ability to choose accent color", + "description": "The ability to choose accent color for replies and user profile", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureBackgroundForBoth", + "description": "The ability to set private chat background for both users", "class": "PremiumFeature", "properties": [] }, @@ -16593,7 +17216,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active for the users" + "description": "Number of months the Telegram Premium subscription will be active for the users" } ] }, @@ -16625,7 +17248,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active for the users" + "description": "Number of months the Telegram Premium subscription will be active for the users" } ] }, @@ -16922,6 +17545,18 @@ } ] }, + { + "name": "backgroundTypeChatTheme", + "description": "A background from a chat theme; can be used only as a chat background in channels", + "class": "BackgroundType", + "properties": [ + { + "name": "theme_name", + "type": "string", + "description": "Name of the chat theme" + } + ] + }, { "name": "inputBackgroundLocal", "description": "A background from a local file", @@ -17194,7 +17829,7 @@ }, { "name": "messageFileTypePrivate", - "description": "The messages was exported from a private chat", + "description": "The messages were exported from a private chat", "class": "MessageFileType", "properties": [ { @@ -17206,7 +17841,7 @@ }, { "name": "messageFileTypeGroup", - "description": "The messages was exported from a group chat", + "description": "The messages were exported from a group chat", "class": "MessageFileType", "properties": [ { @@ -17218,7 +17853,7 @@ }, { "name": "messageFileTypeUnknown", - "description": "The messages was exported from a chat of unknown type", + "description": "The messages were exported from a chat of unknown type", "class": "MessageFileType", "properties": [] }, @@ -17443,7 +18078,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation" + "description": "Number of months the Telegram Premium subscription will be active after code activation" } ] }, @@ -17460,7 +18095,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message" + "description": "Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message" }, { "name": "is_pinned", @@ -18701,7 +19336,7 @@ }, { "name": "internalLinkTypeActiveSessions", - "description": "The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link", + "description": "The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user", "class": "InternalLinkType", "properties": [] }, @@ -18741,7 +19376,7 @@ }, { "name": "internalLinkTypeBackground", - "description": "The link is a link to a background. Call searchBackground with the given background name to process the link", + "description": "The link is a link to a background. Call searchBackground with the given background name to process the link If background is found and the user wants to apply it, then call setDefaultBackground", "class": "InternalLinkType", "properties": [ { @@ -18832,7 +19467,7 @@ }, { "name": "internalLinkTypeChatFolderInvite", - "description": "The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link", + "description": "The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink", "class": "InternalLinkType", "properties": [ { @@ -18850,7 +19485,7 @@ }, { "name": "internalLinkTypeChatInvite", - "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link", + "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink", "class": "InternalLinkType", "properties": [ { @@ -18891,7 +19526,7 @@ }, { "name": "internalLinkTypeInstantView", - "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link", + "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser", "class": "InternalLinkType", "properties": [ { @@ -18920,7 +19555,7 @@ }, { "name": "internalLinkTypeLanguagePack", - "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link", + "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option \"language_pack_id\"", "class": "InternalLinkType", "properties": [ { @@ -18938,7 +19573,7 @@ }, { "name": "internalLinkTypeMessage", - "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link", + "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there", "class": "InternalLinkType", "properties": [ { @@ -18999,7 +19634,7 @@ }, { "name": "internalLinkTypePhoneNumberConfirmation", - "description": "The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link", + "description": "The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it", "class": "InternalLinkType", "properties": [ { @@ -19026,6 +19661,18 @@ } ] }, + { + "name": "internalLinkTypePremiumGift", + "description": "The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases", + "class": "InternalLinkType", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "Referrer specified in the link" + } + ] + }, { "name": "internalLinkTypePremiumGiftCode", "description": "The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode", @@ -19068,7 +19715,7 @@ }, { "name": "internalLinkTypePublicChat", - "description": "The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link", + "description": "The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself", "class": "InternalLinkType", "properties": [ { @@ -19098,7 +19745,7 @@ }, { "name": "internalLinkTypeSideMenuBot", - "description": "The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL", + "description": "The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App", "class": "InternalLinkType", "properties": [ { @@ -19115,7 +19762,7 @@ }, { "name": "internalLinkTypeStickerSet", - "description": "The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set", + "description": "The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet", "class": "InternalLinkType", "properties": [ { @@ -19132,7 +19779,7 @@ }, { "name": "internalLinkTypeStory", - "description": "The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier", + "description": "The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received", "class": "InternalLinkType", "properties": [ { @@ -19185,7 +19832,7 @@ }, { "name": "internalLinkTypeUserPhoneNumber", - "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", + "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat", "class": "InternalLinkType", "properties": [ { @@ -19197,7 +19844,7 @@ }, { "name": "internalLinkTypeUserToken", - "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link", + "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat", "class": "InternalLinkType", "properties": [ { @@ -19865,25 +20512,25 @@ }, { "name": "connectionStateWaitingForNetwork", - "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", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateConnectingToProxy", - "description": "Currently establishing a connection with a proxy server", + "description": "Establishing a connection with a proxy server", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateConnecting", - "description": "Currently establishing a connection to the Telegram servers", + "description": "Establishing a connection to the Telegram servers", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateUpdating", - "description": "Downloading data received while the application was offline", + "description": "Downloading data supposed to be received while the application was offline", "class": "ConnectionState", "properties": [] }, @@ -20107,6 +20754,12 @@ "class": "SuggestedAction", "properties": [] }, + { + "name": "suggestedActionGiftPremiumForChristmas", + "description": "Suggests the user to gift Telegram Premium to friends for Christmas", + "class": "SuggestedAction", + "properties": [] + }, { "name": "count", "description": "Contains a counter", @@ -20398,24 +21051,53 @@ ] }, { - "name": "chatStatisticsMessageInteractionInfo", - "description": "Contains statistics about interactions with a message", - "class": "ChatStatisticsMessageInteractionInfo", + "name": "chatStatisticsObjectTypeMessage", + "description": "Describes a message sent in the chat", + "class": "ChatStatisticsObjectType", "properties": [ { "name": "message_id", "type": "int53", "description": "Message identifier" + } + ] + }, + { + "name": "chatStatisticsObjectTypeStory", + "description": "Describes a story sent by the chat", + "class": "ChatStatisticsObjectType", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, + { + "name": "chatStatisticsInteractionInfo", + "description": "Contains statistics about interactions with a message sent in the chat or a story sent by the chat", + "class": "ChatStatisticsInteractionInfo", + "properties": [ + { + "name": "object_type", + "type": "ChatStatisticsObjectType", + "description": "Type of the object" }, { "name": "view_count", "type": "int32", - "description": "Number of times the message was viewed" + "description": "Number of times the object was viewed" }, { "name": "forward_count", "type": "int32", - "description": "Number of times the message was forwarded" + "description": "Number of times the object was forwarded" + }, + { + "name": "reaction_count", + "type": "int32", + "description": "Number of times reactions were added to the object" } ] }, @@ -20588,14 +21270,34 @@ "description": "Number of members in the chat" }, { - "name": "mean_view_count", + "name": "mean_message_view_count", "type": "statisticalValue", - "description": "Mean number of times the recently sent messages was viewed" + "description": "Mean number of times the recently sent messages were viewed" }, { - "name": "mean_share_count", + "name": "mean_message_share_count", "type": "statisticalValue", - "description": "Mean number of times the recently sent messages was shared" + "description": "Mean number of times the recently sent messages were shared" + }, + { + "name": "mean_message_reaction_count", + "type": "statisticalValue", + "description": "Mean number of times reactions were added to the recently sent messages" + }, + { + "name": "mean_story_view_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent stories were viewed" + }, + { + "name": "mean_story_share_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent stories were shared" + }, + { + "name": "mean_story_reaction_count", + "type": "statisticalValue", + "description": "Mean number of times reactions were added to the recently sent stories" }, { "name": "enabled_notifications_percentage", @@ -20642,15 +21344,30 @@ "type": "StatisticalGraph", "description": "A graph containing number of chat message views and shares" }, + { + "name": "message_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of reactions on messages" + }, + { + "name": "story_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story views and shares" + }, + { + "name": "story_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of reactions on stories" + }, { "name": "instant_view_interaction_graph", "type": "StatisticalGraph", "description": "A graph containing number of views of associated with the chat instant views" }, { - "name": "recent_message_interactions", - "type": "vector\u003cchatStatisticsMessageInteractionInfo\u003e", - "description": "Detailed statistics about number of views and shares of recently sent messages" + "name": "recent_interactions", + "type": "vector\u003cchatStatisticsInteractionInfo\u003e", + "description": "Detailed statistics about number of views and shares of recently sent messages and stories" } ] }, @@ -20663,6 +21380,28 @@ "name": "message_interaction_graph", "type": "StatisticalGraph", "description": "A graph containing number of message views and shares" + }, + { + "name": "message_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of message reactions" + } + ] + }, + { + "name": "storyStatistics", + "description": "A detailed statistics about a story", + "class": "StoryStatistics", + "properties": [ + { + "name": "story_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story views and shares" + }, + { + "name": "story_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story reactions" } ] }, @@ -20808,7 +21547,7 @@ }, { "name": "updateMessageSendAcknowledged", - "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", "class": "Update", "properties": [ { @@ -21085,8 +21824,8 @@ ] }, { - "name": "updateChatAccentColor", - "description": "A chat accent color has changed", + "name": "updateChatAccentColors", + "description": "Chat accent colors have changed", "class": "Update", "properties": [ { @@ -21098,29 +21837,27 @@ "name": "accent_color_id", "type": "int32", "description": "The new chat accent color identifier" - } - ] - }, - { - "name": "updateChatBackgroundCustomEmoji", - "description": "A chat's custom emoji for reply background has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" }, { "name": "background_custom_emoji_id", "type": "int64", - "description": "The new tdentifier of a custom emoji to be shown on the reply header background" + "description": "The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "The new chat profile accent color identifier; -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "The new identifier of a custom emoji to be shown on the profile background; 0 if none" } ] }, { "name": "updateChatPermissions", - "description": "Chat permissions was changed", + "description": "Chat permissions were changed", "class": "Update", "properties": [ { @@ -21269,6 +22006,23 @@ } ] }, + { + "name": "updateChatEmojiStatus", + "description": "Chat emoji status has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "The new chat emoji status; may be null" + } + ] + }, { "name": "updateChatMessageSender", "description": "The message sender that is selected to send messages in a chat has changed", @@ -21507,6 +22261,23 @@ } ] }, + { + "name": "updateChatViewAsTopics", + "description": "A chat default appearance has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "view_as_topics", + "type": "Bool", + "description": "New value of view_as_topics" + } + ] + }, { "name": "updateChatBlockList", "description": "A chat was blocked or unblocked", @@ -21560,7 +22331,7 @@ }, { "name": "updateChatOnlineMemberCount", - "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", + "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 is sent just after the number of online users has changed", "class": "Update", "properties": [ { @@ -21675,7 +22446,7 @@ }, { "name": "updateActiveNotifications", - "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", + "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", "class": "Update", "properties": [ { @@ -22377,7 +23148,7 @@ }, { "name": "updateSavedNotificationSounds", - "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", + "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", "class": "Update", "properties": [ { @@ -22388,19 +23159,19 @@ ] }, { - "name": "updateSelectedBackground", - "description": "The selected background has changed", + "name": "updateDefaultBackground", + "description": "The default background has changed", "class": "Update", "properties": [ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if background for dark theme has changed" + "description": "True, if default background for dark theme has changed" }, { "name": "background", "type": "background", - "description": "The new selected background; may be null" + "description": "The new default background; may be null" } ] }, @@ -22433,6 +23204,23 @@ } ] }, + { + "name": "updateProfileAccentColors", + "description": "The list of supported accent colors for user profiles has changed", + "class": "Update", + "properties": [ + { + "name": "colors", + "type": "vector\u003cprofileAccentColor\u003e", + "description": "Information about supported colors" + }, + { + "name": "available_accent_color_ids", + "type": "vector\u003cint32\u003e", + "description": "The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order" + } + ] + }, { "name": "updateLanguagePackStrings", "description": "Some language pack strings have been updated", @@ -22556,6 +23344,33 @@ } ] }, + { + "name": "updateSpeechRecognitionTrial", + "description": "The parameters of speech recognition without Telegram Premium subscription has changed", + "class": "Update", + "properties": [ + { + "name": "max_media_duration", + "type": "int32", + "description": "The maximum allowed duration of media for speech recognition without Telegram Premium subscription" + }, + { + "name": "weekly_count", + "type": "int32", + "description": "The total number of allowed speech recognitions per week; 0 if none" + }, + { + "name": "left_count", + "type": "int32", + "description": "Number of left speech recognition attempts this week" + }, + { + "name": "next_reset_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown" + } + ] + }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -22951,7 +23766,7 @@ { "name": "date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user rights was changed" + "description": "Point in time (Unix timestamp) when the user rights were changed" }, { "name": "invite_link", @@ -23019,6 +23834,70 @@ } ] }, + { + "name": "updateMessageReaction", + "description": "User changed its reactions on a message with public reactions; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "actor_id", + "type": "MessageSender", + "description": "Identifier of the user or chat that changed reactions" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reactions were changed" + }, + { + "name": "old_reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "Old list of chosen reactions" + }, + { + "name": "new_reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "New list of chosen reactions" + } + ] + }, + { + "name": "updateMessageReactions", + "description": "Reactions added to a message with anonymous reactions have changed; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reactions were changed" + }, + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "The list of reactions added to the message" + } + ] + }, { "name": "updates", "description": "Contains a list of updates", @@ -23465,6 +24344,18 @@ "name": "StoryList", "description": "Describes a list of stories" }, + { + "name": "StoryOrigin", + "description": "Contains information about the origin of a story that was reposted" + }, + { + "name": "StoryInteractionType", + "description": "Describes type of interaction with a story" + }, + { + "name": "PublicForward", + "description": "Describes a public forward or repost of a story" + }, { "name": "ChatBoostSource", "description": "Describes source of a chat boost" @@ -23689,6 +24580,10 @@ "name": "StatisticalGraph", "description": "Describes a statistical graph" }, + { + "name": "ChatStatisticsObjectType", + "description": "Describes type of an object, for which statistics are provided" + }, { "name": "ChatStatistics", "description": "Contains a detailed statistics about a chat" @@ -24448,7 +25343,7 @@ }, { "name": "getRepliedMessage", - "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, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic messages without non-bundled replied message respectively", "class": "Message", "properties": [ { @@ -24711,6 +25606,58 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getChatSimilarChats", + "description": "Returns a list of chats similar to the given chat", + "class": "Chats", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the target chat; must be an identifier of a channel chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatSimilarChatCount", + "description": "Returns approximate number of chats similar to the given chat", + "class": "Count", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the target chat; must be an identifier of a channel chat" + }, + { + "name": "return_local", + "type": "Bool", + "description": "Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openChatSimilarChat", + "description": "Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the original chat, which similar chats were requested" + }, + { + "name": "opened_chat_id", + "type": "int53", + "description": "Identifier of the opened chat" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getTopChats", "description": "Returns a list of frequently used chats", @@ -25549,7 +26496,7 @@ }, { "name": "recognizeSpeech", - "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", "class": "Ok", "properties": [ { @@ -25825,7 +26772,7 @@ }, { "name": "quote", - "type": "formattedText", + "type": "inputTextQuote", "description": "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" } ], @@ -26621,6 +27568,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setMessageReactions", + "description": "Sets reactions on a message; for bots only", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "Types of the reaction to set" + }, + { + "name": "is_big", + "type": "Bool", + "description": "Pass true if the reactions are added with a big animation" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getMessageAddedReactions", "description": "Returns reactions added for a message, along with their sender", @@ -27017,8 +27993,8 @@ "type": 2 }, { - "name": "shareUserWithBot", - "description": "Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot", + "name": "shareUsersWithBot", + "description": "Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot", "class": "Ok", "properties": [ { @@ -27037,14 +28013,14 @@ "description": "Identifier of the button" }, { - "name": "shared_user_id", - "type": "int53", - "description": "Identifier of the shared user" + "name": "shared_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the shared users" }, { "name": "only_check", "type": "Bool", - "description": "Pass true to check that the user can be shared by the button instead of actually sharing them" + "description": "Pass true to check that the users can be shared by the button instead of actually sharing them" } ], "is_synchronous": false, @@ -27988,7 +28964,7 @@ } ], "is_synchronous": false, - "type": 1 + "type": 2 }, { "name": "upgradeBasicGroupChatToSupergroupChat", @@ -28400,7 +29376,7 @@ }, { "name": "setChatAccentColor", - "description": "Changes accent color and background custom emoji of a chat. Supported only for channels with getOption(\"channel_custom_accent_color_boost_level_min\") boost level. Requires can_change_info administrator right", + "description": "Changes accent color and background custom emoji of a chat. Requires can_change_info administrator right", "class": "Ok", "properties": [ { @@ -28411,12 +29387,36 @@ { "name": "accent_color_id", "type": "int32", - "description": "Identifier of the accent color to use" + "description": "Identifier of the accent color to use. The chat must have at least accentColor.min_chat_boost_level boost level to pass the corresponding color" }, { "name": "background_custom_emoji_id", "type": "int64", - "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none" + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatProfileAccentColor", + "description": "Changes accent color and background custom emoji for profile of a chat. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding color" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set" } ], "is_synchronous": false, @@ -28441,6 +29441,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setChatEmojiStatus", + "description": "Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "New emoji status; pass null to remove emoji status" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatPermissions", "description": "Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right", @@ -28462,7 +29481,7 @@ }, { "name": "setChatBackground", - "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, and in chats with sufficient boost level and can_change_info administrator right", "class": "Ok", "properties": [ { @@ -28473,17 +29492,41 @@ { "name": "background", "type": "InputBackground", - "description": "The input background to use; pass null to create a new filled background or to remove the current background" + "description": "The input background to use; pass null to create a new filled or chat theme background" }, { "name": "type", "type": "BackgroundType", - "description": "Background type; pass null to remove the current background" + "description": "Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat" }, { "name": "dark_theme_dimming", "type": "int32", - "description": "Dimming of the background in dark themes, as a percentage; 0-100" + "description": "Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background" + }, + { + "name": "only_for_self", + "type": "Bool", + "description": "Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatBackground", + "description": "Deletes background in a specific chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "restore_previous", + "type": "Bool", + "description": "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" } ], "is_synchronous": false, @@ -28570,9 +29613,28 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleChatViewAsTopics", + "description": "Changes the view_as_topics setting of a forum chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "view_as_topics", + "type": "Bool", + "description": "New value of view_as_topics" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleChatIsTranslatable", - "description": "Changes the translatable state of a chat; for Telegram Premium users only", + "description": "Changes the translatable state of a chat", "class": "Ok", "properties": [ { @@ -28640,7 +29702,7 @@ { "name": "available_reactions", "type": "ChatAvailableReactions", - "description": "Reactions available in the chat. All emoji reactions must be active" + "description": "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" } ], "is_synchronous": false, @@ -29302,6 +30364,11 @@ "type": "int32", "description": "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" }, + { + "name": "from_story_full_id", + "type": "storyFullId", + "description": "Full identifier of the original story, which content was used to create the story" + }, { "name": "is_pinned", "type": "Bool", @@ -29602,9 +30669,9 @@ "type": 2 }, { - "name": "getStoryViewers", - "description": "Returns viewers of a story. The method can be called only for stories posted on behalf of the current user", - "class": "StoryViewers", + "name": "getStoryInteractions", + "description": "Returns interactions with a story. The method can be called only for stories posted on behalf of the current user", + "class": "StoryInteractions", "properties": [ { "name": "story_id", @@ -29614,17 +30681,22 @@ { "name": "query", "type": "string", - "description": "Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers" + "description": "Query to search for in names, usernames and titles; may be empty to get all relevant interactions" }, { "name": "only_contacts", "type": "Bool", - "description": "Pass true to get only contacts; pass false to get all relevant viewers" + "description": "Pass true to get only interactions by contacts; pass false to get all relevant interactions" + }, + { + "name": "prefer_forwards", + "type": "Bool", + "description": "Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date" }, { "name": "prefer_with_reaction", "type": "Bool", - "description": "Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date" + "description": "Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true" }, { "name": "offset", @@ -29634,7 +30706,46 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of story viewers to return" + "description": "The maximum number of story interactions to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatStoryInteractions", + "description": "Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat", + "class": "StoryInteractions", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions" + }, + { + "name": "prefer_forwards", + "type": "Bool", + "description": "Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of story interactions to return" } ], "is_synchronous": false, @@ -29677,6 +30788,57 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getStoryPublicForwards", + "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", + "class": "PublicForwards", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "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" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostLevelFeatures", + "description": "Returns list of features available on the specific chat boost level; this is an offline request", + "class": "ChatBoostLevelFeatures", + "properties": [ + { + "name": "level", + "type": "int32", + "description": "Chat boost level" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostFeatures", + "description": "Returns list of features available on the first 10 chat boost levels; this is an offline request", + "class": "ChatBoostFeatures", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "getAvailableChatBoostSlots", "description": "Returns the list of available chat boost slots for the current user", @@ -29834,7 +30996,7 @@ }, { "name": "getThemedEmojiStatuses", - "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list", + "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -29842,7 +31004,7 @@ }, { "name": "getRecentEmojiStatuses", - "description": "Returns recent emoji statuses", + "description": "Returns recent emoji statuses for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -29850,7 +31012,7 @@ }, { "name": "getDefaultEmojiStatuses", - "description": "Returns default emoji statuses", + "description": "Returns default emoji statuses for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -29858,12 +31020,36 @@ }, { "name": "clearRecentEmojiStatuses", - "description": "Clears the list of recently used emoji statuses", + "description": "Clears the list of recently used emoji statuses for self status", "class": "Ok", "properties": [], "is_synchronous": false, "type": 2 }, + { + "name": "getThemedChatEmojiStatuses", + "description": "Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultChatEmojiStatuses", + "description": "Returns default emoji statuses for chats", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDisallowedChatEmojiStatuses", + "description": "Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -29957,7 +31143,7 @@ }, { "name": "preliminaryUploadFile", - "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", + "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 is sent in a message", "class": "File", "properties": [ { @@ -30927,7 +32113,7 @@ }, { "name": "toggleGroupCallEnabledStartNotification", - "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", "class": "Ok", "properties": [ { @@ -31921,9 +33107,14 @@ }, { "name": "searchStickerSets", - "description": "Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results", + "description": "Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results", "class": "StickerSets", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" + }, { "name": "query", "type": "string", @@ -32371,7 +33562,26 @@ { "name": "background_custom_emoji_id", "type": "int64", - "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none" + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setProfileAccentColor", + "description": "Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use for profile; pass -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none" } ], "is_synchronous": false, @@ -33549,20 +34759,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getBackgrounds", - "description": "Returns backgrounds installed by the user", - "class": "Backgrounds", - "properties": [ - { - "name": "for_dark_theme", - "type": "Bool", - "description": "Pass true to order returned backgrounds for a dark theme" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getBackgroundUrl", "description": "Constructs a persistent HTTP URL for a background", @@ -33576,7 +34772,7 @@ { "name": "type", "type": "BackgroundType", - "description": "Background type" + "description": "Background type; backgroundTypeChatTheme isn't supported" } ], "is_synchronous": false, @@ -33597,31 +34793,59 @@ "type": 2 }, { - "name": "setBackground", - "description": "Changes the background selected by the user; adds background to the list of installed backgrounds", + "name": "setDefaultBackground", + "description": "Sets default background for chats; adds the background to the list of installed backgrounds", "class": "Background", "properties": [ { "name": "background", "type": "InputBackground", - "description": "The input background to use; pass null to create a new filled background or to remove the current background" + "description": "The input background to use; pass null to create a new filled background" }, { "name": "type", "type": "BackgroundType", - "description": "Background type; pass null to use the default type of the remote background or to remove the current background" + "description": "Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported" }, { "name": "for_dark_theme", "type": "Bool", - "description": "Pass true if the background is changed for a dark theme" + "description": "Pass true if the background is set for a dark theme" } ], "is_synchronous": false, "type": 2 }, { - "name": "removeBackground", + "name": "deleteDefaultBackground", + "description": "Deletes default background for chats", + "class": "Ok", + "properties": [ + { + "name": "for_dark_theme", + "type": "Bool", + "description": "Pass true if the background is deleted for a dark theme" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getInstalledBackgrounds", + "description": "Returns backgrounds installed by the user", + "class": "Backgrounds", + "properties": [ + { + "name": "for_dark_theme", + "type": "Bool", + "description": "Pass true to order returned backgrounds for a dark theme" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeInstalledBackground", "description": "Removes background from the list of installed backgrounds", "class": "Ok", "properties": [ @@ -33635,7 +34859,7 @@ "type": 2 }, { - "name": "resetBackgrounds", + "name": "resetInstalledBackgrounds", "description": "Resets list of installed backgrounds to its default value", "class": "Ok", "properties": [], @@ -34114,8 +35338,8 @@ }, { "name": "getMessagePublicForwards", - "description": "Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib", - "class": "FoundMessages", + "description": "Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib", + "class": "PublicForwards", "properties": [ { "name": "chat_id", @@ -34135,7 +35359,31 @@ { "name": "limit", "type": "int32", - "description": "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" + "description": "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" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryStatistics", + "description": "Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true", + "class": "StoryStatistics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "Pass true if a dark theme is used by the application" } ], "is_synchronous": false, @@ -35153,7 +36401,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the giveaway message in the chat" + "description": "Identifier of the giveaway or a giveaway winners message in the chat" } ], "is_synchronous": false, @@ -35387,20 +36635,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "addApplicationChangelog", - "description": "Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed", - "class": "Ok", - "properties": [ - { - "name": "previous_application_version", - "type": "string", - "description": "The previous application version" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "saveApplicationLogEvent", "description": "Saves application log event on the server. Can be called before authorization", diff --git a/data/td_api.tl b/data/td_api.tl index c2b106b..aa37525 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -511,14 +511,14 @@ poll id:int64 question:string options:vector total_voter_count:int32 //@is_default True, if this is one of default backgrounds //@is_dark True, if the background is dark and is recommended to be used with dark theme //@name Unique background name -//@document Document with the background; may be null. Null only for filled backgrounds +//@document Document with the background; may be null. Null only for filled and chat theme backgrounds //@type Type of the background background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; //@description Contains a list of backgrounds @backgrounds A list of backgrounds backgrounds backgrounds:vector = Backgrounds; -//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background chatBackground background:background dark_theme_dimming:int32 = ChatBackground; @@ -632,7 +632,7 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; //@description Describes actions that a user is allowed to take in a chat -//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues //@can_send_audios True, if the user can send music files //@can_send_documents True, if the user can send documents //@can_send_photos True, if the user can send photos @@ -671,7 +671,7 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa //@currency ISO 4217 currency code for Telegram Premium subscription payment //@amount The amount to pay, in the smallest units of the currency //@discount_percentage The discount associated with this option, as a percentage -//@month_count Number of month the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option //@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; @@ -687,7 +687,7 @@ premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is //@currency ISO 4217 currency code for Telegram Premium gift code payment //@amount The amount to pay, in the smallest units of the currency //@user_count Number of users which will be able to activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option; may be empty if none //@store_product_quantity Number of times the store product must be paid premiumGiftCodePaymentOption currency:string amount:int53 user_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; @@ -696,11 +696,11 @@ premiumGiftCodePaymentOption currency:string amount:int53 user_count:int32 month premiumGiftCodePaymentOptions options:vector = PremiumGiftCodePaymentOptions; //@description Contains information about a Telegram Premium gift code -//@creator_id Identifier of a chat or a user that created the gift code +//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used //@creation_date Point in time (Unix timestamp) when the code was created //@is_from_giveaway True, if the gift code was created for a giveaway -//@giveaway_message_id Identifier of the corresponding giveaway message; 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 +//@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 months the Telegram Premium subscription will be active after code activation //@user_id Identifier of a user for which the code was created; 0 if none //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; @@ -748,14 +748,28 @@ premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:i //@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 //@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes //@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes -accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; +//@min_chat_boost_level The minimum chat boost level required to use the color +accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector min_chat_boost_level:int32 = AccentColor; + +//@description Contains information about supported accent colors for user profile photo background in RGB format +//@palette_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings +//@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 Accent colors expected to be used in light themes +//@dark_theme_colors Accent colors expected to be used in dark themes +//@min_chat_boost_level The minimum chat boost level required to use the color +profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_chat_boost_level:int32 = ProfileAccentColor; //@description Describes a custom emoji to be shown instead of the Telegram Premium badge //@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format //@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; -//@description Contains a list of custom emoji identifiers, which can be set as emoji statuses @custom_emoji_ids The list of custom emoji identifiers +//@description Contains a list of custom emoji identifiers for emoji statuses @custom_emoji_ids The list of custom emoji identifiers emojiStatuses custom_emoji_ids:vector = EmojiStatuses; @@ -774,8 +788,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 -//@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 +//@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 and link preview 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 @@ -792,7 +808,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 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 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 @@ -825,11 +841,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; @@ -1041,8 +1058,11 @@ 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 publicForwards, +//-or for public chats in which where sent messages from getMessagePublicForwards response +//@boost_level Approximate boost level for the chat //@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 @@ -1051,14 +1071,14 @@ 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 //@is_fake True, if many users reported this supergroup or channel as a fake account //@has_active_stories True, if the channel has non-expired stories available to the current user //@has_unread_active_stories True, if the channel has unread non-expired stories available to the current user -supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -1127,7 +1147,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 @@ -1195,7 +1215,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; @@ -1229,19 +1249,31 @@ 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 as specified by the message sender +//@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; +//-messagePhoto, messagePoll, messagePremiumGiveaway, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, +//-messageVideo, messageVideoNote, or messageVoiceNote +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; @@ -1250,11 +1282,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; @@ -1270,7 +1301,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 @@ -1306,7 +1337,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 @@ -1363,6 +1394,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; @@ -1384,8 +1418,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; @@ -1408,7 +1443,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; @@ -1425,21 +1460,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; @@ -1447,8 +1482,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 @@ -1474,7 +1509,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; @@ -1589,7 +1624,9 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@title Chat title //@photo Chat photo; may be null //@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none +//@profile_accent_color_id Identifier of the profile accent color for the chat's profile; -1 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists @@ -1598,6 +1635,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 @@ -1611,6 +1649,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@notification_settings Notification settings for the chat //@available_reactions Types of reaction, available in the chat //@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@emoji_status Emoji status to be shown along with chat title; may be null //@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none @@ -1619,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 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1656,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 @@ -1686,13 +1725,14 @@ keyboardButtonTypeRequestLocation = KeyboardButtonType; //@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; -//@description A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request +//@description A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request //@id Unique button identifier -//@restrict_user_is_bot True, if the shared user must or must not be a bot -//@user_is_bot True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false -//@restrict_user_is_premium True, if the shared user must or must not be a Telegram Premium user -//@user_is_premium True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false -keyboardButtonTypeRequestUser id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool = KeyboardButtonType; +//@restrict_user_is_bot True, if the shared users must or must not be bots +//@user_is_bot True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false +//@restrict_user_is_premium True, if the shared users must or must not be Telegram Premium users +//@user_is_premium True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false +//@max_quantity The maximum number of users to share +keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool max_quantity:int32 = KeyboardButtonType; //@description A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request //@id Unique button identifier @@ -2126,8 +2166,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 @@ -2250,8 +2290,8 @@ inputCredentialsGooglePay data:string = InputCredentials; //@class PaymentProvider @description Contains information about a payment provider -//@description Smart Glocal payment provider @public_token Public payment token -paymentProviderSmartGlocal public_token:string = PaymentProvider; +//@description Smart Glocal payment provider @public_token Public payment token @tokenize_url URL for sending card tokenization requests +paymentProviderSmartGlocal public_token:string tokenize_url:string = PaymentProvider; //@description Stripe payment provider //@publishable_key Stripe API publishable key @@ -2341,10 +2381,12 @@ messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; //@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription //@additional_chat_ids Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats //@winners_selection_date Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways -//@only_new_members True, if only new subscribers of the chats will be eligible for the giveaway +//@only_new_members True, if only new members of the chats will be eligible for the giveaway +//@has_public_winners True, if the list of winners of the giveaway will be available to everyone //@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. //-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list -premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool country_codes:vector = PremiumGiveawayParameters; +//@prize_description Additional description of the giveaway prize; 0-128 characters +premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool has_public_winners:Bool country_codes:vector prize_description:string = PremiumGiveawayParameters; //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded @@ -2632,7 +2674,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). @@ -2781,8 +2823,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; @@ -2841,19 +2886,23 @@ messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none -//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency -//@month_count Number of month the Telegram Premium subscription will be active +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none +//@month_count Number of months the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown messageGiftedPremium gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; //@description A Telegram Premium gift code was created for the user -//@creator_id Identifier of a chat or a user that created the gift code +//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown //@is_from_giveaway True, if the gift code was created for a giveaway //@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@currency Currency for the paid amount; empty if unknown +//@amount The paid amount, in the smallest units of the currency; 0 if unknown +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none or unknown +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if unknown +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown //@code The gift code -messagePremiumGiftCode creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool month_count:int32 sticker:sticker code:string = MessageContent; +messagePremiumGiftCode creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; //@description A Telegram Premium giveaway was created for the chat messagePremiumGiveawayCreated = MessageContent; @@ -2861,15 +2910,35 @@ messagePremiumGiveawayCreated = MessageContent; //@description A Telegram Premium giveaway //@parameters Giveaway parameters //@winner_count Number of users which will receive Telegram Premium subscription gift codes -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown messagePremiumGiveaway parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent; +//@description A Telegram Premium giveaway without public winners has been completed for the chat +//@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted +//@winner_count Number of winners in the giveaway +//@unclaimed_prize_count Number of undistributed prizes +messagePremiumGiveawayCompleted giveaway_message_id:int53 winner_count:int32 unclaimed_prize_count:int32 = MessageContent; + +//@description A Telegram Premium giveaway with public winners has been completed for the chat +//@boosted_chat_id Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat +//@additional_chat_count Number of other chats that participated in the giveaway +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@only_new_members True, if only new members of the chats were eligible for the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@prize_description Additional description of the giveaway prize +//@winner_count Total number of winners in the giveaway +//@winner_user_ids Up to 100 user identifiers of the winners of the giveaway +//@unclaimed_prize_count Number of undistributed prizes +messagePremiumGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool month_count:int32 prize_description:string winner_count:int32 winner_user_ids:vector unclaimed_prize_count:int32 = MessageContent; + //@description A contact has registered with Telegram messageContactRegistered = MessageContent; -//@description The current user shared a user, which was requested by the bot @user_id Identifier of the shared user @button_id Identifier of the keyboard button with the request -messageUserShared user_id:int53 button_id:int32 = MessageContent; +//@description The current user shared users, which were requested by the bot @user_ids Identifier of the shared users @button_id Identifier of the keyboard button with the request +messageUsersShared user_ids:vector button_id:int32 = MessageContent; //@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request messageChatShared chat_id:int53 button_id:int32 = MessageContent; @@ -2974,7 +3043,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; @@ -2997,7 +3066,7 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@only_preview Pass true to get a fake message instead of actually sending them messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false //@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false @@ -3035,7 +3104,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 Pass true to disable automatic file type detection and send the document 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; @@ -3284,16 +3353,17 @@ emojis emojis:vector = Emojis; //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set //@title Title of the sticker set //@name Name of the sticker set -//@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null +//@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously @@ -3301,10 +3371,11 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -3335,21 +3406,6 @@ emojiCategoryTypeEmojiStatus = EmojiCategoryType; emojiCategoryTypeChatPhoto = EmojiCategoryType; -//@description Represents a viewer of a story -//@user_id User identifier of the viewer -//@view_date Approximate point in time (Unix timestamp) when the story was viewed -//@block_list Block list to which the user is added; may be null if none -//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none -storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer; - -//@description Represents a list of story viewers -//@total_count Approximate total number of story viewers found -//@total_reaction_count Approximate total number of reactions set by found story viewers -//@viewers List of story viewers -//@next_offset The offset for the next request. If empty, there are no more results -storyViewers total_count:int32 total_reaction_count:int32 viewers:vector next_offset:string = StoryViewers; - - //@description Describes position of a clickable rectangle area on a story media //@x_percentage The abscissa of the rectangle's center, as a percentage of the media width //@y_percentage The ordinate of the rectangle's center, as a percentage of the media height @@ -3374,6 +3430,9 @@ storyAreaTypeVenue venue:venue = StoryAreaType; //@is_flipped True, if reaction corner is flipped storyAreaTypeSuggestedReaction reaction_type:ReactionType total_count:int32 is_dark:Bool is_flipped:Bool = StoryAreaType; +//@description An area pointing to a message @chat_id Identifier of the chat with the message @message_id Identifier of the message +storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; + //@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; @@ -3400,11 +3459,18 @@ inputStoryAreaTypePreviousVenue venue_provider:string venue_id:string = InputSto //@is_flipped True, if reaction corner is flipped inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_flipped:Bool = InputStoryAreaType; +//@description An area pointing to a message +//@chat_id Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat +//@message_id Identifier of the message. Only successfully sent non-scheduled messages can be specified +inputStoryAreaTypeMessage chat_id:int53 message_id:int53 = InputStoryAreaType; + //@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; -//@description Contains a list of story areas to be added @areas List of 0-10 input story areas +//@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have +//-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, +//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area inputStoryAreas areas:vector = InputStoryAreas; @@ -3457,6 +3523,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 @@ -3478,19 +3558,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_viewers True, if users viewed the story can be received through getStoryViewers +//@can_get_statistics True, if the story statistics are available through getStoryStatistics +//@can_get_interactions True, if interactions with the story can be received through getStoryInteractions //@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago +//@repost_info Information about the original story; may be null if the story wasn't reposted //@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions //@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_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; //@description Represents a list of stories @total_count Approximate total number of stories found @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 @@ -3506,6 +3593,68 @@ 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 StoryInteractionType @description Describes type of interaction with a story + +//@description A view of the story @chosen_reaction_type Type of the reaction that was chosen by the viewer; may be null if none +storyInteractionTypeView chosen_reaction_type:ReactionType = StoryInteractionType; + +//@description A forward of the story as a message @message The message with story forward +storyInteractionTypeForward message:message = StoryInteractionType; + +//@description A repost of the story as a story @story The reposted story +storyInteractionTypeRepost story:story = StoryInteractionType; + + +//@description Represents interaction with a story +//@actor_id Identifier of the user or chat that made the interaction +//@interaction_date Approximate point in time (Unix timestamp) when the interaction happened +//@block_list Block list to which the actor is added; may be null if none or for chat stories +//@type Type of the interaction +storyInteraction actor_id:MessageSender interaction_date:int32 block_list:BlockList type:StoryInteractionType = StoryInteraction; + +//@description Represents a list of interactions with a story +//@total_count Approximate total number of interactions found +//@total_forward_count Approximate total number of found forwards and reposts; always 0 for chat stories +//@total_reaction_count Approximate total number of found reactions; always 0 for chat stories +//@interactions List of story interactions +//@next_offset The offset for the next request. If empty, then there are no more results +storyInteractions total_count:int32 total_forward_count:int32 total_reaction_count:int32 interactions:vector next_offset:string = StoryInteractions; + + +//@class PublicForward @description Describes a public forward or repost of a story + +//@description Contains a public forward as a message @message Information about the message +publicForwardMessage message:message = PublicForward; + +//@description Contains a public repost to a story @story Information about the story +publicForwardStory story:story = PublicForward; + + +//@description Represents a list of public forwards and reposts as a story of a message or a story +//@total_count Approximate total number of messages and stories found +//@forwards List of found public forwards and reposts +//@next_offset The offset for the next request. If empty, then there are no more results +publicForwards total_count:int32 forwards:vector next_offset:string = PublicForwards; + + +//@description Contains a list of features available on a specific chat boost level +//@level Target chat boost level +//@story_per_day_count Number of stories that the chat can publish daily +//@custom_emoji_reaction_count Number of custom emoji reactions that can be added to the list of available reactions +//@title_color_count Number of custom colors for chat title +//@profile_accent_color_count Number of custom colors for profile photo background +//@can_set_profile_background_custom_emoji True, if custom emoji for profile background can be set +//@accent_color_count Number of custom colors for background of empty chat photo, replies to messages and link previews +//@can_set_background_custom_emoji True, if custom emoji for reply header and link preview background can be set +//@can_set_emoji_status True, if emoji status can be set +//@chat_theme_background_count Number of chat theme backgrounds that can be set as chat background +//@can_set_custom_background True, if custom background can be set in the chat for all users +chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool = ChatBoostLevelFeatures; + +//@description Contains a list of features available on the first chat boost levels @features The list of features +chatBoostFeatures features:vector = ChatBoostFeatures; + + //@class ChatBoostSource @description Describes source of a chat boost //@description The chat created a Telegram Premium gift code for a user @@ -3528,7 +3677,7 @@ chatBoostSourcePremium user_id:int53 = ChatBoostSource; //@description Describes a prepaid Telegram Premium giveaway //@id Unique identifier of the prepaid giveaway //@winner_count Number of users which will receive Telegram Premium subscription gift codes -//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@payment_date Point in time (Unix timestamp) when the giveaway was paid prepaidPremiumGiveaway id:int64 winner_count:int32 month_count:int32 payment_date:int32 = PrepaidPremiumGiveaway; @@ -3553,7 +3702,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 @@ -3633,7 +3782,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 @@ -3687,7 +3836,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 @@ -3770,7 +3919,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 @@ -3803,7 +3952,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 @@ -3813,7 +3962,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 @@ -3862,7 +4011,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; @@ -4154,7 +4303,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; @@ -4226,9 +4375,15 @@ chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus ne //@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions chatEventAvailableReactionsChanged old_available_reactions:ChatAvailableReactions new_available_reactions:ChatAvailableReactions = ChatEventAction; +//@description The chat background was changed @old_background Previous background; may be null if none @new_background New background; may be null if none +chatEventBackgroundChanged old_background:chatBackground new_background:chatBackground = ChatEventAction; + //@description The chat description was changed @old_description Previous chat description @new_description New chat description chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; +//@description The chat emoji status was changed @old_emoji_status Previous emoji status; may be null if none @new_emoji_status New emoji status; may be null if none +chatEventEmojiStatusChanged old_emoji_status:emojiStatus new_emoji_status:emojiStatus = ChatEventAction; + //@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; @@ -4238,7 +4393,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 @@ -4259,11 +4414,19 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi //@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames chatEventActiveUsernamesChanged old_usernames:vector new_usernames:vector = ChatEventAction; -//@description The chat accent color was changed @old_accent_color_id Previous identifier of chat accent color @new_accent_color_id New identifier of chat accent color -chatEventAccentColorChanged old_accent_color_id:int32 new_accent_color_id:int32 = ChatEventAction; +//@description The chat accent color or background custom emoji were changed +//@old_accent_color_id Previous identifier of chat accent color +//@old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_accent_color_id New identifier of chat accent color +//@new_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventAccentColorChanged old_accent_color_id:int32 old_background_custom_emoji_id:int64 new_accent_color_id:int32 new_background_custom_emoji_id:int64 = ChatEventAction; -//@description The chat's custom emoji for reply background was changed @old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none @new_background_custom_emoji_id New identifier of the custom emoji; 0 if none -chatEventBackgroundCustomEmojiChanged old_background_custom_emoji_id:int64 new_background_custom_emoji_id:int64 = ChatEventAction; +//@description The chat's profile accent color or profile background custom emoji were changed +//@old_profile_accent_color_id Previous identifier of chat's profile accent color; -1 if none +//@old_profile_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_profile_accent_color_id New identifier of chat's profile accent color; -1 if none +//@new_profile_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventProfileAccentColorChanged old_profile_accent_color_id:int32 old_profile_background_custom_emoji_id:int64 new_profile_accent_color_id:int32 new_profile_background_custom_emoji_id:int64 = ChatEventAction; //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; @@ -4449,6 +4612,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 @@ -4503,9 +4669,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 @@ -4595,7 +4764,7 @@ storePaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@user_ids Identifiers of the users which can activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active for the users +//@month_count Number of months the Telegram Premium subscription will be active for the users telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 = TelegramPaymentPurpose; //@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels @@ -4603,7 +4772,7 @@ telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amo //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@winner_count Number of users which will be able to activate the gift codes -//@month_count Number of month the Telegram Premium subscription will be active for the users +//@month_count Number of months the Telegram Premium subscription will be active for the users telegramPaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; @@ -4686,6 +4855,9 @@ backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_mo //@description A filled background @fill The background fill backgroundTypeFill fill:BackgroundFill = BackgroundType; +//@description A background from a chat theme; can be used only as a chat background in channels @theme_name Name of the chat theme +backgroundTypeChatTheme theme_name:string = BackgroundType; + //@class InputBackground @description Contains information about background to set @@ -4803,13 +4975,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; @@ -4858,12 +5030,12 @@ pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent; -//@description A message with a Telegram Premium gift code created for the user @month_count Number of month the Telegram Premium subscription will be active after code activation +//@description A message with a Telegram Premium gift code created for the user @month_count Number of months the Telegram Premium subscription will be active after code activation pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent; //@description A message with a Telegram Premium giveaway //@winner_count Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message -//@month_count Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPremiumGiveaway winner_count:int32 month_count:int32 is_pinned:Bool = PushMessageContent; @@ -5288,7 +5460,7 @@ targetChatInternalLink link:InternalLinkType = TargetChat; //@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way -//@description The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link +//@description The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user internalLinkTypeActiveSessions = InternalLinkType; //@description The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. @@ -5304,7 +5476,9 @@ internalLinkTypeAttachmentMenuBot target_chat:TargetChat bot_username:string url //@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code internalLinkTypeAuthenticationCode code:string = InternalLinkType; -//@description The link is a link to a background. Call searchBackground with the given background name to process the link @background_name Name of the background +//@description The link is a link to a background. Call searchBackground with the given background name to process the link +//-If background is found and the user wants to apply it, then call setDefaultBackground +//@background_name Name of the background internalLinkTypeBackground background_name:string = InternalLinkType; //@description The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, @@ -5341,13 +5515,17 @@ internalLinkTypeChangePhoneNumber = InternalLinkType; //@url URL to be passed to getChatBoostLinkInfo internalLinkTypeChatBoost url:string = InternalLinkType; -//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. +//-If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink +//@invite_link Internal representation of the invite link internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; //@description The link is a link to the folder section of the app settings internalLinkTypeChatFolderSettings = InternalLinkType; -//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. +//-If the link is valid and the user wants to join the chat, then call joinChatByInviteLink +//@invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; //@description The link is a link to the default message auto-delete timer settings section of the app settings @@ -5356,24 +5534,32 @@ internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; //@description The link is a link to the edit profile section of the app settings internalLinkTypeEditProfileSettings = InternalLinkType; -//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame +//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, +//-ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game //@game_short_name Short name of the game internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; -//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView @fallback_url An URL to open if getWebPageInstantView fails +//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. +//-If Instant View is found, then show it, otherwise, open the fallback URL in an external browser +//@url URL to be passed to getWebPageInstantView +//@fallback_url An URL to open if getWebPageInstantView fails internalLinkTypeInstantView url:string fallback_url:string = InternalLinkType; //@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice internalLinkTypeInvoice invoice_name:string = InternalLinkType; -//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier +//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. +//-If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id" +//@language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; //@description The link is a link to the language section of the app settings internalLinkTypeLanguageSettings = InternalLinkType; -//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo +//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, +//-and then open received forum topic or chat and show the message there +//@url URL to be passed to getMessageLinkInfo internalLinkTypeMessage url:string = InternalLinkType; //@description The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field @@ -5390,15 +5576,21 @@ internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLin //-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType; -//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link +//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. +//-If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it //@hash Hash value from the link //@phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; -//@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link +//@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link +//@referrer Referrer specified in the link internalLinkTypePremiumFeatures referrer:string = InternalLinkType; -//@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases @referrer Referrer specified in the link +internalLinkTypePremiumGift referrer:string = InternalLinkType; + +//@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. +//-If the code is valid and the user wants to apply it, then call applyPremiumGiftCode //@code The Telegram Premium gift code internalLinkTypePremiumGiftCode code:string = InternalLinkType; @@ -5411,7 +5603,9 @@ internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; //@type Type of the proxy internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; -//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link @chat_username Username of the chat +//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link +//-If the chat is found, open its profile information screen or the chat itself +//@chat_username Username of the chat internalLinkTypePublicChat chat_username:string = InternalLinkType; //@description The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to @@ -5427,17 +5621,18 @@ internalLinkTypeSettings = InternalLinkType; //@description The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. //-Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, //-ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. -//-If the bot is added to side menu, then use getWebAppUrl with the given URL +//-If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App //@bot_username Username of the bot //@url URL to be passed to getWebAppUrl internalLinkTypeSideMenuBot bot_username:string url:string = InternalLinkType; -//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set +//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. +//-If the sticker set is found and the user wants to add it, then call changeStickerSet //@sticker_set_name Name of the sticker set //@expect_custom_emoji True, if the sticker set is expected to contain custom emoji internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = InternalLinkType; -//@description The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier +//@description The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received //@story_sender_username Username of the sender of the story //@story_id Story identifier internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; @@ -5454,10 +5649,14 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; //@description The link is a link to an unsupported proxy. An alert can be shown to the user internalLinkTypeUnsupportedProxy = InternalLinkType; -//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link @phone_number Phone number of the user +//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. +//-If the user is found, then call createPrivateChat and open the chat +//@phone_number Phone number of the user internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType; -//@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link @token The token +//@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. +//-If the user is found, then call createPrivateChat and open the chat +//@token The token internalLinkTypeUserToken token:string = InternalLinkType; //@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link @@ -5696,16 +5895,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 @@ -5794,6 +5993,9 @@ suggestedActionRestorePremium = SuggestedAction; //@description Suggests the user to subscribe to the Premium subscription with annual payments suggestedActionSubscribeToAnnualPremium = SuggestedAction; +//@description Suggests the user to gift Telegram Premium to friends for Christmas +suggestedActionGiftPremiumForChristmas = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -5876,11 +6078,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 @@ -5925,8 +6137,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 @@ -5936,13 +6152,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 @@ -5990,8 +6216,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; @@ -6048,13 +6274,15 @@ updateChatTitle chat_id:int53 title:string = Update; //@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null 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 Chat accent colors have changed +//@chat_id Chat identifier +//@accent_color_id The new chat accent color identifier +//@background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +//@profile_accent_color_id The new chat profile accent color identifier; -1 if none +//@profile_background_custom_emoji_id The new identifier of a custom emoji to be shown on the profile background; 0 if none +updateChatAccentColors chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Update; -//@description A chat's custom emoji for reply background has changed @chat_id Chat identifier @background_custom_emoji_id The new tdentifier of a custom emoji to be shown on the reply header background -updateChatBackgroundCustomEmoji 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 @@ -6086,6 +6314,11 @@ updateChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReac //@positions The new chat positions in the chat lists updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector = Update; +//@description Chat emoji status has changed +//@chat_id Chat identifier +//@emoji_status The new chat emoji status; may be null +updateChatEmojiStatus chat_id:int53 emoji_status:emojiStatus = Update; + //@description The message sender that is selected to send messages in a chat has changed @chat_id Chat identifier @message_sender_id New value of message_sender_id; may be null if the user can't change message sender updateChatMessageSender chat_id:int53 message_sender_id:MessageSender = Update; @@ -6130,6 +6363,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; @@ -6140,7 +6376,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; @@ -6165,7 +6401,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 @@ -6328,11 +6564,11 @@ 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 -updateSelectedBackground for_dark_theme:Bool background:background = Update; +//@description The default background has changed @for_dark_theme True, if default background for dark theme has changed @background The new default background; may be null +updateDefaultBackground for_dark_theme:Bool background:background = Update; //@description The list of available chat themes has changed @chat_themes The new list of chat themes updateChatThemes chat_themes:vector = Update; @@ -6343,6 +6579,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 and setChatProfileAccentColor. 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; @@ -6370,6 +6611,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; @@ -6460,7 +6708,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 @@ -6479,6 +6727,22 @@ updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest user_chat_id:int5 //@boost New information about the boost updateChatBoost chat_id:int53 boost:chatBoost = Update; +//@description User changed its reactions on a message with public reactions; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@actor_id Identifier of the user or chat that changed reactions +//@date Point in time (Unix timestamp) when the reactions were changed +//@old_reaction_types Old list of chosen reactions +//@new_reaction_types New list of chosen reactions +updateMessageReaction chat_id:int53 message_id:int53 actor_id:MessageSender date:int32 old_reaction_types:vector new_reaction_types:vector = Update; + +//@description Reactions added to a message with anonymous reactions have changed; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@date Point in time (Unix timestamp) when the reactions were changed +//@reactions The list of reactions added to the message +updateMessageReactions chat_id:int53 message_id:int53 date:int32 reactions:vector = Update; + //@description Contains a list of updates @updates List of updates updates updates:vector = Updates; @@ -6723,8 +6987,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, the giveaway message, and the topic creation message for messages of the types +//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted 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; @@ -6786,6 +7051,19 @@ 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 Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +//@chat_id Identifier of the original chat, which similar chats were requested +//@opened_chat_id Identifier of the opened chat +openChatSimilarChat chat_id:int53 opened_chat_id:int53 = Ok; + //@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 getTopChats category:TopChatCategory limit:int32 = Chats; @@ -7003,7 +7281,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; @@ -7066,7 +7344,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 Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat @@ -7258,6 +7536,13 @@ addMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType is_ //@reaction_type Type of the reaction to remove removeMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType = Ok; +//@description Sets reactions on a message; for bots only +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@reaction_types Types of the reaction to set +//@is_big Pass true if the reactions are added with a big animation +setMessageReactions chat_id:int53 message_id:int53 reaction_types:vector is_big:Bool = Ok; + //@description Returns reactions added for a message, along with their sender //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message @@ -7355,13 +7640,13 @@ getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; -//@description Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot +//@description Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot //@chat_id Identifier of the chat with the bot //@message_id Identifier of the message with the button //@button_id Identifier of the button -//@shared_user_id Identifier of the shared user -//@only_check Pass true to check that the user can be shared by the button instead of actually sharing them -shareUserWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_id:int53 only_check:Bool = Ok; +//@shared_user_ids Identifiers of the shared users +//@only_check Pass true to check that the users can be shared by the button instead of actually sharing them +shareUsersWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_ids:vector only_check:Bool = Ok; //@description Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot //@chat_id Identifier of the chat with the bot @@ -7670,29 +7955,48 @@ setChatTitle chat_id:int53 title:string = Ok; //@photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; -//@description Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +//@description Changes accent color and background custom emoji of a chat. Requires can_change_info administrator right //@chat_id Chat identifier -//@accent_color_id Identifier of the accent color to use -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +//@accent_color_id Identifier of the accent color to use. The chat must have at least accentColor.min_chat_boost_level boost level to pass the corresponding color +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; +//@description Changes accent color and background custom emoji for profile of a chat. Requires can_change_info administrator right +//@chat_id Chat identifier +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding color +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set +setChatProfileAccentColor chat_id:int53 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; + //@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels //-Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). //@chat_id Chat identifier //@message_auto_delete_time New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok; +//@description Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right +//@chat_id Chat identifier +//@emoji_status New emoji status; pass null to remove emoji status +setChatEmojiStatus chat_id:int53 emoji_status:emojiStatus = Ok; + //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right //@chat_id Chat identifier //@permissions New non-administrator members permissions in the chat setChatPermissions 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, and in chats with sufficient boost level and can_change_info administrator right //@chat_id Chat identifier -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to remove the current 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; +//@background The input background to use; pass null to create a new filled or chat theme background +//@type Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. +//-Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background +//@only_for_self Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious +setChatBackground 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; @@ -7710,7 +8014,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 @@ -7719,7 +8026,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 @@ -7876,9 +8185,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 @@ -7955,14 +8265,24 @@ getStoryAvailableReactions row_size:int32 = AvailableReactions; //@update_recent_reactions Pass true if the reaction needs to be added to recent reactions setStoryReaction story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; -//@description Returns viewers of a story. The method can be called only for stories posted on behalf of the current user +//@description Returns interactions with a story. The method can be called only for stories posted on behalf of the current user //@story_id Story identifier -//@query Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers -//@only_contacts Pass true to get only contacts; pass false to get all relevant viewers -//@prefer_with_reaction Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date +//@query Query to search for in names, usernames and titles; may be empty to get all relevant interactions +//@only_contacts Pass true to get only interactions by contacts; pass false to get all relevant interactions +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date +//@prefer_with_reaction Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of story viewers to return -getStoryViewers story_id:int32 query:string only_contacts:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryViewers; +//@limit The maximum number of story interactions to return +getStoryInteractions story_id:int32 query:string only_contacts:Bool prefer_forwards:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryInteractions; + +//@description Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat +//@story_sender_chat_id The identifier of the sender of the story +//@story_id Story identifier +//@reaction_type Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of story interactions to return +getChatStoryInteractions story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType prefer_forwards:Bool offset:string limit:int32 = StoryInteractions; //@description Reports a story to the Telegram moderators //@story_sender_chat_id The identifier of the sender of the story to report @@ -7975,6 +8295,20 @@ 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 = PublicForwards; + + +//@description Returns list of features available on the specific chat boost level; this is an offline request @level Chat boost level +getChatBoostLevelFeatures level:int32 = ChatBoostLevelFeatures; + +//@description Returns list of features available on the first 10 chat boost levels; this is an offline request +getChatBoostFeatures = ChatBoostFeatures; //@description Returns the list of available chat boost slots for the current user getAvailableChatBoostSlots = ChatBoostSlots; @@ -8014,19 +8348,29 @@ getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool allow_write_access:Bool = Ok; -//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status getThemedEmojiStatuses = EmojiStatuses; -//@description Returns recent emoji statuses +//@description Returns recent emoji statuses for self status getRecentEmojiStatuses = EmojiStatuses; -//@description Returns default emoji statuses +//@description Returns default emoji statuses for self status getDefaultEmojiStatuses = EmojiStatuses; -//@description Clears the list of recently used emoji statuses +//@description Clears the list of recently used emoji statuses for self status clearRecentEmojiStatuses = Ok; +//@description Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats +getThemedChatEmojiStatuses = EmojiStatuses; + +//@description Returns default emoji statuses for chats +getDefaultChatEmojiStatuses = EmojiStatuses; + +//@description Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true +getDisallowedChatEmojiStatuses = EmojiStatuses; + + //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download //@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first @@ -8045,7 +8389,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 @@ -8266,7 +8610,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; @@ -8498,8 +8842,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; @@ -8608,9 +8954,14 @@ deleteProfilePhoto profile_photo_id:int64 = Ok; //@description Changes accent color and background custom emoji for the current user; for Telegram Premium users only //@accent_color_id Identifier of the accent color to use -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none setAccentColor 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 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; @@ -8896,26 +9247,29 @@ createInvoiceLink invoice:InputMessageContent = HttpUrl; getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme -getBackgrounds for_dark_theme:Bool = Backgrounds; - -//@description Constructs a persistent HTTP URL for a background @name Background name @type Background type +//@description Constructs a persistent HTTP URL for a background @name Background name @type Background type; backgroundTypeChatTheme isn't supported getBackgroundUrl name:string type:BackgroundType = HttpUrl; //@description Searches for a background by its name @name The name of the background searchBackground name:string = Background; -//@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme Pass true if the background is changed for a dark theme -setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; +//@description Sets default background for chats; adds the background to the list of installed backgrounds +//@background The input background to use; pass null to create a new filled background +//@type Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported +//@for_dark_theme Pass true if the background is set for a dark theme +setDefaultBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; + +//@description Deletes default background for chats @for_dark_theme Pass true if the background is deleted for a dark theme +deleteDefaultBackground for_dark_theme:Bool = Ok; + +//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme +getInstalledBackgrounds for_dark_theme:Bool = Backgrounds; //@description Removes background from the list of installed backgrounds @background_id The background identifier -removeBackground background_id:int64 = Ok; +removeInstalledBackground background_id:int64 = Ok; //@description Resets list of installed backgrounds to its default value -resetBackgrounds = Ok; +resetInstalledBackgrounds = Ok; //@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests @@ -9036,12 +9390,15 @@ getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; //@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; -//@description Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib +//@description Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; +//@limit The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = PublicForwards; + +//@description Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true @chat_id Chat identifier @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; @@ -9300,7 +9657,7 @@ launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParamet //@description Returns information about a Telegram Premium giveaway //@chat_id Identifier of the channel chat which started the giveaway -//@message_id Identifier of the giveaway message in the chat +//@message_id Identifier of the giveaway or a giveaway winners message in the chat getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; //@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose @@ -9362,9 +9719,6 @@ getDeepLinkInfo link:string = DeepLinkInfo; //@description Returns application config, provided by the server. Can be called before authorization getApplicationConfig = JsonValue; -//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version -addApplicationChangelog previous_application_version:string = Ok; - //@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok;