diff --git a/client/function.go b/client/function.go index 63ba51e..cbd2cde 100755 --- a/client/function.go +++ b/client/function.go @@ -355,6 +355,63 @@ func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticati return UnmarshalOk(result.Data) } +// Returns parameters for authentication using a passkey as JSON-serialized string +func (client *Client) GetAuthenticationPasskeyParameters() (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAuthenticationPasskeyParameters", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type CheckAuthenticationPasskeyRequest struct { + // Base64url-encoded identifier of the credential + CredentialId string `json:"credential_id"` + // JSON-encoded client data + ClientData string `json:"client_data"` + // Authenticator data of the application that created the credential + AuthenticatorData []byte `json:"authenticator_data"` + // Cryptographic signature of the credential + Signature []byte `json:"signature"` + // User handle of the passkey + UserHandle []byte `json:"user_handle"` +} + +// Checks a passkey to log in to the corresponding account. Call getAuthenticationPasskeyParameters to get parameters for the passkey. Works only when the current authorization state is authorizationStateWaitPhoneNumber or authorizationStateWaitOtherDeviceConfirmation, or if there is no pending authentication query and the current authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +func (client *Client) CheckAuthenticationPasskey(req *CheckAuthenticationPasskeyRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationPasskey", + }, + Data: map[string]interface{}{ + "credential_id": req.CredentialId, + "client_data": req.ClientData, + "authenticator_data": req.AuthenticatorData, + "signature": req.Signature, + "user_handle": req.UserHandle, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type RegisterUserRequest struct { // The first name of the user; 1-64 characters FirstName string `json:"first_name"` @@ -772,12 +829,31 @@ func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, erro return UnmarshalPasswordState(result.Data) } +// Checks whether the current user is required to set login email address +func (client *Client) IsLoginEmailAddressRequired() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "isLoginEmailAddressRequired", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetLoginEmailAddressRequest struct { // New login email address NewLoginEmailAddress string `json:"new_login_email_address"` } -// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly +// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty, or the user received suggestedActionSetLoginEmailAddress and isLoginEmailAddressRequired succeeds. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -1429,7 +1505,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -2678,38 +2754,6 @@ func (client *Client) SetDirectMessagesChatTopicIsMarkedAsUnread(req *SetDirectM return UnmarshalOk(result.Data) } -type SetDirectMessagesChatTopicDraftMessageRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Topic identifier - TopicId int64 `json:"topic_id"` - // New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored - DraftMessage *DraftMessage `json:"draft_message"` -} - -// Changes the draft message in the topic in a channel direct messages chat administered by the current user -func (client *Client) SetDirectMessagesChatTopicDraftMessage(req *SetDirectMessagesChatTopicDraftMessageRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setDirectMessagesChatTopicDraftMessage", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "draft_message": req.DraftMessage, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type UnpinAllDirectMessagesChatTopicMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` @@ -3435,6 +3479,67 @@ func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocument return UnmarshalFoundMessages(result.Data) } +type GetPublicPostSearchLimitsRequest struct { + // Query that will be searched for + Query string `json:"query"` +} + +// Checks public post search limits without actually performing the search +func (client *Client) GetPublicPostSearchLimits(req *GetPublicPostSearchLimitsRequest) (*PublicPostSearchLimits, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPublicPostSearchLimits", + }, + Data: map[string]interface{}{ + "query": req.Query, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPublicPostSearchLimits(result.Data) +} + +type SearchPublicPostsRequest struct { + // Query to search for + Query string `json:"query"` + // 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; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` + // The Telegram Star amount the user agreed to pay for the search; pass 0 for free searches + StarCount int64 `json:"star_count"` +} + +// Searches for public channel posts using the given query. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchPublicPosts(req *SearchPublicPostsRequest) (*FoundPublicPosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchPublicPosts", + }, + Data: map[string]interface{}{ + "query": req.Query, + "offset": req.Offset, + "limit": req.Limit, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPublicPosts(result.Data) +} + type SearchPublicMessagesByTagRequest struct { // Hashtag or cashtag to search for Tag string `json:"tag"` @@ -3775,7 +3880,7 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics aren't supported + // Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics and message threads aren't supported TopicId MessageTopic `json:"topic_id"` // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` @@ -3810,7 +3915,7 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) type GetChatMessageCountRequest struct { // Identifier of the chat in which to count messages ChatId int64 `json:"chat_id"` - // Pass topic identifier to get number of messages only in specific topic; pass null to get number of messages in all topics + // Pass topic identifier to get number of messages only in specific topic; pass null to get number of messages in all topics; message threads aren't supported TopicId MessageTopic `json:"topic_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` @@ -3845,7 +3950,7 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou type GetChatMessagePositionRequest struct { // Identifier of the chat in which to find message position ChatId int64 `json:"chat_id"` - // Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages + // Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages; message threads aren't supported TopicId MessageTopic `json:"topic_id"` // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function Filter SearchMessagesFilter `json:"filter"` @@ -4455,7 +4560,7 @@ type TranslateMessageTextRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "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" + // Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values ToLanguageCode string `json:"to_language_code"` } @@ -4482,6 +4587,38 @@ func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*F return UnmarshalFormattedText(result.Data) } +type SummarizeMessageRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Pass a language code to which the summary will be translated; may be empty if translation isn't needed. See translateText.to_language_code for the list of supported values + TranslateToLanguageCode string `json:"translate_to_language_code"` +} + +// Summarizes content of the message with non-empty summary_language_code +func (client *Client) SummarizeMessage(req *SummarizeMessageRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "summarizeMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "translate_to_language_code": req.TranslateToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + type RecognizeSpeechRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -4601,8 +4738,8 @@ func (client *Client) SetChatMessageSender(req *SetChatMessageSenderRequest) (*O type SendMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the message will be sent - MessageThreadId int64 `json:"message_thread_id"` + // Topic in which the message will be sent; pass null if none + TopicId MessageTopic `json:"topic_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options @@ -4621,7 +4758,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "reply_to": req.ReplyTo, "options": req.Options, "reply_markup": req.ReplyMarkup, @@ -4642,8 +4779,8 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { type SendMessageAlbumRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the messages will be sent - MessageThreadId int64 `json:"message_thread_id"` + // Topic in which the messages will be sent; pass null if none + TopicId MessageTopic `json:"topic_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options @@ -4660,7 +4797,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, @@ -4712,8 +4849,8 @@ func (client *Client) SendBotStartMessage(req *SendBotStartMessageRequest) (*Mes type SendInlineQueryResultMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the message will be sent - MessageThreadId int64 `json:"message_thread_id"` + // Topic in which the message will be sent; pass null if none + TopicId MessageTopic `json:"topic_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options @@ -4734,7 +4871,7 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "reply_to": req.ReplyTo, "options": req.Options, "query_id": req.QueryId, @@ -4756,8 +4893,8 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the message will be sent; for forum threads only - MessageThreadId int64 `json:"message_thread_id"` + // Topic in which the messages will be forwarded; message threads aren't supported; pass null if none + TopicId MessageTopic `json:"topic_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded @@ -4778,7 +4915,7 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "from_chat_id": req.FromChatId, "message_ids": req.MessageIds, "options": req.Options, @@ -6161,7 +6298,7 @@ type GetBusinessAccountStarAmountRequest struct { BusinessConnectionId string `json:"business_connection_id"` } -// Returns the amount of Telegram Stars owned by a business account; for bots only +// Returns the Telegram Star amount owned by a business account; for bots only func (client *Client) GetBusinessAccountStarAmount(req *GetBusinessAccountStarAmountRequest) (*StarAmount, error) { result, err := client.Send(Request{ meta: meta{ @@ -6189,7 +6326,7 @@ type TransferBusinessAccountStarsRequest struct { StarCount int64 `json:"star_count"` } -// Transfer Telegram Stars from the business account to the business bot; for bots only +// Transfers Telegram Stars from the business account to the business bot; for bots only func (client *Client) TransferBusinessAccountStars(req *TransferBusinessAccountStarsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6584,11 +6721,13 @@ type CreateForumTopicRequest struct { ChatId int64 `json:"chat_id"` // Name of the topic; 1-128 characters Name string `json:"name"` + // Pass true if the name of the topic wasn't entered explicitly; for chats with bots only + IsNameImplicit bool `json:"is_name_implicit"` // Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons Icon *ForumTopicIcon `json:"icon"` } -// Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup +// Creates a topic in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator or can_create_topics member right in the supergroup func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -6597,6 +6736,7 @@ func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopi Data: map[string]interface{}{ "chat_id": req.ChatId, "name": req.Name, + "is_name_implicit": req.IsNameImplicit, "icon": req.Icon, }, }) @@ -6614,8 +6754,8 @@ func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopi type EditForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` // New name of the topic; 0-128 characters. If empty, the previous topic name is kept Name string `json:"name"` // Pass true to edit the icon of the topic. Icon of the General topic can't be edited @@ -6624,7 +6764,7 @@ type EditForumTopicRequest struct { IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` } -// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +// Edits title and icon of a topic in a forum supergroup chat or a chat with a bot with topics; for supergroup chats requires can_manage_topics administrator right unless the user is creator of the topic func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6632,7 +6772,7 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, "name": req.Name, "edit_icon_custom_emoji": req.EditIconCustomEmoji, "icon_custom_emoji_id": req.IconCustomEmojiId, @@ -6652,11 +6792,11 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { type GetForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` } -// Returns information about a forum topic +// Returns information about a topic in a forum supergroup chat or a chat with a bot with topics func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, error) { result, err := client.Send(Request{ meta: meta{ @@ -6664,7 +6804,7 @@ func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, err }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, }, }) if err != nil { @@ -6678,14 +6818,52 @@ func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, err return UnmarshalForumTopic(result.Data) } +type GetForumTopicHistoryRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` + // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message + FromMessageId int64 `json:"from_message_id"` + // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages + Offset int32 `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns messages in a topic in a forum supergroup chat or a chat with a bot with topics. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +func (client *Client) GetForumTopicHistory(req *GetForumTopicHistoryRequest) (*Messages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopicHistory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessages(result.Data) +} + type GetForumTopicLinkRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` } -// Returns an HTTPS link to a topic in a forum chat. This is an offline method +// Returns an HTTPS link to a topic in a forum supergroup chat. This is an offline method func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*MessageLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -6693,7 +6871,7 @@ func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*Message }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, }, }) if err != nil { @@ -6708,7 +6886,7 @@ func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*Message } type GetForumTopicsRequest struct { - // Identifier of the forum chat + // Identifier of the chat ChatId int64 `json:"chat_id"` // Query to search for in the forum topic's name Query string `json:"query"` @@ -6716,13 +6894,13 @@ type GetForumTopicsRequest struct { OffsetDate int32 `json:"offset_date"` // The message identifier of the last message in the last found topic, or 0 for the first request OffsetMessageId int64 `json:"offset_message_id"` - // The message thread identifier of the last found topic, or 0 for the first request - OffsetMessageThreadId int64 `json:"offset_message_thread_id"` + // The forum topic identifier of the last found topic, or 0 for the first request + OffsetForumTopicId int32 `json:"offset_forum_topic_id"` // The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server +// Returns found forum topics in a forum supergroup chat or a chat with a bot with topics. This is a temporary method for getting information about topic list from the server func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, error) { result, err := client.Send(Request{ meta: meta{ @@ -6733,7 +6911,7 @@ func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, "query": req.Query, "offset_date": req.OffsetDate, "offset_message_id": req.OffsetMessageId, - "offset_message_thread_id": req.OffsetMessageThreadId, + "offset_forum_topic_id": req.OffsetForumTopicId, "limit": req.Limit, }, }) @@ -6751,13 +6929,13 @@ func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, type SetForumTopicNotificationSettingsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` // New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } -// Changes the notification settings of a forum topic +// Changes the notification settings of a forum topic in a forum supergroup chat or a chat with a bot with topics func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotificationSettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6765,7 +6943,7 @@ func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotifi }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, "notification_settings": req.NotificationSettings, }, }) @@ -6783,8 +6961,8 @@ func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotifi type ToggleForumTopicIsClosedRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` // Pass true to close the topic; pass false to reopen it IsClosed bool `json:"is_closed"` } @@ -6797,7 +6975,7 @@ func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequ }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, "is_closed": req.IsClosed, }, }) @@ -6844,13 +7022,13 @@ func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTop type ToggleForumTopicIsPinnedRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` // Pass true to pin the topic; pass false to unpin it IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +// Changes the pinned state of a topic in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6858,7 +7036,7 @@ func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequ }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, "is_pinned": req.IsPinned, }, }) @@ -6876,11 +7054,11 @@ func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequ type SetPinnedForumTopicsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // The new list of pinned forum topics - MessageThreadIds []int64 `json:"message_thread_ids"` + // The new list of identifiers of the pinned forum topics + ForumTopicIds []int32 `json:"forum_topic_ids"` } -// Changes the order of pinned forum topics; requires can_manage_topics administrator right in the supergroup +// Changes the order of pinned topics in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator right in the supergroup func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6888,7 +7066,7 @@ func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*O }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_ids": req.MessageThreadIds, + "forum_topic_ids": req.ForumTopicIds, }, }) if err != nil { @@ -6905,11 +7083,11 @@ func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*O type DeleteForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Message thread identifier of the forum topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier + ForumTopicId int32 `json:"forum_topic_id"` } -// Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages +// Deletes all messages from a topic in a forum supergroup chat or a chat with a bot with topics; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6917,7 +7095,187 @@ func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "forum_topic_id": req.ForumTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllForumTopicMentionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Forum topic identifier in which mentions are marked as read + ForumTopicId int32 `json:"forum_topic_id"` +} + +// Marks all mentions in a topic in a forum supergroup chat as read +func (client *Client) ReadAllForumTopicMentions(req *ReadAllForumTopicMentionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllForumTopicMentions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllForumTopicReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Forum topic identifier in which reactions are marked as read + ForumTopicId int32 `json:"forum_topic_id"` +} + +// Marks all reactions in a topic in a forum supergroup chat or a chat with a bot with topics as read +func (client *Client) ReadAllForumTopicReactions(req *ReadAllForumTopicReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllForumTopicReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type UnpinAllForumTopicMessagesRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Forum topic identifier in which messages will be unpinned + ForumTopicId int32 `json:"forum_topic_id"` +} + +// Removes all pinned messages from a topic in a forum supergroup chat or a chat with a bot with topics; requires can_pin_messages member right in the supergroup +func (client *Client) UnpinAllForumTopicMessages(req *UnpinAllForumTopicMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "unpinAllForumTopicMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns parameters for creating of a new passkey as JSON-serialized string +func (client *Client) GetPasskeyParameters() (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPasskeyParameters", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type AddLoginPasskeyRequest struct { + // JSON-encoded client data + ClientData string `json:"client_data"` + // Passkey attestation object + AttestationObject []byte `json:"attestation_object"` +} + +// Adds a passkey allowed to be used for the login by the current user and returns the added passkey. Call getPasskeyParameters to get parameters for creating of the passkey +func (client *Client) AddLoginPasskey(req *AddLoginPasskeyRequest) (*Passkey, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addLoginPasskey", + }, + Data: map[string]interface{}{ + "client_data": req.ClientData, + "attestation_object": req.AttestationObject, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPasskey(result.Data) +} + +// Returns the list of passkeys allowed to be used for the login by the current user +func (client *Client) GetLoginPasskeys() (*Passkeys, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLoginPasskeys", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPasskeys(result.Data) +} + +type RemoveLoginPasskeyRequest struct { + // Unique identifier of the passkey to remove + PasskeyId string `json:"passkey_id"` +} + +// Removes a passkey from the list of passkeys allowed to be used for the login by the current user +func (client *Client) RemoveLoginPasskey(req *RemoveLoginPasskeyRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeLoginPasskey", + }, + Data: map[string]interface{}{ + "passkey_id": req.PasskeyId, }, }) if err != nil { @@ -8170,7 +8528,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // Pass true to allow the bot to send messages to the current user + // Pass true to allow the bot to send messages to the current user. Phone number access can't be requested using the button AllowWriteAccess bool `json:"allow_write_access"` } @@ -8315,7 +8673,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query + // Pass true if results may be cached and returned only for the user who sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` // Button to be shown above inline query results; pass null if none Button *InlineQueryResultsButton `json:"button"` @@ -8645,10 +9003,8 @@ type OpenWebAppRequest struct { BotUserId int64 `json:"bot_user_id"` // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise Url string `json:"url"` - // If not 0, the message thread identifier to which the message will be sent - MessageThreadId int64 `json:"message_thread_id"` - // If not 0, unique identifier of the topic of channel direct messages chat to which the message will be sent - DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"` + // Topic in which the message will be sent; pass null if none + TopicId MessageTopic `json:"topic_id"` // Information about the message or story to be replied in the message sent by the Web App; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Parameters to use to open the Web App @@ -8665,8 +9021,7 @@ func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { "chat_id": req.ChatId, "bot_user_id": req.BotUserId, "url": req.Url, - "message_thread_id": req.MessageThreadId, - "direct_messages_chat_topic_id": req.DirectMessagesChatTopicId, + "topic_id": req.TopicId, "reply_to": req.ReplyTo, "parameters": req.Parameters, }, @@ -9047,7 +9402,7 @@ type DeleteChatReplyMarkupRequest struct { MessageId int64 `json:"message_id"` } -// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed +// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used or dismissed func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9072,8 +9427,8 @@ func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) ( type SendChatActionRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the action was performed - MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the topic in which the action is performed; pass null if none + TopicId MessageTopic `json:"topic_id"` // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` // The action description; pass null to cancel the currently active action @@ -9088,7 +9443,7 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "business_connection_id": req.BusinessConnectionId, "action": req.Action, }, @@ -9104,6 +9459,41 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SendTextMessageDraftRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The forum topic identifier in which the message will be sent; pass 0 if none + ForumTopicId int32 `json:"forum_topic_id"` + // Unique identifier of the draft + DraftId JsonInt64 `json:"draft_id"` + // Draft text of the message + Text *FormattedText `json:"text"` +} + +// Sends a draft for a being generated text message; for bots only +func (client *Client) SendTextMessageDraft(req *SendTextMessageDraftRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendTextMessageDraft", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + "draft_id": req.DraftId, + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type OpenChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -9302,9 +9692,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte } switch result.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(result.Data) - case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) @@ -9326,11 +9713,8 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(result.Data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(result.Data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(result.Data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(result.Data) @@ -9341,21 +9725,27 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(result.Data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(result.Data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(result.Data) + + case TypeInternalLinkTypeDirectMessagesChat: + return UnmarshalInternalLinkTypeDirectMessagesChat(result.Data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(result.Data) + + case TypeInternalLinkTypeGiftCollection: + return UnmarshalInternalLinkTypeGiftCollection(result.Data) + case TypeInternalLinkTypeGroupCall: return UnmarshalInternalLinkTypeGroupCall(result.Data) @@ -9368,8 +9758,8 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(result.Data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(result.Data) @@ -9380,11 +9770,20 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(result.Data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(result.Data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(result.Data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(result.Data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(result.Data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(result.Data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(result.Data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(result.Data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(result.Data) @@ -9392,17 +9791,14 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(result.Data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(result.Data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(result.Data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(result.Data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -9416,27 +9812,33 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(result.Data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(result.Data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(result.Data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(result.Data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(result.Data) + case TypeInternalLinkTypeStoryAlbum: + return UnmarshalInternalLinkTypeStoryAlbum(result.Data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(result.Data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(result.Data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(result.Data) @@ -9495,11 +9897,13 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` + // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to access their phone number + AllowPhoneNumberAccess bool `json:"allow_phone_number_access"` } -// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed +// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed. May return an empty link if just a toast about successful login has to be shown func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -9508,6 +9912,7 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er Data: map[string]interface{}{ "link": req.Link, "allow_write_access": req.AllowWriteAccess, + "allow_phone_number_access": req.AllowPhoneNumberAccess, }, }) if err != nil { @@ -9547,41 +9952,12 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } -type ReadAllMessageThreadMentionsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message thread identifier in which mentions are marked as read - MessageThreadId int64 `json:"message_thread_id"` -} - -// Marks all mentions in a forum topic as read -func (client *Client) ReadAllMessageThreadMentions(req *ReadAllMessageThreadMentionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllMessageThreadMentions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type ReadAllChatReactionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Marks all reactions in a chat or a forum topic as read +// Marks all reactions in a chat as read func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9602,35 +9978,6 @@ func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*O return UnmarshalOk(result.Data) } -type ReadAllMessageThreadReactionsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message thread identifier in which reactions are marked as read - MessageThreadId int64 `json:"message_thread_id"` -} - -// Marks all reactions in a forum topic as read -func (client *Client) ReadAllMessageThreadReactions(req *ReadAllMessageThreadReactionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllMessageThreadReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -10773,11 +11120,40 @@ func (client *Client) DeleteChatBackground(req *DeleteChatBackgroundRequest) (*O return UnmarshalOk(result.Data) } +type GetGiftChatThemesRequest struct { + // 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 chat themes to return + Limit int32 `json:"limit"` +} + +// Returns available to the current user gift chat themes +func (client *Client) GetGiftChatThemes(req *GetGiftChatThemesRequest) (*GiftChatThemes, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftChatThemes", + }, + Data: map[string]interface{}{ + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftChatThemes(result.Data) +} + type SetChatThemeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Name of the new chat theme; pass an empty string to return the default theme - ThemeName string `json:"theme_name"` + // New chat theme; pass null to return the default theme + Theme InputChatTheme `json:"theme"` } // Changes the chat theme. Supported only in private and secret chats @@ -10788,7 +11164,7 @@ func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "theme_name": req.ThemeName, + "theme": req.Theme, }, }) if err != nil { @@ -10805,13 +11181,13 @@ func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { type SetChatDraftMessageRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the draft was changed - MessageThreadId int64 `json:"message_thread_id"` + // Topic in which the draft will be changed; pass null to change the draft for the chat itself + TopicId MessageTopic `json:"topic_id"` // New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored DraftMessage *DraftMessage `json:"draft_message"` } -// Changes the draft message in a chat +// Changes the draft message in a chat or a topic func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10819,7 +11195,7 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, + "topic_id": req.TopicId, "draft_message": req.DraftMessage, }, }) @@ -11188,7 +11564,7 @@ func (client *Client) SetChatLocation(req *SetChatLocationRequest) (*Ok, error) type SetChatSlowModeDelayRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 + // New slow mode delay for the chat, in seconds; must be one of 0, 5, 10, 30, 60, 300, 900, 3600 SlowModeDelay int32 `json:"slow_mode_delay"` } @@ -11304,35 +11680,6 @@ func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*O return UnmarshalOk(result.Data) } -type UnpinAllMessageThreadMessagesRequest struct { - // Identifier of the chat - ChatId int64 `json:"chat_id"` - // Message thread identifier in which messages will be unpinned - MessageThreadId int64 `json:"message_thread_id"` -} - -// Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup -func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "unpinAllMessageThreadMessages", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type JoinChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11485,7 +11832,7 @@ type BanChatMemberRequest struct { MemberId MessageSender `json:"member_id"` // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned BannedUntilDate int32 `json:"banned_until_date"` - // Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels + // Pass true to delete all messages in the chat for the user who is being removed. Always true for supergroups and channels RevokeMessages bool `json:"revoke_messages"` } @@ -11579,6 +11926,32 @@ func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) ( return UnmarshalOk(result.Data) } +type GetChatOwnerAfterLeavingRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the chat during that period; requires owner privileges in the chat. Available only for supergroups and channel chats +func (client *Client) GetChatOwnerAfterLeaving(req *GetChatOwnerAfterLeavingRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatOwnerAfterLeaving", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type GetChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11695,6 +12068,25 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } +// Returns the current state of stake dice +func (client *Client) GetStakeDiceState() (*StakeDiceState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStakeDiceState", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStakeDiceState(result.Data) +} + type GetSavedNotificationSoundRequest struct { // Identifier of the notification sound NotificationSoundId JsonInt64 `json:"notification_sound_id"` @@ -11987,7 +12379,7 @@ type ReadChatListRequest struct { ChatList ChatList `json:"chat_list"` } -// Traverse all chats in a chat list and marks all messages in the chats as read +// Traverses all chats in a chat list and marks all messages in the chats as read func (client *Client) ReadChatList(req *ReadChatListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12127,6 +12519,9 @@ func (client *Client) CanPostStory(req *CanPostStoryRequest) (CanPostStoryResult case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(result.Data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(result.Data) + default: return nil, errors.New("invalid type") } @@ -12143,6 +12538,8 @@ type PostStoryRequest struct { Caption *FormattedText `json:"caption"` // The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_size_max") stories + AlbumIds []int32 `json:"album_ids"` // 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; pass null if the story isn't repost of another story @@ -12165,6 +12562,7 @@ func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { "areas": req.Areas, "caption": req.Caption, "privacy_settings": req.PrivacySettings, + "album_ids": req.AlbumIds, "active_period": req.ActivePeriod, "from_story_full_id": req.FromStoryFullId, "is_posted_to_chat_page": req.IsPostedToChatPage, @@ -12182,6 +12580,56 @@ func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { return UnmarshalStory(result.Data) } +type StartLiveStoryRequest struct { + // Identifier of the chat that will start the live story. Pass Saved Messages chat identifier when starting a live story on behalf of the current user, or a channel chat identifier + ChatId int64 `json:"chat_id"` + // The privacy settings for the story; ignored for stories posted on behalf of channel chats + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Pass true if the content of the story must be protected from screenshotting + ProtectContent bool `json:"protect_content"` + // Pass true to create an RTMP stream instead of an ordinary group call + IsRtmpStream bool `json:"is_rtmp_stream"` + // Pass true to allow viewers of the story to send messages + EnableMessages bool `json:"enable_messages"` + // The minimum number of Telegram Stars that must be paid by viewers for each sent message to the call; 0-getOption("paid_group_call_message_star_count_max") + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Starts a new live story on behalf of a chat; requires can_post_stories administrator right for channel chats +func (client *Client) StartLiveStory(req *StartLiveStoryRequest) (StartLiveStoryResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "startLiveStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "privacy_settings": req.PrivacySettings, + "protect_content": req.ProtectContent, + "is_rtmp_stream": req.IsRtmpStream, + "enable_messages": req.EnableMessages, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(result.Data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type EditStoryRequest struct { // Identifier of the chat that posted the story StoryPosterChatId int64 `json:"story_poster_chat_id"` @@ -12259,7 +12707,7 @@ type SetStoryPrivacySettingsRequest struct { PrivacySettings StoryPrivacySettings `json:"privacy_settings"` } -// Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true +// Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_set_privacy_settings == true func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12630,7 +13078,7 @@ type SetStoryReactionRequest struct { UpdateRecentReactions bool `json:"update_recent_reactions"` } -// Changes chosen reaction on a story that has already been sent +// Changes chosen reaction on a story that has already been sent; not supported for live stories func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12840,6 +13288,285 @@ func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) return UnmarshalPublicForwards(result.Data) } +type GetChatStoryAlbumsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the list of story albums owned by the given chat +func (client *Client) GetChatStoryAlbums(req *GetChatStoryAlbumsRequest) (*StoryAlbums, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatStoryAlbums", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbums(result.Data) +} + +type GetStoryAlbumStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Story album identifier + StoryAlbumId int32 `json:"story_album_id"` + // Offset of the first entry to return; use 0 to get results from the first album story + Offset int32 `json:"offset"` + // The maximum number of stories to be returned. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns the list of stories added to the given story album. For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetStoryAlbumStories(req *GetStoryAlbumStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryAlbumStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type CreateStoryAlbumRequest struct { + // Identifier of the chat that posted the stories + StoryPosterChatId int64 `json:"story_poster_chat_id"` + // Name of the album; 1-12 characters + Name string `json:"name"` + // Identifiers of stories to add to the album; 0-getOption("story_album_size_max") identifiers + StoryIds []int32 `json:"story_ids"` +} + +// Creates an album of stories; requires can_edit_stories administrator right for supergroup and channel chats +func (client *Client) CreateStoryAlbum(req *CreateStoryAlbumRequest) (*StoryAlbum, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createStoryAlbum", + }, + Data: map[string]interface{}{ + "story_poster_chat_id": req.StoryPosterChatId, + "name": req.Name, + "story_ids": req.StoryIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbum(result.Data) +} + +type ReorderStoryAlbumsRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // New order of story albums + StoryAlbumIds []int32 `json:"story_album_ids"` +} + +// Changes order of story albums. If the albums are owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat +func (client *Client) ReorderStoryAlbums(req *ReorderStoryAlbumsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderStoryAlbums", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_ids": req.StoryAlbumIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStoryAlbumRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story album + StoryAlbumId int32 `json:"story_album_id"` +} + +// Deletes a story album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat +func (client *Client) DeleteStoryAlbum(req *DeleteStoryAlbumRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStoryAlbum", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStoryAlbumNameRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story album + StoryAlbumId int32 `json:"story_album_id"` + // New name of the album; 1-12 characters + Name string `json:"name"` +} + +// Changes name of an album of stories. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album +func (client *Client) SetStoryAlbumName(req *SetStoryAlbumNameRequest) (*StoryAlbum, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryAlbumName", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbum(result.Data) +} + +type AddStoryAlbumStoriesRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story album + StoryAlbumId int32 `json:"story_album_id"` + // Identifier of the stories to add to the album; 1-getOption("story_album_size_max") identifiers. If after addition the album has more than getOption("story_album_size_max") stories, then the last one are removed from the album + StoryIds []int32 `json:"story_ids"` +} + +// Adds stories to the beginning of a previously created story album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album +func (client *Client) AddStoryAlbumStories(req *AddStoryAlbumStoriesRequest) (*StoryAlbum, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addStoryAlbumStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + "story_ids": req.StoryIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbum(result.Data) +} + +type RemoveStoryAlbumStoriesRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story album + StoryAlbumId int32 `json:"story_album_id"` + // Identifier of the stories to remove from the album + StoryIds []int32 `json:"story_ids"` +} + +// Removes stories from an album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album +func (client *Client) RemoveStoryAlbumStories(req *RemoveStoryAlbumStoriesRequest) (*StoryAlbum, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeStoryAlbumStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + "story_ids": req.StoryIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbum(result.Data) +} + +type ReorderStoryAlbumStoriesRequest struct { + // Identifier of the chat that owns the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story album + StoryAlbumId int32 `json:"story_album_id"` + // Identifier of the stories to move to the beginning of the album. All other stories are placed in the current order after the specified stories + StoryIds []int32 `json:"story_ids"` +} + +// Changes order of stories in an album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album +func (client *Client) ReorderStoryAlbumStories(req *ReorderStoryAlbumStoriesRequest) (*StoryAlbum, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderStoryAlbumStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_album_id": req.StoryAlbumId, + "story_ids": req.StoryIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryAlbum(result.Data) +} + type GetChatBoostLevelFeaturesRequest struct { // Pass true to get the list of features for channels; pass false to get the list of features for supergroups IsChannel bool `json:"is_channel"` @@ -13429,7 +14156,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. In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message +// Preliminarily 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. In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -13825,7 +14552,7 @@ type SetApplicationVerificationTokenRequest struct { Token string `json:"token"` } -// Application or reCAPTCHA verification has been completed. Can be called before authorization +// Informs TDLib that application or reCAPTCHA verification has been completed. Can be called before authorization func (client *Client) SetApplicationVerificationToken(req *SetApplicationVerificationTokenRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14426,7 +15153,7 @@ func (client *Client) GetChatJoinRequests(req *GetChatJoinRequestsRequest) (*Cha type ProcessChatJoinRequestRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the user that sent the request + // Identifier of the user who sent the request UserId int64 `json:"user_id"` // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` @@ -14560,7 +15287,7 @@ type AddOfferRequest struct { Options *MessageSendOptions `json:"options"` } -// Sent a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. Returns the sent message +// Sends a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. Returns the sent message func (client *Client) AddOffer(req *AddOfferRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -14836,7 +15563,7 @@ func (client *Client) GetVideoChatAvailableParticipants(req *GetVideoChatAvailab type SetVideoChatDefaultParticipantRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Default group call participant identifier to join the video chats + // Default group call participant identifier to join the video chats in the chat DefaultParticipantId MessageSender `json:"default_participant_id"` } @@ -14975,6 +15702,58 @@ func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlReques return UnmarshalRtmpUrl(result.Data) } +type GetLiveStoryRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns RTMP URL for streaming to a live story; requires can_post_stories administrator right for channel chats +func (client *Client) GetLiveStoryRtmpUrl(req *GetLiveStoryRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + +type ReplaceLiveStoryRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Replaces the current RTMP URL for streaming to a live story; requires owner privileges for channel chats +func (client *Client) ReplaceLiveStoryRtmpUrl(req *ReplaceLiveStoryRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceLiveStoryRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15063,7 +15842,7 @@ type JoinGroupCallRequest struct { JoinParameters *GroupCallJoinParameters `json:"join_parameters"` } -// Joins a group call that is not bound to a chat +// Joins a regular group call that is not bound to a chat func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*GroupCallInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -15088,7 +15867,7 @@ func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*GroupCallInfo, type JoinVideoChatRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only + // Identifier of a group call participant, which will be used to join the call; pass null to join as self ParticipantId MessageSender `json:"participant_id"` // Parameters to join the call JoinParameters *GroupCallJoinParameters `json:"join_parameters"` @@ -15120,6 +15899,35 @@ func (client *Client) JoinVideoChat(req *JoinVideoChatRequest) (*Text, error) { return UnmarshalText(result.Data) } +type JoinLiveStoryRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Parameters to join the call + JoinParameters *GroupCallJoinParameters `json:"join_parameters"` +} + +// Joins a group call of an active live story. Returns join response payload for tgcalls +func (client *Client) JoinLiveStory(req *JoinLiveStoryRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "joinLiveStory", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "join_parameters": req.JoinParameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type StartGroupCallScreenSharingRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15129,7 +15937,7 @@ type StartGroupCallScreenSharingRequest struct { Payload string `json:"payload"` } -// Starts screen sharing in a joined group call. Returns join response payload for tgcalls +// Starts screen sharing in a joined group call; not supported in live stories. Returns join response payload for tgcalls func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenSharingRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -15159,7 +15967,7 @@ type ToggleGroupCallScreenSharingIsPausedRequest struct { IsPaused bool `json:"is_paused"` } -// Pauses or unpauses screen sharing in a joined group call +// Pauses or unpauses screen sharing in a joined group call; not supported in live stories func (client *Client) ToggleGroupCallScreenSharingIsPaused(req *ToggleGroupCallScreenSharingIsPausedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15186,7 +15994,7 @@ type EndGroupCallScreenSharingRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends screen sharing in a joined group call +// Ends screen sharing in a joined group call; not supported in live stories func (client *Client) EndGroupCallScreenSharing(req *EndGroupCallScreenSharingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15265,6 +16073,319 @@ func (client *Client) ToggleVideoChatMuteNewParticipants(req *ToggleVideoChatMut return UnmarshalOk(result.Data) } +type ToggleGroupCallAreMessagesAllowedRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New value of the are_messages_allowed setting + AreMessagesAllowed bool `json:"are_messages_allowed"` +} + +// Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_are_messages_allowed right +func (client *Client) ToggleGroupCallAreMessagesAllowed(req *ToggleGroupCallAreMessagesAllowedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallAreMessagesAllowed", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "are_messages_allowed": req.AreMessagesAllowed, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetLiveStoryStreamerRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about the user or the chat that streams to a live story; for live stories that aren't an RTMP stream only +func (client *Client) GetLiveStoryStreamer(req *GetLiveStoryStreamerRequest) (*GroupCallParticipant, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryStreamer", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallParticipant(result.Data) +} + +type GetLiveStoryAvailableMessageSendersRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns the list of message sender identifiers, on whose behalf messages can be sent to a live story +func (client *Client) GetLiveStoryAvailableMessageSenders(req *GetLiveStoryAvailableMessageSendersRequest) (*ChatMessageSenders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryAvailableMessageSenders", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatMessageSenders(result.Data) +} + +type SetLiveStoryMessageSenderRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New message sender for the group call + MessageSenderId MessageSender `json:"message_sender_id"` +} + +// Selects a message sender to send messages in a live story call +func (client *Client) SetLiveStoryMessageSender(req *SetLiveStoryMessageSenderRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setLiveStoryMessageSender", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "message_sender_id": req.MessageSenderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SendGroupCallMessageRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, which depends on paid_message_star_count. Can't contain line feeds for live stories + Text *FormattedText `json:"text"` + // The number of Telegram Stars the user agreed to pay to send the message; for live stories only; 0-getOption("paid_group_call_message_star_count_max"). Must be 0 for messages sent to live stories posted by the current user + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Sends a message to other participants of a group call. Requires groupCall.can_send_messages right +func (client *Client) SendGroupCallMessage(req *SendGroupCallMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendGroupCallMessage", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "text": req.Text, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddPendingLiveStoryReactionRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Number of Telegram Stars to be used for the reaction. The total number of pending paid reactions must not exceed getOption("paid_group_call_message_star_count_max") + StarCount int64 `json:"star_count"` +} + +// Adds pending paid reaction in a live story group call. Can't be used in live stories posted by the current user. Call commitPendingLiveStoryReactions or removePendingLiveStoryReactions to actually send all pending reactions when the undo timer is over or abort the sending +func (client *Client) AddPendingLiveStoryReaction(req *AddPendingLiveStoryReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addPendingLiveStoryReaction", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CommitPendingLiveStoryReactionsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Applies all pending paid reactions in a live story group call +func (client *Client) CommitPendingLiveStoryReactions(req *CommitPendingLiveStoryReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "commitPendingLiveStoryReactions", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemovePendingLiveStoryReactionsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Removes all pending paid reactions in a live story group call +func (client *Client) RemovePendingLiveStoryReactions(req *RemovePendingLiveStoryReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removePendingLiveStoryReactions", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteGroupCallMessagesRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Identifiers of the messages to be deleted + MessageIds []int32 `json:"message_ids"` + // Pass true to report the messages as spam + ReportSpam bool `json:"report_spam"` +} + +// Deletes messages in a group call; for live story calls only. Requires groupCallMessage.can_be_deleted right +func (client *Client) DeleteGroupCallMessages(req *DeleteGroupCallMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGroupCallMessages", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "message_ids": req.MessageIds, + "report_spam": req.ReportSpam, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteGroupCallMessagesBySenderRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Identifier of the sender of messages to delete + SenderId MessageSender `json:"sender_id"` + // Pass true to report the messages as spam + ReportSpam bool `json:"report_spam"` +} + +// Deletes all messages sent by the specified message sender in a group call; for live story calls only. Requires groupCall.can_delete_messages right +func (client *Client) DeleteGroupCallMessagesBySender(req *DeleteGroupCallMessagesBySenderRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGroupCallMessagesBySender", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "sender_id": req.SenderId, + "report_spam": req.ReportSpam, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetLiveStoryTopDonorsRequest struct { + // Group call identifier of the live story + GroupCallId int32 `json:"group_call_id"` +} + +// Returns the list of top live story donors +func (client *Client) GetLiveStoryTopDonors(req *GetLiveStoryTopDonorsRequest) (*LiveStoryDonors, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryTopDonors", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalLiveStoryDonors(result.Data) +} + type InviteGroupCallParticipantRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15573,6 +16694,35 @@ func (client *Client) ToggleGroupCallIsMyVideoEnabled(req *ToggleGroupCallIsMyVi return UnmarshalOk(result.Data) } +type SetGroupCallPaidMessageStarCountRequest struct { + // Group call identifier; must be an identifier of a live story call + GroupCallId int32 `json:"group_call_id"` + // The new minimum number of Telegram Stars; 0-getOption("paid_group_call_message_star_count_max") + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Changes the minimum number of Telegram Stars that must be paid by general participant for each sent message to a live story call. Requires groupCall.can_be_managed right +func (client *Client) SetGroupCallPaidMessageStarCount(req *SetGroupCallPaidMessageStarCountRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGroupCallPaidMessageStarCount", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetGroupCallParticipantIsSpeakingRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15623,7 +16773,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { IsMuted bool `json:"is_muted"` } -// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves; not supported for live stories func (client *Client) ToggleGroupCallParticipantIsMuted(req *ToggleGroupCallParticipantIsMutedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15655,7 +16805,7 @@ type SetGroupCallParticipantVolumeLevelRequest struct { VolumeLevel int32 `json:"volume_level"` } -// Changes volume level of a participant of an active group call. If the current user can manage the group call or is the owner of the group call, then the participant's volume level will be changed for all users with the default volume level +// Changes volume level of a participant of an active group call; not supported for live stories. If the current user can manage the group call or is the owner of the group call, then the participant's volume level will be changed for all users with the default volume level func (client *Client) SetGroupCallParticipantVolumeLevel(req *SetGroupCallParticipantVolumeLevelRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15746,7 +16896,7 @@ type LoadGroupCallParticipantsRequest struct { Limit int32 `json:"limit"` } -// Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded +// Loads more participants of a group call; not supported in live stories. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded func (client *Client) LoadGroupCallParticipants(req *LoadGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15799,7 +16949,7 @@ type EndGroupCallRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise +// Ends a group call. Requires groupCall.can_be_managed right for video chats and live stories or groupCall.is_owned otherwise func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15820,16 +16970,16 @@ func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetVideoChatStreamsRequest struct { +type GetGroupCallStreamsRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` } -// Returns information about available video chat streams -func (client *Client) GetVideoChatStreams(req *GetVideoChatStreamsRequest) (*VideoChatStreams, error) { +// Returns information about available streams in a video chat or a live story +func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getVideoChatStreams", + Type: "getGroupCallStreams", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -15843,10 +16993,10 @@ func (client *Client) GetVideoChatStreams(req *GetVideoChatStreamsRequest) (*Vid return nil, buildResponseError(result.Data) } - return UnmarshalVideoChatStreams(result.Data) + return UnmarshalGroupCallStreams(result.Data) } -type GetVideoChatStreamSegmentRequest struct { +type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // Point in time when the stream segment begins; Unix timestamp in milliseconds @@ -15859,11 +17009,11 @@ type GetVideoChatStreamSegmentRequest struct { VideoQuality GroupCallVideoQuality `json:"video_quality"` } -// Returns a file with a segment of a video chat stream in a modified OGG format for audio or MPEG-4 format for video -func (client *Client) GetVideoChatStreamSegment(req *GetVideoChatStreamSegmentRequest) (*Data, error) { +// Returns a file with a segment of a video chat or live story in a modified OGG format for audio or MPEG-4 format for video +func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRequest) (*Data, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getVideoChatStreamSegment", + Type: "getGroupCallStreamSegment", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16051,8 +17201,10 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored - Contact *Contact `json:"contact"` + // Identifier of the user + UserId int64 `json:"user_id"` + // The contact to add or edit; phone number may be empty and needs to be specified only if known + Contact *ImportedContact `json:"contact"` // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -16064,6 +17216,7 @@ func (client *Client) AddContact(req *AddContactRequest) (*Ok, error) { Type: "addContact", }, Data: map[string]interface{}{ + "user_id": req.UserId, "contact": req.Contact, "share_phone_number": req.SharePhoneNumber, }, @@ -16080,8 +17233,8 @@ func (client *Client) AddContact(req *AddContactRequest) (*Ok, error) { } type ImportContactsRequest struct { - // The list of contacts to import or edit; contacts' vCard are ignored and are not imported - Contacts []*Contact `json:"contacts"` + // The list of contacts to import or edit + Contacts []*ImportedContact `json:"contacts"` } // Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @@ -16199,8 +17352,8 @@ func (client *Client) GetImportedContactCount() (*Count, error) { } type ChangeImportedContactsRequest struct { - // The new list of contacts, contact's vCard are ignored and are not imported - Contacts []*Contact `json:"contacts"` + // The new list of contacts to import + Contacts []*ImportedContact `json:"contacts"` } // Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time @@ -16317,6 +17470,35 @@ func (client *Client) SetUserPersonalProfilePhoto(req *SetUserPersonalProfilePho return UnmarshalOk(result.Data) } +type SetUserNoteRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + Note *FormattedText `json:"note"` +} + +// Changes a note of a contact user +func (client *Client) SetUserNote(req *SetUserNoteRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUserNote", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "note": req.Note, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SuggestUserProfilePhotoRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -16346,6 +17528,35 @@ func (client *Client) SuggestUserProfilePhoto(req *SuggestUserProfilePhotoReques return UnmarshalOk(result.Data) } +type SuggestUserBirthdateRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Birthdate to suggest + Birthdate *Birthdate `json:"birthdate"` +} + +// Suggests a birthdate to another regular user with common messages and allowing non-paid messages +func (client *Client) SuggestUserBirthdate(req *SuggestUserBirthdateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "suggestUserBirthdate", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "birthdate": req.Birthdate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleBotCanManageEmojiStatusRequest struct { // User identifier of the bot BotUserId int64 `json:"bot_user_id"` @@ -16491,6 +17702,145 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C return UnmarshalChatPhotos(result.Data) } +type GetUserProfileAudiosRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // The number of audio files to skip; must be non-negative + Offset int32 `json:"offset"` + // The maximum number of audio files to be returned; up to 100 + Limit int32 `json:"limit"` +} + +// Returns the list of profile audio files of a user +func (client *Client) GetUserProfileAudios(req *GetUserProfileAudiosRequest) (*Audios, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserProfileAudios", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAudios(result.Data) +} + +type IsProfileAudioRequest struct { + // Identifier of the audio file to check + FileId int32 `json:"file_id"` +} + +// Checks whether a file is in the profile audio files of the current user. Returns a 404 error if it isn't +func (client *Client) IsProfileAudio(req *IsProfileAudioRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "isProfileAudio", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddProfileAudioRequest struct { + // Identifier of the audio file to be added. The file must have been uploaded to the server + FileId int32 `json:"file_id"` +} + +// Adds an audio file to the beginning of the profile audio files of the current user +func (client *Client) AddProfileAudio(req *AddProfileAudioRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addProfileAudio", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetProfileAudioPositionRequest struct { + // Identifier of the file from profile audio files, which position will be changed + FileId int32 `json:"file_id"` + // Identifier of the file from profile audio files after which the file will be positioned; pass 0 to move the file to the beginning of the list + AfterFileId int32 `json:"after_file_id"` +} + +// Changes position of an audio file in the profile audio files of the current user +func (client *Client) SetProfileAudioPosition(req *SetProfileAudioPositionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setProfileAudioPosition", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "after_file_id": req.AfterFileId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveProfileAudioRequest struct { + // Identifier of the audio file to be removed + FileId int32 `json:"file_id"` +} + +// Removes an audio file from the profile audio files of the current user +func (client *Client) RemoveProfileAudio(req *RemoveProfileAudioRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeProfileAudio", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetStickerOutlineRequest struct { // File identifier of the sticker StickerFileId int32 `json:"sticker_file_id"` @@ -16523,6 +17873,38 @@ func (client *Client) GetStickerOutline(req *GetStickerOutlineRequest) (*Outline return UnmarshalOutline(result.Data) } +type GetStickerOutlineSvgPathRequest struct { + // File identifier of the sticker + StickerFileId int32 `json:"sticker_file_id"` + // Pass true to get the outline scaled for animated emoji + ForAnimatedEmoji bool `json:"for_animated_emoji"` + // Pass true to get the outline scaled for clicked animated emoji message + ForClickedAnimatedEmojiMessage bool `json:"for_clicked_animated_emoji_message"` +} + +// Returns outline of a sticker as an SVG path. This is an offline method. Returns an empty string if the outline isn't known +func (client *Client) GetStickerOutlineSvgPath(req *GetStickerOutlineSvgPathRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStickerOutlineSvgPath", + }, + Data: map[string]interface{}{ + "sticker_file_id": req.StickerFileId, + "for_animated_emoji": req.ForAnimatedEmoji, + "for_clicked_animated_emoji_message": req.ForClickedAnimatedEmojiMessage, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type GetStickersRequest struct { // Type of the stickers to return StickerType StickerType `json:"sticker_type"` @@ -17267,7 +18649,7 @@ type GetKeywordEmojisRequest struct { InputLanguageCodes []string `json:"input_language_codes"` } -// Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +// Returns emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified func (client *Client) GetKeywordEmojis(req *GetKeywordEmojisRequest) (*Emojis, error) { result, err := client.Send(Request{ meta: meta{ @@ -17756,6 +19138,32 @@ func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetUpgradedGiftColorsRequest struct { + // Identifier of the upgradedGiftColors scheme to use + UpgradedGiftColorsId JsonInt64 `json:"upgraded_gift_colors_id"` +} + +// Changes color scheme for the current user based on an owned or a hosted upgraded gift; for Telegram Premium users only +func (client *Client) SetUpgradedGiftColors(req *SetUpgradedGiftColorsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUpgradedGiftColors", + }, + Data: map[string]interface{}{ + "upgraded_gift_colors_id": req.UpgradedGiftColorsId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + 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"` @@ -17947,6 +19355,32 @@ func (client *Client) SetBirthdate(req *SetBirthdateRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetMainProfileTabRequest struct { + // The new value of the main profile tab + MainProfileTab ProfileTab `json:"main_profile_tab"` +} + +// Changes the main profile tab of the current user +func (client *Client) SetMainProfileTab(req *SetMainProfileTabRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMainProfileTab", + }, + Data: map[string]interface{}{ + "main_profile_tab": req.MainProfileTab, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetPersonalChatRequest struct { // Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats ChatId int64 `json:"chat_id"` @@ -18270,7 +19704,7 @@ type CheckPhoneNumberCodeRequest struct { Code string `json:"code"` } -// Check the authentication code and completes the request for which the code was sent if appropriate +// Checks the authentication code and completes the request for which the code was sent if appropriate func (client *Client) CheckPhoneNumberCode(req *CheckPhoneNumberCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19032,7 +20466,7 @@ type DeleteBotMediaPreviewsRequest struct { FileIds []int32 `json:"file_ids"` } -// Delete media previews from the list of media previews of a bot +// Deletes media previews from the list of media previews of a bot func (client *Client) DeleteBotMediaPreviews(req *DeleteBotMediaPreviewsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19154,7 +20588,7 @@ type ToggleBotUsernameIsActiveRequest struct { IsActive bool `json:"is_active"` } -// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true +// Changes active state for a username of a bot. The editable username can be disabled only if there are other active usernames. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true func (client *Client) ToggleBotUsernameIsActive(req *ToggleBotUsernameIsActiveRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19830,6 +21264,35 @@ func (client *Client) SetSupergroupUnrestrictBoostCount(req *SetSupergroupUnrest return UnmarshalOk(result.Data) } +type SetSupergroupMainProfileTabRequest struct { + // Identifier of the channel + SupergroupId int64 `json:"supergroup_id"` + // The new value of the main profile tab + MainProfileTab ProfileTab `json:"main_profile_tab"` +} + +// Changes the main profile tab of the channel; requires can_change_info administrator right +func (client *Client) SetSupergroupMainProfileTab(req *SetSupergroupMainProfileTabRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setSupergroupMainProfileTab", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "main_profile_tab": req.MainProfileTab, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupSignMessagesRequest struct { // Identifier of the channel SupergroupId int64 `json:"supergroup_id"` @@ -19892,7 +21355,7 @@ func (client *Client) ToggleSupergroupJoinToSendMessages(req *ToggleSupergroupJo } type ToggleSupergroupJoinByRequestRequest struct { - // Identifier of the supergroup that isn't a broadcast group + // Identifier of the supergroup that isn't a broadcast group and isn't a channel direct message group SupergroupId int64 `json:"supergroup_id"` // New value of join_by_request JoinByRequest bool `json:"join_by_request"` @@ -20535,10 +21998,45 @@ func (client *Client) GetAvailableGifts() (*AvailableGifts, error) { return UnmarshalAvailableGifts(result.Data) } +type CanSendGiftRequest struct { + // Identifier of the gift to send + GiftId JsonInt64 `json:"gift_id"` +} + +// Checks whether a gift with next_send_date in the future can be sent already +func (client *Client) CanSendGift(req *CanSendGiftRequest) (CanSendGiftResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canSendGift", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanSendGiftResultOk: + return UnmarshalCanSendGiftResultOk(result.Data) + + case TypeCanSendGiftResultFail: + return UnmarshalCanSendGiftResultFail(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type SendGiftRequest struct { // Identifier of the gift to send GiftId JsonInt64 `json:"gift_id"` - // Identifier of the user or the channel chat that will receive the gift + // Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats OwnerId MessageSender `json:"owner_id"` // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages Text *FormattedText `json:"text"` @@ -20573,6 +22071,177 @@ func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetGiftAuctionStateRequest struct { + // Unique identifier of the auction + AuctionId string `json:"auction_id"` +} + +// Returns auction state for a gift +func (client *Client) GetGiftAuctionState(req *GetGiftAuctionStateRequest) (*GiftAuctionState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftAuctionState", + }, + Data: map[string]interface{}{ + "auction_id": req.AuctionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftAuctionState(result.Data) +} + +type GetGiftAuctionAcquiredGiftsRequest struct { + // Identifier of the auctioned gift + GiftId JsonInt64 `json:"gift_id"` +} + +// Returns the gifts that were acquired by the current user on a gift auction +func (client *Client) GetGiftAuctionAcquiredGifts(req *GetGiftAuctionAcquiredGiftsRequest) (*GiftAuctionAcquiredGifts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftAuctionAcquiredGifts", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftAuctionAcquiredGifts(result.Data) +} + +type OpenGiftAuctionRequest struct { + // Identifier of the gift, which auction was opened + GiftId JsonInt64 `json:"gift_id"` +} + +// Informs TDLib that a gift auction was opened by the user +func (client *Client) OpenGiftAuction(req *OpenGiftAuctionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openGiftAuction", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CloseGiftAuctionRequest struct { + // Identifier of the gift, which auction was closed + GiftId JsonInt64 `json:"gift_id"` +} + +// Informs TDLib that a gift auction was closed by the user +func (client *Client) CloseGiftAuction(req *CloseGiftAuctionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeGiftAuction", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type PlaceGiftAuctionBidRequest struct { + // Identifier of the gift to place the bid on + GiftId JsonInt64 `json:"gift_id"` + // The number of Telegram Stars to place in the bid + StarCount int64 `json:"star_count"` + // Identifier of the user who will receive the gift + UserId int64 `json:"user_id"` + // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages + Text *FormattedText `json:"text"` + // Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` +} + +// Places a bid on an auction gift +func (client *Client) PlaceGiftAuctionBid(req *PlaceGiftAuctionBidRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "placeGiftAuctionBid", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + "star_count": req.StarCount, + "user_id": req.UserId, + "text": req.Text, + "is_private": req.IsPrivate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type IncreaseGiftAuctionBidRequest struct { + // Identifier of the gift to put the bid on + GiftId JsonInt64 `json:"gift_id"` + // The number of Telegram Stars to put in the bid + StarCount int64 `json:"star_count"` +} + +// Increases a bid for an auction gift without changing gift text and receiver +func (client *Client) IncreaseGiftAuctionBid(req *IncreaseGiftAuctionBidRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "increaseGiftAuctionBid", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SellGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -20690,8 +22359,8 @@ func (client *Client) ToggleChatGiftNotifications(req *ToggleChatGiftNotificatio } type GetGiftUpgradePreviewRequest struct { - // Identifier of the gift - GiftId JsonInt64 `json:"gift_id"` + // Identifier of the regular gift + RegularGiftId JsonInt64 `json:"regular_gift_id"` } // Returns examples of possible upgraded gifts for a regular gift @@ -20701,7 +22370,7 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( Type: "getGiftUpgradePreview", }, Data: map[string]interface{}{ - "gift_id": req.GiftId, + "regular_gift_id": req.RegularGiftId, }, }) if err != nil { @@ -20715,6 +22384,38 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( return UnmarshalGiftUpgradePreview(result.Data) } +type GetUpgradedGiftVariantsRequest struct { + // Identifier of the regular gift + RegularGiftId JsonInt64 `json:"regular_gift_id"` + // Pass true to get models that can be obtained by upgrading a regular gift + ReturnUpgradeModels bool `json:"return_upgrade_models"` + // Pass true to get models that can be obtained by crafting a gift from upgraded gifts + ReturnCraftModels bool `json:"return_craft_models"` +} + +// Returns all possible variants of upgraded gifts for a regular gift +func (client *Client) GetUpgradedGiftVariants(req *GetUpgradedGiftVariantsRequest) (*GiftUpgradeVariants, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUpgradedGiftVariants", + }, + Data: map[string]interface{}{ + "regular_gift_id": req.RegularGiftId, + "return_upgrade_models": req.ReturnUpgradeModels, + "return_craft_models": req.ReturnCraftModels, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftUpgradeVariants(result.Data) +} + type UpgradeGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -20722,7 +22423,7 @@ type UpgradeGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Pass true to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails bool `json:"keep_original_details"` - // The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count + // The Telegram Star amount required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count StarCount int64 `json:"star_count"` } @@ -20750,6 +22451,79 @@ func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult, return UnmarshalUpgradeGiftResult(result.Data) } +type BuyGiftUpgradeRequest struct { + // Identifier of the user or the channel chat that owns the gift + OwnerId MessageSender `json:"owner_id"` + // Prepaid upgrade hash as received along with the gift + PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` + // The Telegram Star amount the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count + StarCount int64 `json:"star_count"` +} + +// Pays for upgrade of a regular gift that is owned by another user or channel chat +func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "buyGiftUpgrade", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "prepaid_upgrade_hash": req.PrepaidUpgradeHash, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CraftGiftRequest struct { + // Identifier of the gifts to use for crafting + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Crafts a new gift from other gifts that will be permanently lost +func (client *Client) CraftGift(req *CraftGiftRequest) (CraftGiftResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "craftGift", + }, + Data: map[string]interface{}{ + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(result.Data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(result.Data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(result.Data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type TransferGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -20757,11 +22531,11 @@ type TransferGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Identifier of the user or the channel chat that will receive the gift NewOwnerId MessageSender `json:"new_owner_id"` - // The amount of Telegram Stars required to pay for the transfer + // The Telegram Star amount required to pay for the transfer StarCount int64 `json:"star_count"` } -// Sends an upgraded gift to another user or a channel chat +// Sends an upgraded gift to another user or channel chat func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -20785,17 +22559,46 @@ func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type DropGiftOriginalDetailsRequest struct { + // Identifier of the gift + ReceivedGiftId string `json:"received_gift_id"` + // The Telegram Star amount required to pay for the operation + StarCount int64 `json:"star_count"` +} + +// Drops original details for an upgraded gift +func (client *Client) DropGiftOriginalDetails(req *DropGiftOriginalDetailsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "dropGiftOriginalDetails", + }, + Data: map[string]interface{}{ + "received_gift_id": req.ReceivedGiftId, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SendResoldGiftRequest struct { // Name of the upgraded gift to send GiftName string `json:"gift_name"` // Identifier of the user or the channel chat that will receive the gift OwnerId MessageSender `json:"owner_id"` - // The amount of Telegram Stars required to pay for the gift - StarCount int64 `json:"star_count"` + // The price that the user agreed to pay for the gift + Price GiftResalePrice `json:"price"` } // Sends an upgraded gift that is available for resale to another user or channel chat; gifts already owned by the current user must be transferred using transferGift and can't be passed to the method -func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (*Ok, error) { +func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (GiftResaleResult, error) { result, err := client.Send(Request{ meta: meta{ Type: "sendResoldGift", @@ -20803,7 +22606,83 @@ func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (*Ok, error) { Data: map[string]interface{}{ "gift_name": req.GiftName, "owner_id": req.OwnerId, - "star_count": req.StarCount, + "price": req.Price, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeGiftResaleResultOk: + return UnmarshalGiftResaleResultOk(result.Data) + + case TypeGiftResaleResultPriceIncreased: + return UnmarshalGiftResaleResultPriceIncreased(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type SendGiftPurchaseOfferRequest struct { + // Identifier of the user or the channel chat that currently owns the gift and will receive the offer + OwnerId MessageSender `json:"owner_id"` + // Name of the upgraded gift + GiftName string `json:"gift_name"` + // The price that the user agreed to pay for the gift + Price GiftResalePrice `json:"price"` + // Duration of the offer, in seconds; must be one of 21600, 43200, 86400, 129600, 172800, or 259200. Can also be 120 if Telegram test environment is used + Duration int32 `json:"duration"` + // The number of Telegram Stars the user agreed to pay additionally for sending of the offer message to the current gift owner; pass userFullInfo.outgoing_paid_message_star_count for users and 0 otherwise + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Sends an offer to purchase an upgraded gift +func (client *Client) SendGiftPurchaseOffer(req *SendGiftPurchaseOfferRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendGiftPurchaseOffer", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "gift_name": req.GiftName, + "price": req.Price, + "duration": req.Duration, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ProcessGiftPurchaseOfferRequest struct { + // Identifier of the message with the gift purchase offer + MessageId int64 `json:"message_id"` + // Pass true to accept the request; pass false to reject it + Accept bool `json:"accept"` +} + +// Handles a pending gift purchase offer +func (client *Client) ProcessGiftPurchaseOffer(req *ProcessGiftPurchaseOfferRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processGiftPurchaseOffer", + }, + Data: map[string]interface{}{ + "message_id": req.MessageId, + "accept": req.Accept, }, }) if err != nil { @@ -20822,16 +22701,24 @@ type GetReceivedGiftsRequest struct { BusinessConnectionId string `json:"business_connection_id"` // Identifier of the gift receiver OwnerId MessageSender `json:"owner_id"` + // Pass collection identifier to get gifts only from the specified collection; pass 0 to get gifts regardless of collections + CollectionId int32 `json:"collection_id"` // Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right ExcludeUnsaved bool `json:"exclude_unsaved"` // Pass true to exclude gifts that are saved to the chat's profile page. Always false for gifts received by other users and channel chats without can_post_messages administrator right ExcludeSaved bool `json:"exclude_saved"` // Pass true to exclude gifts that can be purchased unlimited number of times ExcludeUnlimited bool `json:"exclude_unlimited"` - // Pass true to exclude gifts that can be purchased limited number of times - ExcludeLimited bool `json:"exclude_limited"` + // Pass true to exclude gifts that can be purchased limited number of times and can be upgraded + ExcludeUpgradable bool `json:"exclude_upgradable"` + // Pass true to exclude gifts that can be purchased limited number of times and can't be upgraded + ExcludeNonUpgradable bool `json:"exclude_non_upgradable"` // Pass true to exclude upgraded gifts ExcludeUpgraded bool `json:"exclude_upgraded"` + // Pass true to exclude gifts that can't be used in setUpgradedGiftColors + ExcludeWithoutColors bool `json:"exclude_without_colors"` + // Pass true to exclude gifts that are just hosted and are not owned by the owner + ExcludeHosted bool `json:"exclude_hosted"` // Pass true to sort results by gift price instead of send date SortByPrice bool `json:"sort_by_price"` // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -20849,11 +22736,15 @@ func (client *Client) GetReceivedGifts(req *GetReceivedGiftsRequest) (*ReceivedG Data: map[string]interface{}{ "business_connection_id": req.BusinessConnectionId, "owner_id": req.OwnerId, + "collection_id": req.CollectionId, "exclude_unsaved": req.ExcludeUnsaved, "exclude_saved": req.ExcludeSaved, "exclude_unlimited": req.ExcludeUnlimited, - "exclude_limited": req.ExcludeLimited, + "exclude_upgradable": req.ExcludeUpgradable, + "exclude_non_upgradable": req.ExcludeNonUpgradable, "exclude_upgraded": req.ExcludeUpgraded, + "exclude_without_colors": req.ExcludeWithoutColors, + "exclude_hosted": req.ExcludeHosted, "sort_by_price": req.SortByPrice, "offset": req.Offset, "limit": req.Limit, @@ -20896,6 +22787,38 @@ func (client *Client) GetReceivedGift(req *GetReceivedGiftRequest) (*ReceivedGif return UnmarshalReceivedGift(result.Data) } +type GetGiftsForCraftingRequest struct { + // Identifier of the regular gift that will be used for crafting + RegularGiftId JsonInt64 `json:"regular_gift_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 gifts 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 upgraded gifts of the current user who can be used to craft another gifts +func (client *Client) GetGiftsForCrafting(req *GetGiftsForCraftingRequest) (*GiftsForCrafting, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftsForCrafting", + }, + Data: map[string]interface{}{ + "regular_gift_id": req.RegularGiftId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftsForCrafting(result.Data) +} + type GetUpgradedGiftRequest struct { // Unique name of the upgraded gift Name string `json:"name"` @@ -20922,6 +22845,32 @@ func (client *Client) GetUpgradedGift(req *GetUpgradedGiftRequest) (*UpgradedGif return UnmarshalUpgradedGift(result.Data) } +type GetUpgradedGiftValueInfoRequest struct { + // Unique name of the upgraded gift + Name string `json:"name"` +} + +// Returns information about value of an upgraded gift by its name +func (client *Client) GetUpgradedGiftValueInfo(req *GetUpgradedGiftValueInfoRequest) (*UpgradedGiftValueInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUpgradedGiftValueInfo", + }, + Data: map[string]interface{}{ + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUpgradedGiftValueInfo(result.Data) +} + type GetUpgradedGiftWithdrawalUrlRequest struct { // Identifier of the gift ReceivedGiftId string `json:"received_gift_id"` @@ -20951,11 +22900,30 @@ func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawa return UnmarshalHttpUrl(result.Data) } +// Returns promotional anumation for upgraded gifts +func (client *Client) GetUpgradedGiftsPromotionalAnimation() (*Animation, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUpgradedGiftsPromotionalAnimation", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAnimation(result.Data) +} + type SetGiftResalePriceRequest struct { // Identifier of the unique gift ReceivedGiftId string `json:"received_gift_id"` - // The new price for the unique gift; 0 or getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max"). Pass 0 to disallow gift resale. The current user will receive getOption("gift_resale_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift - ResaleStarCount int64 `json:"resale_star_count"` + // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_ton_earnings_per_mille") Toncoins for each 1000 Toncoins paid for the gift if the gift price is in Toncoins + Price GiftResalePrice `json:"price"` } // Changes resale price of a unique gift owned by the current user @@ -20966,7 +22934,7 @@ func (client *Client) SetGiftResalePrice(req *SetGiftResalePriceRequest) (*Ok, e }, Data: map[string]interface{}{ "received_gift_id": req.ReceivedGiftId, - "resale_star_count": req.ResaleStarCount, + "price": req.Price, }, }) if err != nil { @@ -20985,6 +22953,8 @@ type SearchGiftsForResaleRequest struct { GiftId JsonInt64 `json:"gift_id"` // Order in which the results will be sorted Order GiftForResaleOrder `json:"order"` + // Pass true to get only gifts suitable for crafting + ForCrafting bool `json:"for_crafting"` // Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. If none attributes of specific type are specified, then all values for this attribute type are allowed Attributes []UpgradedGiftAttributeId `json:"attributes"` // Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results @@ -21002,6 +22972,7 @@ func (client *Client) SearchGiftsForResale(req *SearchGiftsForResaleRequest) (*G Data: map[string]interface{}{ "gift_id": req.GiftId, "order": req.Order, + "for_crafting": req.ForCrafting, "attributes": req.Attributes, "offset": req.Offset, "limit": req.Limit, @@ -21018,6 +22989,250 @@ func (client *Client) SearchGiftsForResale(req *SearchGiftsForResaleRequest) (*G return UnmarshalGiftsForResale(result.Data) } +type GetGiftCollectionsRequest struct { + // Identifier of the user or the channel chat that received the gifts + OwnerId MessageSender `json:"owner_id"` +} + +// Returns collections of gifts owned by the given user or chat +func (client *Client) GetGiftCollections(req *GetGiftCollectionsRequest) (*GiftCollections, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftCollections", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollections(result.Data) +} + +type CreateGiftCollectionRequest struct { + // Identifier of the user or the channel chat that received the gifts + OwnerId MessageSender `json:"owner_id"` + // Name of the collection; 1-12 characters + Name string `json:"name"` + // Identifier of the gifts to add to the collection; 0-getOption("gift_collection_size_max") identifiers + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Creates a collection from gifts on the current user's or a channel's profile page; requires can_post_messages administrator right in the channel chat. An owner can have up to getOption("gift_collection_count_max") gift collections. The new collection will be added to the end of the gift collection list of the owner. Returns the created collection +func (client *Client) CreateGiftCollection(req *CreateGiftCollectionRequest) (*GiftCollection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createGiftCollection", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "name": req.Name, + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollection(result.Data) +} + +type ReorderGiftCollectionsRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // New order of gift collections + CollectionIds []int32 `json:"collection_ids"` +} + +// Changes order of gift collections. If the collections are owned by a channel chat, then requires can_post_messages administrator right in the channel chat +func (client *Client) ReorderGiftCollections(req *ReorderGiftCollectionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderGiftCollections", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_ids": req.CollectionIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteGiftCollectionRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // Identifier of the gift collection + CollectionId int32 `json:"collection_id"` +} + +// Deletes a gift collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat +func (client *Client) DeleteGiftCollection(req *DeleteGiftCollectionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGiftCollection", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_id": req.CollectionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetGiftCollectionNameRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // Identifier of the gift collection + CollectionId int32 `json:"collection_id"` + // New name of the collection; 1-12 characters + Name string `json:"name"` +} + +// Changes name of a gift collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection +func (client *Client) SetGiftCollectionName(req *SetGiftCollectionNameRequest) (*GiftCollection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGiftCollectionName", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_id": req.CollectionId, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollection(result.Data) +} + +type AddGiftCollectionGiftsRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // Identifier of the gift collection + CollectionId int32 `json:"collection_id"` + // Identifier of the gifts to add to the collection; 1-getOption("gift_collection_size_max") identifiers. If after addition the collection has more than getOption("gift_collection_size_max") gifts, then the last one are removed from the collection + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Adds gifts to the beginning of a previously created collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection +func (client *Client) AddGiftCollectionGifts(req *AddGiftCollectionGiftsRequest) (*GiftCollection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addGiftCollectionGifts", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_id": req.CollectionId, + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollection(result.Data) +} + +type RemoveGiftCollectionGiftsRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // Identifier of the gift collection + CollectionId int32 `json:"collection_id"` + // Identifier of the gifts to remove from the collection + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Removes gifts from a collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection +func (client *Client) RemoveGiftCollectionGifts(req *RemoveGiftCollectionGiftsRequest) (*GiftCollection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeGiftCollectionGifts", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_id": req.CollectionId, + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollection(result.Data) +} + +type ReorderGiftCollectionGiftsRequest struct { + // Identifier of the user or the channel chat that owns the collection + OwnerId MessageSender `json:"owner_id"` + // Identifier of the gift collection + CollectionId int32 `json:"collection_id"` + // Identifier of the gifts to move to the beginning of the collection. All other gifts are placed in the current order after the specified gifts + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Changes order of gifts in a collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection +func (client *Client) ReorderGiftCollectionGifts(req *ReorderGiftCollectionGiftsRequest) (*GiftCollection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderGiftCollectionGifts", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "collection_id": req.CollectionId, + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftCollection(result.Data) +} + type CreateInvoiceLinkRequest struct { // Unique identifier of business connection on behalf of which to send the request BusinessConnectionId string `json:"business_connection_id"` @@ -21048,7 +23263,7 @@ func (client *Client) CreateInvoiceLink(req *CreateInvoiceLinkRequest) (*HttpUrl } type RefundStarPaymentRequest struct { - // Identifier of the user that did the payment + // Identifier of the user who did the payment UserId int64 `json:"user_id"` // Telegram payment identifier TelegramPaymentChargeId string `json:"telegram_payment_charge_id"` @@ -21076,7 +23291,7 @@ func (client *Client) RefundStarPayment(req *RefundStarPaymentRequest) (*Ok, err return UnmarshalOk(result.Data) } -// Returns a user that can be contacted to get support +// Returns a user who can be contacted to get support func (client *Client) GetSupportUser() (*User, error) { result, err := client.Send(Request{ meta: meta{ @@ -21841,7 +24056,7 @@ type SetChatPaidMessageStarCountRequest struct { PaidMessageStarCount int64 `json:"paid_message_star_count"` } -// Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages +// Changes the Telegram Star amount that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages func (client *Client) SetChatPaidMessageStarCount(req *SetChatPaidMessageStarCountRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -21870,7 +24085,7 @@ type CanSendMessageToUserRequest struct { OnlyLocal bool `json:"only_local"` } -// Check whether the current user can message another user or try to create a chat with them +// Checks whether the current user can message another user or try to create a chat with them func (client *Client) CanSendMessageToUser(req *CanSendMessageToUserRequest) (CanSendMessageToUserResult, error) { result, err := client.Send(Request{ meta: meta{ @@ -22453,6 +24668,58 @@ func (client *Client) GetStarAdAccountUrl(req *GetStarAdAccountUrlRequest) (*Htt return UnmarshalHttpUrl(result.Data) } +type GetTonRevenueStatisticsRequest struct { + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed Toncoin revenue statistics of the current user +func (client *Client) GetTonRevenueStatistics(req *GetTonRevenueStatisticsRequest) (*TonRevenueStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonRevenueStatistics", + }, + Data: map[string]interface{}{ + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonRevenueStatistics(result.Data) +} + +type GetTonWithdrawalUrlRequest struct { + // The 2-step verification password of the current user + Password string `json:"password"` +} + +// Returns a URL for Toncoin withdrawal from the current user's account. The user must have at least 10 toncoins to withdraw and can withdraw up to 100000 Toncoins in one transaction +func (client *Client) GetTonWithdrawalUrl(req *GetTonWithdrawalUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWithdrawalUrl", + }, + Data: map[string]interface{}{ + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -23187,7 +25454,7 @@ type SetPassportElementErrorsRequest struct { Errors []*InputPassportElementError `json:"errors"` } -// Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed +// Informs the user who some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed func (client *Client) SetPassportElementErrors(req *SetPassportElementErrorsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -24177,7 +26444,7 @@ type CheckPremiumGiftCodeRequest struct { Code string `json:"code"` } -// Return information about a Telegram Premium gift code +// Returns information about a Telegram Premium gift code func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -24352,7 +26619,7 @@ func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { } type GetStarGiftPaymentOptionsRequest struct { - // Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user + // Identifier of the user who will receive Telegram Stars; pass 0 to get options for an unspecified user UserId int64 `json:"user_id"` } @@ -24763,7 +27030,7 @@ type GetConnectedAffiliateProgramRequest struct { BotUserId int64 `json:"bot_user_id"` } -// Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program +// Returns an affiliate program that was connected to the given affiliate by identifier of the bot that created the program func (client *Client) GetConnectedAffiliateProgram(req *GetConnectedAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) { result, err := client.Send(Request{ meta: meta{ @@ -25235,27 +27502,21 @@ func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { } type AddProxyRequest struct { - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` + // The proxy to add + Proxy *Proxy `json:"proxy"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` - // Proxy type - Type ProxyType `json:"type"` } // Adds a proxy server for network requests. Can be called before authorization -func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { +func (client *Client) AddProxy(req *AddProxyRequest) (*AddedProxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "addProxy", }, Data: map[string]interface{}{ - "server": req.Server, - "port": req.Port, + "proxy": req.Proxy, "enable": req.Enable, - "type": req.Type, }, }) if err != nil { @@ -25266,34 +27527,28 @@ func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxy(result.Data) + return UnmarshalAddedProxy(result.Data) } type EditProxyRequest struct { // Proxy identifier ProxyId int32 `json:"proxy_id"` - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` + // The new information about the proxy + Proxy *Proxy `json:"proxy"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` - // Proxy type - Type ProxyType `json:"type"` } // Edits an existing proxy server for network requests. Can be called before authorization -func (client *Client) EditProxy(req *EditProxyRequest) (*Proxy, error) { +func (client *Client) EditProxy(req *EditProxyRequest) (*AddedProxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "editProxy", }, Data: map[string]interface{}{ "proxy_id": req.ProxyId, - "server": req.Server, - "port": req.Port, + "proxy": req.Proxy, "enable": req.Enable, - "type": req.Type, }, }) if err != nil { @@ -25304,7 +27559,7 @@ func (client *Client) EditProxy(req *EditProxyRequest) (*Proxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxy(result.Data) + return UnmarshalAddedProxy(result.Data) } type EnableProxyRequest struct { @@ -25379,7 +27634,7 @@ func (client *Client) RemoveProxy(req *RemoveProxyRequest) (*Ok, error) { } // Returns the list of proxies that are currently set up. Can be called before authorization -func (client *Client) GetProxies() (*Proxies, error) { +func (client *Client) GetProxies() (*AddedProxies, error) { result, err := client.Send(Request{ meta: meta{ Type: "getProxies", @@ -25394,38 +27649,12 @@ func (client *Client) GetProxies() (*Proxies, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxies(result.Data) -} - -type GetProxyLinkRequest struct { - // Proxy identifier - ProxyId int32 `json:"proxy_id"` -} - -// Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization -func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getProxyLink", - }, - Data: map[string]interface{}{ - "proxy_id": req.ProxyId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalHttpUrl(result.Data) + return UnmarshalAddedProxies(result.Data) } type PingProxyRequest struct { - // Proxy identifier. Use 0 to ping a Telegram server without a proxy - ProxyId int32 `json:"proxy_id"` + // The proxy to test; pass null to ping a Telegram server without a proxy + Proxy *Proxy `json:"proxy"` } // Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @@ -25435,7 +27664,7 @@ func (client *Client) PingProxy(req *PingProxyRequest) (*Seconds, error) { Type: "pingProxy", }, Data: map[string]interface{}{ - "proxy_id": req.ProxyId, + "proxy": req.Proxy, }, }) if err != nil { @@ -25989,12 +28218,8 @@ func (client *Client) TestNetwork() (*Ok, error) { } type TestProxyRequest struct { - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Proxy type - Type ProxyType `json:"type"` + // The proxy to test + Proxy *Proxy `json:"proxy"` // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request @@ -26008,9 +28233,7 @@ func (client *Client) TestProxy(req *TestProxyRequest) (*Ok, error) { Type: "testProxy", }, Data: map[string]interface{}{ - "server": req.Server, - "port": req.Port, - "type": req.Type, + "proxy": req.Proxy, "dc_id": req.DcId, "timeout": req.Timeout, }, @@ -26269,6 +28492,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(result.Data) + case TypeUpdatePendingTextMessage: + return UnmarshalUpdatePendingTextMessage(result.Data) + case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(result.Data) @@ -26338,9 +28564,30 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(result.Data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(result.Data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(result.Data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(result.Data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(result.Data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(result.Data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(result.Data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(result.Data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(result.Data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(result.Data) @@ -26371,6 +28618,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) @@ -26398,8 +28648,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(result.Data) - case TypeUpdateChatThemes: - return UnmarshalUpdateChatThemes(result.Data) + case TypeUpdateEmojiChatThemes: + return UnmarshalUpdateEmojiChatThemes(result.Data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(result.Data) @@ -26416,6 +28666,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(result.Data) + case TypeUpdateAgeVerificationParameters: + return UnmarshalUpdateAgeVerificationParameters(result.Data) + case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(result.Data) @@ -26458,12 +28711,21 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(result.Data) + case TypeUpdateTonRevenueStatus: + return UnmarshalUpdateTonRevenueStatus(result.Data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(result.Data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(result.Data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(result.Data) diff --git a/client/type.go b/client/type.go index a98e665..feb0c58 100755 --- a/client/type.go +++ b/client/type.go @@ -19,23 +19,32 @@ const ( ClassStickerType = "StickerType" ClassStickerFullType = "StickerFullType" ClassPollType = "PollType" + ClassProfileTab = "ProfileTab" ClassUserType = "UserType" ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule" ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" + ClassGiftResalePrice = "GiftResalePrice" + ClassGiftPurchaseOfferState = "GiftPurchaseOfferState" ClassSuggestedPostPrice = "SuggestedPostPrice" ClassSuggestedPostState = "SuggestedPostState" ClassSuggestedPostRefundReason = "SuggestedPostRefundReason" ClassStarSubscriptionType = "StarSubscriptionType" ClassAffiliateType = "AffiliateType" ClassAffiliateProgramSortOrder = "AffiliateProgramSortOrder" + ClassCanSendGiftResult = "CanSendGiftResult" ClassUpgradedGiftOrigin = "UpgradedGiftOrigin" + ClassUpgradedGiftAttributeRarity = "UpgradedGiftAttributeRarity" + ClassCraftGiftResult = "CraftGiftResult" ClassUpgradedGiftAttributeId = "UpgradedGiftAttributeId" ClassGiftForResaleOrder = "GiftForResaleOrder" + ClassGiftResaleResult = "GiftResaleResult" ClassSentGift = "SentGift" + ClassAuctionState = "AuctionState" ClassTransactionDirection = "TransactionDirection" ClassStarTransactionType = "StarTransactionType" ClassTonTransactionType = "TonTransactionType" + ClassActiveStoryState = "ActiveStoryState" ClassGiveawayParticipantStatus = "GiveawayParticipantStatus" ClassGiveawayInfo = "GiveawayInfo" ClassGiveawayPrize = "GiveawayPrize" @@ -65,12 +74,14 @@ const ( ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" + ClassButtonStyle = "ButtonStyle" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" ClassReplyMarkup = "ReplyMarkup" ClassLoginUrlInfo = "LoginUrlInfo" ClassWebAppOpenMode = "WebAppOpenMode" ClassSavedMessagesTopicType = "SavedMessagesTopicType" + ClassBuiltInTheme = "BuiltInTheme" ClassRichText = "RichText" ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" @@ -103,6 +114,7 @@ const ( ClassEmojiCategoryType = "EmojiCategoryType" ClassStoryAreaType = "StoryAreaType" ClassInputStoryAreaType = "InputStoryAreaType" + ClassStoryContentType = "StoryContentType" ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" @@ -143,7 +155,10 @@ const ( ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" ClassInputBackground = "InputBackground" + ClassChatTheme = "ChatTheme" + ClassInputChatTheme = "InputChatTheme" ClassCanPostStoryResult = "CanPostStoryResult" + ClassStartLiveStoryResult = "StartLiveStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -162,6 +177,7 @@ const ( ClassReportReason = "ReportReason" ClassReportChatResult = "ReportChatResult" ClassReportStoryResult = "ReportStoryResult" + ClassSettingsSection = "SettingsSection" ClassInternalLinkType = "InternalLinkType" ClassBlockList = "BlockList" ClassFileType = "FileType" @@ -192,6 +208,8 @@ const ( ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" ClassTermsOfService = "TermsOfService" + ClassPasskey = "Passkey" + ClassPasskeys = "Passkeys" ClassPasswordState = "PasswordState" ClassRecoveryEmailAddress = "RecoveryEmailAddress" ClassTemporaryPasswordState = "TemporaryPasswordState" @@ -211,6 +229,7 @@ const ( ClassInputChecklist = "InputChecklist" ClassAnimation = "Animation" ClassAudio = "Audio" + ClassAudios = "Audios" ClassDocument = "Document" ClassPhoto = "Photo" ClassSticker = "Sticker" @@ -222,6 +241,7 @@ const ( ClassLocation = "Location" ClassVenue = "Venue" ClassGame = "Game" + ClassStakeDiceState = "StakeDiceState" ClassWebApp = "WebApp" ClassPoll = "Poll" ClassAlternativeVideo = "AlternativeVideo" @@ -289,16 +309,25 @@ const ( ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions" ClassAcceptedGiftTypes = "AcceptedGiftTypes" ClassGiftSettings = "GiftSettings" + ClassGiftAuction = "GiftAuction" + ClassGiftBackground = "GiftBackground" + ClassGiftPurchaseLimits = "GiftPurchaseLimits" + ClassGiftResaleParameters = "GiftResaleParameters" + ClassGiftCollection = "GiftCollection" + ClassGiftCollections = "GiftCollections" ClassUpgradedGiftModel = "UpgradedGiftModel" ClassUpgradedGiftSymbol = "UpgradedGiftSymbol" ClassUpgradedGiftBackdropColors = "UpgradedGiftBackdropColors" ClassUpgradedGiftBackdrop = "UpgradedGiftBackdrop" ClassUpgradedGiftOriginalDetails = "UpgradedGiftOriginalDetails" + ClassUpgradedGiftColors = "UpgradedGiftColors" ClassGift = "Gift" ClassUpgradedGift = "UpgradedGift" + ClassUpgradedGiftValueInfo = "UpgradedGiftValueInfo" ClassUpgradeGiftResult = "UpgradeGiftResult" ClassAvailableGift = "AvailableGift" ClassAvailableGifts = "AvailableGifts" + ClassGiftUpgradePrice = "GiftUpgradePrice" ClassUpgradedGiftModelCount = "UpgradedGiftModelCount" ClassUpgradedGiftSymbolCount = "UpgradedGiftSymbolCount" ClassUpgradedGiftBackdropCount = "UpgradedGiftBackdropCount" @@ -306,7 +335,16 @@ const ( ClassGiftsForResale = "GiftsForResale" ClassReceivedGift = "ReceivedGift" ClassReceivedGifts = "ReceivedGifts" + ClassAttributeCraftPersistenceProbability = "AttributeCraftPersistenceProbability" + ClassGiftsForCrafting = "GiftsForCrafting" ClassGiftUpgradePreview = "GiftUpgradePreview" + ClassGiftUpgradeVariants = "GiftUpgradeVariants" + ClassAuctionBid = "AuctionBid" + ClassUserAuctionBid = "UserAuctionBid" + ClassAuctionRound = "AuctionRound" + ClassGiftAuctionState = "GiftAuctionState" + ClassGiftAuctionAcquiredGift = "GiftAuctionAcquiredGift" + ClassGiftAuctionAcquiredGifts = "GiftAuctionAcquiredGifts" ClassStarTransaction = "StarTransaction" ClassStarTransactions = "StarTransactions" ClassTonTransaction = "TonTransaction" @@ -314,6 +352,8 @@ const ( ClassAccentColor = "AccentColor" ClassProfileAccentColors = "ProfileAccentColors" ClassProfileAccentColor = "ProfileAccentColor" + ClassUserRating = "UserRating" + ClassRestrictionInfo = "RestrictionInfo" ClassEmojiStatus = "EmojiStatus" ClassEmojiStatuses = "EmojiStatuses" ClassEmojiStatusCustomEmojis = "EmojiStatusCustomEmojis" @@ -343,6 +383,7 @@ const ( ClassSupergroup = "Supergroup" ClassSupergroupFullInfo = "SupergroupFullInfo" ClassSecretChat = "SecretChat" + ClassPublicPostSearchLimits = "PublicPostSearchLimits" ClassMessageSenders = "MessageSenders" ClassChatMessageSender = "ChatMessageSender" ClassChatMessageSenders = "ChatMessageSenders" @@ -350,6 +391,7 @@ const ( ClassMessageViewers = "MessageViewers" ClassForwardSource = "ForwardSource" ClassPaidReactor = "PaidReactor" + ClassLiveStoryDonors = "LiveStoryDonors" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" @@ -365,6 +407,7 @@ const ( ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" ClassFoundChatMessages = "FoundChatMessages" + ClassFoundPublicPosts = "FoundPublicPosts" ClassMessagePosition = "MessagePosition" ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" @@ -493,6 +536,8 @@ const ( ClassStory = "Story" ClassStories = "Stories" ClassFoundStories = "FoundStories" + ClassStoryAlbum = "StoryAlbum" + ClassStoryAlbums = "StoryAlbums" ClassStoryFullId = "StoryFullId" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" @@ -518,8 +563,8 @@ const ( ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" ClassGroupCallJoinParameters = "GroupCallJoinParameters" - ClassVideoChatStream = "VideoChatStream" - ClassVideoChatStreams = "VideoChatStreams" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" @@ -528,6 +573,8 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassGroupCallParticipants = "GroupCallParticipants" ClassGroupCallInfo = "GroupCallInfo" + ClassGroupCallMessage = "GroupCallMessage" + ClassGroupCallMessageLevel = "GroupCallMessageLevel" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" ClassAddedReaction = "AddedReaction" @@ -536,6 +583,7 @@ const ( ClassAvailableReactions = "AvailableReactions" ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" + ClassImportedContact = "ImportedContact" ClassImportedContacts = "ImportedContacts" ClassBusinessConnection = "BusinessConnection" ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" @@ -566,7 +614,9 @@ const ( ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation" ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" - ClassChatTheme = "ChatTheme" + ClassEmojiChatTheme = "EmojiChatTheme" + ClassGiftChatTheme = "GiftChatTheme" + ClassGiftChatThemes = "GiftChatThemes" ClassTimeZone = "TimeZone" ClassTimeZones = "TimeZones" ClassHashtags = "Hashtags" @@ -574,6 +624,7 @@ const ( ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" + ClassProxy = "Proxy" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassReadDatePrivacySettings = "ReadDatePrivacySettings" @@ -600,6 +651,7 @@ const ( ClassScopeAutosaveSettings = "ScopeAutosaveSettings" ClassAutosaveSettingsException = "AutosaveSettingsException" ClassAutosaveSettings = "AutosaveSettings" + ClassAgeVerificationParameters = "AgeVerificationParameters" ClassFoundPosition = "FoundPosition" ClassFoundPositions = "FoundPositions" ClassTMeUrl = "TMeUrl" @@ -611,8 +663,8 @@ const ( ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassStarCount = "StarCount" ClassDeepLinkInfo = "DeepLinkInfo" - ClassProxy = "Proxy" - ClassProxies = "Proxies" + ClassAddedProxy = "AddedProxy" + ClassAddedProxies = "AddedProxies" ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" @@ -628,6 +680,8 @@ const ( ClassChatRevenueTransactions = "ChatRevenueTransactions" ClassStarRevenueStatus = "StarRevenueStatus" ClassStarRevenueStatistics = "StarRevenueStatistics" + ClassTonRevenueStatus = "TonRevenueStatus" + ClassTonRevenueStatistics = "TonRevenueStatistics" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -666,6 +720,8 @@ const ( TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" TypeTermsOfService = "termsOfService" + TypePasskey = "passkey" + TypePasskeys = "passkeys" TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitPremiumPurchase = "authorizationStateWaitPremiumPurchase" @@ -726,6 +782,7 @@ const ( TypeInputChecklist = "inputChecklist" TypeAnimation = "animation" TypeAudio = "audio" + TypeAudios = "audios" TypeDocument = "document" TypePhoto = "photo" TypeSticker = "sticker" @@ -737,6 +794,7 @@ const ( TypeLocation = "location" TypeVenue = "venue" TypeGame = "game" + TypeStakeDiceState = "stakeDiceState" TypeWebApp = "webApp" TypePoll = "poll" TypeAlternativeVideo = "alternativeVideo" @@ -746,6 +804,14 @@ const ( TypeChatBackground = "chatBackground" TypeProfilePhoto = "profilePhoto" TypeChatPhotoInfo = "chatPhotoInfo" + TypeProfileTabPosts = "profileTabPosts" + TypeProfileTabGifts = "profileTabGifts" + TypeProfileTabMedia = "profileTabMedia" + TypeProfileTabFiles = "profileTabFiles" + TypeProfileTabLinks = "profileTabLinks" + TypeProfileTabMusic = "profileTabMusic" + TypeProfileTabVoice = "profileTabVoice" + TypeProfileTabGifs = "profileTabGifs" TypeUserTypeRegular = "userTypeRegular" TypeUserTypeDeleted = "userTypeDeleted" TypeUserTypeBot = "userTypeBot" @@ -789,6 +855,11 @@ const ( TypeInputChatPhotoSticker = "inputChatPhotoSticker" TypeChatPermissions = "chatPermissions" TypeChatAdministratorRights = "chatAdministratorRights" + TypeGiftResalePriceStar = "giftResalePriceStar" + TypeGiftResalePriceTon = "giftResalePriceTon" + TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" + TypeGiftPurchaseOfferStateAccepted = "giftPurchaseOfferStateAccepted" + TypeGiftPurchaseOfferStateRejected = "giftPurchaseOfferStateRejected" TypeSuggestedPostPriceStar = "suggestedPostPriceStar" TypeSuggestedPostPriceTon = "suggestedPostPriceTon" TypeSuggestedPostStatePending = "suggestedPostStatePending" @@ -832,19 +903,43 @@ const ( TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions" TypeAcceptedGiftTypes = "acceptedGiftTypes" TypeGiftSettings = "giftSettings" + TypeGiftAuction = "giftAuction" + TypeGiftBackground = "giftBackground" + TypeGiftPurchaseLimits = "giftPurchaseLimits" + TypeGiftResaleParameters = "giftResaleParameters" + TypeGiftCollection = "giftCollection" + TypeGiftCollections = "giftCollections" + TypeCanSendGiftResultOk = "canSendGiftResultOk" + TypeCanSendGiftResultFail = "canSendGiftResultFail" TypeUpgradedGiftOriginUpgrade = "upgradedGiftOriginUpgrade" TypeUpgradedGiftOriginTransfer = "upgradedGiftOriginTransfer" TypeUpgradedGiftOriginResale = "upgradedGiftOriginResale" + TypeUpgradedGiftOriginBlockchain = "upgradedGiftOriginBlockchain" + TypeUpgradedGiftOriginPrepaidUpgrade = "upgradedGiftOriginPrepaidUpgrade" + TypeUpgradedGiftOriginOffer = "upgradedGiftOriginOffer" + TypeUpgradedGiftOriginCraft = "upgradedGiftOriginCraft" + TypeUpgradedGiftAttributeRarityPerMille = "upgradedGiftAttributeRarityPerMille" + TypeUpgradedGiftAttributeRarityUncommon = "upgradedGiftAttributeRarityUncommon" + TypeUpgradedGiftAttributeRarityRare = "upgradedGiftAttributeRarityRare" + TypeUpgradedGiftAttributeRarityEpic = "upgradedGiftAttributeRarityEpic" + TypeUpgradedGiftAttributeRarityLegendary = "upgradedGiftAttributeRarityLegendary" TypeUpgradedGiftModel = "upgradedGiftModel" TypeUpgradedGiftSymbol = "upgradedGiftSymbol" TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors" TypeUpgradedGiftBackdrop = "upgradedGiftBackdrop" TypeUpgradedGiftOriginalDetails = "upgradedGiftOriginalDetails" + TypeUpgradedGiftColors = "upgradedGiftColors" TypeGift = "gift" TypeUpgradedGift = "upgradedGift" + TypeUpgradedGiftValueInfo = "upgradedGiftValueInfo" TypeUpgradeGiftResult = "upgradeGiftResult" + TypeCraftGiftResultSuccess = "craftGiftResultSuccess" + TypeCraftGiftResultTooEarly = "craftGiftResultTooEarly" + TypeCraftGiftResultInvalidGift = "craftGiftResultInvalidGift" + TypeCraftGiftResultFail = "craftGiftResultFail" TypeAvailableGift = "availableGift" TypeAvailableGifts = "availableGifts" + TypeGiftUpgradePrice = "giftUpgradePrice" TypeUpgradedGiftAttributeIdModel = "upgradedGiftAttributeIdModel" TypeUpgradedGiftAttributeIdSymbol = "upgradedGiftAttributeIdSymbol" TypeUpgradedGiftAttributeIdBackdrop = "upgradedGiftAttributeIdBackdrop" @@ -856,11 +951,24 @@ const ( TypeGiftForResaleOrderNumber = "giftForResaleOrderNumber" TypeGiftForResale = "giftForResale" TypeGiftsForResale = "giftsForResale" + TypeGiftResaleResultOk = "giftResaleResultOk" + TypeGiftResaleResultPriceIncreased = "giftResaleResultPriceIncreased" TypeSentGiftRegular = "sentGiftRegular" TypeSentGiftUpgraded = "sentGiftUpgraded" TypeReceivedGift = "receivedGift" TypeReceivedGifts = "receivedGifts" + TypeAttributeCraftPersistenceProbability = "attributeCraftPersistenceProbability" + TypeGiftsForCrafting = "giftsForCrafting" TypeGiftUpgradePreview = "giftUpgradePreview" + TypeGiftUpgradeVariants = "giftUpgradeVariants" + TypeAuctionBid = "auctionBid" + TypeUserAuctionBid = "userAuctionBid" + TypeAuctionRound = "auctionRound" + TypeAuctionStateActive = "auctionStateActive" + TypeAuctionStateFinished = "auctionStateFinished" + TypeGiftAuctionState = "giftAuctionState" + TypeGiftAuctionAcquiredGift = "giftAuctionAcquiredGift" + TypeGiftAuctionAcquiredGifts = "giftAuctionAcquiredGifts" TypeTransactionDirectionIncoming = "transactionDirectionIncoming" TypeTransactionDirectionOutgoing = "transactionDirectionOutgoing" TypeStarTransactionTypePremiumBotDeposit = "starTransactionTypePremiumBotDeposit" @@ -882,10 +990,14 @@ const ( TypeStarTransactionTypeBotSubscriptionSale = "starTransactionTypeBotSubscriptionSale" TypeStarTransactionTypeChannelSubscriptionPurchase = "starTransactionTypeChannelSubscriptionPurchase" TypeStarTransactionTypeChannelSubscriptionSale = "starTransactionTypeChannelSubscriptionSale" + TypeStarTransactionTypeGiftAuctionBid = "starTransactionTypeGiftAuctionBid" TypeStarTransactionTypeGiftPurchase = "starTransactionTypeGiftPurchase" + TypeStarTransactionTypeGiftPurchaseOffer = "starTransactionTypeGiftPurchaseOffer" TypeStarTransactionTypeGiftTransfer = "starTransactionTypeGiftTransfer" + TypeStarTransactionTypeGiftOriginalDetailsDrop = "starTransactionTypeGiftOriginalDetailsDrop" TypeStarTransactionTypeGiftSale = "starTransactionTypeGiftSale" TypeStarTransactionTypeGiftUpgrade = "starTransactionTypeGiftUpgrade" + TypeStarTransactionTypeGiftUpgradePurchase = "starTransactionTypeGiftUpgradePurchase" TypeStarTransactionTypeUpgradedGiftPurchase = "starTransactionTypeUpgradedGiftPurchase" TypeStarTransactionTypeUpgradedGiftSale = "starTransactionTypeUpgradedGiftSale" TypeStarTransactionTypeChannelPaidReactionSend = "starTransactionTypeChannelPaidReactionSend" @@ -893,19 +1005,33 @@ const ( TypeStarTransactionTypeAffiliateProgramCommission = "starTransactionTypeAffiliateProgramCommission" TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend" TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive" + TypeStarTransactionTypePaidGroupCallMessageSend = "starTransactionTypePaidGroupCallMessageSend" + TypeStarTransactionTypePaidGroupCallMessageReceive = "starTransactionTypePaidGroupCallMessageReceive" + TypeStarTransactionTypePaidGroupCallReactionSend = "starTransactionTypePaidGroupCallReactionSend" + TypeStarTransactionTypePaidGroupCallReactionReceive = "starTransactionTypePaidGroupCallReactionReceive" TypeStarTransactionTypeSuggestedPostPaymentSend = "starTransactionTypeSuggestedPostPaymentSend" TypeStarTransactionTypeSuggestedPostPaymentReceive = "starTransactionTypeSuggestedPostPaymentReceive" TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase" TypeStarTransactionTypeBusinessBotTransferSend = "starTransactionTypeBusinessBotTransferSend" TypeStarTransactionTypeBusinessBotTransferReceive = "starTransactionTypeBusinessBotTransferReceive" + TypeStarTransactionTypePublicPostSearch = "starTransactionTypePublicPostSearch" TypeStarTransactionTypeUnsupported = "starTransactionTypeUnsupported" TypeStarTransaction = "starTransaction" TypeStarTransactions = "starTransactions" TypeTonTransactionTypeFragmentDeposit = "tonTransactionTypeFragmentDeposit" + TypeTonTransactionTypeFragmentWithdrawal = "tonTransactionTypeFragmentWithdrawal" TypeTonTransactionTypeSuggestedPostPayment = "tonTransactionTypeSuggestedPostPayment" + TypeTonTransactionTypeGiftPurchaseOffer = "tonTransactionTypeGiftPurchaseOffer" + TypeTonTransactionTypeUpgradedGiftPurchase = "tonTransactionTypeUpgradedGiftPurchase" + TypeTonTransactionTypeUpgradedGiftSale = "tonTransactionTypeUpgradedGiftSale" + TypeTonTransactionTypeStakeDiceStake = "tonTransactionTypeStakeDiceStake" + TypeTonTransactionTypeStakeDicePayout = "tonTransactionTypeStakeDicePayout" TypeTonTransactionTypeUnsupported = "tonTransactionTypeUnsupported" TypeTonTransaction = "tonTransaction" TypeTonTransactions = "tonTransactions" + TypeActiveStoryStateLive = "activeStoryStateLive" + TypeActiveStoryStateUnread = "activeStoryStateUnread" + TypeActiveStoryStateRead = "activeStoryStateRead" TypeGiveawayParticipantStatusEligible = "giveawayParticipantStatusEligible" TypeGiveawayParticipantStatusParticipating = "giveawayParticipantStatusParticipating" TypeGiveawayParticipantStatusAlreadyWasMember = "giveawayParticipantStatusAlreadyWasMember" @@ -918,6 +1044,8 @@ const ( TypeAccentColor = "accentColor" TypeProfileAccentColors = "profileAccentColors" TypeProfileAccentColor = "profileAccentColor" + TypeUserRating = "userRating" + TypeRestrictionInfo = "restrictionInfo" TypeEmojiStatusTypeCustomEmoji = "emojiStatusTypeCustomEmoji" TypeEmojiStatusTypeUpgradedGift = "emojiStatusTypeUpgradedGift" TypeEmojiStatus = "emojiStatus" @@ -976,6 +1104,7 @@ const ( TypeSecretChatStateReady = "secretChatStateReady" TypeSecretChatStateClosed = "secretChatStateClosed" TypeSecretChat = "secretChat" + TypePublicPostSearchLimits = "publicPostSearchLimits" TypeMessageSenderUser = "messageSenderUser" TypeMessageSenderChat = "messageSenderChat" TypeMessageSenders = "messageSenders" @@ -1000,6 +1129,7 @@ const ( TypePaidReactionTypeAnonymous = "paidReactionTypeAnonymous" TypePaidReactionTypeChat = "paidReactionTypeChat" TypePaidReactor = "paidReactor" + TypeLiveStoryDonors = "liveStoryDonors" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageImportInfo = "messageImportInfo" TypeMessageReplyInfo = "messageReplyInfo" @@ -1007,6 +1137,7 @@ const ( TypeMessageReactions = "messageReactions" TypeMessageInteractionInfo = "messageInteractionInfo" TypeUnreadReaction = "unreadReaction" + TypeMessageTopicThread = "messageTopicThread" TypeMessageTopicForum = "messageTopicForum" TypeMessageTopicDirectMessages = "messageTopicDirectMessages" TypeMessageTopicSavedMessages = "messageTopicSavedMessages" @@ -1027,6 +1158,7 @@ const ( TypeMessages = "messages" TypeFoundMessages = "foundMessages" TypeFoundChatMessages = "foundChatMessages" + TypeFoundPublicPosts = "foundPublicPosts" TypeMessagePosition = "messagePosition" TypeMessagePositions = "messagePositions" TypeMessageCalendarDay = "messageCalendarDay" @@ -1111,6 +1243,10 @@ const ( TypeChatActionBarAddContact = "chatActionBarAddContact" TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" + TypeButtonStyleDefault = "buttonStyleDefault" + TypeButtonStylePrimary = "buttonStylePrimary" + TypeButtonStyleDanger = "buttonStyleDanger" + TypeButtonStyleSuccess = "buttonStyleSuccess" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -1157,6 +1293,11 @@ const ( TypeLinkPreviewOptions = "linkPreviewOptions" TypeSharedUser = "sharedUser" TypeSharedChat = "sharedChat" + TypeBuiltInThemeClassic = "builtInThemeClassic" + TypeBuiltInThemeDay = "builtInThemeDay" + TypeBuiltInThemeNight = "builtInThemeNight" + TypeBuiltInThemeTinted = "builtInThemeTinted" + TypeBuiltInThemeArctic = "builtInThemeArctic" TypeThemeSettings = "themeSettings" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" @@ -1225,14 +1366,18 @@ const ( TypeLinkPreviewTypeBackground = "linkPreviewTypeBackground" TypeLinkPreviewTypeChannelBoost = "linkPreviewTypeChannelBoost" TypeLinkPreviewTypeChat = "linkPreviewTypeChat" + TypeLinkPreviewTypeDirectMessagesChat = "linkPreviewTypeDirectMessagesChat" TypeLinkPreviewTypeDocument = "linkPreviewTypeDocument" TypeLinkPreviewTypeEmbeddedAnimationPlayer = "linkPreviewTypeEmbeddedAnimationPlayer" TypeLinkPreviewTypeEmbeddedAudioPlayer = "linkPreviewTypeEmbeddedAudioPlayer" TypeLinkPreviewTypeEmbeddedVideoPlayer = "linkPreviewTypeEmbeddedVideoPlayer" TypeLinkPreviewTypeExternalAudio = "linkPreviewTypeExternalAudio" TypeLinkPreviewTypeExternalVideo = "linkPreviewTypeExternalVideo" + TypeLinkPreviewTypeGiftAuction = "linkPreviewTypeGiftAuction" + TypeLinkPreviewTypeGiftCollection = "linkPreviewTypeGiftCollection" TypeLinkPreviewTypeGroupCall = "linkPreviewTypeGroupCall" TypeLinkPreviewTypeInvoice = "linkPreviewTypeInvoice" + TypeLinkPreviewTypeLiveStory = "linkPreviewTypeLiveStory" TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" @@ -1240,6 +1385,7 @@ const ( TypeLinkPreviewTypeSticker = "linkPreviewTypeSticker" TypeLinkPreviewTypeStickerSet = "linkPreviewTypeStickerSet" TypeLinkPreviewTypeStory = "linkPreviewTypeStory" + TypeLinkPreviewTypeStoryAlbum = "linkPreviewTypeStoryAlbum" TypeLinkPreviewTypeSupergroupBoost = "linkPreviewTypeSupergroupBoost" TypeLinkPreviewTypeTheme = "linkPreviewTypeTheme" TypeLinkPreviewTypeUnsupported = "linkPreviewTypeUnsupported" @@ -1385,6 +1531,7 @@ const ( TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" + TypeMessageStakeDice = "messageStakeDice" TypeMessageStory = "messageStory" TypeMessageChecklist = "messageChecklist" TypeMessageInvoice = "messageInvoice" @@ -1399,6 +1546,8 @@ const ( TypeMessageChatChangeTitle = "messageChatChangeTitle" TypeMessageChatChangePhoto = "messageChatChangePhoto" TypeMessageChatDeletePhoto = "messageChatDeletePhoto" + TypeMessageChatOwnerLeft = "messageChatOwnerLeft" + TypeMessageChatOwnerChanged = "messageChatOwnerChanged" TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" @@ -1416,6 +1565,7 @@ const ( TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" + TypeMessageSuggestBirthdate = "messageSuggestBirthdate" TypeMessageCustomServiceAction = "messageCustomServiceAction" TypeMessageGameScore = "messageGameScore" TypeMessagePaymentSuccessful = "messagePaymentSuccessful" @@ -1433,6 +1583,8 @@ const ( TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" + TypeMessageUpgradedGiftPurchaseOffer = "messageUpgradedGiftPurchaseOffer" + TypeMessageUpgradedGiftPurchaseOfferRejected = "messageUpgradedGiftPurchaseOfferRejected" TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded" TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged" TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged" @@ -1503,6 +1655,7 @@ const ( TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageStakeDice = "inputMessageStakeDice" TypeInputMessageStory = "inputMessageStory" TypeInputMessageChecklist = "inputMessageChecklist" TypeInputMessageForwarded = "inputMessageForwarded" @@ -1585,8 +1738,13 @@ const ( TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" + TypeStoryContentTypePhoto = "storyContentTypePhoto" + TypeStoryContentTypeVideo = "storyContentTypeVideo" + TypeStoryContentTypeLive = "storyContentTypeLive" + TypeStoryContentTypeUnsupported = "storyContentTypeUnsupported" TypeStoryContentPhoto = "storyContentPhoto" TypeStoryContentVideo = "storyContentVideo" + TypeStoryContentLive = "storyContentLive" TypeStoryContentUnsupported = "storyContentUnsupported" TypeInputStoryContentPhoto = "inputStoryContentPhoto" TypeInputStoryContentVideo = "inputStoryContentVideo" @@ -1599,6 +1757,8 @@ const ( TypeStory = "story" TypeStories = "stories" TypeFoundStories = "foundStories" + TypeStoryAlbum = "storyAlbum" + TypeStoryAlbums = "storyAlbums" TypeStoryFullId = "storyFullId" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" @@ -1651,8 +1811,8 @@ const ( TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeVideoChatStream = "videoChatStream" - TypeVideoChatStreams = "videoChatStreams" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" TypeRtmpUrl = "rtmpUrl" TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" TypeGroupCall = "groupCall" @@ -1661,6 +1821,8 @@ const ( TypeGroupCallParticipant = "groupCallParticipant" TypeGroupCallParticipants = "groupCallParticipants" TypeGroupCallInfo = "groupCallInfo" + TypeGroupCallMessage = "groupCallMessage" + TypeGroupCallMessageLevel = "groupCallMessageLevel" TypeInviteGroupCallParticipantResultUserPrivacyRestricted = "inviteGroupCallParticipantResultUserPrivacyRestricted" TypeInviteGroupCallParticipantResultUserAlreadyParticipant = "inviteGroupCallParticipantResultUserAlreadyParticipant" TypeInviteGroupCallParticipantResultUserWasBanned = "inviteGroupCallParticipantResultUserWasBanned" @@ -1692,6 +1854,7 @@ const ( TypeAnimations = "animations" TypeDiceStickersRegular = "diceStickersRegular" TypeDiceStickersSlotMachine = "diceStickersSlotMachine" + TypeImportedContact = "importedContact" TypeImportedContacts = "importedContacts" TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" TypeSpeechRecognitionResultText = "speechRecognitionResultText" @@ -1853,6 +2016,7 @@ const ( TypePremiumFeatureBusiness = "premiumFeatureBusiness" TypePremiumFeatureMessageEffects = "premiumFeatureMessageEffects" TypePremiumFeatureChecklists = "premiumFeatureChecklists" + TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -1922,7 +2086,13 @@ const ( TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" TypeInputBackgroundPrevious = "inputBackgroundPrevious" - TypeChatTheme = "chatTheme" + TypeEmojiChatTheme = "emojiChatTheme" + TypeGiftChatTheme = "giftChatTheme" + TypeGiftChatThemes = "giftChatThemes" + TypeChatThemeEmoji = "chatThemeEmoji" + TypeChatThemeGift = "chatThemeGift" + TypeInputChatThemeEmoji = "inputChatThemeEmoji" + TypeInputChatThemeGift = "inputChatThemeGift" TypeTimeZone = "timeZone" TypeTimeZones = "timeZones" TypeHashtags = "hashtags" @@ -1932,6 +2102,9 @@ const ( TypeCanPostStoryResultActiveStoryLimitExceeded = "canPostStoryResultActiveStoryLimitExceeded" TypeCanPostStoryResultWeeklyLimitExceeded = "canPostStoryResultWeeklyLimitExceeded" TypeCanPostStoryResultMonthlyLimitExceeded = "canPostStoryResultMonthlyLimitExceeded" + TypeCanPostStoryResultLiveStoryIsActive = "canPostStoryResultLiveStoryIsActive" + TypeStartLiveStoryResultOk = "startLiveStoryResultOk" + TypeStartLiveStoryResultFail = "startLiveStoryResultFail" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" @@ -1990,6 +2163,7 @@ const ( TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" + TypePushMessageContentSuggestBirthdate = "pushMessageContentSuggestBirthdate" TypePushMessageContentProximityAlertTriggered = "pushMessageContentProximityAlertTriggered" TypePushMessageContentChecklistTasksAdded = "pushMessageContentChecklistTasksAdded" TypePushMessageContentChecklistTasksDone = "pushMessageContentChecklistTasksDone" @@ -2007,6 +2181,7 @@ const ( TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" + TypeProxy = "proxy" TypeOptionValueBoolean = "optionValueBoolean" TypeOptionValueEmpty = "optionValueEmpty" TypeOptionValueInteger = "optionValueInteger" @@ -2040,6 +2215,7 @@ const ( TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" + TypeUserPrivacySettingShowProfileAudio = "userPrivacySettingShowProfileAudio" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -2094,7 +2270,27 @@ const ( TypeReportStoryResultOk = "reportStoryResultOk" TypeReportStoryResultOptionRequired = "reportStoryResultOptionRequired" TypeReportStoryResultTextRequired = "reportStoryResultTextRequired" - TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeSettingsSectionAppearance = "settingsSectionAppearance" + TypeSettingsSectionAskQuestion = "settingsSectionAskQuestion" + TypeSettingsSectionBusiness = "settingsSectionBusiness" + TypeSettingsSectionChatFolders = "settingsSectionChatFolders" + TypeSettingsSectionDataAndStorage = "settingsSectionDataAndStorage" + TypeSettingsSectionDevices = "settingsSectionDevices" + TypeSettingsSectionEditProfile = "settingsSectionEditProfile" + TypeSettingsSectionFaq = "settingsSectionFaq" + TypeSettingsSectionFeatures = "settingsSectionFeatures" + TypeSettingsSectionInAppBrowser = "settingsSectionInAppBrowser" + TypeSettingsSectionLanguage = "settingsSectionLanguage" + TypeSettingsSectionMyStars = "settingsSectionMyStars" + TypeSettingsSectionMyToncoins = "settingsSectionMyToncoins" + TypeSettingsSectionNotifications = "settingsSectionNotifications" + TypeSettingsSectionPowerSaving = "settingsSectionPowerSaving" + TypeSettingsSectionPremium = "settingsSectionPremium" + TypeSettingsSectionPrivacyAndSecurity = "settingsSectionPrivacyAndSecurity" + TypeSettingsSectionPrivacyPolicy = "settingsSectionPrivacyPolicy" + TypeSettingsSectionQrCode = "settingsSectionQrCode" + TypeSettingsSectionSearch = "settingsSectionSearch" + TypeSettingsSectionSendGift = "settingsSectionSendGift" TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" TypeInternalLinkTypeBackground = "internalLinkTypeBackground" @@ -2102,43 +2298,48 @@ const ( TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" TypeInternalLinkTypeBusinessChat = "internalLinkTypeBusinessChat" - TypeInternalLinkTypeBuyStars = "internalLinkTypeBuyStars" - TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeCallsPage = "internalLinkTypeCallsPage" TypeInternalLinkTypeChatAffiliateProgram = "internalLinkTypeChatAffiliateProgram" TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" - TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" - TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" + TypeInternalLinkTypeChatSelection = "internalLinkTypeChatSelection" + TypeInternalLinkTypeContactsPage = "internalLinkTypeContactsPage" + TypeInternalLinkTypeDirectMessagesChat = "internalLinkTypeDirectMessagesChat" TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeGiftAuction = "internalLinkTypeGiftAuction" + TypeInternalLinkTypeGiftCollection = "internalLinkTypeGiftCollection" TypeInternalLinkTypeGroupCall = "internalLinkTypeGroupCall" TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeLiveStory = "internalLinkTypeLiveStory" TypeInternalLinkTypeMainWebApp = "internalLinkTypeMainWebApp" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypeMyStars = "internalLinkTypeMyStars" - TypeInternalLinkTypeMyToncoins = "internalLinkTypeMyToncoins" + TypeInternalLinkTypeMyProfilePage = "internalLinkTypeMyProfilePage" + TypeInternalLinkTypeNewChannelChat = "internalLinkTypeNewChannelChat" + TypeInternalLinkTypeNewGroupChat = "internalLinkTypeNewGroupChat" + TypeInternalLinkTypeNewPrivateChat = "internalLinkTypeNewPrivateChat" + TypeInternalLinkTypeNewStory = "internalLinkTypeNewStory" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" - TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" + TypeInternalLinkTypePremiumFeaturesPage = "internalLinkTypePremiumFeaturesPage" TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" - TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" + TypeInternalLinkTypePremiumGiftPurchase = "internalLinkTypePremiumGiftPurchase" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" + TypeInternalLinkTypeSavedMessages = "internalLinkTypeSavedMessages" + TypeInternalLinkTypeSearch = "internalLinkTypeSearch" TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeStarPurchase = "internalLinkTypeStarPurchase" TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" TypeInternalLinkTypeStory = "internalLinkTypeStory" + TypeInternalLinkTypeStoryAlbum = "internalLinkTypeStoryAlbum" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" - TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" - TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" TypeInternalLinkTypeUpgradedGift = "internalLinkTypeUpgradedGift" TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" @@ -2200,6 +2401,7 @@ const ( TypeConnectionStateConnecting = "connectionStateConnecting" TypeConnectionStateUpdating = "connectionStateUpdating" TypeConnectionStateReady = "connectionStateReady" + TypeAgeVerificationParameters = "ageVerificationParameters" TypeTopChatCategoryUsers = "topChatCategoryUsers" TypeTopChatCategoryBots = "topChatCategoryBots" TypeTopChatCategoryGroups = "topChatCategoryGroups" @@ -2231,6 +2433,8 @@ const ( TypeSuggestedActionExtendPremium = "suggestedActionExtendPremium" TypeSuggestedActionExtendStarSubscriptions = "suggestedActionExtendStarSubscriptions" TypeSuggestedActionCustom = "suggestedActionCustom" + TypeSuggestedActionSetLoginEmailAddress = "suggestedActionSetLoginEmailAddress" + TypeSuggestedActionAddLoginPasskey = "suggestedActionAddLoginPasskey" TypeCount = "count" TypeText = "text" TypeData = "data" @@ -2243,8 +2447,8 @@ const ( TypeProxyTypeSocks5 = "proxyTypeSocks5" TypeProxyTypeHttp = "proxyTypeHttp" TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeProxy = "proxy" - TypeProxies = "proxies" + TypeAddedProxy = "addedProxy" + TypeAddedProxies = "addedProxies" TypeInputSticker = "inputSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" @@ -2275,6 +2479,8 @@ const ( TypeChatRevenueTransactions = "chatRevenueTransactions" TypeStarRevenueStatus = "starRevenueStatus" TypeStarRevenueStatistics = "starRevenueStatistics" + TypeTonRevenueStatus = "tonRevenueStatus" + TypeTonRevenueStatistics = "tonRevenueStatistics" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -2357,6 +2563,7 @@ const ( TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" TypeUpdateDeleteMessages = "updateDeleteMessages" TypeUpdateChatAction = "updateChatAction" + TypeUpdatePendingTextMessage = "updatePendingTextMessage" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" TypeUpdateBasicGroup = "updateBasicGroup" @@ -2380,7 +2587,14 @@ const ( TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" TypeUpdateGroupCallParticipants = "updateGroupCallParticipants" TypeUpdateGroupCallVerificationState = "updateGroupCallVerificationState" + TypeUpdateNewGroupCallMessage = "updateNewGroupCallMessage" + TypeUpdateNewGroupCallPaidReaction = "updateNewGroupCallPaidReaction" + TypeUpdateGroupCallMessageSendFailed = "updateGroupCallMessageSendFailed" + TypeUpdateGroupCallMessagesDeleted = "updateGroupCallMessagesDeleted" + TypeUpdateLiveStoryTopDonors = "updateLiveStoryTopDonors" TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" + TypeUpdateGiftAuctionState = "updateGiftAuctionState" + TypeUpdateActiveGiftAuctions = "updateActiveGiftAuctions" TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" @@ -2391,6 +2605,7 @@ const ( TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateTrustedMiniAppBots = "updateTrustedMiniAppBots" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -2400,12 +2615,13 @@ const ( TypeUpdateSavedAnimations = "updateSavedAnimations" TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" TypeUpdateDefaultBackground = "updateDefaultBackground" - TypeUpdateChatThemes = "updateChatThemes" + TypeUpdateEmojiChatThemes = "updateEmojiChatThemes" TypeUpdateAccentColors = "updateAccentColors" TypeUpdateProfileAccentColors = "updateProfileAccentColors" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateFreezeState = "updateFreezeState" + TypeUpdateAgeVerificationParameters = "updateAgeVerificationParameters" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUnconfirmedSession = "updateUnconfirmedSession" TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" @@ -2420,8 +2636,11 @@ const ( TypeUpdateOwnedTonCount = "updateOwnedTonCount" TypeUpdateChatRevenueAmount = "updateChatRevenueAmount" TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" + TypeUpdateTonRevenueStatus = "updateTonRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" + TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateStakeDiceState = "updateStakeDiceState" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" @@ -2525,6 +2744,11 @@ type PollType interface { PollTypeType() string } +// Describes a tab shown in a user or a chat profile +type ProfileTab interface { + ProfileTabType() string +} + // Represents the type of user. The following types are possible: regular users, deleted users and bots type UserType interface { UserTypeType() string @@ -2545,6 +2769,16 @@ type InputChatPhoto interface { InputChatPhotoType() string } +// Describes price of a resold gift +type GiftResalePrice interface { + GiftResalePriceType() string +} + +// Describes state of a gift purchase offer +type GiftPurchaseOfferState interface { + GiftPurchaseOfferStateType() string +} + // Describes price of a suggested post type SuggestedPostPrice interface { SuggestedPostPriceType() string @@ -2575,11 +2809,26 @@ type AffiliateProgramSortOrder interface { AffiliateProgramSortOrderType() string } +// Describes whether a gift can be sent now by the current user +type CanSendGiftResult interface { + CanSendGiftResultType() string +} + // Describes origin from which the upgraded gift was obtained type UpgradedGiftOrigin interface { UpgradedGiftOriginType() string } +// Describes rarity of an upgraded gift attribute +type UpgradedGiftAttributeRarity interface { + UpgradedGiftAttributeRarityType() string +} + +// Contains result of gift crafting +type CraftGiftResult interface { + CraftGiftResultType() string +} + // Contains identifier of an upgraded gift attribute to search for type UpgradedGiftAttributeId interface { UpgradedGiftAttributeIdType() string @@ -2590,11 +2839,21 @@ type GiftForResaleOrder interface { GiftForResaleOrderType() string } +// Describes result of sending a resold gift +type GiftResaleResult interface { + GiftResaleResultType() string +} + // Represents content of a gift received by a user or a channel chat type SentGift interface { SentGiftType() string } +// Describes state of an auction +type AuctionState interface { + AuctionStateType() string +} + // Describes direction of transactions in a transaction list type TransactionDirection interface { TransactionDirectionType() string @@ -2610,6 +2869,11 @@ type TonTransactionType interface { TonTransactionTypeType() string } +// Describes state of active stories posted by a chat +type ActiveStoryState interface { + ActiveStoryStateType() string +} + // Contains information about status of a user in a giveaway type GiveawayParticipantStatus interface { GiveawayParticipantStatusType() string @@ -2755,6 +3019,11 @@ type ChatActionBar interface { ChatActionBarType() string } +// Describes style of a button +type ButtonStyle interface { + ButtonStyleType() string +} + // Describes a keyboard button type type KeyboardButtonType interface { KeyboardButtonTypeType() string @@ -2785,6 +3054,11 @@ type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string } +// Describes a built-in theme of an official app +type BuiltInTheme interface { + BuiltInThemeType() string +} + // Describes a formatted text object type RichText interface { RichTextType() string @@ -2945,6 +3219,11 @@ type InputStoryAreaType interface { InputStoryAreaTypeType() string } +// Contains the type of the content of a story +type StoryContentType interface { + StoryContentTypeType() string +} + // Contains the content of a story type StoryContent interface { StoryContentType() string @@ -3145,11 +3424,26 @@ type InputBackground interface { InputBackgroundType() string } +// Describes a chat theme +type ChatTheme interface { + ChatThemeType() string +} + +// Describes a chat theme to set +type InputChatTheme interface { + InputChatThemeType() string +} + // Represents result of checking whether the current user can post a story on behalf of the specific chat type CanPostStoryResult interface { CanPostStoryResultType() string } +// Represents result of starting a live story +type StartLiveStoryResult interface { + StartLiveStoryResultType() string +} + // Represents result of checking whether the current session can be used to transfer a chat ownership to another user type CanTransferOwnershipResult interface { CanTransferOwnershipResultType() string @@ -3240,6 +3534,11 @@ type ReportStoryResult interface { ReportStoryResultType() string } +// Describes a section of the application settings +type SettingsSection interface { + SettingsSectionType() string +} + // Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { InternalLinkTypeType() string @@ -4032,6 +4331,60 @@ func (*TermsOfService) GetType() string { return TypeTermsOfService } +// Describes a passkey +type Passkey struct { + meta + // Unique identifier of the passkey + Id string `json:"id"` + // Name of the passkey + Name string `json:"name"` + // Point in time (Unix timestamp) when the passkey was added + AdditionDate int32 `json:"addition_date"` + // Point in time (Unix timestamp) when the passkey was used last time; 0 if never + LastUsageDate int32 `json:"last_usage_date"` + // Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown + SoftwareIconCustomEmojiId JsonInt64 `json:"software_icon_custom_emoji_id"` +} + +func (entity *Passkey) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Passkey + + return json.Marshal((*stub)(entity)) +} + +func (*Passkey) GetClass() string { + return ClassPasskey +} + +func (*Passkey) GetType() string { + return TypePasskey +} + +// Contains a list of passkeys +type Passkeys struct { + meta + // List of passkeys + Passkeys []*Passkey `json:"passkeys"` +} + +func (entity *Passkeys) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Passkeys + + return json.Marshal((*stub)(entity)) +} + +func (*Passkeys) GetClass() string { + return ClassPasskeys +} + +func (*Passkeys) GetType() string { + return TypePasskeys +} + // Initialization parameters are needed. Call setTdlibParameters to provide them type AuthorizationStateWaitTdlibParameters struct{ meta @@ -4057,7 +4410,7 @@ func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { return TypeAuthorizationStateWaitTdlibParameters } -// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options +// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct{ meta } @@ -4087,6 +4440,10 @@ type AuthorizationStateWaitPremiumPurchase struct { meta // Identifier of the store product that must be bought StoreProductId string `json:"store_product_id"` + // Email address to use for support if the user has issues with Telegram Premium purchase + SupportEmailAddress string `json:"support_email_address"` + // Subject for the email sent to the support email address + SupportEmailSubject string `json:"support_email_subject"` } func (entity *AuthorizationStateWaitPremiumPurchase) MarshalJSON() ([]byte, error) { @@ -5586,8 +5943,8 @@ type ChecklistTask struct { Id int32 `json:"id"` // Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities Text *FormattedText `json:"text"` - // Identifier of the user that completed the task; 0 if the task isn't completed - CompletedByUserId int64 `json:"completed_by_user_id"` + // Identifier of the user or chat that completed the task; may be null if the task isn't completed yet + CompletedBy MessageSender `json:"completed_by"` // Point in time (Unix timestamp) when the task was completed; 0 if the task isn't completed CompletionDate int32 `json:"completion_date"` } @@ -5608,6 +5965,29 @@ func (*ChecklistTask) GetType() string { return TypeChecklistTask } +func (checklistTask *ChecklistTask) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Text *FormattedText `json:"text"` + CompletedBy json.RawMessage `json:"completed_by"` + CompletionDate int32 `json:"completion_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + checklistTask.Id = tmp.Id + checklistTask.Text = tmp.Text + checklistTask.CompletionDate = tmp.CompletionDate + + fieldCompletedBy, _ := UnmarshalMessageSender(tmp.CompletedBy) + checklistTask.CompletedBy = fieldCompletedBy + + return nil +} + // Describes a task in a checklist to be sent type InputChecklistTask struct { meta @@ -5773,6 +6153,31 @@ func (*Audio) GetType() string { return TypeAudio } +// Contains a list of audio files +type Audios struct { + meta + // Approximate total number of audio files found + TotalCount int32 `json:"total_count"` + // List of audio files + Audios []*Audio `json:"audios"` +} + +func (entity *Audios) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Audios + + return json.Marshal((*stub)(entity)) +} + +func (*Audios) GetClass() string { + return ClassAudios +} + +func (*Audios) GetType() string { + return TypeAudios +} + // Describes a document of any type type Document struct { meta @@ -5842,7 +6247,7 @@ type Sticker struct { Width int32 `json:"width"` // Sticker height; as defined by the sender Height int32 `json:"height"` - // Emoji corresponding to the sticker + // Emoji corresponding to the sticker; may be empty if unknown Emoji string `json:"emoji"` // Sticker format Format StickerFormat `json:"format"` @@ -6097,14 +6502,14 @@ func (*AnimatedEmoji) GetType() string { return TypeAnimatedEmoji } -// Describes a user contact +// Describes a contact of a user type Contact struct { meta // Phone number of the user PhoneNumber string `json:"phone_number"` - // First name of the user; 1-255 characters in length + // First name of the user; 1-64 characters FirstName string `json:"first_name"` - // Last name of the user + // Last name of the user; 0-64 characters LastName string `json:"last_name"` // Additional data about the user in a form of vCard; 0-2048 bytes in length Vcard string `json:"vcard"` @@ -6223,6 +6628,39 @@ func (*Game) GetType() string { return TypeGame } +// Describes state of the stake dice +type StakeDiceState struct { + meta + // Hash of the state to use for sending the next dice; may be empty if the stake dice can't be sent by the current user + StateHash string `json:"state_hash"` + // The Toncoin amount that was staked in the previous roll; in the smallest units of the currency + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + // The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency + SuggestedStakeToncoinAmounts []int64 `json:"suggested_stake_toncoin_amounts"` + // The number of rolled sixes towards the streak; 0-2 + CurrentStreak int32 `json:"current_streak"` + // The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user + PrizePerMille []int32 `json:"prize_per_mille"` + // The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 6 three times in a row with the same stake + StreakPrizePerMille int32 `json:"streak_prize_per_mille"` +} + +func (entity *StakeDiceState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StakeDiceState + + return json.Marshal((*stub)(entity)) +} + +func (*StakeDiceState) GetClass() string { + return ClassStakeDiceState +} + +func (*StakeDiceState) GetType() string { + return TypeStakeDiceState +} + // Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App type WebApp struct { meta @@ -6341,7 +6779,7 @@ type AlternativeVideo struct { Width int32 `json:"width"` // Video height Height int32 `json:"height"` - // Codec used for video file encoding, for example, "h264", "h265", or "av1" + // Codec used for video file encoding, for example, "h264", "h265", "av1", or "av01" Codec string `json:"codec"` // HLS file describing the video HlsFile *File `json:"hls_file"` @@ -6566,6 +7004,206 @@ func (*ChatPhotoInfo) GetType() string { return TypeChatPhotoInfo } +// A tab with stories posted by the user or the channel chat and saved to profile +type ProfileTabPosts struct{ + meta +} + +func (entity *ProfileTabPosts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabPosts + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabPosts) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabPosts) GetType() string { + return TypeProfileTabPosts +} + +func (*ProfileTabPosts) ProfileTabType() string { + return TypeProfileTabPosts +} + +// A tab with gifts received by the user or the channel chat +type ProfileTabGifts struct{ + meta +} + +func (entity *ProfileTabGifts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabGifts + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabGifts) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabGifts) GetType() string { + return TypeProfileTabGifts +} + +func (*ProfileTabGifts) ProfileTabType() string { + return TypeProfileTabGifts +} + +// A tab with photos and videos posted by the channel +type ProfileTabMedia struct{ + meta +} + +func (entity *ProfileTabMedia) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabMedia + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabMedia) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabMedia) GetType() string { + return TypeProfileTabMedia +} + +func (*ProfileTabMedia) ProfileTabType() string { + return TypeProfileTabMedia +} + +// A tab with documents posted by the channel +type ProfileTabFiles struct{ + meta +} + +func (entity *ProfileTabFiles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabFiles + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabFiles) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabFiles) GetType() string { + return TypeProfileTabFiles +} + +func (*ProfileTabFiles) ProfileTabType() string { + return TypeProfileTabFiles +} + +// A tab with messages posted by the channel and containing links +type ProfileTabLinks struct{ + meta +} + +func (entity *ProfileTabLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabLinks) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabLinks) GetType() string { + return TypeProfileTabLinks +} + +func (*ProfileTabLinks) ProfileTabType() string { + return TypeProfileTabLinks +} + +// A tab with audio messages posted by the channel +type ProfileTabMusic struct{ + meta +} + +func (entity *ProfileTabMusic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabMusic + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabMusic) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabMusic) GetType() string { + return TypeProfileTabMusic +} + +func (*ProfileTabMusic) ProfileTabType() string { + return TypeProfileTabMusic +} + +// A tab with voice notes posted by the channel +type ProfileTabVoice struct{ + meta +} + +func (entity *ProfileTabVoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabVoice + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabVoice) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabVoice) GetType() string { + return TypeProfileTabVoice +} + +func (*ProfileTabVoice) ProfileTabType() string { + return TypeProfileTabVoice +} + +// A tab with animations posted by the channel +type ProfileTabGifs struct{ + meta +} + +func (entity *ProfileTabGifs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileTabGifs + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileTabGifs) GetClass() string { + return ClassProfileTab +} + +func (*ProfileTabGifs) GetType() string { + return TypeProfileTabGifs +} + +func (*ProfileTabGifs) ProfileTabType() string { + return TypeProfileTabGifs +} + // A regular user type UserTypeRegular struct{ meta @@ -6627,6 +7265,10 @@ type UserTypeBot struct { CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` // True, if the bot has the main Web App HasMainWebApp bool `json:"has_main_web_app"` + // True, if the bot has topics + HasTopics bool `json:"has_topics"` + // True, if users can create and delete topics in the chat with the bot + AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` // Placeholder for inline queries (displayed on the application input field) @@ -6898,7 +7540,7 @@ func (*Birthdate) GetType() string { return TypeBirthdate } -// Describes a user that had or will have a birthday soon +// Describes a user who had or will have a birthday soon type CloseBirthdayUser struct { meta // User identifier @@ -7160,7 +7802,7 @@ type BusinessBotRights struct { CanEditProfilePhoto bool `json:"can_edit_profile_photo"` // True, if the bot can edit username of the business account CanEditUsername bool `json:"can_edit_username"` - // True, if the bot can view gifts and amount of Telegram Stars owned by the business account + // True, if the bot can view gifts and Telegram Star amount owned by the business account CanViewGiftsAndStars bool `json:"can_view_gifts_and_stars"` // True, if the bot can sell regular gifts received by the business account CanSellGifts bool `json:"can_sell_gifts"` @@ -7884,7 +8526,7 @@ type ChatAdministratorRights struct { CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels + // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can pin messages; applicable to basic groups and supergroups only CanPinMessages bool `json:"can_pin_messages"` @@ -7922,10 +8564,139 @@ func (*ChatAdministratorRights) GetType() string { return TypeChatAdministratorRights } +// Describes price of a resold gift in Telegram Stars +type GiftResalePriceStar struct { + meta + // The Telegram Star amount expected to be paid for the gift. Must be in the range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale + StarCount int64 `json:"star_count"` +} + +func (entity *GiftResalePriceStar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftResalePriceStar + + return json.Marshal((*stub)(entity)) +} + +func (*GiftResalePriceStar) GetClass() string { + return ClassGiftResalePrice +} + +func (*GiftResalePriceStar) GetType() string { + return TypeGiftResalePriceStar +} + +func (*GiftResalePriceStar) GiftResalePriceType() string { + return TypeGiftResalePriceStar +} + +// Describes price of a resold gift in Toncoins +type GiftResalePriceTon struct { + meta + // The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in the range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") + ToncoinCentCount int64 `json:"toncoin_cent_count"` +} + +func (entity *GiftResalePriceTon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftResalePriceTon + + return json.Marshal((*stub)(entity)) +} + +func (*GiftResalePriceTon) GetClass() string { + return ClassGiftResalePrice +} + +func (*GiftResalePriceTon) GetType() string { + return TypeGiftResalePriceTon +} + +func (*GiftResalePriceTon) GiftResalePriceType() string { + return TypeGiftResalePriceTon +} + +// The offer must be accepted or rejected +type GiftPurchaseOfferStatePending struct{ + meta +} + +func (entity *GiftPurchaseOfferStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStatePending) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStatePending) GetType() string { + return TypeGiftPurchaseOfferStatePending +} + +func (*GiftPurchaseOfferStatePending) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStatePending +} + +// The offer was accepted +type GiftPurchaseOfferStateAccepted struct{ + meta +} + +func (entity *GiftPurchaseOfferStateAccepted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStateAccepted + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStateAccepted) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStateAccepted) GetType() string { + return TypeGiftPurchaseOfferStateAccepted +} + +func (*GiftPurchaseOfferStateAccepted) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStateAccepted +} + +// The offer was rejected +type GiftPurchaseOfferStateRejected struct{ + meta +} + +func (entity *GiftPurchaseOfferStateRejected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStateRejected + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStateRejected) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStateRejected) GetType() string { + return TypeGiftPurchaseOfferStateRejected +} + +func (*GiftPurchaseOfferStateRejected) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStateRejected +} + // Describes price of a suggested post in Telegram Stars type SuggestedPostPriceStar struct { meta - // The amount of Telegram Stars agreed to pay for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") + // The Telegram Star amount expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") StarCount int64 `json:"star_count"` } @@ -7952,7 +8723,7 @@ func (*SuggestedPostPriceStar) SuggestedPostPriceType() string { // Describes price of a suggested post in Toncoins type SuggestedPostPriceTon struct { meta - // The amount of 1/100 of Toncoin agreed to pay for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max") + // The amount of 1/100 of Toncoin expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max") ToncoinCentCount int64 `json:"toncoin_cent_count"` } @@ -8203,10 +8974,10 @@ func (*SuggestedPostRefundReasonPaymentRefunded) SuggestedPostRefundReasonType() return TypeSuggestedPostRefundReasonPaymentRefunded } -// Describes a possibly non-integer amount of Telegram Stars +// Describes a possibly non-integer Telegram Star amount type StarAmount struct { meta - // The integer amount of Telegram Stars rounded to 0 + // The integer Telegram Star amount rounded to 0 StarCount int64 `json:"star_count"` // The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 NanostarCount int32 `json:"nanostar_count"` @@ -8295,7 +9066,7 @@ type StarSubscriptionPricing struct { meta // The number of seconds between consecutive Telegram Star debiting Period int32 `json:"period"` - // The amount of Telegram Stars that must be paid for each period + // The Telegram Star amount that must be paid for each period StarCount int64 `json:"star_count"` } @@ -8621,7 +9392,7 @@ type AffiliateInfo struct { CommissionPerMille int32 `json:"commission_per_mille"` // Identifier of the chat which received the commission AffiliateChatId int64 `json:"affiliate_chat_id"` - // The amount of Telegram Stars that were received by the affiliate; can be negative for refunds + // The Telegram Star amount that was received by the affiliate; can be negative for refunds StarAmount *StarAmount `json:"star_amount"` } @@ -8709,7 +9480,7 @@ type ConnectedAffiliateProgram struct { // The number of users that used the affiliate program UserCount JsonInt64 `json:"user_count"` // The number of Telegram Stars that were earned by the affiliate program - RevenueStarCount JsonInt64 `json:"revenue_star_count"` + RevenueStarCount int64 `json:"revenue_star_count"` } func (entity *ConnectedAffiliateProgram) MarshalJSON() ([]byte, error) { @@ -8878,7 +9649,7 @@ type PremiumGiftPaymentOption struct { Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible + // The alternative Telegram Star amount to pay; 0 if payment in Telegram Stars is not possible StarCount int64 `json:"star_count"` // The discount associated with this option, as a percentage DiscountPercentage int32 `json:"discount_percentage"` @@ -8988,16 +9759,18 @@ func (*PremiumGiveawayPaymentOptions) 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; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used + // Identifier of a chat or a user who 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 in the creator_id chat; can be 0 or an identifier of a deleted message + // Identifier of the corresponding giveaway message in the creator_id chat; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` - // Number of months the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active after code activation + DayCount int32 `json:"day_count"` // Identifier of a user for which the code was created; 0 if none UserId int64 `json:"user_id"` // Point in time (Unix timestamp) when the code was activated; 0 if none @@ -9027,6 +9800,7 @@ func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error IsFromGiveaway bool `json:"is_from_giveaway"` GiveawayMessageId int64 `json:"giveaway_message_id"` MonthCount int32 `json:"month_count"` + DayCount int32 `json:"day_count"` UserId int64 `json:"user_id"` UseDate int32 `json:"use_date"` } @@ -9040,6 +9814,7 @@ func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId premiumGiftCodeInfo.MonthCount = tmp.MonthCount + premiumGiftCodeInfo.DayCount = tmp.DayCount premiumGiftCodeInfo.UserId = tmp.UserId premiumGiftCodeInfo.UseDate = tmp.UseDate @@ -9199,6 +9974,8 @@ type AcceptedGiftTypes struct { LimitedGifts bool `json:"limited_gifts"` // True, if upgraded gifts and regular gifts that can be upgraded for free are accepted UpgradedGifts bool `json:"upgraded_gifts"` + // True, if gifts from channels are accepted subject to other restrictions + GiftsFromChannels bool `json:"gifts_from_channels"` // True, if Telegram Premium subscription is accepted PremiumSubscription bool `json:"premium_subscription"` } @@ -9244,10 +10021,220 @@ func (*GiftSettings) GetType() string { return TypeGiftSettings } +// Describes an auction on which a gift can be purchased +type GiftAuction struct { + meta + // Identifier of the auction + Id string `json:"id"` + // Number of gifts distributed in each round + GiftsPerRound int32 `json:"gifts_per_round"` + // Point in time (Unix timestamp) when the auction will start + StartDate int32 `json:"start_date"` +} + +func (entity *GiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuction) GetClass() string { + return ClassGiftAuction +} + +func (*GiftAuction) GetType() string { + return TypeGiftAuction +} + +// Describes background of a gift +type GiftBackground struct { + meta + // Center color in RGB format + CenterColor int32 `json:"center_color"` + // Edge color in RGB format + EdgeColor int32 `json:"edge_color"` + // Text color in RGB format + TextColor int32 `json:"text_color"` +} + +func (entity *GiftBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftBackground + + return json.Marshal((*stub)(entity)) +} + +func (*GiftBackground) GetClass() string { + return ClassGiftBackground +} + +func (*GiftBackground) GetType() string { + return TypeGiftBackground +} + +// Describes the maximum number of times that a specific gift can be purchased +type GiftPurchaseLimits struct { + meta + // The maximum number of times the gifts can be purchased + TotalCount int32 `json:"total_count"` + // Number of remaining times the gift can be purchased + RemainingCount int32 `json:"remaining_count"` +} + +func (entity *GiftPurchaseLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseLimits + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseLimits) GetClass() string { + return ClassGiftPurchaseLimits +} + +func (*GiftPurchaseLimits) GetType() string { + return TypeGiftPurchaseLimits +} + +// Describes parameters of a unique gift available for resale +type GiftResaleParameters struct { + meta + // Resale price of the gift in Telegram Stars + StarCount int64 `json:"star_count"` + // Resale price of the gift in 1/100 of Toncoin + ToncoinCentCount int64 `json:"toncoin_cent_count"` + // True, if the gift can be bought only using Toncoins + ToncoinOnly bool `json:"toncoin_only"` +} + +func (entity *GiftResaleParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftResaleParameters + + return json.Marshal((*stub)(entity)) +} + +func (*GiftResaleParameters) GetClass() string { + return ClassGiftResaleParameters +} + +func (*GiftResaleParameters) GetType() string { + return TypeGiftResaleParameters +} + +// Describes collection of gifts +type GiftCollection struct { + meta + // Unique identifier of the collection + Id int32 `json:"id"` + // Name of the collection + Name string `json:"name"` + // Icon of the collection; may be null if none + Icon *Sticker `json:"icon"` + // Total number of gifts in the collection + GiftCount int32 `json:"gift_count"` +} + +func (entity *GiftCollection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftCollection + + return json.Marshal((*stub)(entity)) +} + +func (*GiftCollection) GetClass() string { + return ClassGiftCollection +} + +func (*GiftCollection) GetType() string { + return TypeGiftCollection +} + +// Contains a list of gift collections +type GiftCollections struct { + meta + // List of gift collections + Collections []*GiftCollection `json:"collections"` +} + +func (entity *GiftCollections) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftCollections + + return json.Marshal((*stub)(entity)) +} + +func (*GiftCollections) GetClass() string { + return ClassGiftCollections +} + +func (*GiftCollections) GetType() string { + return TypeGiftCollections +} + +// The gift can be sent now by the current user +type CanSendGiftResultOk struct{ + meta +} + +func (entity *CanSendGiftResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendGiftResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendGiftResultOk) GetClass() string { + return ClassCanSendGiftResult +} + +func (*CanSendGiftResultOk) GetType() string { + return TypeCanSendGiftResultOk +} + +func (*CanSendGiftResultOk) CanSendGiftResultType() string { + return TypeCanSendGiftResultOk +} + +// The gift can't be sent now by the current user +type CanSendGiftResultFail struct { + meta + // Reason to be shown to the user + Reason *FormattedText `json:"reason"` +} + +func (entity *CanSendGiftResultFail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendGiftResultFail + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendGiftResultFail) GetClass() string { + return ClassCanSendGiftResult +} + +func (*CanSendGiftResultFail) GetType() string { + return TypeCanSendGiftResultFail +} + +func (*CanSendGiftResultFail) CanSendGiftResultType() string { + return TypeCanSendGiftResultFail +} + // The gift was obtained by upgrading of a previously received gift type UpgradedGiftOriginUpgrade struct { meta - // Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message + // Identifier of the message with the regular gift that was upgraded; may be 0 or an identifier of a deleted message GiftMessageId int64 `json:"gift_message_id"` } @@ -9299,8 +10286,8 @@ func (*UpgradedGiftOriginTransfer) UpgradedGiftOriginType() string { // The gift was bought from another user type UpgradedGiftOriginResale struct { meta - // Number of Telegram Stars that were paid by the sender for the gift - StarCount int64 `json:"star_count"` + // Price paid for the gift + Price GiftResalePrice `json:"price"` } func (entity *UpgradedGiftOriginResale) MarshalJSON() ([]byte, error) { @@ -9323,6 +10310,267 @@ func (*UpgradedGiftOriginResale) UpgradedGiftOriginType() string { return TypeUpgradedGiftOriginResale } +func (upgradedGiftOriginResale *UpgradedGiftOriginResale) UnmarshalJSON(data []byte) error { + var tmp struct { + Price json.RawMessage `json:"price"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + upgradedGiftOriginResale.Price = fieldPrice + + return nil +} + +// The gift was assigned from blockchain and isn't owned by the current user. The gift can't be transferred, resold or withdrawn to blockchain +type UpgradedGiftOriginBlockchain struct{ + meta +} + +func (entity *UpgradedGiftOriginBlockchain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginBlockchain + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginBlockchain) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginBlockchain) GetType() string { + return TypeUpgradedGiftOriginBlockchain +} + +func (*UpgradedGiftOriginBlockchain) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginBlockchain +} + +// The sender or receiver of the message has paid for upgraid of the gift, which has been completed +type UpgradedGiftOriginPrepaidUpgrade struct{ + meta +} + +func (entity *UpgradedGiftOriginPrepaidUpgrade) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginPrepaidUpgrade + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginPrepaidUpgrade) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginPrepaidUpgrade) GetType() string { + return TypeUpgradedGiftOriginPrepaidUpgrade +} + +func (*UpgradedGiftOriginPrepaidUpgrade) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginPrepaidUpgrade +} + +// The gift was bought through an offer +type UpgradedGiftOriginOffer struct { + meta + // Price paid for the gift + Price GiftResalePrice `json:"price"` +} + +func (entity *UpgradedGiftOriginOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginOffer + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginOffer) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginOffer) GetType() string { + return TypeUpgradedGiftOriginOffer +} + +func (*UpgradedGiftOriginOffer) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginOffer +} + +func (upgradedGiftOriginOffer *UpgradedGiftOriginOffer) UnmarshalJSON(data []byte) error { + var tmp struct { + Price json.RawMessage `json:"price"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + upgradedGiftOriginOffer.Price = fieldPrice + + return nil +} + +// The gift was crafted from other gifts +type UpgradedGiftOriginCraft struct{ + meta +} + +func (entity *UpgradedGiftOriginCraft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginCraft + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginCraft) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginCraft) GetType() string { + return TypeUpgradedGiftOriginCraft +} + +func (*UpgradedGiftOriginCraft) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginCraft +} + +// The rarity is represented as the numeric frequence of the model +type UpgradedGiftAttributeRarityPerMille struct { + meta + // The number of upgraded gifts that receive this attribute for each 1000 gifts upgraded; if 0, then it can be shown as "<0.1%" + PerMille int32 `json:"per_mille"` +} + +func (entity *UpgradedGiftAttributeRarityPerMille) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityPerMille + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityPerMille) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityPerMille) GetType() string { + return TypeUpgradedGiftAttributeRarityPerMille +} + +func (*UpgradedGiftAttributeRarityPerMille) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityPerMille +} + +// The attribute is uncommon +type UpgradedGiftAttributeRarityUncommon struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityUncommon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityUncommon + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityUncommon) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityUncommon) GetType() string { + return TypeUpgradedGiftAttributeRarityUncommon +} + +func (*UpgradedGiftAttributeRarityUncommon) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityUncommon +} + +// The attribute is rare +type UpgradedGiftAttributeRarityRare struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityRare) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityRare + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityRare) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityRare) GetType() string { + return TypeUpgradedGiftAttributeRarityRare +} + +func (*UpgradedGiftAttributeRarityRare) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityRare +} + +// The attribute is epic +type UpgradedGiftAttributeRarityEpic struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityEpic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityEpic + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityEpic) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityEpic) GetType() string { + return TypeUpgradedGiftAttributeRarityEpic +} + +func (*UpgradedGiftAttributeRarityEpic) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityEpic +} + +// The attribute is legendary +type UpgradedGiftAttributeRarityLegendary struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityLegendary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityLegendary + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityLegendary) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityLegendary) GetType() string { + return TypeUpgradedGiftAttributeRarityLegendary +} + +func (*UpgradedGiftAttributeRarityLegendary) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityLegendary +} + // Describes a model of an upgraded gift type UpgradedGiftModel struct { meta @@ -9330,8 +10578,10 @@ type UpgradedGiftModel struct { Name string `json:"name"` // The sticker representing the upgraded gift Sticker *Sticker `json:"sticker"` - // The number of upgraded gifts that receive this model for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the model + Rarity UpgradedGiftAttributeRarity `json:"rarity"` + // True, if the model can be obtained only through gift crafting + IsCrafted bool `json:"is_crafted"` } func (entity *UpgradedGiftModel) MarshalJSON() ([]byte, error) { @@ -9350,6 +10600,29 @@ func (*UpgradedGiftModel) GetType() string { return TypeUpgradedGiftModel } +func (upgradedGiftModel *UpgradedGiftModel) UnmarshalJSON(data []byte) error { + var tmp struct { + Name string `json:"name"` + Sticker *Sticker `json:"sticker"` + Rarity json.RawMessage `json:"rarity"` + IsCrafted bool `json:"is_crafted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftModel.Name = tmp.Name + upgradedGiftModel.Sticker = tmp.Sticker + upgradedGiftModel.IsCrafted = tmp.IsCrafted + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftModel.Rarity = fieldRarity + + return nil +} + // Describes a symbol shown on the pattern of an upgraded gift type UpgradedGiftSymbol struct { meta @@ -9357,8 +10630,8 @@ type UpgradedGiftSymbol struct { Name string `json:"name"` // The sticker representing the symbol Sticker *Sticker `json:"sticker"` - // The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the symbol + Rarity UpgradedGiftAttributeRarity `json:"rarity"` } func (entity *UpgradedGiftSymbol) MarshalJSON() ([]byte, error) { @@ -9377,6 +10650,27 @@ func (*UpgradedGiftSymbol) GetType() string { return TypeUpgradedGiftSymbol } +func (upgradedGiftSymbol *UpgradedGiftSymbol) UnmarshalJSON(data []byte) error { + var tmp struct { + Name string `json:"name"` + Sticker *Sticker `json:"sticker"` + Rarity json.RawMessage `json:"rarity"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftSymbol.Name = tmp.Name + upgradedGiftSymbol.Sticker = tmp.Sticker + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftSymbol.Rarity = fieldRarity + + return nil +} + // Describes colors of a backdrop of an upgraded gift type UpgradedGiftBackdropColors struct { meta @@ -9415,8 +10709,8 @@ type UpgradedGiftBackdrop struct { Name string `json:"name"` // Colors of the backdrop Colors *UpgradedGiftBackdropColors `json:"colors"` - // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the backdrop + Rarity UpgradedGiftAttributeRarity `json:"rarity"` } func (entity *UpgradedGiftBackdrop) MarshalJSON() ([]byte, error) { @@ -9435,6 +10729,29 @@ func (*UpgradedGiftBackdrop) GetType() string { return TypeUpgradedGiftBackdrop } +func (upgradedGiftBackdrop *UpgradedGiftBackdrop) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Name string `json:"name"` + Colors *UpgradedGiftBackdropColors `json:"colors"` + Rarity json.RawMessage `json:"rarity"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftBackdrop.Id = tmp.Id + upgradedGiftBackdrop.Name = tmp.Name + upgradedGiftBackdrop.Colors = tmp.Colors + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftBackdrop.Rarity = fieldRarity + + return nil +} + // Describes the original details about the gift type UpgradedGiftOriginalDetails struct { meta @@ -9489,6 +10806,41 @@ func (upgradedGiftOriginalDetails *UpgradedGiftOriginalDetails) UnmarshalJSON(da return nil } +// Contains information about color scheme for user's name, background of empty chat photo, replies to messages and link previews +type UpgradedGiftColors struct { + meta + // Unique identifier of the upgraded gift colors + Id JsonInt64 `json:"id"` + // Custom emoji identifier of the model of the upgraded gift + ModelCustomEmojiId JsonInt64 `json:"model_custom_emoji_id"` + // Custom emoji identifier of the symbol of the upgraded gift + SymbolCustomEmojiId JsonInt64 `json:"symbol_custom_emoji_id"` + // Accent color to use in light themes in RGB format + LightThemeAccentColor int32 `json:"light_theme_accent_color"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + LightThemeColors []int32 `json:"light_theme_colors"` + // Accent color to use in dark themes in RGB format + DarkThemeAccentColor int32 `json:"dark_theme_accent_color"` + // 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"` +} + +func (entity *UpgradedGiftColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftColors) GetClass() string { + return ClassUpgradedGiftColors +} + +func (*UpgradedGiftColors) GetType() string { + return TypeUpgradedGiftColors +} + // Describes a gift that can be sent to another user or channel chat type Gift struct { meta @@ -9504,12 +10856,24 @@ type Gift struct { DefaultSellStarCount int64 `json:"default_sell_star_count"` // Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible UpgradeStarCount int64 `json:"upgrade_star_count"` + // Number of unique gift variants that are available for the upgraded gift; 0 if unknown + UpgradeVariantCount int32 `json:"upgrade_variant_count"` + // True, if the gift can be used to customize the user's name, and backgrounds of profile photo, reply header, and link preview + HasColors bool `json:"has_colors"` // True, if the gift is a birthday gift IsForBirthday bool `json:"is_for_birthday"` - // Number of remaining times the gift can be purchased; 0 if not limited or the gift was sold out - RemainingCount int32 `json:"remaining_count"` - // Number of total times the gift can be purchased; 0 if not limited - TotalCount int32 `json:"total_count"` + // True, if the gift can be bought only by Telegram Premium subscribers + IsPremium bool `json:"is_premium"` + // Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly + AuctionInfo *GiftAuction `json:"auction_info"` + // Point in time (Unix timestamp) when the gift can be sent next time by the current user; may be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can't be sent now + NextSendDate int32 `json:"next_send_date"` + // Number of times the gift can be purchased by the current user; may be null if not limited + UserLimits *GiftPurchaseLimits `json:"user_limits"` + // Number of times the gift can be purchased all users; may be null if not limited + OverallLimits *GiftPurchaseLimits `json:"overall_limits"` + // Background of the gift + Background *GiftBackground `json:"background"` // Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only FirstSendDate int32 `json:"first_send_date"` // Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only @@ -9537,6 +10901,8 @@ type UpgradedGift struct { meta // Unique identifier of the gift Id JsonInt64 `json:"id"` + // Unique identifier of the regular gift from which the gift was upgraded; may be 0 for short period of time for old gifts from database + RegularGiftId JsonInt64 `json:"regular_gift_id"` // Identifier of the chat that published the gift; 0 if none PublisherChatId int64 `json:"publisher_chat_id"` // The title of the upgraded gift @@ -9549,6 +10915,18 @@ type UpgradedGift struct { TotalUpgradedCount int32 `json:"total_upgraded_count"` // The maximum number of gifts that can be upgraded from the same gift MaxUpgradedCount int32 `json:"max_upgraded_count"` + // True, if the gift was used to craft another gift + IsBurned bool `json:"is_burned"` + // True, if the gift was craft from another gifts + IsCrafted bool `json:"is_crafted"` + // True, if the original gift could have been bought only by Telegram Premium subscribers + IsPremium bool `json:"is_premium"` + // True, if the gift can be used to set a theme in a chat + IsThemeAvailable bool `json:"is_theme_available"` + // Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn't owned by the current user + UsedThemeChatId int64 `json:"used_theme_chat_id"` + // Identifier of the user or the chat to which the upgraded gift was assigned from blockchain; may be null if none or unknown + HostId MessageSender `json:"host_id"` // Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown OwnerId MessageSender `json:"owner_id"` // Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address @@ -9565,8 +10943,20 @@ type UpgradedGift struct { Backdrop *UpgradedGiftBackdrop `json:"backdrop"` // Information about the originally sent gift; may be null if unknown OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` - // Number of Telegram Stars that must be paid to buy the gift and send it to someone else; 0 if resale isn't possible - ResaleStarCount int64 `json:"resale_star_count"` + // Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none or unknown + Colors *UpgradedGiftColors `json:"colors"` + // Resale parameters of the gift; may be null if resale isn't possible + ResaleParameters *GiftResaleParameters `json:"resale_parameters"` + // True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer + CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` + // Probability that the gift adds to the chance of successful crafting of a new gift; 0 if the gift can't be used for crafting + CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` + // ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable + ValueCurrency string `json:"value_currency"` + // Estimated value of the gift; in the smallest units of the currency; 0 if unavailable + ValueAmount int64 `json:"value_amount"` + // Estimated value of the gift in USD; in USD cents; 0 if unavailable + ValueUsdAmount int64 `json:"value_usd_amount"` } func (entity *UpgradedGift) MarshalJSON() ([]byte, error) { @@ -9588,12 +10978,19 @@ func (*UpgradedGift) GetType() string { func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { var tmp struct { Id JsonInt64 `json:"id"` + RegularGiftId JsonInt64 `json:"regular_gift_id"` PublisherChatId int64 `json:"publisher_chat_id"` Title string `json:"title"` Name string `json:"name"` Number int32 `json:"number"` TotalUpgradedCount int32 `json:"total_upgraded_count"` MaxUpgradedCount int32 `json:"max_upgraded_count"` + IsBurned bool `json:"is_burned"` + IsCrafted bool `json:"is_crafted"` + IsPremium bool `json:"is_premium"` + IsThemeAvailable bool `json:"is_theme_available"` + UsedThemeChatId int64 `json:"used_theme_chat_id"` + HostId json.RawMessage `json:"host_id"` OwnerId json.RawMessage `json:"owner_id"` OwnerAddress string `json:"owner_address"` OwnerName string `json:"owner_name"` @@ -9602,7 +10999,13 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { Symbol *UpgradedGiftSymbol `json:"symbol"` Backdrop *UpgradedGiftBackdrop `json:"backdrop"` OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` - ResaleStarCount int64 `json:"resale_star_count"` + Colors *UpgradedGiftColors `json:"colors"` + ResaleParameters *GiftResaleParameters `json:"resale_parameters"` + CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` + CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` + ValueCurrency string `json:"value_currency"` + ValueAmount int64 `json:"value_amount"` + ValueUsdAmount int64 `json:"value_usd_amount"` } err := json.Unmarshal(data, &tmp) @@ -9611,12 +11014,18 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { } upgradedGift.Id = tmp.Id + upgradedGift.RegularGiftId = tmp.RegularGiftId upgradedGift.PublisherChatId = tmp.PublisherChatId upgradedGift.Title = tmp.Title upgradedGift.Name = tmp.Name upgradedGift.Number = tmp.Number upgradedGift.TotalUpgradedCount = tmp.TotalUpgradedCount upgradedGift.MaxUpgradedCount = tmp.MaxUpgradedCount + upgradedGift.IsBurned = tmp.IsBurned + upgradedGift.IsCrafted = tmp.IsCrafted + upgradedGift.IsPremium = tmp.IsPremium + upgradedGift.IsThemeAvailable = tmp.IsThemeAvailable + upgradedGift.UsedThemeChatId = tmp.UsedThemeChatId upgradedGift.OwnerAddress = tmp.OwnerAddress upgradedGift.OwnerName = tmp.OwnerName upgradedGift.GiftAddress = tmp.GiftAddress @@ -9624,7 +11033,16 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.Symbol = tmp.Symbol upgradedGift.Backdrop = tmp.Backdrop upgradedGift.OriginalDetails = tmp.OriginalDetails - upgradedGift.ResaleStarCount = tmp.ResaleStarCount + upgradedGift.Colors = tmp.Colors + upgradedGift.ResaleParameters = tmp.ResaleParameters + upgradedGift.CanSendPurchaseOffer = tmp.CanSendPurchaseOffer + upgradedGift.CraftProbabilityPerMille = tmp.CraftProbabilityPerMille + upgradedGift.ValueCurrency = tmp.ValueCurrency + upgradedGift.ValueAmount = tmp.ValueAmount + upgradedGift.ValueUsdAmount = tmp.ValueUsdAmount + + fieldHostId, _ := UnmarshalMessageSender(tmp.HostId) + upgradedGift.HostId = fieldHostId fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) upgradedGift.OwnerId = fieldOwnerId @@ -9632,6 +11050,55 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { return nil } +// Contains information about value of an upgraded gift +type UpgradedGiftValueInfo struct { + meta + // ISO 4217 currency code of the currency in which the prices are represented + Currency string `json:"currency"` + // Estimated value of the gift; in the smallest units of the currency + Value int64 `json:"value"` + // True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift + IsValueAverage bool `json:"is_value_average"` + // Point in time (Unix timestamp) when the corresponding regular gift was originally purchased + InitialSaleDate int32 `json:"initial_sale_date"` + // The Telegram Star amount that was paid for the gift + InitialSaleStarCount int64 `json:"initial_sale_star_count"` + // Initial price of the gift; in the smallest units of the currency + InitialSalePrice int64 `json:"initial_sale_price"` + // Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never + LastSaleDate int32 `json:"last_sale_date"` + // Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold + LastSalePrice int64 `json:"last_sale_price"` + // True, if the last sale was completed on Fragment + IsLastSaleOnFragment bool `json:"is_last_sale_on_fragment"` + // The current minimum price of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there are no such gifts + MinimumPrice int64 `json:"minimum_price"` + // The average sale price in the last month of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there were no such sales + AverageSalePrice int64 `json:"average_sale_price"` + // Number of gifts upgraded from the same gift being resold on Telegram + TelegramListedGiftCount int32 `json:"telegram_listed_gift_count"` + // Number of gifts upgraded from the same gift being resold on Fragment + FragmentListedGiftCount int32 `json:"fragment_listed_gift_count"` + // The HTTPS link to the Fragment for the gift; may be empty if there are no such gifts being sold on Fragment + FragmentUrl string `json:"fragment_url"` +} + +func (entity *UpgradedGiftValueInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftValueInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftValueInfo) GetClass() string { + return ClassUpgradedGiftValueInfo +} + +func (*UpgradedGiftValueInfo) GetType() string { + return TypeUpgradedGiftValueInfo +} + // Contains result of gift upgrading type UpgradeGiftResult struct { meta @@ -9645,11 +11112,13 @@ type UpgradeGiftResult struct { CanBeTransferred bool `json:"can_be_transferred"` // Number of Telegram Stars that must be paid to transfer the upgraded gift TransferStarCount int64 `json:"transfer_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; 0 if the gift can be transferred immediately or transfer isn't possible + // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available + DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` + // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible NextTransferDate int32 `json:"next_transfer_date"` - // Point in time (Unix timestamp) when the gift can be resold to another user; 0 if the gift can't be resold; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift NextResaleDate int32 `json:"next_resale_date"` - // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT + // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past ExportDate int32 `json:"export_date"` } @@ -9669,6 +11138,112 @@ func (*UpgradeGiftResult) GetType() string { return TypeUpgradeGiftResult } +// Crafting was successful +type CraftGiftResultSuccess struct { + meta + // The created gift + Gift *UpgradedGift `json:"gift"` + // Unique identifier of the received gift for the current user + ReceivedGiftId string `json:"received_gift_id"` +} + +func (entity *CraftGiftResultSuccess) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultSuccess + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultSuccess) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultSuccess) GetType() string { + return TypeCraftGiftResultSuccess +} + +func (*CraftGiftResultSuccess) CraftGiftResultType() string { + return TypeCraftGiftResultSuccess +} + +// Crafting isn't possible because one of the gifts can't be used for crafting yet +type CraftGiftResultTooEarly struct { + meta + // Time left before the gift can be used for crafting + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CraftGiftResultTooEarly) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultTooEarly + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultTooEarly) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultTooEarly) GetType() string { + return TypeCraftGiftResultTooEarly +} + +func (*CraftGiftResultTooEarly) CraftGiftResultType() string { + return TypeCraftGiftResultTooEarly +} + +// Crafting isn't possible because one of the gifts isn't suitable for crafting +type CraftGiftResultInvalidGift struct{ + meta +} + +func (entity *CraftGiftResultInvalidGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultInvalidGift + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultInvalidGift) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultInvalidGift) GetType() string { + return TypeCraftGiftResultInvalidGift +} + +func (*CraftGiftResultInvalidGift) CraftGiftResultType() string { + return TypeCraftGiftResultInvalidGift +} + +// Crafting has failed +type CraftGiftResultFail struct{ + meta +} + +func (entity *CraftGiftResultFail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultFail + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultFail) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultFail) GetType() string { + return TypeCraftGiftResultFail +} + +func (*CraftGiftResultFail) CraftGiftResultType() string { + return TypeCraftGiftResultFail +} + // Describes a gift that is available for purchase type AvailableGift struct { meta @@ -9676,7 +11251,7 @@ type AvailableGift struct { Gift *Gift `json:"gift"` // Number of gifts that are available for resale ResaleCount int32 `json:"resale_count"` - // The minimum price for the gifts available for resale; 0 if there are no such gifts + // The minimum price for the gifts available for resale in Telegram Star equivalent; 0 if there are no such gifts MinResaleStarCount int64 `json:"min_resale_star_count"` // The title of the upgraded gift; empty if the gift isn't available for resale Title string `json:"title"` @@ -9721,6 +11296,31 @@ func (*AvailableGifts) GetType() string { return TypeAvailableGifts } +// Describes a price required to pay to upgrade a gift +type GiftUpgradePrice struct { + meta + // Point in time (Unix timestamp) when the price will be in effect + Date int32 `json:"date"` + // The Telegram Star amount required to pay to upgrade the gift + StarCount int64 `json:"star_count"` +} + +func (entity *GiftUpgradePrice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftUpgradePrice + + return json.Marshal((*stub)(entity)) +} + +func (*GiftUpgradePrice) GetClass() string { + return ClassGiftUpgradePrice +} + +func (*GiftUpgradePrice) GetType() string { + return TypeGiftUpgradePrice +} + // Identifier of a gift model type UpgradedGiftAttributeIdModel struct { meta @@ -10010,6 +11610,76 @@ func (*GiftsForResale) GetType() string { return TypeGiftsForResale } +// Operation was successfully completed +type GiftResaleResultOk struct { + meta + // Unique identifier of the received gift; only for the gifts sent to the current user + ReceivedGiftId string `json:"received_gift_id"` +} + +func (entity *GiftResaleResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftResaleResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*GiftResaleResultOk) GetClass() string { + return ClassGiftResaleResult +} + +func (*GiftResaleResultOk) GetType() string { + return TypeGiftResaleResultOk +} + +func (*GiftResaleResultOk) GiftResaleResultType() string { + return TypeGiftResaleResultOk +} + +// Operation has failed, because price has increased. If the price has decreased, then the buying will succeed anyway +type GiftResaleResultPriceIncreased struct { + meta + // New price for the gift + Price GiftResalePrice `json:"price"` +} + +func (entity *GiftResaleResultPriceIncreased) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftResaleResultPriceIncreased + + return json.Marshal((*stub)(entity)) +} + +func (*GiftResaleResultPriceIncreased) GetClass() string { + return ClassGiftResaleResult +} + +func (*GiftResaleResultPriceIncreased) GetType() string { + return TypeGiftResaleResultPriceIncreased +} + +func (*GiftResaleResultPriceIncreased) GiftResaleResultType() string { + return TypeGiftResaleResultPriceIncreased +} + +func (giftResaleResultPriceIncreased *GiftResaleResultPriceIncreased) UnmarshalJSON(data []byte) error { + var tmp struct { + Price json.RawMessage `json:"price"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + giftResaleResultPriceIncreased.Price = fieldPrice + + return nil +} + // Regular gift type SentGiftRegular struct { meta @@ -10073,6 +11743,8 @@ type ReceivedGift struct { SenderId MessageSender `json:"sender_id"` // Message added to the gift Text *FormattedText `json:"text"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them IsPrivate bool `json:"is_private"` // True, if the gift is displayed on the chat's profile page; only for the receiver of the gift @@ -10089,18 +11761,28 @@ type ReceivedGift struct { Date int32 `json:"date"` // The gift Gift SentGift `json:"gift"` + // Identifiers of collections to which the gift is added; only for the receiver of the gift + CollectionIds []int32 `json:"collection_ids"` // Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the current user SellStarCount int64 `json:"sell_star_count"` // Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` + // True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost + IsUpgradeSeparate bool `json:"is_upgrade_separate"` // Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift TransferStarCount int64 `json:"transfer_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift + // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available; only for the receiver of the gift + DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` + // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift NextTransferDate int32 `json:"next_transfer_date"` - // Point in time (Unix timestamp) when the gift can be resold to another user; 0 if the gift can't be resold; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift NextResaleDate int32 `json:"next_resale_date"` - // Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift + // Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` + // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade + PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` + // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + CraftDate int32 `json:"craft_date"` } func (entity *ReceivedGift) MarshalJSON() ([]byte, error) { @@ -10124,6 +11806,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { ReceivedGiftId string `json:"received_gift_id"` SenderId json.RawMessage `json:"sender_id"` Text *FormattedText `json:"text"` + UniqueGiftNumber int32 `json:"unique_gift_number"` IsPrivate bool `json:"is_private"` IsSaved bool `json:"is_saved"` IsPinned bool `json:"is_pinned"` @@ -10132,12 +11815,17 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { WasRefunded bool `json:"was_refunded"` Date int32 `json:"date"` Gift json.RawMessage `json:"gift"` + CollectionIds []int32 `json:"collection_ids"` SellStarCount int64 `json:"sell_star_count"` PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` + IsUpgradeSeparate bool `json:"is_upgrade_separate"` TransferStarCount int64 `json:"transfer_star_count"` + DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` NextTransferDate int32 `json:"next_transfer_date"` NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` + PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` + CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -10147,6 +11835,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.ReceivedGiftId = tmp.ReceivedGiftId receivedGift.Text = tmp.Text + receivedGift.UniqueGiftNumber = tmp.UniqueGiftNumber receivedGift.IsPrivate = tmp.IsPrivate receivedGift.IsSaved = tmp.IsSaved receivedGift.IsPinned = tmp.IsPinned @@ -10154,12 +11843,17 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.CanBeTransferred = tmp.CanBeTransferred receivedGift.WasRefunded = tmp.WasRefunded receivedGift.Date = tmp.Date + receivedGift.CollectionIds = tmp.CollectionIds receivedGift.SellStarCount = tmp.SellStarCount receivedGift.PrepaidUpgradeStarCount = tmp.PrepaidUpgradeStarCount + receivedGift.IsUpgradeSeparate = tmp.IsUpgradeSeparate receivedGift.TransferStarCount = tmp.TransferStarCount + receivedGift.DropOriginalDetailsStarCount = tmp.DropOriginalDetailsStarCount receivedGift.NextTransferDate = tmp.NextTransferDate receivedGift.NextResaleDate = tmp.NextResaleDate receivedGift.ExportDate = tmp.ExportDate + receivedGift.PrepaidUpgradeHash = tmp.PrepaidUpgradeHash + receivedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) receivedGift.SenderId = fieldSenderId @@ -10199,6 +11893,58 @@ func (*ReceivedGifts) GetType() string { return TypeReceivedGifts } +// Describes chance of the crafted gift to have the backdrop or symbol of one of the original gifts +type AttributeCraftPersistenceProbability struct { + meta + // The 4 numbers that describe probability of the craft result to have the same attribute as one of the original gifts if 1, 2, 3, or 4 gifts with the attribute are used in the craft. Each number represents the number of crafted gifts with the original attribute per 1000 successful craftings + PersistenceChancePerMille []int32 `json:"persistence_chance_per_mille"` +} + +func (entity *AttributeCraftPersistenceProbability) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttributeCraftPersistenceProbability + + return json.Marshal((*stub)(entity)) +} + +func (*AttributeCraftPersistenceProbability) GetClass() string { + return ClassAttributeCraftPersistenceProbability +} + +func (*AttributeCraftPersistenceProbability) GetType() string { + return TypeAttributeCraftPersistenceProbability +} + +// Represents a list of gifts received by a user or a chat +type GiftsForCrafting struct { + meta + // The total number of received gifts + TotalCount int32 `json:"total_count"` + // The list of gifts + Gifts []*ReceivedGift `json:"gifts"` + // The 4 objects that describe probabilities of the crafted gift to have the backdrop or symbol of one of the original gifts for the cases when 1, 2, 3 or 4 gifts are used in the craft correspondingly + AttributePersistenceProbabilities []*AttributeCraftPersistenceProbability `json:"attribute_persistence_probabilities"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *GiftsForCrafting) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftsForCrafting + + return json.Marshal((*stub)(entity)) +} + +func (*GiftsForCrafting) GetClass() string { + return ClassGiftsForCrafting +} + +func (*GiftsForCrafting) GetType() string { + return TypeGiftsForCrafting +} + // Contains examples of possible upgraded gifts for the given regular gift type GiftUpgradePreview struct { meta @@ -10208,6 +11954,10 @@ type GiftUpgradePreview struct { Symbols []*UpgradedGiftSymbol `json:"symbols"` // Examples of possible backdrops that can be chosen for the gift after upgrade Backdrops []*UpgradedGiftBackdrop `json:"backdrops"` + // Examples of price for gift upgrade from the maximum price to the minimum price + Prices []*GiftUpgradePrice `json:"prices"` + // Next changes for the price for gift upgrade with more granularity than in prices + NextPrices []*GiftUpgradePrice `json:"next_prices"` } func (entity *GiftUpgradePreview) MarshalJSON() ([]byte, error) { @@ -10226,6 +11976,370 @@ func (*GiftUpgradePreview) GetType() string { return TypeGiftUpgradePreview } +// Contains all possible variants of upgraded gifts for the given regular gift +type GiftUpgradeVariants struct { + meta + // Models that can be chosen for the gift after upgrade + Models []*UpgradedGiftModel `json:"models"` + // Symbols that can be chosen for the gift after upgrade + Symbols []*UpgradedGiftSymbol `json:"symbols"` + // Backdrops that can be chosen for the gift after upgrade + Backdrops []*UpgradedGiftBackdrop `json:"backdrops"` +} + +func (entity *GiftUpgradeVariants) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftUpgradeVariants + + return json.Marshal((*stub)(entity)) +} + +func (*GiftUpgradeVariants) GetClass() string { + return ClassGiftUpgradeVariants +} + +func (*GiftUpgradeVariants) GetType() string { + return TypeGiftUpgradeVariants +} + +// Describes a bid in an auction +type AuctionBid struct { + meta + // The number of Telegram Stars that were put in the bid + StarCount int64 `json:"star_count"` + // Point in time (Unix timestamp) when the bid was made + BidDate int32 `json:"bid_date"` + // Position of the bid in the list of all bids + Position int32 `json:"position"` +} + +func (entity *AuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionBid) GetClass() string { + return ClassAuctionBid +} + +func (*AuctionBid) GetType() string { + return TypeAuctionBid +} + +// Describes a bid of the current user in an auction +type UserAuctionBid struct { + meta + // The number of Telegram Stars that were put in the bid + StarCount int64 `json:"star_count"` + // Point in time (Unix timestamp) when the bid was made + BidDate int32 `json:"bid_date"` + // The minimum number of Telegram Stars that can be put for the next bid + NextBidStarCount int64 `json:"next_bid_star_count"` + // Identifier of the user or the chat that will receive the auctioned item. If the auction is opened in context of another user or chat, then a warning is supposed to be shown to the current user + OwnerId MessageSender `json:"owner_id"` + // True, if the bid was returned to the user, because it was outbid and can't win anymore + WasReturned bool `json:"was_returned"` +} + +func (entity *UserAuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserAuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*UserAuctionBid) GetClass() string { + return ClassUserAuctionBid +} + +func (*UserAuctionBid) GetType() string { + return TypeUserAuctionBid +} + +func (userAuctionBid *UserAuctionBid) UnmarshalJSON(data []byte) error { + var tmp struct { + StarCount int64 `json:"star_count"` + BidDate int32 `json:"bid_date"` + NextBidStarCount int64 `json:"next_bid_star_count"` + OwnerId json.RawMessage `json:"owner_id"` + WasReturned bool `json:"was_returned"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + userAuctionBid.StarCount = tmp.StarCount + userAuctionBid.BidDate = tmp.BidDate + userAuctionBid.NextBidStarCount = tmp.NextBidStarCount + userAuctionBid.WasReturned = tmp.WasReturned + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + userAuctionBid.OwnerId = fieldOwnerId + + return nil +} + +// Describes a round of an auction +type AuctionRound struct { + meta + // 1-based number of the round + Number int32 `json:"number"` + // Duration of the round, in seconds + Duration int32 `json:"duration"` + // The number of seconds for which the round will be extended if there are changes in the top winners + ExtendTime int32 `json:"extend_time"` + // The number of top winners who trigger round extension if changed + TopWinnerCount int32 `json:"top_winner_count"` +} + +func (entity *AuctionRound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionRound + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionRound) GetClass() string { + return ClassAuctionRound +} + +func (*AuctionRound) GetType() string { + return TypeAuctionRound +} + +// Contains information about an ongoing or scheduled auction +type AuctionStateActive struct { + meta + // Point in time (Unix timestamp) when the auction started or will start + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the auction will be ended + EndDate int32 `json:"end_date"` + // The minimum possible bid in the auction in Telegram Stars + MinBid int64 `json:"min_bid"` + // A sparse list of bids that were made in the auction + BidLevels []*AuctionBid `json:"bid_levels"` + // User identifiers of at most 3 users with the biggest bids + TopBidderUserIds []int64 `json:"top_bidder_user_ids"` + // Rounds of the auction in which their duration or extension rules are changed + Rounds []*AuctionRound `json:"rounds"` + // Point in time (Unix timestamp) when the current round will end + CurrentRoundEndDate int32 `json:"current_round_end_date"` + // 1-based number of the current round + CurrentRoundNumber int32 `json:"current_round_number"` + // The total number of rounds + TotalRoundCount int32 `json:"total_round_count"` + // The number of items that were purchased on the auction by all users + DistributedItemCount int32 `json:"distributed_item_count"` + // The number of items that have to be distributed on the auction + LeftItemCount int32 `json:"left_item_count"` + // The number of items that were purchased by the current user on the auction + AcquiredItemCount int32 `json:"acquired_item_count"` + // Bid of the current user in the auction; may be null if none + UserBid *UserAuctionBid `json:"user_bid"` +} + +func (entity *AuctionStateActive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionStateActive + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionStateActive) GetClass() string { + return ClassAuctionState +} + +func (*AuctionStateActive) GetType() string { + return TypeAuctionStateActive +} + +func (*AuctionStateActive) AuctionStateType() string { + return TypeAuctionStateActive +} + +// Contains information about a finished auction +type AuctionStateFinished struct { + meta + // Point in time (Unix timestamp) when the auction started + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the auction will be ended + EndDate int32 `json:"end_date"` + // Average price of bought items in Telegram Stars + AveragePrice int64 `json:"average_price"` + // The number of items that were purchased by the current user on the auction + AcquiredItemCount int32 `json:"acquired_item_count"` + // Number of items from the auction being resold on Telegram + TelegramListedItemCount int32 `json:"telegram_listed_item_count"` + // Number of items from the auction being resold on Fragment + FragmentListedItemCount int32 `json:"fragment_listed_item_count"` + // The HTTPS link to the Fragment for the resold items; may be empty if there are no such items being sold on Fragment + FragmentUrl string `json:"fragment_url"` +} + +func (entity *AuctionStateFinished) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionStateFinished + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionStateFinished) GetClass() string { + return ClassAuctionState +} + +func (*AuctionStateFinished) GetType() string { + return TypeAuctionStateFinished +} + +func (*AuctionStateFinished) AuctionStateType() string { + return TypeAuctionStateFinished +} + +// Represent auction state of a gift +type GiftAuctionState struct { + meta + // The gift + Gift *Gift `json:"gift"` + // Auction state of the gift + State AuctionState `json:"state"` +} + +func (entity *GiftAuctionState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionState + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionState) GetClass() string { + return ClassGiftAuctionState +} + +func (*GiftAuctionState) GetType() string { + return TypeGiftAuctionState +} + +func (giftAuctionState *GiftAuctionState) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *Gift `json:"gift"` + State json.RawMessage `json:"state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + giftAuctionState.Gift = tmp.Gift + + fieldState, _ := UnmarshalAuctionState(tmp.State) + giftAuctionState.State = fieldState + + return nil +} + +// Represents a gift that was acquired by the current user on an auction +type GiftAuctionAcquiredGift struct { + meta + // Receiver of the gift + ReceiverId MessageSender `json:"receiver_id"` + // Point in time (Unix timestamp) when the gift was acquired + Date int32 `json:"date"` + // The number of Telegram Stars that were paid for the gift + StarCount int64 `json:"star_count"` + // Identifier of the auction round in which the gift was acquired + AuctionRoundNumber int32 `json:"auction_round_number"` + // Position of the user in the round among all auction participants + AuctionRoundPosition int32 `json:"auction_round_position"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` + // Message added to the gift + Text *FormattedText `json:"text"` + // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` +} + +func (entity *GiftAuctionAcquiredGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionAcquiredGift + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionAcquiredGift) GetClass() string { + return ClassGiftAuctionAcquiredGift +} + +func (*GiftAuctionAcquiredGift) GetType() string { + return TypeGiftAuctionAcquiredGift +} + +func (giftAuctionAcquiredGift *GiftAuctionAcquiredGift) UnmarshalJSON(data []byte) error { + var tmp struct { + ReceiverId json.RawMessage `json:"receiver_id"` + Date int32 `json:"date"` + StarCount int64 `json:"star_count"` + AuctionRoundNumber int32 `json:"auction_round_number"` + AuctionRoundPosition int32 `json:"auction_round_position"` + UniqueGiftNumber int32 `json:"unique_gift_number"` + Text *FormattedText `json:"text"` + IsPrivate bool `json:"is_private"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + giftAuctionAcquiredGift.Date = tmp.Date + giftAuctionAcquiredGift.StarCount = tmp.StarCount + giftAuctionAcquiredGift.AuctionRoundNumber = tmp.AuctionRoundNumber + giftAuctionAcquiredGift.AuctionRoundPosition = tmp.AuctionRoundPosition + giftAuctionAcquiredGift.UniqueGiftNumber = tmp.UniqueGiftNumber + giftAuctionAcquiredGift.Text = tmp.Text + giftAuctionAcquiredGift.IsPrivate = tmp.IsPrivate + + fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) + giftAuctionAcquiredGift.ReceiverId = fieldReceiverId + + return nil +} + +// Represents a list of gifts that were acquired by the current user on an auction +type GiftAuctionAcquiredGifts struct { + meta + // The list of acquired gifts + Gifts []*GiftAuctionAcquiredGift `json:"gifts"` +} + +func (entity *GiftAuctionAcquiredGifts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionAcquiredGifts + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionAcquiredGifts) GetClass() string { + return ClassGiftAuctionAcquiredGifts +} + +func (*GiftAuctionAcquiredGifts) GetType() string { + return TypeGiftAuctionAcquiredGifts +} + // The transaction is incoming and increases the amount of owned currency type TransactionDirectionIncoming struct{ meta @@ -10276,7 +12390,7 @@ func (*TransactionDirectionOutgoing) TransactionDirectionType() string { return TypeTransactionDirectionOutgoing } -// The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only +// The transaction is a deposit of Telegram Stars from the Premium bot; relevant for regular users only type StarTransactionTypePremiumBotDeposit struct{ meta } @@ -10301,7 +12415,7 @@ func (*StarTransactionTypePremiumBotDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumBotDeposit } -// The transaction is a deposit of Telegram Stars from App Store; for regular users only +// The transaction is a deposit of Telegram Stars from App Store; relevant for regular users only type StarTransactionTypeAppStoreDeposit struct{ meta } @@ -10326,7 +12440,7 @@ func (*StarTransactionTypeAppStoreDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeAppStoreDeposit } -// The transaction is a deposit of Telegram Stars from Google Play; for regular users only +// The transaction is a deposit of Telegram Stars from Google Play; relevant for regular users only type StarTransactionTypeGooglePlayDeposit struct{ meta } @@ -10351,7 +12465,7 @@ func (*StarTransactionTypeGooglePlayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGooglePlayDeposit } -// The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only +// The transaction is a deposit of Telegram Stars from Fragment; relevant for regular users and bots only type StarTransactionTypeFragmentDeposit struct{ meta } @@ -10376,10 +12490,10 @@ func (*StarTransactionTypeFragmentDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeFragmentDeposit } -// The transaction is a deposit of Telegram Stars by another user; for regular users only +// The transaction is a deposit of Telegram Stars by another user; relevant for regular users only type StarTransactionTypeUserDeposit struct { meta - // Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous + // Identifier of the user who gifted Telegram Stars; 0 if the user was anonymous UserId int64 `json:"user_id"` // The sticker to be shown in the transaction information; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -10405,12 +12519,12 @@ func (*StarTransactionTypeUserDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeUserDeposit } -// The transaction is a deposit of Telegram Stars from a giveaway; for regular users only +// The transaction is a deposit of Telegram Stars from a giveaway; relevant for regular users only type StarTransactionTypeGiveawayDeposit struct { meta // Identifier of a supergroup or a channel chat that created the giveaway ChatId int64 `json:"chat_id"` - // Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message + // Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` } @@ -10434,7 +12548,7 @@ func (*StarTransactionTypeGiveawayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGiveawayDeposit } -// The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Fragment; relevant for regular users, bots, supergroup and channel chats only type StarTransactionTypeFragmentWithdrawal struct { meta // State of the withdrawal; may be null for refunds from Fragment @@ -10477,7 +12591,7 @@ func (starTransactionTypeFragmentWithdrawal *StarTransactionTypeFragmentWithdraw return nil } -// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; relevant for bots and channel chats only type StarTransactionTypeTelegramAdsWithdrawal struct{ meta } @@ -10502,7 +12616,7 @@ func (*StarTransactionTypeTelegramAdsWithdrawal) StarTransactionTypeType() strin return TypeStarTransactionTypeTelegramAdsWithdrawal } -// The transaction is a payment for Telegram API usage; for bots only +// The transaction is a payment for Telegram API usage; relevant for bots only type StarTransactionTypeTelegramApiUsage struct { meta // The number of billed requests @@ -10529,10 +12643,10 @@ func (*StarTransactionTypeTelegramApiUsage) StarTransactionTypeType() string { return TypeStarTransactionTypeTelegramApiUsage } -// The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only +// The transaction is a purchase of paid media from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotPaidMediaPurchase struct { meta - // Identifier of the bot or the business account user that sent the paid media + // Identifier of the bot or the business account user who sent the paid media UserId int64 `json:"user_id"` // The bought media if the transaction wasn't refunded Media []PaidMedia `json:"media"` @@ -10577,10 +12691,10 @@ func (starTransactionTypeBotPaidMediaPurchase *StarTransactionTypeBotPaidMediaPu return nil } -// The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only +// The transaction is a sale of paid media by the bot or a business account managed by the bot; relevant for bots only type StarTransactionTypeBotPaidMediaSale struct { meta - // Identifier of the user that bought the media + // Identifier of the user who bought the media UserId int64 `json:"user_id"` // The bought media Media []PaidMedia `json:"media"` @@ -10633,12 +12747,12 @@ func (starTransactionTypeBotPaidMediaSale *StarTransactionTypeBotPaidMediaSale) return nil } -// The transaction is a purchase of paid media from a channel by the current user; for regular users only +// The transaction is a purchase of paid media from a channel by the current user; relevant for regular users only type StarTransactionTypeChannelPaidMediaPurchase struct { meta // Identifier of the channel chat that sent the paid media ChatId int64 `json:"chat_id"` - // Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` // The bought media if the transaction wasn't refunded Media []PaidMedia `json:"media"` @@ -10685,12 +12799,12 @@ func (starTransactionTypeChannelPaidMediaPurchase *StarTransactionTypeChannelPai return nil } -// The transaction is a sale of paid media by the channel chat; for channel chats only +// The transaction is a sale of paid media by the channel chat; relevant for channel chats only type StarTransactionTypeChannelPaidMediaSale struct { meta - // Identifier of the user that bought the media + // Identifier of the user who bought the media UserId int64 `json:"user_id"` - // Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` // The bought media Media []PaidMedia `json:"media"` @@ -10737,10 +12851,10 @@ func (starTransactionTypeChannelPaidMediaSale *StarTransactionTypeChannelPaidMed return nil } -// The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only +// The transaction is a purchase of a product from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotInvoicePurchase struct { meta - // Identifier of the bot or the business account user that created the invoice + // Identifier of the bot or the business account user who created the invoice UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -10766,10 +12880,10 @@ func (*StarTransactionTypeBotInvoicePurchase) StarTransactionTypeType() string { return TypeStarTransactionTypeBotInvoicePurchase } -// The transaction is a sale of a product by the bot; for bots only +// The transaction is a sale of a product by the bot; relevant for bots only type StarTransactionTypeBotInvoiceSale struct { meta - // Identifier of the user that bought the product + // Identifier of the user who bought the product UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -10799,10 +12913,10 @@ func (*StarTransactionTypeBotInvoiceSale) StarTransactionTypeType() string { return TypeStarTransactionTypeBotInvoiceSale } -// The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only +// The transaction is a purchase of a subscription from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotSubscriptionPurchase struct { meta - // Identifier of the bot or the business account user that created the subscription link + // Identifier of the bot or the business account user who created the subscription link UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -10830,10 +12944,10 @@ func (*StarTransactionTypeBotSubscriptionPurchase) StarTransactionTypeType() str return TypeStarTransactionTypeBotSubscriptionPurchase } -// The transaction is a sale of a subscription by the bot; for bots only +// The transaction is a sale of a subscription by the bot; relevant for bots only type StarTransactionTypeBotSubscriptionSale struct { meta - // Identifier of the user that bought the subscription + // Identifier of the user who bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -10865,7 +12979,7 @@ func (*StarTransactionTypeBotSubscriptionSale) StarTransactionTypeType() string return TypeStarTransactionTypeBotSubscriptionSale } -// The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only +// The transaction is a purchase of a subscription to a channel chat by the current user; relevant for regular users only type StarTransactionTypeChannelSubscriptionPurchase struct { meta // Identifier of the channel chat that created the subscription @@ -10894,10 +13008,10 @@ func (*StarTransactionTypeChannelSubscriptionPurchase) StarTransactionTypeType() return TypeStarTransactionTypeChannelSubscriptionPurchase } -// The transaction is a sale of a subscription by the channel chat; for channel chats only +// The transaction is a sale of a subscription by the channel chat; relevant for channel chats only type StarTransactionTypeChannelSubscriptionSale struct { meta - // Identifier of the user that bought the subscription + // Identifier of the user who bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -10923,7 +13037,55 @@ func (*StarTransactionTypeChannelSubscriptionSale) StarTransactionTypeType() str return TypeStarTransactionTypeChannelSubscriptionSale } -// The transaction is a purchase of a regular gift; for regular users and bots only +// The transaction is a bid on a gift auction; relevant for regular users only +type StarTransactionTypeGiftAuctionBid struct { + meta + // Identifier of the user who will receive the gift + OwnerId MessageSender `json:"owner_id"` + // The gift + Gift *Gift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftAuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftAuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftAuctionBid) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftAuctionBid) GetType() string { + return TypeStarTransactionTypeGiftAuctionBid +} + +func (*StarTransactionTypeGiftAuctionBid) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftAuctionBid +} + +func (starTransactionTypeGiftAuctionBid *StarTransactionTypeGiftAuctionBid) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Gift *Gift `json:"gift"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypeGiftAuctionBid.Gift = tmp.Gift + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + starTransactionTypeGiftAuctionBid.OwnerId = fieldOwnerId + + return nil +} + +// The transaction is a purchase of a regular gift; relevant for regular users and bots only type StarTransactionTypeGiftPurchase struct { meta // Identifier of the user or the channel that received the gift @@ -10971,7 +13133,34 @@ func (starTransactionTypeGiftPurchase *StarTransactionTypeGiftPurchase) Unmarsha return nil } -// The transaction is a transfer of an upgraded gift; for regular users only +// The transaction is an offer of gift purchase; relevant for regular users only +type StarTransactionTypeGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftPurchaseOffer) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftPurchaseOffer) GetType() string { + return TypeStarTransactionTypeGiftPurchaseOffer +} + +func (*StarTransactionTypeGiftPurchaseOffer) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftPurchaseOffer +} + +// The transaction is a transfer of an upgraded gift; relevant for regular users only type StarTransactionTypeGiftTransfer struct { meta // Identifier of the user or the channel that received the gift @@ -11019,10 +13208,58 @@ func (starTransactionTypeGiftTransfer *StarTransactionTypeGiftTransfer) Unmarsha return nil } -// The transaction is a sale of a received gift; for regular users and channel chats only +// The transaction is a drop of original details of an upgraded gift; relevant for regular users only +type StarTransactionTypeGiftOriginalDetailsDrop struct { + meta + // Identifier of the user or the channel that owns the gift + OwnerId MessageSender `json:"owner_id"` + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftOriginalDetailsDrop) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftOriginalDetailsDrop + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftOriginalDetailsDrop) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftOriginalDetailsDrop) GetType() string { + return TypeStarTransactionTypeGiftOriginalDetailsDrop +} + +func (*StarTransactionTypeGiftOriginalDetailsDrop) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftOriginalDetailsDrop +} + +func (starTransactionTypeGiftOriginalDetailsDrop *StarTransactionTypeGiftOriginalDetailsDrop) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Gift *UpgradedGift `json:"gift"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypeGiftOriginalDetailsDrop.Gift = tmp.Gift + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + starTransactionTypeGiftOriginalDetailsDrop.OwnerId = fieldOwnerId + + return nil +} + +// The transaction is a sale of a received gift; relevant for regular users and channel chats only type StarTransactionTypeGiftSale struct { meta - // Identifier of the user that sent the gift + // Identifier of the user who sent the gift UserId int64 `json:"user_id"` // The gift Gift *Gift `json:"gift"` @@ -11048,10 +13285,10 @@ func (*StarTransactionTypeGiftSale) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftSale } -// The transaction is an upgrade of a gift; for regular users only +// The transaction is an upgrade of a gift; relevant for regular users only type StarTransactionTypeGiftUpgrade struct { meta - // Identifier of the user that initially sent the gift + // Identifier of the user who initially sent the gift UserId int64 `json:"user_id"` // The upgraded gift Gift *UpgradedGift `json:"gift"` @@ -11077,10 +13314,58 @@ func (*StarTransactionTypeGiftUpgrade) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftUpgrade } -// The transaction is a purchase of an upgraded gift for some user or channel; for regular users only +// The transaction is a purchase of an upgrade of a gift owned by another user or channel; relevant for regular users only +type StarTransactionTypeGiftUpgradePurchase struct { + meta + // Owner of the upgraded gift + OwnerId MessageSender `json:"owner_id"` + // The gift + Gift *Gift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftUpgradePurchase) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftUpgradePurchase + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftUpgradePurchase) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftUpgradePurchase) GetType() string { + return TypeStarTransactionTypeGiftUpgradePurchase +} + +func (*StarTransactionTypeGiftUpgradePurchase) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftUpgradePurchase +} + +func (starTransactionTypeGiftUpgradePurchase *StarTransactionTypeGiftUpgradePurchase) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Gift *Gift `json:"gift"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypeGiftUpgradePurchase.Gift = tmp.Gift + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + starTransactionTypeGiftUpgradePurchase.OwnerId = fieldOwnerId + + return nil +} + +// The transaction is a purchase of an upgraded gift for some user or channel; relevant for regular users only type StarTransactionTypeUpgradedGiftPurchase struct { meta - // Identifier of the user that sold the gift + // Identifier of the user who sold the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` @@ -11106,15 +13391,19 @@ func (*StarTransactionTypeUpgradedGiftPurchase) StarTransactionTypeType() string return TypeStarTransactionTypeUpgradedGiftPurchase } -// The transaction is a sale of an upgraded gift; for regular users only +// The transaction is a sale of an upgraded gift; relevant for regular users only type StarTransactionTypeUpgradedGiftSale struct { meta - // Identifier of the user that bought the gift + // Identifier of the user who bought the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` - // Information about commission received by Telegram from the transaction - Affiliate *AffiliateInfo `json:"affiliate"` + // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift + CommissionPerMille int32 `json:"commission_per_mille"` + // The Telegram Star amount that was received by Telegram; can be negative for refunds + CommissionStarAmount *StarAmount `json:"commission_star_amount"` + // True, if the gift was sold through a purchase offer + ViaOffer bool `json:"via_offer"` } func (entity *StarTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { @@ -11137,12 +13426,12 @@ func (*StarTransactionTypeUpgradedGiftSale) StarTransactionTypeType() string { return TypeStarTransactionTypeUpgradedGiftSale } -// The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only +// The transaction is a sending of a paid reaction to a message in a channel chat by the current user; relevant for regular users only type StarTransactionTypeChannelPaidReactionSend struct { meta // Identifier of the channel chat ChatId int64 `json:"chat_id"` - // Identifier of the reacted message; can be 0 or an identifier of a deleted message + // Identifier of the reacted message; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -11166,12 +13455,12 @@ func (*StarTransactionTypeChannelPaidReactionSend) StarTransactionTypeType() str return TypeStarTransactionTypeChannelPaidReactionSend } -// The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only +// The transaction is a receiving of a paid reaction to a message by the channel chat; relevant for channel chats only type StarTransactionTypeChannelPaidReactionReceive struct { meta - // Identifier of the user that added the paid reaction + // Identifier of the user who added the paid reaction UserId int64 `json:"user_id"` - // Identifier of the reacted message; can be 0 or an identifier of a deleted message + // Identifier of the reacted message; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -11195,7 +13484,7 @@ func (*StarTransactionTypeChannelPaidReactionReceive) StarTransactionTypeType() return TypeStarTransactionTypeChannelPaidReactionReceive } -// The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only +// The transaction is a receiving of a commission from an affiliate program; relevant for regular users, bots and channel chats only type StarTransactionTypeAffiliateProgramCommission struct { meta // Identifier of the chat that created the affiliate program @@ -11224,7 +13513,7 @@ func (*StarTransactionTypeAffiliateProgramCommission) StarTransactionTypeType() return TypeStarTransactionTypeAffiliateProgramCommission } -// The transaction is a sending of a paid message; for regular users only +// The transaction is a sending of a paid message; relevant for regular users only type StarTransactionTypePaidMessageSend struct { meta // Identifier of the chat that received the payment @@ -11253,7 +13542,7 @@ func (*StarTransactionTypePaidMessageSend) StarTransactionTypeType() string { return TypeStarTransactionTypePaidMessageSend } -// The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only +// The transaction is a receiving of a paid message; relevant for regular users, supergroup and channel chats only type StarTransactionTypePaidMessageReceive struct { meta // Identifier of the sender of the message @@ -11262,7 +13551,7 @@ type StarTransactionTypePaidMessageReceive struct { MessageCount int32 `json:"message_count"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Telegram Stars that were received by Telegram; can be negative for refunds + // The Telegram Star amount that was received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` } @@ -11309,7 +13598,165 @@ func (starTransactionTypePaidMessageReceive *StarTransactionTypePaidMessageRecei return nil } -// The transaction is a payment for a suggested post; for regular users only +// The transaction is a sending of a paid group call message; relevant for regular users only +type StarTransactionTypePaidGroupCallMessageSend struct { + meta + // Identifier of the chat that received the payment + ChatId int64 `json:"chat_id"` +} + +func (entity *StarTransactionTypePaidGroupCallMessageSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallMessageSend + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallMessageSend) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallMessageSend) GetType() string { + return TypeStarTransactionTypePaidGroupCallMessageSend +} + +func (*StarTransactionTypePaidGroupCallMessageSend) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallMessageSend +} + +// The transaction is a receiving of a paid group call message; relevant for regular users and channel chats only +type StarTransactionTypePaidGroupCallMessageReceive struct { + meta + // Identifier of the sender of the message + SenderId MessageSender `json:"sender_id"` + // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending + CommissionPerMille int32 `json:"commission_per_mille"` + // The Telegram Star amount that was received by Telegram; can be negative for refunds + CommissionStarAmount *StarAmount `json:"commission_star_amount"` +} + +func (entity *StarTransactionTypePaidGroupCallMessageReceive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallMessageReceive + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) GetType() string { + return TypeStarTransactionTypePaidGroupCallMessageReceive +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallMessageReceive +} + +func (starTransactionTypePaidGroupCallMessageReceive *StarTransactionTypePaidGroupCallMessageReceive) UnmarshalJSON(data []byte) error { + var tmp struct { + SenderId json.RawMessage `json:"sender_id"` + CommissionPerMille int32 `json:"commission_per_mille"` + CommissionStarAmount *StarAmount `json:"commission_star_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypePaidGroupCallMessageReceive.CommissionPerMille = tmp.CommissionPerMille + starTransactionTypePaidGroupCallMessageReceive.CommissionStarAmount = tmp.CommissionStarAmount + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + starTransactionTypePaidGroupCallMessageReceive.SenderId = fieldSenderId + + return nil +} + +// The transaction is a sending of a paid group reaction; relevant for regular users only +type StarTransactionTypePaidGroupCallReactionSend struct { + meta + // Identifier of the chat that received the payment + ChatId int64 `json:"chat_id"` +} + +func (entity *StarTransactionTypePaidGroupCallReactionSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallReactionSend + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallReactionSend) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallReactionSend) GetType() string { + return TypeStarTransactionTypePaidGroupCallReactionSend +} + +func (*StarTransactionTypePaidGroupCallReactionSend) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallReactionSend +} + +// The transaction is a receiving of a paid group call reaction; relevant for regular users and channel chats only +type StarTransactionTypePaidGroupCallReactionReceive struct { + meta + // Identifier of the sender of the reaction + SenderId MessageSender `json:"sender_id"` + // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for reaction sending + CommissionPerMille int32 `json:"commission_per_mille"` + // The Telegram Star amount that was received by Telegram; can be negative for refunds + CommissionStarAmount *StarAmount `json:"commission_star_amount"` +} + +func (entity *StarTransactionTypePaidGroupCallReactionReceive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallReactionReceive + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) GetType() string { + return TypeStarTransactionTypePaidGroupCallReactionReceive +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallReactionReceive +} + +func (starTransactionTypePaidGroupCallReactionReceive *StarTransactionTypePaidGroupCallReactionReceive) UnmarshalJSON(data []byte) error { + var tmp struct { + SenderId json.RawMessage `json:"sender_id"` + CommissionPerMille int32 `json:"commission_per_mille"` + CommissionStarAmount *StarAmount `json:"commission_star_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypePaidGroupCallReactionReceive.CommissionPerMille = tmp.CommissionPerMille + starTransactionTypePaidGroupCallReactionReceive.CommissionStarAmount = tmp.CommissionStarAmount + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + starTransactionTypePaidGroupCallReactionReceive.SenderId = fieldSenderId + + return nil +} + +// The transaction is a payment for a suggested post; relevant for regular users only type StarTransactionTypeSuggestedPostPaymentSend struct { meta // Identifier of the channel chat that posted the post @@ -11336,10 +13783,10 @@ func (*StarTransactionTypeSuggestedPostPaymentSend) StarTransactionTypeType() st return TypeStarTransactionTypeSuggestedPostPaymentSend } -// The transaction is a receiving of a payment for a suggested post by the channel chat; for channel chats only +// The transaction is a receiving of a payment for a suggested post by the channel chat; relevant for channel chats only type StarTransactionTypeSuggestedPostPaymentReceive struct { meta - // Identifier of the user that paid for the suggested post + // Identifier of the user who paid for the suggested post UserId int64 `json:"user_id"` } @@ -11363,10 +13810,10 @@ func (*StarTransactionTypeSuggestedPostPaymentReceive) StarTransactionTypeType() return TypeStarTransactionTypeSuggestedPostPaymentReceive } -// The transaction is a purchase of Telegram Premium subscription; for regular users and bots only +// The transaction is a purchase of Telegram Premium subscription; relevant for regular users and bots only type StarTransactionTypePremiumPurchase struct { meta - // Identifier of the user that received the Telegram Premium subscription + // Identifier of the user who received the Telegram Premium subscription UserId int64 `json:"user_id"` // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` @@ -11394,7 +13841,7 @@ func (*StarTransactionTypePremiumPurchase) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumPurchase } -// The transaction is a transfer of Telegram Stars to a business bot; for regular users only +// The transaction is a transfer of Telegram Stars to a business bot; relevant for regular users only type StarTransactionTypeBusinessBotTransferSend struct { meta // Identifier of the bot that received Telegram Stars @@ -11421,10 +13868,10 @@ func (*StarTransactionTypeBusinessBotTransferSend) StarTransactionTypeType() str return TypeStarTransactionTypeBusinessBotTransferSend } -// The transaction is a transfer of Telegram Stars from a business account; for bots only +// The transaction is a transfer of Telegram Stars from a business account; relevant for bots only type StarTransactionTypeBusinessBotTransferReceive struct { meta - // Identifier of the user that sent Telegram Stars + // Identifier of the user who sent Telegram Stars UserId int64 `json:"user_id"` } @@ -11448,6 +13895,31 @@ func (*StarTransactionTypeBusinessBotTransferReceive) StarTransactionTypeType() return TypeStarTransactionTypeBusinessBotTransferReceive } +// The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only +type StarTransactionTypePublicPostSearch struct{ + meta +} + +func (entity *StarTransactionTypePublicPostSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePublicPostSearch + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePublicPostSearch) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePublicPostSearch) GetType() string { + return TypeStarTransactionTypePublicPostSearch +} + +func (*StarTransactionTypePublicPostSearch) StarTransactionTypeType() string { + return TypeStarTransactionTypePublicPostSearch +} + // The transaction is a transaction of an unsupported type type StarTransactionTypeUnsupported struct{ meta @@ -11585,6 +14057,49 @@ func (*TonTransactionTypeFragmentDeposit) TonTransactionTypeType() string { return TypeTonTransactionTypeFragmentDeposit } +// The transaction is a withdrawal of earned Toncoins to Fragment +type TonTransactionTypeFragmentWithdrawal struct { + meta + // State of the withdrawal; may be null for refunds from Fragment + WithdrawalState RevenueWithdrawalState `json:"withdrawal_state"` +} + +func (entity *TonTransactionTypeFragmentWithdrawal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeFragmentWithdrawal + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeFragmentWithdrawal) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeFragmentWithdrawal) GetType() string { + return TypeTonTransactionTypeFragmentWithdrawal +} + +func (*TonTransactionTypeFragmentWithdrawal) TonTransactionTypeType() string { + return TypeTonTransactionTypeFragmentWithdrawal +} + +func (tonTransactionTypeFragmentWithdrawal *TonTransactionTypeFragmentWithdrawal) UnmarshalJSON(data []byte) error { + var tmp struct { + WithdrawalState json.RawMessage `json:"withdrawal_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldWithdrawalState, _ := UnmarshalRevenueWithdrawalState(tmp.WithdrawalState) + tonTransactionTypeFragmentWithdrawal.WithdrawalState = fieldWithdrawalState + + return nil +} + // The transaction is a payment for a suggested post type TonTransactionTypeSuggestedPostPayment struct { meta @@ -11612,6 +14127,147 @@ func (*TonTransactionTypeSuggestedPostPayment) TonTransactionTypeType() string { return TypeTonTransactionTypeSuggestedPostPayment } +// The transaction is an offer of gift purchase +type TonTransactionTypeGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *TonTransactionTypeGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeGiftPurchaseOffer) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeGiftPurchaseOffer) GetType() string { + return TypeTonTransactionTypeGiftPurchaseOffer +} + +func (*TonTransactionTypeGiftPurchaseOffer) TonTransactionTypeType() string { + return TypeTonTransactionTypeGiftPurchaseOffer +} + +// The transaction is a purchase of an upgraded gift for some user or channel +type TonTransactionTypeUpgradedGiftPurchase struct { + meta + // Identifier of the user who sold the gift + UserId int64 `json:"user_id"` + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *TonTransactionTypeUpgradedGiftPurchase) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeUpgradedGiftPurchase + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeUpgradedGiftPurchase) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeUpgradedGiftPurchase) GetType() string { + return TypeTonTransactionTypeUpgradedGiftPurchase +} + +func (*TonTransactionTypeUpgradedGiftPurchase) TonTransactionTypeType() string { + return TypeTonTransactionTypeUpgradedGiftPurchase +} + +// The transaction is a sale of an upgraded gift +type TonTransactionTypeUpgradedGiftSale struct { + meta + // Identifier of the user who bought the gift + UserId int64 `json:"user_id"` + // The gift + Gift *UpgradedGift `json:"gift"` + // The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift + CommissionPerMille int32 `json:"commission_per_mille"` + // The Toncoin amount that was received by the Telegram; in the smallest units of the currency + CommissionToncoinAmount int64 `json:"commission_toncoin_amount"` + // True, if the gift was sold through a purchase offer + ViaOffer bool `json:"via_offer"` +} + +func (entity *TonTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeUpgradedGiftSale + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeUpgradedGiftSale) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeUpgradedGiftSale) GetType() string { + return TypeTonTransactionTypeUpgradedGiftSale +} + +func (*TonTransactionTypeUpgradedGiftSale) TonTransactionTypeType() string { + return TypeTonTransactionTypeUpgradedGiftSale +} + +// The transaction is a payment for stake dice throw +type TonTransactionTypeStakeDiceStake struct{ + meta +} + +func (entity *TonTransactionTypeStakeDiceStake) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeStakeDiceStake + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeStakeDiceStake) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeStakeDiceStake) GetType() string { + return TypeTonTransactionTypeStakeDiceStake +} + +func (*TonTransactionTypeStakeDiceStake) TonTransactionTypeType() string { + return TypeTonTransactionTypeStakeDiceStake +} + +// The transaction is a payment for successful stake dice throw +type TonTransactionTypeStakeDicePayout struct{ + meta +} + +func (entity *TonTransactionTypeStakeDicePayout) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeStakeDicePayout + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeStakeDicePayout) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeStakeDicePayout) GetType() string { + return TypeTonTransactionTypeStakeDicePayout +} + +func (*TonTransactionTypeStakeDicePayout) TonTransactionTypeType() string { + return TypeTonTransactionTypeStakeDicePayout +} + // The transaction is a transaction of an unsupported type type TonTransactionTypeUnsupported struct{ meta @@ -11720,6 +14376,83 @@ func (*TonTransactions) GetType() string { return TypeTonTransactions } +// The chat has an active live story +type ActiveStoryStateLive struct { + meta + // Identifier of the active live story + StoryId int32 `json:"story_id"` +} + +func (entity *ActiveStoryStateLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateLive + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateLive) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateLive) GetType() string { + return TypeActiveStoryStateLive +} + +func (*ActiveStoryStateLive) ActiveStoryStateType() string { + return TypeActiveStoryStateLive +} + +// The chat has some unread active stories +type ActiveStoryStateUnread struct{ + meta +} + +func (entity *ActiveStoryStateUnread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateUnread + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateUnread) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateUnread) GetType() string { + return TypeActiveStoryStateUnread +} + +func (*ActiveStoryStateUnread) ActiveStoryStateType() string { + return TypeActiveStoryStateUnread +} + +// The chat has active stories, all of which were read +type ActiveStoryStateRead struct{ + meta +} + +func (entity *ActiveStoryStateRead) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateRead + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateRead) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateRead) GetType() string { + return TypeActiveStoryStateRead +} + +func (*ActiveStoryStateRead) ActiveStoryStateType() string { + return TypeActiveStoryStateRead +} + // The user is eligible for the giveaway type GiveawayParticipantStatusEligible struct{ meta @@ -11920,7 +14653,7 @@ type GiveawayInfoCompleted struct { ActivationCount int32 `json:"activation_count"` // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway GiftCode string `json:"gift_code"` - // The amount of Telegram Stars won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway + // The Telegram Star amount won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway WonStarCount int64 `json:"won_star_count"` } @@ -12087,6 +14820,62 @@ func (*ProfileAccentColor) GetType() string { return TypeProfileAccentColor } +// Contains description of user rating +type UserRating struct { + meta + // The level of the user; may be negative + Level int32 `json:"level"` + // True, if the maximum level is reached + IsMaximumLevelReached bool `json:"is_maximum_level_reached"` + // Numerical value of the rating + Rating int64 `json:"rating"` + // The rating required for the current level + CurrentLevelRating int64 `json:"current_level_rating"` + // The rating required for the next level; 0 if the maximum level is reached + NextLevelRating int64 `json:"next_level_rating"` +} + +func (entity *UserRating) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserRating + + return json.Marshal((*stub)(entity)) +} + +func (*UserRating) GetClass() string { + return ClassUserRating +} + +func (*UserRating) GetType() string { + return TypeUserRating +} + +// Contains information about restrictions that must be applied to a chat or a message +type RestrictionInfo struct { + meta + // A human-readable description of the reason why access to the content must be restricted. If empty, then the content can be accessed, but may be covered by hidden with 18+ spoiler anyway + RestrictionReason string `json:"restriction_reason"` + // True, if media content of the messages must be hidden with 18+ spoiler. Use value of the option "can_ignore_sensitive_content_restrictions" to check whether the current user can ignore the restriction. If age verification parameters were received in updateAgeVerificationParameters, then the user must complete age verification to ignore the restriction. Set the option "ignore_sensitive_content_restrictions" to true if the user passes age verification + HasSensitiveContent bool `json:"has_sensitive_content"` +} + +func (entity *RestrictionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RestrictionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*RestrictionInfo) GetClass() string { + return ClassRestrictionInfo +} + +func (*RestrictionInfo) GetType() string { + return TypeRestrictionInfo +} + // A custom emoji set as emoji status type EmojiStatusTypeCustomEmoji struct { meta @@ -12248,8 +15037,10 @@ type Usernames struct { ActiveUsernames []string `json:"active_usernames"` // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive DisabledUsernames []string `json:"disabled_usernames"` - // The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo + // Active or disabled username, which may be changed with setUsername or setSupergroupUsername EditableUsername string `json:"editable_username"` + // Collectible usernames that were purchased at https://fragment.com and can be passed to getCollectibleItemInfo for more details + CollectibleUsernames []string `json:"collectible_usernames"` } func (entity *Usernames) MarshalJSON() ([]byte, error) { @@ -12291,6 +15082,8 @@ type User struct { AccentColorId int32 `json:"accent_color_id"` // 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"` + // Color scheme based on an upgraded gift to be used for the user instead of accent_color_id and background_custom_emoji_id; may be null if none + UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // Identifier of the accent color for the user'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 user's profile; 0 if none @@ -12309,12 +15102,10 @@ type User struct { IsPremium bool `json:"is_premium"` // True, if the user is Telegram support account IsSupport bool `json:"is_support"` - // If non-empty, it contains a human-readable description of the reason why access to this user must be restricted - RestrictionReason string `json:"restriction_reason"` - // True, if the user has non-expired stories available to the current user - HasActiveStories bool `json:"has_active_stories"` - // True, if the user has unread non-expired stories available to the current user - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // Information about restrictions that must be applied to the corresponding private chat; may be null if none + RestrictionInfo *RestrictionInfo `json:"restriction_info"` + // State of active stories of the user; may be null if the user has no active stories + ActiveStoryState ActiveStoryState `json:"active_story_state"` // True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them RestrictsNewChats bool `json:"restricts_new_chats"` // Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay @@ -12357,6 +15148,7 @@ func (user *User) UnmarshalJSON(data []byte) error { ProfilePhoto *ProfilePhoto `json:"profile_photo"` AccentColorId int32 `json:"accent_color_id"` BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` ProfileAccentColorId int32 `json:"profile_accent_color_id"` ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` EmojiStatus *EmojiStatus `json:"emoji_status"` @@ -12366,9 +15158,8 @@ func (user *User) UnmarshalJSON(data []byte) error { VerificationStatus *VerificationStatus `json:"verification_status"` IsPremium bool `json:"is_premium"` IsSupport bool `json:"is_support"` - RestrictionReason string `json:"restriction_reason"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + RestrictionInfo *RestrictionInfo `json:"restriction_info"` + ActiveStoryState json.RawMessage `json:"active_story_state"` RestrictsNewChats bool `json:"restricts_new_chats"` PaidMessageStarCount int64 `json:"paid_message_star_count"` HaveAccess bool `json:"have_access"` @@ -12391,6 +15182,7 @@ func (user *User) UnmarshalJSON(data []byte) error { user.ProfilePhoto = tmp.ProfilePhoto user.AccentColorId = tmp.AccentColorId user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + user.UpgradedGiftColors = tmp.UpgradedGiftColors user.ProfileAccentColorId = tmp.ProfileAccentColorId user.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId user.EmojiStatus = tmp.EmojiStatus @@ -12400,9 +15192,7 @@ func (user *User) UnmarshalJSON(data []byte) error { user.VerificationStatus = tmp.VerificationStatus user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport - user.RestrictionReason = tmp.RestrictionReason - user.HasActiveStories = tmp.HasActiveStories - user.HasUnreadActiveStories = tmp.HasUnreadActiveStories + user.RestrictionInfo = tmp.RestrictionInfo user.RestrictsNewChats = tmp.RestrictsNewChats user.PaidMessageStarCount = tmp.PaidMessageStarCount user.HaveAccess = tmp.HaveAccess @@ -12412,6 +15202,9 @@ func (user *User) UnmarshalJSON(data []byte) error { fieldStatus, _ := UnmarshalUserStatus(tmp.Status) user.Status = fieldStatus + fieldActiveStoryState, _ := UnmarshalActiveStoryState(tmp.ActiveStoryState) + user.ActiveStoryState = fieldActiveStoryState + fieldType, _ := UnmarshalUserType(tmp.Type) user.Type = fieldType @@ -12595,6 +15388,18 @@ type UserFullInfo struct { GiftSettings *GiftSettings `json:"gift_settings"` // Information about verification status of the user provided by a bot; may be null if none or unknown BotVerification *BotVerification `json:"bot_verification"` + // The main tab chosen by the user; may be null if not chosen manually + MainProfileTab ProfileTab `json:"main_profile_tab"` + // The first audio file added to the user's profile; may be null if none + FirstProfileAudio *Audio `json:"first_profile_audio"` + // The current rating of the user; may be null if none + Rating *UserRating `json:"rating"` + // The rating of the user after the next change; may be null if the user isn't the current user or there are no pending rating changes + PendingRating *UserRating `json:"pending_rating"` + // Unix timestamp when rating of the user will change to pending_rating; 0 if the user isn't the current user or there are no pending rating changes + PendingRatingDate int32 `json:"pending_rating_date"` + // Note added to the user's contact; may be null if none + Note *FormattedText `json:"note"` // Information about business settings for Telegram Business accounts; may be null if none BusinessInfo *BusinessInfo `json:"business_info"` // For bots, information about the bot; may be null if the user isn't a bot @@ -12641,6 +15446,12 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` GiftSettings *GiftSettings `json:"gift_settings"` BotVerification *BotVerification `json:"bot_verification"` + MainProfileTab json.RawMessage `json:"main_profile_tab"` + FirstProfileAudio *Audio `json:"first_profile_audio"` + Rating *UserRating `json:"rating"` + PendingRating *UserRating `json:"pending_rating"` + PendingRatingDate int32 `json:"pending_rating_date"` + Note *FormattedText `json:"note"` BusinessInfo *BusinessInfo `json:"business_info"` BotInfo *BotInfo `json:"bot_info"` } @@ -12671,12 +15482,20 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount userFullInfo.GiftSettings = tmp.GiftSettings userFullInfo.BotVerification = tmp.BotVerification + userFullInfo.FirstProfileAudio = tmp.FirstProfileAudio + userFullInfo.Rating = tmp.Rating + userFullInfo.PendingRating = tmp.PendingRating + userFullInfo.PendingRatingDate = tmp.PendingRatingDate + userFullInfo.Note = tmp.Note userFullInfo.BusinessInfo = tmp.BusinessInfo userFullInfo.BotInfo = tmp.BotInfo fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) userFullInfo.BlockList = fieldBlockList + fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) + userFullInfo.MainProfileTab = fieldMainProfileTab + return nil } @@ -12957,7 +15776,7 @@ type ChatMember struct { meta // Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels MemberId MessageSender `json:"member_id"` - // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown + // Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int64 `json:"inviter_user_id"` // Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat JoinedChatDate int32 `json:"joined_chat_date"` @@ -13109,8 +15928,8 @@ func (*ChatMembersFilterMembers) ChatMembersFilterType() string { // Returns users which can be mentioned in the chat type ChatMembersFilterMention struct { meta - // If non-zero, the identifier of the current message thread - MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the topic in which the users will be mentioned; pass null if none + TopicId MessageTopic `json:"topic_id"` } func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) { @@ -13133,6 +15952,22 @@ func (*ChatMembersFilterMention) ChatMembersFilterType() string { return TypeChatMembersFilterMention } +func (chatMembersFilterMention *ChatMembersFilterMention) UnmarshalJSON(data []byte) error { + var tmp struct { + TopicId json.RawMessage `json:"topic_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) + chatMembersFilterMention.TopicId = fieldTopicId + + return nil +} + // Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup type ChatMembersFilterRestricted struct{ meta @@ -13371,8 +16206,8 @@ type SupergroupMembersFilterMention struct { meta // Query to search for Query string `json:"query"` - // If non-zero, the identifier of the current message thread - MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the topic in which the users will be mentioned; pass null if none + TopicId MessageTopic `json:"topic_id"` } func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) { @@ -13395,6 +16230,25 @@ func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterMention } +func (supergroupMembersFilterMention *SupergroupMembersFilterMention) UnmarshalJSON(data []byte) error { + var tmp struct { + Query string `json:"query"` + TopicId json.RawMessage `json:"topic_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + supergroupMembersFilterMention.Query = tmp.Query + + fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) + supergroupMembersFilterMention.TopicId = fieldTopicId + + return nil +} + // Returns bot members of the supergroup or channel type SupergroupMembersFilterBots struct{ meta @@ -13788,7 +16642,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { return nil } -// Describes a user that sent a join request and waits for administrator approval +// Describes a user who sent a join request and waits for administrator approval type ChatJoinRequest struct { meta // User identifier @@ -13987,7 +16841,7 @@ type Supergroup struct { ShowMessageSender bool `json:"show_message_sender"` // True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups JoinToSendMessages bool `json:"join_to_send_messages"` - // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. May be true only for non-broadcast supergroups with username, location, or a linked chat JoinByRequest bool `json:"join_by_request"` // True, if the slow mode is enabled in the supergroup IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` @@ -14007,16 +16861,12 @@ type Supergroup struct { HasDirectMessagesGroup bool `json:"has_direct_messages_group"` // True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups HasForumTabs bool `json:"has_forum_tabs"` - // True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler - HasSensitiveContent bool `json:"has_sensitive_content"` - // If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted - RestrictionReason string `json:"restriction_reason"` + // Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none + RestrictionInfo *RestrictionInfo `json:"restriction_info"` // Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message PaidMessageStarCount int64 `json:"paid_message_star_count"` - // True, if the supergroup or channel has non-expired stories available to the current user - HasActiveStories bool `json:"has_active_stories"` - // True, if the supergroup or channel has unread non-expired stories available to the current user - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // State of active stories of the supergroup or channel; may be null if there are no active stories + ActiveStoryState ActiveStoryState `json:"active_story_state"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -14060,11 +16910,9 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { VerificationStatus *VerificationStatus `json:"verification_status"` HasDirectMessagesGroup bool `json:"has_direct_messages_group"` HasForumTabs bool `json:"has_forum_tabs"` - HasSensitiveContent bool `json:"has_sensitive_content"` - RestrictionReason string `json:"restriction_reason"` + RestrictionInfo *RestrictionInfo `json:"restriction_info"` PaidMessageStarCount int64 `json:"paid_message_star_count"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + ActiveStoryState json.RawMessage `json:"active_story_state"` } err := json.Unmarshal(data, &tmp) @@ -14094,15 +16942,15 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.VerificationStatus = tmp.VerificationStatus supergroup.HasDirectMessagesGroup = tmp.HasDirectMessagesGroup supergroup.HasForumTabs = tmp.HasForumTabs - supergroup.HasSensitiveContent = tmp.HasSensitiveContent - supergroup.RestrictionReason = tmp.RestrictionReason + supergroup.RestrictionInfo = tmp.RestrictionInfo supergroup.PaidMessageStarCount = tmp.PaidMessageStarCount - supergroup.HasActiveStories = tmp.HasActiveStories - supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) supergroup.Status = fieldStatus + fieldActiveStoryState, _ := UnmarshalActiveStoryState(tmp.ActiveStoryState) + supergroup.ActiveStoryState = fieldActiveStoryState + return nil } @@ -14183,6 +17031,8 @@ type SupergroupFullInfo struct { BotCommands []*BotCommands `json:"bot_commands"` // Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown BotVerification *BotVerification `json:"bot_verification"` + // The main tab chosen by the administrators of the channel; may be null if not chosen manually + MainProfileTab ProfileTab `json:"main_profile_tab"` // Identifier of the basic group from which supergroup was upgraded; 0 if none UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` // Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none @@ -14205,6 +17055,101 @@ func (*SupergroupFullInfo) GetType() string { return TypeSupergroupFullInfo } +func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo *ChatPhoto `json:"photo"` + Description string `json:"description"` + MemberCount int32 `json:"member_count"` + AdministratorCount int32 `json:"administrator_count"` + RestrictedCount int32 `json:"restricted_count"` + BannedCount int32 `json:"banned_count"` + LinkedChatId int64 `json:"linked_chat_id"` + DirectMessagesChatId int64 `json:"direct_messages_chat_id"` + SlowModeDelay int32 `json:"slow_mode_delay"` + SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"` + CanEnablePaidMessages bool `json:"can_enable_paid_messages"` + CanEnablePaidReaction bool `json:"can_enable_paid_reaction"` + CanGetMembers bool `json:"can_get_members"` + HasHiddenMembers bool `json:"has_hidden_members"` + CanHideMembers bool `json:"can_hide_members"` + CanSetStickerSet bool `json:"can_set_sticker_set"` + CanSetLocation bool `json:"can_set_location"` + CanGetStatistics bool `json:"can_get_statistics"` + CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"` + CanGetStarRevenueStatistics bool `json:"can_get_star_revenue_statistics"` + CanSendGift bool `json:"can_send_gift"` + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` + IsAllHistoryAvailable bool `json:"is_all_history_available"` + CanHaveSponsoredMessages bool `json:"can_have_sponsored_messages"` + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` + HasPaidMediaAllowed bool `json:"has_paid_media_allowed"` + HasPinnedStories bool `json:"has_pinned_stories"` + GiftCount int32 `json:"gift_count"` + MyBoostCount int32 `json:"my_boost_count"` + UnrestrictBoostCount int32 `json:"unrestrict_boost_count"` + OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` + StickerSetId JsonInt64 `json:"sticker_set_id"` + CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` + Location *ChatLocation `json:"location"` + InviteLink *ChatInviteLink `json:"invite_link"` + BotCommands []*BotCommands `json:"bot_commands"` + BotVerification *BotVerification `json:"bot_verification"` + MainProfileTab json.RawMessage `json:"main_profile_tab"` + UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` + UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + supergroupFullInfo.Photo = tmp.Photo + supergroupFullInfo.Description = tmp.Description + supergroupFullInfo.MemberCount = tmp.MemberCount + supergroupFullInfo.AdministratorCount = tmp.AdministratorCount + supergroupFullInfo.RestrictedCount = tmp.RestrictedCount + supergroupFullInfo.BannedCount = tmp.BannedCount + supergroupFullInfo.LinkedChatId = tmp.LinkedChatId + supergroupFullInfo.DirectMessagesChatId = tmp.DirectMessagesChatId + supergroupFullInfo.SlowModeDelay = tmp.SlowModeDelay + supergroupFullInfo.SlowModeDelayExpiresIn = tmp.SlowModeDelayExpiresIn + supergroupFullInfo.CanEnablePaidMessages = tmp.CanEnablePaidMessages + supergroupFullInfo.CanEnablePaidReaction = tmp.CanEnablePaidReaction + supergroupFullInfo.CanGetMembers = tmp.CanGetMembers + supergroupFullInfo.HasHiddenMembers = tmp.HasHiddenMembers + supergroupFullInfo.CanHideMembers = tmp.CanHideMembers + supergroupFullInfo.CanSetStickerSet = tmp.CanSetStickerSet + supergroupFullInfo.CanSetLocation = tmp.CanSetLocation + supergroupFullInfo.CanGetStatistics = tmp.CanGetStatistics + supergroupFullInfo.CanGetRevenueStatistics = tmp.CanGetRevenueStatistics + supergroupFullInfo.CanGetStarRevenueStatistics = tmp.CanGetStarRevenueStatistics + supergroupFullInfo.CanSendGift = tmp.CanSendGift + supergroupFullInfo.CanToggleAggressiveAntiSpam = tmp.CanToggleAggressiveAntiSpam + supergroupFullInfo.IsAllHistoryAvailable = tmp.IsAllHistoryAvailable + supergroupFullInfo.CanHaveSponsoredMessages = tmp.CanHaveSponsoredMessages + supergroupFullInfo.HasAggressiveAntiSpamEnabled = tmp.HasAggressiveAntiSpamEnabled + supergroupFullInfo.HasPaidMediaAllowed = tmp.HasPaidMediaAllowed + supergroupFullInfo.HasPinnedStories = tmp.HasPinnedStories + supergroupFullInfo.GiftCount = tmp.GiftCount + supergroupFullInfo.MyBoostCount = tmp.MyBoostCount + supergroupFullInfo.UnrestrictBoostCount = tmp.UnrestrictBoostCount + supergroupFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount + supergroupFullInfo.StickerSetId = tmp.StickerSetId + supergroupFullInfo.CustomEmojiStickerSetId = tmp.CustomEmojiStickerSetId + supergroupFullInfo.Location = tmp.Location + supergroupFullInfo.InviteLink = tmp.InviteLink + supergroupFullInfo.BotCommands = tmp.BotCommands + supergroupFullInfo.BotVerification = tmp.BotVerification + supergroupFullInfo.UpgradedFromBasicGroupId = tmp.UpgradedFromBasicGroupId + supergroupFullInfo.UpgradedFromMaxMessageId = tmp.UpgradedFromMaxMessageId + + fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) + supergroupFullInfo.MainProfileTab = fieldMainProfileTab + + return nil +} + // The secret chat is not yet created; waiting for the other user to get online type SecretChatStatePending struct{ meta @@ -14340,10 +17285,41 @@ func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { return nil } +// Contains information about public post search limits +type PublicPostSearchLimits struct { + meta + // Number of queries that can be sent daily for free + DailyFreeQueryCount int32 `json:"daily_free_query_count"` + // Number of remaining free queries today + RemainingFreeQueryCount int32 `json:"remaining_free_query_count"` + // Amount of time till the next free query can be sent; 0 if it can be sent now + NextFreeQueryIn int32 `json:"next_free_query_in"` + // Number of Telegram Stars that must be paid for each non-free query + StarCount int64 `json:"star_count"` + // True, if the search for the specified query isn't charged + IsCurrentQueryFree bool `json:"is_current_query_free"` +} + +func (entity *PublicPostSearchLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicPostSearchLimits + + return json.Marshal((*stub)(entity)) +} + +func (*PublicPostSearchLimits) GetClass() string { + return ClassPublicPostSearchLimits +} + +func (*PublicPostSearchLimits) GetType() string { + return TypePublicPostSearchLimits +} + // The message was sent by a known user type MessageSenderUser struct { meta - // Identifier of the user that sent the message + // Identifier of the user who sent the message UserId int64 `json:"user_id"` } @@ -14683,7 +17659,7 @@ func (*MessageViewers) GetType() string { // The message was originally sent by a known user type MessageOriginUser struct { meta - // Identifier of the user that originally sent the message + // Identifier of the user who originally sent the message SenderUserId int64 `json:"sender_user_id"` } @@ -15010,13 +17986,13 @@ func (*PaidReactionTypeChat) PaidReactionTypeType() string { return TypePaidReactionTypeChat } -// Contains information about a user that added paid reactions +// Contains information about a user who added paid reactions type PaidReactor struct { meta // Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user SenderId MessageSender `json:"sender_id"` // Number of Telegram Stars added - StarCount int32 `json:"star_count"` + StarCount int64 `json:"star_count"` // True, if the reactor is one of the most active reactors; may be false if the reactor is the current user IsTop bool `json:"is_top"` // True, if the paid reaction was added by the current user @@ -15044,7 +18020,7 @@ func (*PaidReactor) GetType() string { func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { var tmp struct { SenderId json.RawMessage `json:"sender_id"` - StarCount int32 `json:"star_count"` + StarCount int64 `json:"star_count"` IsTop bool `json:"is_top"` IsMe bool `json:"is_me"` IsAnonymous bool `json:"is_anonymous"` @@ -15066,6 +18042,31 @@ func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { return nil } +// Contains a list of users and chats that spend most money on paid messages and reactions in a live story +type LiveStoryDonors struct { + meta + // Total amount of spend Telegram Stars + TotalStarCount int64 `json:"total_star_count"` + // List of top donors in the live story + TopDonors []*PaidReactor `json:"top_donors"` +} + +func (entity *LiveStoryDonors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LiveStoryDonors + + return json.Marshal((*stub)(entity)) +} + +func (*LiveStoryDonors) GetClass() string { + return ClassLiveStoryDonors +} + +func (*LiveStoryDonors) GetType() string { + return TypeLiveStoryDonors +} + // Contains information about a forwarded message type MessageForwardInfo struct { meta @@ -15367,11 +18368,38 @@ func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { return nil } -// A topic in a forum supergroup chat +// A topic in a non-forum supergroup chat +type MessageTopicThread struct { + meta + // Unique identifier of the message thread + MessageThreadId int64 `json:"message_thread_id"` +} + +func (entity *MessageTopicThread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageTopicThread + + return json.Marshal((*stub)(entity)) +} + +func (*MessageTopicThread) GetClass() string { + return ClassMessageTopic +} + +func (*MessageTopicThread) GetType() string { + return TypeMessageTopicThread +} + +func (*MessageTopicThread) MessageTopicType() string { + return TypeMessageTopicThread +} + +// A topic in a forum supergroup chat or a chat with a bot type MessageTopicForum struct { meta - // Unique identifier of the forum topic; all messages in a non-forum supergroup chats belongs to the General topic - ForumTopicId int64 `json:"forum_topic_id"` + // Unique identifier of the forum topic + ForumTopicId int32 `json:"forum_topic_id"` } func (entity *MessageTopicForum) MarshalJSON() ([]byte, error) { @@ -15693,7 +18721,7 @@ type MessageReplyToMessage struct { Origin MessageOrigin `json:"origin"` // 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 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, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, 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, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote Content MessageContent `json:"content"` } @@ -15944,9 +18972,7 @@ type Message struct { SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info"` // Information about the message or the story this message is replying to; may be null if none ReplyTo MessageReplyTo `json:"reply_to"` - // If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs - MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the topic within the chat to which the message belongs; may be null if none + // Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back TopicId MessageTopic `json:"topic_id"` // The message's self-destruct type; may be null if none SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` @@ -15968,10 +18994,10 @@ type Message struct { MediaAlbumId JsonInt64 `json:"media_album_id"` // Unique identifier of the effect added to the message; 0 if none EffectId JsonInt64 `json:"effect_id"` - // True, if media content of the message must be hidden with 18+ spoiler - HasSensitiveContent bool `json:"has_sensitive_content"` - // If non-empty, contains a human-readable description of the reason why access to this message must be restricted - RestrictionReason string `json:"restriction_reason"` + // Information about the restrictions that must be applied to the message content; may be null if none + RestrictionInfo *RestrictionInfo `json:"restriction_info"` + // IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message + SummaryLanguageCode string `json:"summary_language_code"` // Content of the message Content MessageContent `json:"content"` // Reply markup for the message; may be null if none @@ -16019,7 +19045,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { FactCheck *FactCheck `json:"fact_check"` SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info"` ReplyTo json.RawMessage `json:"reply_to"` - MessageThreadId int64 `json:"message_thread_id"` TopicId json.RawMessage `json:"topic_id"` SelfDestructType json.RawMessage `json:"self_destruct_type"` SelfDestructIn float64 `json:"self_destruct_in"` @@ -16031,8 +19056,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { AuthorSignature string `json:"author_signature"` MediaAlbumId JsonInt64 `json:"media_album_id"` EffectId JsonInt64 `json:"effect_id"` - HasSensitiveContent bool `json:"has_sensitive_content"` - RestrictionReason string `json:"restriction_reason"` + RestrictionInfo *RestrictionInfo `json:"restriction_info"` + SummaryLanguageCode string `json:"summary_language_code"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` } @@ -16061,7 +19086,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.UnreadReactions = tmp.UnreadReactions message.FactCheck = tmp.FactCheck message.SuggestedPostInfo = tmp.SuggestedPostInfo - message.MessageThreadId = tmp.MessageThreadId message.SelfDestructIn = tmp.SelfDestructIn message.AutoDeleteIn = tmp.AutoDeleteIn message.ViaBotUserId = tmp.ViaBotUserId @@ -16071,8 +19095,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.AuthorSignature = tmp.AuthorSignature message.MediaAlbumId = tmp.MediaAlbumId message.EffectId = tmp.EffectId - message.HasSensitiveContent = tmp.HasSensitiveContent - message.RestrictionReason = tmp.RestrictionReason + message.RestrictionInfo = tmp.RestrictionInfo + message.SummaryLanguageCode = tmp.SummaryLanguageCode fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId @@ -16180,6 +19204,35 @@ func (*FoundChatMessages) GetType() string { return TypeFoundChatMessages } +// Contains a list of messages found by a public post search +type FoundPublicPosts struct { + meta + // List of found public posts + Messages []*Message `json:"messages"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` + // Updated public post search limits after the query; repeated requests with the same query will be free; may be null if they didn't change + SearchLimits *PublicPostSearchLimits `json:"search_limits"` + // True, if the query has failed because search limits are exceeded. In this case search_limits.daily_free_query_count will be equal to 0 + AreLimitsExceeded bool `json:"are_limits_exceeded"` +} + +func (entity *FoundPublicPosts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPublicPosts + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPublicPosts) GetClass() string { + return ClassFoundPublicPosts +} + +func (*FoundPublicPosts) GetType() string { + return TypeFoundPublicPosts +} + // Contains information about a message in a specific position type MessagePosition struct { meta @@ -17387,7 +20440,7 @@ func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON( // Contains information about a message draft type DraftMessage struct { meta - // Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none + // Information about the message to be replied; inputMessageReplyToStory is unsupported; may be null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` @@ -18300,6 +21353,8 @@ type Chat struct { AccentColorId int32 `json:"accent_color_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 BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Color scheme based on an upgraded gift to be used for the chat instead of accent_color_id and background_custom_emoji_id; may be null if none + UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // 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 @@ -18354,8 +21409,8 @@ type Chat struct { 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 - ThemeName string `json:"theme_name"` + // Theme set for the chat; may be null if none + Theme ChatTheme `json:"theme"` // Information about actions which must be possible to do through the chat action bar; may be null if none ActionBar ChatActionBar `json:"action_bar"` // Information about bar for managing a business bot in the chat; may be null if none @@ -18396,6 +21451,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Photo *ChatPhotoInfo `json:"photo"` AccentColorId int32 `json:"accent_color_id"` BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` ProfileAccentColorId int32 `json:"profile_accent_color_id"` ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` Permissions *ChatPermissions `json:"permissions"` @@ -18423,7 +21479,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` EmojiStatus *EmojiStatus `json:"emoji_status"` Background *ChatBackground `json:"background"` - ThemeName string `json:"theme_name"` + Theme json.RawMessage `json:"theme"` ActionBar json.RawMessage `json:"action_bar"` BusinessBotManageBar *BusinessBotManageBar `json:"business_bot_manage_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -18443,6 +21499,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Photo = tmp.Photo chat.AccentColorId = tmp.AccentColorId chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + chat.UpgradedGiftColors = tmp.UpgradedGiftColors chat.ProfileAccentColorId = tmp.ProfileAccentColorId chat.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId chat.Permissions = tmp.Permissions @@ -18466,7 +21523,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime chat.EmojiStatus = tmp.EmojiStatus chat.Background = tmp.Background - chat.ThemeName = tmp.ThemeName chat.BusinessBotManageBar = tmp.BusinessBotManageBar chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -18489,6 +21545,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) chat.AvailableReactions = fieldAvailableReactions + fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) + chat.Theme = fieldTheme + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -18520,7 +21579,7 @@ func (*Chats) GetType() string { return TypeChats } -// Contains information about a user that has failed to be added to a chat +// Contains information about a user who has failed to be added to a chat type FailedToAddMember struct { meta // User identifier @@ -18645,7 +21704,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// Contains basic information about another user that started a chat with the current user +// Contains basic information about another user who started a chat with the current user type AccountInfo struct { meta // Month when the user was registered in Telegram; 0-12; may be 0 if unknown @@ -18838,6 +21897,106 @@ func (*ChatActionBarJoinRequest) ChatActionBarType() string { return TypeChatActionBarJoinRequest } +// The button has default style +type ButtonStyleDefault struct{ + meta +} + +func (entity *ButtonStyleDefault) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleDefault + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleDefault) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleDefault) GetType() string { + return TypeButtonStyleDefault +} + +func (*ButtonStyleDefault) ButtonStyleType() string { + return TypeButtonStyleDefault +} + +// The button has dark blue color +type ButtonStylePrimary struct{ + meta +} + +func (entity *ButtonStylePrimary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStylePrimary + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStylePrimary) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStylePrimary) GetType() string { + return TypeButtonStylePrimary +} + +func (*ButtonStylePrimary) ButtonStyleType() string { + return TypeButtonStylePrimary +} + +// The button has red color +type ButtonStyleDanger struct{ + meta +} + +func (entity *ButtonStyleDanger) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleDanger + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleDanger) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleDanger) GetType() string { + return TypeButtonStyleDanger +} + +func (*ButtonStyleDanger) ButtonStyleType() string { + return TypeButtonStyleDanger +} + +// The button has green color +type ButtonStyleSuccess struct{ + meta +} + +func (entity *ButtonStyleSuccess) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleSuccess + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleSuccess) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleSuccess) GetType() string { + return TypeButtonStyleSuccess +} + +func (*ButtonStyleSuccess) ButtonStyleType() string { + return TypeButtonStyleSuccess +} + // A simple button, with text that must be sent when the button is pressed type KeyboardButtonTypeText struct{ meta @@ -19068,6 +22227,10 @@ type KeyboardButton struct { meta // Text of the button Text string `json:"text"` + // Identifier of the custom emoji that must be shown on the button; 0 if none + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + // Style of the button + Style ButtonStyle `json:"style"` // Type of the button Type KeyboardButtonType `json:"type"` } @@ -19091,6 +22254,8 @@ func (*KeyboardButton) GetType() string { func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -19100,6 +22265,10 @@ func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { } keyboardButton.Text = tmp.Text + keyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId + + fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) + keyboardButton.Style = fieldStyle fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type) keyboardButton.Type = fieldType @@ -19403,6 +22572,10 @@ type InlineKeyboardButton struct { meta // Text of the button Text string `json:"text"` + // Identifier of the custom emoji that must be shown on the button; 0 if none + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + // Style of the button + Style ButtonStyle `json:"style"` // Type of the button Type InlineKeyboardButtonType `json:"type"` } @@ -19426,6 +22599,8 @@ func (*InlineKeyboardButton) GetType() string { func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -19435,6 +22610,10 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err } inlineKeyboardButton.Text = tmp.Text + inlineKeyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId + + fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) + inlineKeyboardButton.Style = fieldStyle fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) inlineKeyboardButton.Type = fieldType @@ -19602,6 +22781,16 @@ type LoginUrlInfoRequestConfirmation struct { BotUserId int64 `json:"bot_user_id"` // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` + // True, if the user must be asked for the permission to share their phone number + RequestPhoneNumberAccess bool `json:"request_phone_number_access"` + // The version of a browser used for the authorization; may be empty if irrelevant + Browser string `json:"browser"` + // Operating system the browser is running on; may be empty if irrelevant + Platform string `json:"platform"` + // IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant + IpAddress string `json:"ip_address"` + // Human-readable description of a country and a region from which the authorization is performed, based on the IP address; may be empty if irrelevant + Location string `json:"location"` } func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { @@ -20077,7 +23266,7 @@ type DirectMessagesChatTopic struct { Order JsonInt64 `json:"order"` // True, if the other party can send unpaid messages even if the chat has paid messages enabled CanSendUnpaidMessages bool `json:"can_send_unpaid_messages"` - // True, if the forum topic is marked as unread + // True, if the topic is marked as unread IsMarkedAsUnread bool `json:"is_marked_as_unread"` // Number of unread messages in the chat UnreadCount int64 `json:"unread_count"` @@ -20176,12 +23365,10 @@ func (*ForumTopicIcon) GetType() string { // Contains basic information about a forum topic type ForumTopicInfo struct { meta - // Identifier of the forum chat to which the topic belongs + // Identifier of a forum supergroup chat or a chat with a bot to which the topic belongs ChatId int64 `json:"chat_id"` // Forum topic identifier of the topic - ForumTopicId int64 `json:"forum_topic_id"` - // Message thread identifier of the topic - MessageThreadId int64 `json:"message_thread_id"` + ForumTopicId int32 `json:"forum_topic_id"` // Name of the topic Name string `json:"name"` // Icon of the topic @@ -20190,7 +23377,7 @@ type ForumTopicInfo struct { CreationDate int32 `json:"creation_date"` // Identifier of the creator of the topic CreatorId MessageSender `json:"creator_id"` - // True, if the topic is the General topic list + // True, if the topic is the General topic IsGeneral bool `json:"is_general"` // True, if the topic was created by the current user IsOutgoing bool `json:"is_outgoing"` @@ -20198,6 +23385,8 @@ type ForumTopicInfo struct { IsClosed bool `json:"is_closed"` // True, if the topic is hidden above the topic list and closed; for General topic only IsHidden bool `json:"is_hidden"` + // True, if the name of the topic wasn't added explicitly + IsNameImplicit bool `json:"is_name_implicit"` } func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { @@ -20219,8 +23408,7 @@ func (*ForumTopicInfo) GetType() string { func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` - ForumTopicId int64 `json:"forum_topic_id"` - MessageThreadId int64 `json:"message_thread_id"` + ForumTopicId int32 `json:"forum_topic_id"` Name string `json:"name"` Icon *ForumTopicIcon `json:"icon"` CreationDate int32 `json:"creation_date"` @@ -20229,6 +23417,7 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { IsOutgoing bool `json:"is_outgoing"` IsClosed bool `json:"is_closed"` IsHidden bool `json:"is_hidden"` + IsNameImplicit bool `json:"is_name_implicit"` } err := json.Unmarshal(data, &tmp) @@ -20238,7 +23427,6 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { forumTopicInfo.ChatId = tmp.ChatId forumTopicInfo.ForumTopicId = tmp.ForumTopicId - forumTopicInfo.MessageThreadId = tmp.MessageThreadId forumTopicInfo.Name = tmp.Name forumTopicInfo.Icon = tmp.Icon forumTopicInfo.CreationDate = tmp.CreationDate @@ -20246,6 +23434,7 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { forumTopicInfo.IsOutgoing = tmp.IsOutgoing forumTopicInfo.IsClosed = tmp.IsClosed forumTopicInfo.IsHidden = tmp.IsHidden + forumTopicInfo.IsNameImplicit = tmp.IsNameImplicit fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) forumTopicInfo.CreatorId = fieldCreatorId @@ -20307,8 +23496,8 @@ type ForumTopics struct { NextOffsetDate int32 `json:"next_offset_date"` // Offset message identifier for the next getForumTopics request NextOffsetMessageId int64 `json:"next_offset_message_id"` - // Offset message thread identifier for the next getForumTopics request - NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` + // Offset forum topic identifier for the next getForumTopics request + NextOffsetForumTopicId int32 `json:"next_offset_forum_topic_id"` } func (entity *ForumTopics) MarshalJSON() ([]byte, error) { @@ -20418,14 +23607,141 @@ func (*SharedChat) GetType() string { return TypeSharedChat } +// Classic light theme +type BuiltInThemeClassic struct{ + meta +} + +func (entity *BuiltInThemeClassic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BuiltInThemeClassic + + return json.Marshal((*stub)(entity)) +} + +func (*BuiltInThemeClassic) GetClass() string { + return ClassBuiltInTheme +} + +func (*BuiltInThemeClassic) GetType() string { + return TypeBuiltInThemeClassic +} + +func (*BuiltInThemeClassic) BuiltInThemeType() string { + return TypeBuiltInThemeClassic +} + +// Regular light theme +type BuiltInThemeDay struct{ + meta +} + +func (entity *BuiltInThemeDay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BuiltInThemeDay + + return json.Marshal((*stub)(entity)) +} + +func (*BuiltInThemeDay) GetClass() string { + return ClassBuiltInTheme +} + +func (*BuiltInThemeDay) GetType() string { + return TypeBuiltInThemeDay +} + +func (*BuiltInThemeDay) BuiltInThemeType() string { + return TypeBuiltInThemeDay +} + +// Regular dark theme +type BuiltInThemeNight struct{ + meta +} + +func (entity *BuiltInThemeNight) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BuiltInThemeNight + + return json.Marshal((*stub)(entity)) +} + +func (*BuiltInThemeNight) GetClass() string { + return ClassBuiltInTheme +} + +func (*BuiltInThemeNight) GetType() string { + return TypeBuiltInThemeNight +} + +func (*BuiltInThemeNight) BuiltInThemeType() string { + return TypeBuiltInThemeNight +} + +// Tinted dark theme +type BuiltInThemeTinted struct{ + meta +} + +func (entity *BuiltInThemeTinted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BuiltInThemeTinted + + return json.Marshal((*stub)(entity)) +} + +func (*BuiltInThemeTinted) GetClass() string { + return ClassBuiltInTheme +} + +func (*BuiltInThemeTinted) GetType() string { + return TypeBuiltInThemeTinted +} + +func (*BuiltInThemeTinted) BuiltInThemeType() string { + return TypeBuiltInThemeTinted +} + +// Arctic light theme +type BuiltInThemeArctic struct{ + meta +} + +func (entity *BuiltInThemeArctic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BuiltInThemeArctic + + return json.Marshal((*stub)(entity)) +} + +func (*BuiltInThemeArctic) GetClass() string { + return ClassBuiltInTheme +} + +func (*BuiltInThemeArctic) GetType() string { + return TypeBuiltInThemeArctic +} + +func (*BuiltInThemeArctic) BuiltInThemeType() string { + return TypeBuiltInThemeArctic +} + // Describes theme settings type ThemeSettings struct { meta + // Base theme for this theme + BaseTheme BuiltInTheme `json:"base_theme"` // Theme accent color in ARGB format AccentColor int32 `json:"accent_color"` // The background to be used in chats; may be null Background *Background `json:"background"` - // The fill to be used as a background for outgoing messages + // The fill to be used as a background for outgoing messages; may be null if the fill from the base theme must be used instead OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` // If true, the freeform gradient fill needs to be animated on every sent message AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` @@ -20451,6 +23767,7 @@ func (*ThemeSettings) GetType() string { func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { var tmp struct { + BaseTheme json.RawMessage `json:"base_theme"` AccentColor int32 `json:"accent_color"` Background *Background `json:"background"` OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` @@ -20468,6 +23785,9 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor + fieldBaseTheme, _ := UnmarshalBuiltInTheme(tmp.BaseTheme) + themeSettings.BaseTheme = fieldBaseTheme + fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill @@ -23130,6 +26450,33 @@ func (linkPreviewTypeChat *LinkPreviewTypeChat) UnmarshalJSON(data []byte) error return nil } +// The link is a link to a direct messages chat of a channel +type LinkPreviewTypeDirectMessagesChat struct { + meta + // Photo of the channel chat; may be null + Photo *ChatPhoto `json:"photo"` +} + +func (entity *LinkPreviewTypeDirectMessagesChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeDirectMessagesChat + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeDirectMessagesChat) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeDirectMessagesChat) GetType() string { + return TypeLinkPreviewTypeDirectMessagesChat +} + +func (*LinkPreviewTypeDirectMessagesChat) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeDirectMessagesChat +} + // The link is a link to a general file type LinkPreviewTypeDocument struct { meta @@ -23328,6 +26675,62 @@ func (*LinkPreviewTypeExternalVideo) LinkPreviewTypeType() string { return TypeLinkPreviewTypeExternalVideo } +// The link is a link to a gift auction +type LinkPreviewTypeGiftAuction struct { + meta + // The gift + Gift *Gift `json:"gift"` + // Point in time (Unix timestamp) when the auction will be ended + AuctionEndDate int32 `json:"auction_end_date"` +} + +func (entity *LinkPreviewTypeGiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeGiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeGiftAuction) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeGiftAuction) GetType() string { + return TypeLinkPreviewTypeGiftAuction +} + +func (*LinkPreviewTypeGiftAuction) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeGiftAuction +} + +// The link is a link to a gift collection +type LinkPreviewTypeGiftCollection struct { + meta + // Icons for some gifts from the collection; may be empty + Icons []*Sticker `json:"icons"` +} + +func (entity *LinkPreviewTypeGiftCollection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeGiftCollection + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeGiftCollection) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeGiftCollection) GetType() string { + return TypeLinkPreviewTypeGiftCollection +} + +func (*LinkPreviewTypeGiftCollection) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeGiftCollection +} + // The link is a link to a group call that isn't bound to a chat type LinkPreviewTypeGroupCall struct{ meta @@ -23378,6 +26781,35 @@ func (*LinkPreviewTypeInvoice) LinkPreviewTypeType() string { return TypeLinkPreviewTypeInvoice } +// The link is a link to a live story group call +type LinkPreviewTypeLiveStory struct { + meta + // The identifier of the chat that posted the story + StoryPosterChatId int64 `json:"story_poster_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *LinkPreviewTypeLiveStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeLiveStory + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeLiveStory) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeLiveStory) GetType() string { + return TypeLinkPreviewTypeLiveStory +} + +func (*LinkPreviewTypeLiveStory) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeLiveStory +} + // The link is a link to a text or a poll Telegram message type LinkPreviewTypeMessage struct{ meta @@ -23563,6 +26995,35 @@ func (*LinkPreviewTypeStory) LinkPreviewTypeType() string { return TypeLinkPreviewTypeStory } +// The link is a link to an album of stories +type LinkPreviewTypeStoryAlbum struct { + meta + // Icon of the album; may be null if none + PhotoIcon *Photo `json:"photo_icon"` + // Video icon of the album; may be null if none + VideoIcon *Video `json:"video_icon"` +} + +func (entity *LinkPreviewTypeStoryAlbum) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeStoryAlbum + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeStoryAlbum) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeStoryAlbum) GetType() string { + return TypeLinkPreviewTypeStoryAlbum +} + +func (*LinkPreviewTypeStoryAlbum) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeStoryAlbum +} + // The link is a link to boost a supergroup chat type LinkPreviewTypeSupergroupBoost struct { meta @@ -27915,7 +31376,7 @@ type MessageDice struct { FinalState DiceStickers `json:"final_state"` // Emoji on which the dice throw animation is based Emoji string `json:"emoji"` - // The dice value. If the value is 0, the dice don't have final state yet + // The dice value. If the value is 0, then the dice don't have final state yet Value int32 `json:"value"` // Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"` @@ -28022,6 +31483,68 @@ func (*MessagePoll) MessageContentType() string { return TypeMessagePoll } +// A stake dice message. The dice value is randomly generated by the server +type MessageStakeDice struct { + meta + // The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known + InitialState DiceStickers `json:"initial_state"` + // The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known + FinalState DiceStickers `json:"final_state"` + // The dice value. If the value is 0, then the dice don't have final state yet + Value int32 `json:"value"` + // The Toncoin amount that was staked; in the smallest units of the currency + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + // The Toncoin amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet + PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` +} + +func (entity *MessageStakeDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStakeDice + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStakeDice) GetClass() string { + return ClassMessageContent +} + +func (*MessageStakeDice) GetType() string { + return TypeMessageStakeDice +} + +func (*MessageStakeDice) MessageContentType() string { + return TypeMessageStakeDice +} + +func (messageStakeDice *MessageStakeDice) UnmarshalJSON(data []byte) error { + var tmp struct { + InitialState json.RawMessage `json:"initial_state"` + FinalState json.RawMessage `json:"final_state"` + Value int32 `json:"value"` + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageStakeDice.Value = tmp.Value + messageStakeDice.StakeToncoinAmount = tmp.StakeToncoinAmount + messageStakeDice.PrizeToncoinAmount = tmp.PrizeToncoinAmount + + fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) + messageStakeDice.InitialState = fieldInitialState + + fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState) + messageStakeDice.FinalState = fieldFinalState + + return nil +} + // A message with a forwarded story type MessageStory struct { meta @@ -28211,6 +31734,8 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { // A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden type MessageGroupCall struct { meta + // Persistent unique group call identifier + UniqueId JsonInt64 `json:"unique_id"` // True, if the call is active, i.e. the called user joined the call IsActive bool `json:"is_active"` // True, if the called user missed or declined the call @@ -28245,6 +31770,7 @@ func (*MessageGroupCall) MessageContentType() string { func (messageGroupCall *MessageGroupCall) UnmarshalJSON(data []byte) error { var tmp struct { + UniqueId JsonInt64 `json:"unique_id"` IsActive bool `json:"is_active"` WasMissed bool `json:"was_missed"` IsVideo bool `json:"is_video"` @@ -28257,6 +31783,7 @@ func (messageGroupCall *MessageGroupCall) UnmarshalJSON(data []byte) error { return err } + messageGroupCall.UniqueId = tmp.UniqueId messageGroupCall.IsActive = tmp.IsActive messageGroupCall.WasMissed = tmp.WasMissed messageGroupCall.IsVideo = tmp.IsVideo @@ -28515,6 +32042,60 @@ func (*MessageChatDeletePhoto) MessageContentType() string { return TypeMessageChatDeletePhoto } +// The owner of the chat has left +type MessageChatOwnerLeft struct { + meta + // Identifier of the user who will become the new owner of the chat if the previous owner isn't return; 0 if none + NewOwnerUserId int64 `json:"new_owner_user_id"` +} + +func (entity *MessageChatOwnerLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatOwnerLeft + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatOwnerLeft) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatOwnerLeft) GetType() string { + return TypeMessageChatOwnerLeft +} + +func (*MessageChatOwnerLeft) MessageContentType() string { + return TypeMessageChatOwnerLeft +} + +// The owner of the chat has changed +type MessageChatOwnerChanged struct { + meta + // Identifier of the user who is the new owner of the chat + NewOwnerUserId int64 `json:"new_owner_user_id"` +} + +func (entity *MessageChatOwnerChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatOwnerChanged + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatOwnerChanged) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatOwnerChanged) GetType() string { + return TypeMessageChatOwnerChanged +} + +func (*MessageChatOwnerChanged) MessageContentType() string { + return TypeMessageChatOwnerChanged +} + // New chat members were added type MessageChatAddMembers struct { meta @@ -28761,8 +32342,8 @@ func (*MessageChatSetBackground) MessageContentType() string { // A theme in the chat has been changed type MessageChatSetTheme struct { meta - // If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one - ThemeName string `json:"theme_name"` + // New theme for the chat; may be null if chat theme was reset to the default one + Theme ChatTheme `json:"theme"` } func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) { @@ -28785,6 +32366,22 @@ func (*MessageChatSetTheme) MessageContentType() string { return TypeMessageChatSetTheme } +func (messageChatSetTheme *MessageChatSetTheme) UnmarshalJSON(data []byte) error { + var tmp struct { + Theme json.RawMessage `json:"theme"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) + messageChatSetTheme.Theme = fieldTheme + + return nil +} + // The auto-delete or self-destruct timer for messages in the chat has been changed type MessageChatSetMessageAutoDeleteTime struct { meta @@ -28846,6 +32443,8 @@ type MessageForumTopicCreated struct { meta // Name of the topic Name string `json:"name"` + // True, if the name of the topic wasn't added explicitly + IsNameImplicit bool `json:"is_name_implicit"` // Icon of the topic Icon *ForumTopicIcon `json:"icon"` } @@ -28982,6 +32581,33 @@ func (*MessageSuggestProfilePhoto) MessageContentType() string { return TypeMessageSuggestProfilePhoto } +// A birthdate was suggested to be set +type MessageSuggestBirthdate struct { + meta + // The suggested birthdate. Use the method setBirthdate to apply the birthdate + Birthdate *Birthdate `json:"birthdate"` +} + +func (entity *MessageSuggestBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSuggestBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSuggestBirthdate) GetClass() string { + return ClassMessageContent +} + +func (*MessageSuggestBirthdate) GetType() string { + return TypeMessageSuggestBirthdate +} + +func (*MessageSuggestBirthdate) MessageContentType() string { + return TypeMessageSuggestBirthdate +} + // A non-standard action has happened in the chat type MessageCustomServiceAction struct { meta @@ -29045,7 +32671,7 @@ type MessagePaymentSuccessful struct { meta // Identifier of the chat, containing the corresponding invoice message InvoiceChatId int64 `json:"invoice_chat_id"` - // Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message + // Identifier of the message with the corresponding invoice; may be 0 or an identifier of a deleted message InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for the price of the product Currency string `json:"currency"` @@ -29193,9 +32819,9 @@ func (messagePaymentRefunded *MessagePaymentRefunded) UnmarshalJSON(data []byte) // Telegram Premium was gifted to a user type MessageGiftedPremium struct { meta - // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Telegram Premium; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Telegram Premium; 0 if the gift is incoming + // The identifier of a user who received Telegram Premium; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Message added to the gifted Telegram Premium by the sender Text *FormattedText `json:"text"` @@ -29207,8 +32833,10 @@ type MessageGiftedPremium struct { Cryptocurrency string `json:"cryptocurrency"` // The paid amount, in the smallest units of the cryptocurrency; 0 if none CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` - // Number of months the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active + DayCount int32 `json:"day_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` } @@ -29236,7 +32864,7 @@ 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; may be null if unknown + // Identifier of a chat or a user who created the gift code; may be null if unknown CreatorId MessageSender `json:"creator_id"` // Message added to the gift Text *FormattedText `json:"text"` @@ -29252,8 +32880,10 @@ type MessagePremiumGiftCode struct { 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 + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active after code activation + DayCount int32 `json:"day_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` // The gift code @@ -29291,6 +32921,7 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) Cryptocurrency string `json:"cryptocurrency"` CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` MonthCount int32 `json:"month_count"` + DayCount int32 `json:"day_count"` Sticker *Sticker `json:"sticker"` Code string `json:"code"` } @@ -29308,6 +32939,7 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) messagePremiumGiftCode.Cryptocurrency = tmp.Cryptocurrency messagePremiumGiftCode.CryptocurrencyAmount = tmp.CryptocurrencyAmount messagePremiumGiftCode.MonthCount = tmp.MonthCount + messagePremiumGiftCode.DayCount = tmp.DayCount messagePremiumGiftCode.Sticker = tmp.Sticker messagePremiumGiftCode.Code = tmp.Code @@ -29403,7 +33035,7 @@ func (messageGiveaway *MessageGiveaway) UnmarshalJSON(data []byte) error { // A giveaway without public winners has been completed for the chat type MessageGiveawayCompleted struct { meta - // Identifier of the message with the giveaway; can be 0 if the message was deleted + // Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` // Number of winners in the giveaway WinnerCount int32 `json:"winner_count"` @@ -29520,9 +33152,9 @@ func (messageGiveawayWinners *MessageGiveawayWinners) UnmarshalJSON(data []byte) // Telegram Stars were gifted to a user type MessageGiftedStars struct { meta - // The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Telegram Stars; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Telegram Stars; 0 if the gift is incoming + // The identifier of a user who received Telegram Stars; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Currency for the paid amount Currency string `json:"currency"` @@ -29563,11 +33195,11 @@ func (*MessageGiftedStars) MessageContentType() string { // Toncoins were gifted to a user type MessageGiftedTon struct { meta - // The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Toncoins; 0 if the gift is incoming + // The identifier of a user who received Toncoins; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` - // The received amount of Toncoins, in the smallest units of the cryptocurrency + // The received Toncoin amount, in the smallest units of the cryptocurrency TonAmount int64 `json:"ton_amount"` // Identifier of the transaction for Toncoin credit; for receiver only TransactionId string `json:"transaction_id"` @@ -29604,7 +33236,7 @@ type MessageGiveawayPrizeStars struct { TransactionId string `json:"transaction_id"` // Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway BoostedChatId int64 `json:"boosted_chat_id"` - // Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted + // Identifier of the message with the giveaway in the boosted chat; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` // True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat IsUnclaimed bool `json:"is_unclaimed"` @@ -29637,7 +33269,7 @@ type MessageGift struct { meta // The gift Gift *Gift `json:"gift"` - // Sender of the gift + // Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users SenderId MessageSender `json:"sender_id"` // Receiver of the gift ReceiverId MessageSender `json:"receiver_id"` @@ -29645,14 +33277,22 @@ type MessageGift struct { ReceivedGiftId string `json:"received_gift_id"` // Message added to the gift Text *FormattedText `json:"text"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` // Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver SellStarCount int64 `json:"sell_star_count"` // Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` + // True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost + IsUpgradeSeparate bool `json:"is_upgrade_separate"` + // True, if the message is a notification about a gift won on an auction + IsFromAuction bool `json:"is_from_auction"` // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them IsPrivate bool `json:"is_private"` // True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift IsSaved bool `json:"is_saved"` + // True, if the message is about prepaid upgrade of the gift by another user + IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` // True, if the gift can be upgraded to a unique gift; only for the receiver of the gift CanBeUpgraded bool `json:"can_be_upgraded"` // True, if the gift was converted to Telegram Stars; only for the receiver of the gift @@ -29663,6 +33303,8 @@ type MessageGift struct { WasRefunded bool `json:"was_refunded"` // Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift UpgradedReceivedGiftId string `json:"upgraded_received_gift_id"` + // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade + PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` } func (entity *MessageGift) MarshalJSON() ([]byte, error) { @@ -29692,15 +33334,20 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { ReceiverId json.RawMessage `json:"receiver_id"` ReceivedGiftId string `json:"received_gift_id"` Text *FormattedText `json:"text"` + UniqueGiftNumber int32 `json:"unique_gift_number"` SellStarCount int64 `json:"sell_star_count"` PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` + IsUpgradeSeparate bool `json:"is_upgrade_separate"` + IsFromAuction bool `json:"is_from_auction"` IsPrivate bool `json:"is_private"` IsSaved bool `json:"is_saved"` + IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` CanBeUpgraded bool `json:"can_be_upgraded"` WasConverted bool `json:"was_converted"` WasUpgraded bool `json:"was_upgraded"` WasRefunded bool `json:"was_refunded"` UpgradedReceivedGiftId string `json:"upgraded_received_gift_id"` + PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` } err := json.Unmarshal(data, &tmp) @@ -29711,15 +33358,20 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { messageGift.Gift = tmp.Gift messageGift.ReceivedGiftId = tmp.ReceivedGiftId messageGift.Text = tmp.Text + messageGift.UniqueGiftNumber = tmp.UniqueGiftNumber messageGift.SellStarCount = tmp.SellStarCount messageGift.PrepaidUpgradeStarCount = tmp.PrepaidUpgradeStarCount + messageGift.IsUpgradeSeparate = tmp.IsUpgradeSeparate + messageGift.IsFromAuction = tmp.IsFromAuction messageGift.IsPrivate = tmp.IsPrivate messageGift.IsSaved = tmp.IsSaved + messageGift.IsPrepaidUpgrade = tmp.IsPrepaidUpgrade messageGift.CanBeUpgraded = tmp.CanBeUpgraded messageGift.WasConverted = tmp.WasConverted messageGift.WasUpgraded = tmp.WasUpgraded messageGift.WasRefunded = tmp.WasRefunded messageGift.UpgradedReceivedGiftId = tmp.UpgradedReceivedGiftId + messageGift.PrepaidUpgradeHash = tmp.PrepaidUpgradeHash fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageGift.SenderId = fieldSenderId @@ -29751,12 +33403,16 @@ type MessageUpgradedGift struct { WasTransferred bool `json:"was_transferred"` // Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift TransferStarCount int64 `json:"transfer_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift + // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available; only for the receiver of the gift + DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` + // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift NextTransferDate int32 `json:"next_transfer_date"` - // Point in time (Unix timestamp) when the gift can be resold to another user; 0 if the gift can't be resold; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift NextResaleDate int32 `json:"next_resale_date"` - // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` + // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + CraftDate int32 `json:"craft_date"` } func (entity *MessageUpgradedGift) MarshalJSON() ([]byte, error) { @@ -29790,9 +33446,11 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error CanBeTransferred bool `json:"can_be_transferred"` WasTransferred bool `json:"was_transferred"` TransferStarCount int64 `json:"transfer_star_count"` + DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` NextTransferDate int32 `json:"next_transfer_date"` NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` + CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -29806,9 +33464,11 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error messageUpgradedGift.CanBeTransferred = tmp.CanBeTransferred messageUpgradedGift.WasTransferred = tmp.WasTransferred messageUpgradedGift.TransferStarCount = tmp.TransferStarCount + messageUpgradedGift.DropOriginalDetailsStarCount = tmp.DropOriginalDetailsStarCount messageUpgradedGift.NextTransferDate = tmp.NextTransferDate messageUpgradedGift.NextResaleDate = tmp.NextResaleDate messageUpgradedGift.ExportDate = tmp.ExportDate + messageUpgradedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageUpgradedGift.SenderId = fieldSenderId @@ -29831,8 +33491,8 @@ type MessageRefundedUpgradedGift struct { SenderId MessageSender `json:"sender_id"` // Receiver of the gift ReceiverId MessageSender `json:"receiver_id"` - // True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred or resold gift - IsUpgrade bool `json:"is_upgrade"` + // Origin of the upgraded gift + Origin UpgradedGiftOrigin `json:"origin"` } func (entity *MessageRefundedUpgradedGift) MarshalJSON() ([]byte, error) { @@ -29860,7 +33520,7 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da Gift *Gift `json:"gift"` SenderId json.RawMessage `json:"sender_id"` ReceiverId json.RawMessage `json:"receiver_id"` - IsUpgrade bool `json:"is_upgrade"` + Origin json.RawMessage `json:"origin"` } err := json.Unmarshal(data, &tmp) @@ -29869,7 +33529,6 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da } messageRefundedUpgradedGift.Gift = tmp.Gift - messageRefundedUpgradedGift.IsUpgrade = tmp.IsUpgrade fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageRefundedUpgradedGift.SenderId = fieldSenderId @@ -29877,6 +33536,123 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) messageRefundedUpgradedGift.ReceiverId = fieldReceiverId + fieldOrigin, _ := UnmarshalUpgradedGiftOrigin(tmp.Origin) + messageRefundedUpgradedGift.Origin = fieldOrigin + + return nil +} + +// An offer to purchase an upgraded gift was sent or received +type MessageUpgradedGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` + // State of the offer + State GiftPurchaseOfferState `json:"state"` + // The proposed price + Price GiftResalePrice `json:"price"` + // Point in time (Unix timestamp) when the offer will expire or has expired + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *MessageUpgradedGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUpgradedGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUpgradedGiftPurchaseOffer) GetClass() string { + return ClassMessageContent +} + +func (*MessageUpgradedGiftPurchaseOffer) GetType() string { + return TypeMessageUpgradedGiftPurchaseOffer +} + +func (*MessageUpgradedGiftPurchaseOffer) MessageContentType() string { + return TypeMessageUpgradedGiftPurchaseOffer +} + +func (messageUpgradedGiftPurchaseOffer *MessageUpgradedGiftPurchaseOffer) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *UpgradedGift `json:"gift"` + State json.RawMessage `json:"state"` + Price json.RawMessage `json:"price"` + ExpirationDate int32 `json:"expiration_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageUpgradedGiftPurchaseOffer.Gift = tmp.Gift + messageUpgradedGiftPurchaseOffer.ExpirationDate = tmp.ExpirationDate + + fieldState, _ := UnmarshalGiftPurchaseOfferState(tmp.State) + messageUpgradedGiftPurchaseOffer.State = fieldState + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + messageUpgradedGiftPurchaseOffer.Price = fieldPrice + + return nil +} + +// An offer to purchase a gift was rejected or expired +type MessageUpgradedGiftPurchaseOfferRejected struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` + // The proposed price + Price GiftResalePrice `json:"price"` + // Identifier of the message with purchase offer which was rejected or expired; may be 0 or an identifier of a deleted message + OfferMessageId int64 `json:"offer_message_id"` + // True, if the offer has expired; otherwise, the offer was explicitly rejected + WasExpired bool `json:"was_expired"` +} + +func (entity *MessageUpgradedGiftPurchaseOfferRejected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUpgradedGiftPurchaseOfferRejected + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) GetClass() string { + return ClassMessageContent +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) GetType() string { + return TypeMessageUpgradedGiftPurchaseOfferRejected +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) MessageContentType() string { + return TypeMessageUpgradedGiftPurchaseOfferRejected +} + +func (messageUpgradedGiftPurchaseOfferRejected *MessageUpgradedGiftPurchaseOfferRejected) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *UpgradedGift `json:"gift"` + Price json.RawMessage `json:"price"` + OfferMessageId int64 `json:"offer_message_id"` + WasExpired bool `json:"was_expired"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageUpgradedGiftPurchaseOfferRejected.Gift = tmp.Gift + messageUpgradedGiftPurchaseOfferRejected.OfferMessageId = tmp.OfferMessageId + messageUpgradedGiftPurchaseOfferRejected.WasExpired = tmp.WasExpired + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + messageUpgradedGiftPurchaseOfferRejected.Price = fieldPrice + return nil } @@ -29968,7 +33744,7 @@ func (*MessageDirectMessagePriceChanged) MessageContentType() string { // Some tasks from a checklist were marked as done or not done type MessageChecklistTasksDone struct { meta - // Identifier of the message with the checklist; can be 0 if the message was deleted + // Identifier of the message with the checklist; may be 0 or an identifier of a deleted message ChecklistMessageId int64 `json:"checklist_message_id"` // Identifiers of tasks that were marked as done MarkedAsDoneTaskIds []int32 `json:"marked_as_done_task_ids"` @@ -29999,7 +33775,7 @@ func (*MessageChecklistTasksDone) MessageContentType() string { // Some tasks were added to a checklist type MessageChecklistTasksAdded struct { meta - // Identifier of the message with the checklist; can be 0 if the message was deleted + // Identifier of the message with the checklist; may be 0 or an identifier of a deleted message ChecklistMessageId int64 `json:"checklist_message_id"` // List of tasks added to the checklist Tasks []*ChecklistTask `json:"tasks"` @@ -30028,7 +33804,7 @@ func (*MessageChecklistTasksAdded) MessageContentType() string { // Approval of suggested post has failed, because the user which proposed the post had no enough funds type MessageSuggestedPostApprovalFailed struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Price of the suggested post Price SuggestedPostPrice `json:"price"` @@ -30076,7 +33852,7 @@ func (messageSuggestedPostApprovalFailed *MessageSuggestedPostApprovalFailed) Un // A suggested post was approved type MessageSuggestedPostApproved struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Price of the suggested post; may be null if the post is non-paid Price SuggestedPostPrice `json:"price"` @@ -30128,7 +33904,7 @@ func (messageSuggestedPostApproved *MessageSuggestedPostApproved) UnmarshalJSON( // A suggested post was declined type MessageSuggestedPostDeclined struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Comment added by administrator of the channel when the post was declined Comment string `json:"comment"` @@ -30157,7 +33933,7 @@ func (*MessageSuggestedPostDeclined) MessageContentType() string { // A suggested post was published for getOption("suggested_post_lifetime_min") seconds and payment for the post was received type MessageSuggestedPostPaid struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // The amount of received Telegram Stars StarAmount *StarAmount `json:"star_amount"` @@ -30188,7 +33964,7 @@ func (*MessageSuggestedPostPaid) MessageContentType() string { // A suggested post was refunded type MessageSuggestedPostRefunded struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Reason of the refund Reason SuggestedPostRefundReason `json:"reason"` @@ -31322,6 +35098,8 @@ type MessageSchedulingStateSendAtDate struct { meta // Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future SendDate int32 `json:"send_date"` + // Period after which the message will be sent again; in seconds; 0 if never; for Telegram Premium users only; may be non-zero only in sendMessage and forwardMessages with one message requests; must be one of 0, 86400, 7 * 86400, 14 * 86400, 30 * 86400, 91 * 86400, 182 * 86400, 365 * 86400, or additionally 60, or 300 in the Test DC + RepeatPeriod int32 `json:"repeat_period"` } func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) { @@ -31451,8 +35229,6 @@ func (*MessageSelfDestructTypeImmediately) MessageSelfDestructTypeType() string // Options to be used when a message is sent type MessageSendOptions struct { meta - // Unique identifier of the topic in a channel direct messages chat administered by the current user; pass 0 if the chat isn't a channel direct messages chat administered by the current user - DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"` // Information about the suggested post; pass null if none. For messages to channel direct messages chat only. Applicable only to sendMessage and addOffer SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` // Pass true to disable notification for the message @@ -31469,7 +35245,7 @@ type MessageSendOptions struct { UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` - // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats + // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage, sendMessageAlbum in private chats and forwardMessages with one message to private chats EffectId JsonInt64 `json:"effect_id"` // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates SendingId int32 `json:"sending_id"` @@ -31495,7 +35271,6 @@ func (*MessageSendOptions) GetType() string { func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { - DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"` SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` DisableNotification bool `json:"disable_notification"` FromBackground bool `json:"from_background"` @@ -31514,7 +35289,6 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return err } - messageSendOptions.DirectMessagesChatTopicId = tmp.DirectMessagesChatTopicId messageSendOptions.SuggestedPostInfo = tmp.SuggestedPostInfo messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground @@ -31568,7 +35342,7 @@ type InputMessageText struct { Text *FormattedText `json:"text"` // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` - // True, if a chat message draft must be deleted + // True, if the chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -32445,6 +36219,37 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { return nil } +// A stake dice message +type InputMessageStakeDice struct { + meta + // Hash of the stake dice state. The state hash can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState + StateHash string `json:"state_hash"` + // The Toncoin amount that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + // True, if the chat message draft must be deleted + ClearDraft bool `json:"clear_draft"` +} + +func (entity *InputMessageStakeDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageStakeDice + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageStakeDice) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageStakeDice) GetType() string { + return TypeInputMessageStakeDice +} + +func (*InputMessageStakeDice) InputMessageContentType() string { + return TypeInputMessageStakeDice +} + // A message with a forwarded story. Stories can't be forwarded to secret chats. A story can be forwarded only if story.can_be_forwarded type InputMessageStory struct { meta @@ -34930,6 +38735,106 @@ func (*StoryVideo) GetType() string { return TypeStoryVideo } +// A photo story +type StoryContentTypePhoto struct{ + meta +} + +func (entity *StoryContentTypePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypePhoto) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypePhoto) GetType() string { + return TypeStoryContentTypePhoto +} + +func (*StoryContentTypePhoto) StoryContentTypeType() string { + return TypeStoryContentTypePhoto +} + +// A video story +type StoryContentTypeVideo struct{ + meta +} + +func (entity *StoryContentTypeVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeVideo) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeVideo) GetType() string { + return TypeStoryContentTypeVideo +} + +func (*StoryContentTypeVideo) StoryContentTypeType() string { + return TypeStoryContentTypeVideo +} + +// A live story +type StoryContentTypeLive struct{ + meta +} + +func (entity *StoryContentTypeLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeLive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeLive) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeLive) GetType() string { + return TypeStoryContentTypeLive +} + +func (*StoryContentTypeLive) StoryContentTypeType() string { + return TypeStoryContentTypeLive +} + +// A story of unknown content type +type StoryContentTypeUnsupported struct{ + meta +} + +func (entity *StoryContentTypeUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeUnsupported) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeUnsupported) GetType() string { + return TypeStoryContentTypeUnsupported +} + +func (*StoryContentTypeUnsupported) StoryContentTypeType() string { + return TypeStoryContentTypeUnsupported +} + // A photo story type StoryContentPhoto struct { meta @@ -34986,6 +38891,35 @@ func (*StoryContentVideo) StoryContentType() string { return TypeStoryContentVideo } +// A live story +type StoryContentLive struct { + meta + // Identifier of the corresponding group call. The group call can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` + // True, if the call is an RTMP stream instead of an ordinary group call + IsRtmpStream bool `json:"is_rtmp_stream"` +} + +func (entity *StoryContentLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentLive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentLive) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentLive) GetType() string { + return TypeStoryContentLive +} + +func (*StoryContentLive) StoryContentType() string { + return TypeStoryContentLive +} + // A story content that is not supported in the current TDLib version type StoryContentUnsupported struct{ meta @@ -35319,14 +39253,18 @@ type Story struct { IsPostedToChatPage bool `json:"is_posted_to_chat_page"` // True, if the story is visible only for the current user IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + // True, if the story can be added to an album using createStoryAlbum and addStoryAlbumStories + CanBeAddedToAlbum bool `json:"can_be_added_to_album"` // True, if the story can be deleted CanBeDeleted bool `json:"can_be_deleted"` // True, if the story can be edited CanBeEdited bool `json:"can_be_edited"` - // True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden + // True, if the story can be forwarded as a message or reposted as a story. Otherwise, screenshotting and saving of the story content must be also forbidden CanBeForwarded bool `json:"can_be_forwarded"` - // True, if the story can be replied in the chat with the user that posted the story + // True, if the story can be replied in the chat with the user who posted the story CanBeReplied bool `json:"can_be_replied"` + // True, if the story privacy settings can be changed + CanSetPrivacySettings bool `json:"can_set_privacy_settings"` // True, if the story's is_posted_to_chat_page value can be changed CanToggleIsPostedToChatPage bool `json:"can_toggle_is_posted_to_chat_page"` // True, if the story statistics are available through getStoryStatistics @@ -35349,6 +39287,8 @@ type Story struct { Areas []*StoryArea `json:"areas"` // Caption of the story Caption *FormattedText `json:"caption"` + // Identifiers of story albums to which the story is added; only for manageable stories + AlbumIds []int32 `json:"album_ids"` } func (entity *Story) MarshalJSON() ([]byte, error) { @@ -35378,10 +39318,12 @@ func (story *Story) UnmarshalJSON(data []byte) error { IsEdited bool `json:"is_edited"` IsPostedToChatPage bool `json:"is_posted_to_chat_page"` IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + CanBeAddedToAlbum bool `json:"can_be_added_to_album"` CanBeDeleted bool `json:"can_be_deleted"` CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` CanBeReplied bool `json:"can_be_replied"` + CanSetPrivacySettings bool `json:"can_set_privacy_settings"` CanToggleIsPostedToChatPage bool `json:"can_toggle_is_posted_to_chat_page"` CanGetStatistics bool `json:"can_get_statistics"` CanGetInteractions bool `json:"can_get_interactions"` @@ -35393,6 +39335,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { Content json.RawMessage `json:"content"` Areas []*StoryArea `json:"areas"` Caption *FormattedText `json:"caption"` + AlbumIds []int32 `json:"album_ids"` } err := json.Unmarshal(data, &tmp) @@ -35408,10 +39351,12 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.IsEdited = tmp.IsEdited story.IsPostedToChatPage = tmp.IsPostedToChatPage story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf + story.CanBeAddedToAlbum = tmp.CanBeAddedToAlbum story.CanBeDeleted = tmp.CanBeDeleted story.CanBeEdited = tmp.CanBeEdited story.CanBeForwarded = tmp.CanBeForwarded story.CanBeReplied = tmp.CanBeReplied + story.CanSetPrivacySettings = tmp.CanSetPrivacySettings story.CanToggleIsPostedToChatPage = tmp.CanToggleIsPostedToChatPage story.CanGetStatistics = tmp.CanGetStatistics story.CanGetInteractions = tmp.CanGetInteractions @@ -35420,6 +39365,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.InteractionInfo = tmp.InteractionInfo story.Areas = tmp.Areas story.Caption = tmp.Caption + story.AlbumIds = tmp.AlbumIds fieldPosterId, _ := UnmarshalMessageSender(tmp.PosterId) story.PosterId = fieldPosterId @@ -35490,6 +39436,58 @@ func (*FoundStories) GetType() string { return TypeFoundStories } +// Describes album of stories +type StoryAlbum struct { + meta + // Unique identifier of the album + Id int32 `json:"id"` + // Name of the album + Name string `json:"name"` + // Icon of the album; may be null if none + PhotoIcon *Photo `json:"photo_icon"` + // Video icon of the album; may be null if none + VideoIcon *Video `json:"video_icon"` +} + +func (entity *StoryAlbum) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAlbum + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAlbum) GetClass() string { + return ClassStoryAlbum +} + +func (*StoryAlbum) GetType() string { + return TypeStoryAlbum +} + +// Represents a list of story albums +type StoryAlbums struct { + meta + // List of story albums + Albums []*StoryAlbum `json:"albums"` +} + +func (entity *StoryAlbums) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAlbums + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAlbums) GetClass() string { + return ClassStoryAlbums +} + +func (*StoryAlbums) GetType() string { + return TypeStoryAlbums +} + // Contains identifier of a story along with identifier of the chat that posted it type StoryFullId struct { meta @@ -35524,6 +39522,8 @@ type StoryInfo struct { Date int32 `json:"date"` // True, if the story is available only to close friends IsForCloseFriends bool `json:"is_for_close_friends"` + // True, if the story is a live story + IsLive bool `json:"is_live"` } func (entity *StoryInfo) MarshalJSON() ([]byte, error) { @@ -35551,6 +39551,8 @@ type ChatActiveStories struct { List StoryList `json:"list"` // A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order Order int64 `json:"order"` + // True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can't be archived nor hidden using removeTopChat + CanBeArchived bool `json:"can_be_archived"` // Identifier of the last read active story MaxReadStoryId int32 `json:"max_read_story_id"` // Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers) @@ -35578,6 +39580,7 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { ChatId int64 `json:"chat_id"` List json.RawMessage `json:"list"` Order int64 `json:"order"` + CanBeArchived bool `json:"can_be_archived"` MaxReadStoryId int32 `json:"max_read_story_id"` Stories []*StoryInfo `json:"stories"` } @@ -35589,6 +39592,7 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { chatActiveStories.ChatId = tmp.ChatId chatActiveStories.Order = tmp.Order + chatActiveStories.CanBeArchived = tmp.CanBeArchived chatActiveStories.MaxReadStoryId = tmp.MaxReadStoryId chatActiveStories.Stories = tmp.Stories @@ -36013,7 +40017,7 @@ type BotMediaPreview struct { meta // Point in time (Unix timestamp) when the preview was added or changed last time Date int32 `json:"date"` - // Content of the preview + // Content of the preview; may only be of the types storyContentPhoto, storyContentVideo, or storyContentUnsupported Content StoryContent `json:"content"` } @@ -36224,7 +40228,7 @@ func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { // The chat created a giveaway type ChatBoostSourceGiveaway struct { meta - // Identifier of a user that won in the giveaway; 0 if none + // Identifier of a user who won in the giveaway; 0 if none UserId int64 `json:"user_id"` // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only GiftCode string `json:"gift_code"` @@ -37223,8 +41227,8 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } -// Describes an available stream in a video chat -type VideoChatStream struct { +// Describes an available stream in a video chat or a live story +type GroupCallStream struct { meta // Identifier of an audio/video channel ChannelId int32 `json:"channel_id"` @@ -37234,43 +41238,43 @@ type VideoChatStream struct { TimeOffset int64 `json:"time_offset"` } -func (entity *VideoChatStream) MarshalJSON() ([]byte, error) { +func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub VideoChatStream + type stub GroupCallStream return json.Marshal((*stub)(entity)) } -func (*VideoChatStream) GetClass() string { - return ClassVideoChatStream +func (*GroupCallStream) GetClass() string { + return ClassGroupCallStream } -func (*VideoChatStream) GetType() string { - return TypeVideoChatStream +func (*GroupCallStream) GetType() string { + return TypeGroupCallStream } -// Represents a list of video chat streams -type VideoChatStreams struct { +// Represents a list of group call streams +type GroupCallStreams struct { meta - // A list of video chat streams - Streams []*VideoChatStream `json:"streams"` + // A list of group call streams + Streams []*GroupCallStream `json:"streams"` } -func (entity *VideoChatStreams) MarshalJSON() ([]byte, error) { +func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub VideoChatStreams + type stub GroupCallStreams return json.Marshal((*stub)(entity)) } -func (*VideoChatStreams) GetClass() string { - return ClassVideoChatStreams +func (*GroupCallStreams) GetClass() string { + return ClassGroupCallStreams } -func (*VideoChatStreams) GetType() string { - return TypeVideoChatStreams +func (*GroupCallStreams) GetType() string { + return TypeGroupCallStreams } // Represents an RTMP URL @@ -37347,10 +41351,14 @@ type GroupCall struct { meta // Group call identifier Id int32 `json:"id"` + // Persistent unique group call identifier + UniqueId JsonInt64 `json:"unique_id"` // Group call title; for video chats only Title string `json:"title"` - // Invite link for the group call; for group calls that aren't bound to a chat. For video chats call getVideoChatInviteLink to get the link + // Invite link for the group call; for group calls that aren't bound to a chat. For video chats call getVideoChatInviteLink to get the link. For live stories in chats with username call getInternalLink with internalLinkTypeLiveStory InviteLink string `json:"invite_link"` + // The minimum number of Telegram Stars that must be paid by general participant for each sent message to the call; for live stories only + PaidMessageStarCount int64 `json:"paid_message_star_count"` // Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended; for video chats only 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 starts; for video chats only @@ -37359,7 +41367,9 @@ type GroupCall struct { IsActive bool `json:"is_active"` // True, if the call is bound to a chat IsVideoChat bool `json:"is_video_chat"` - // True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only + // True, if the call is a live story of a chat + IsLiveStory bool `json:"is_live_story"` + // True, if the call is an RTMP stream instead of an ordinary video chat; for video chats and live stories only IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` @@ -37367,7 +41377,7 @@ type GroupCall struct { NeedRejoin bool `json:"need_rejoin"` // True, if the user is the owner of the call and can end the call, change volume level of other users, or ban users there; for group calls that aren't bound to a chat IsOwned bool `json:"is_owned"` - // True, if the current user can manage the group call; for video chats only + // True, if the current user can manage the group call; for video chats and live stories only CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` @@ -37375,6 +41385,8 @@ type GroupCall struct { HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` + // Message sender chosen to send messages to the group call; for live stories only; may be null if the call isn't a live story + MessageSenderId MessageSender `json:"message_sender_id"` // At most 3 recently speaking users in the group call RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` // True, if the current user's video is enabled @@ -37387,6 +41399,14 @@ type GroupCall struct { MuteNewParticipants bool `json:"mute_new_participants"` // True, if the current user can enable or disable mute_new_participants setting; for video chats only CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` + // True, if the current user can send messages to the group call + CanSendMessages bool `json:"can_send_messages"` + // True, if sending of messages is allowed in the group call + AreMessagesAllowed bool `json:"are_messages_allowed"` + // True, if the current user can enable or disable sending of messages in the group call + CanToggleAreMessagesAllowed bool `json:"can_toggle_are_messages_allowed"` + // True, if the user can delete messages in the group call + CanDeleteMessages bool `json:"can_delete_messages"` // Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on RecordDuration int32 `json:"record_duration"` // True, if a video file is being recorded for the call @@ -37411,6 +41431,85 @@ func (*GroupCall) GetType() string { return TypeGroupCall } +func (groupCall *GroupCall) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + UniqueId JsonInt64 `json:"unique_id"` + Title string `json:"title"` + InviteLink string `json:"invite_link"` + PaidMessageStarCount int64 `json:"paid_message_star_count"` + ScheduledStartDate int32 `json:"scheduled_start_date"` + EnabledStartNotification bool `json:"enabled_start_notification"` + IsActive bool `json:"is_active"` + IsVideoChat bool `json:"is_video_chat"` + IsLiveStory bool `json:"is_live_story"` + IsRtmpStream bool `json:"is_rtmp_stream"` + IsJoined bool `json:"is_joined"` + NeedRejoin bool `json:"need_rejoin"` + IsOwned bool `json:"is_owned"` + CanBeManaged bool `json:"can_be_managed"` + ParticipantCount int32 `json:"participant_count"` + HasHiddenListeners bool `json:"has_hidden_listeners"` + LoadedAllParticipants bool `json:"loaded_all_participants"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` + IsMyVideoEnabled bool `json:"is_my_video_enabled"` + IsMyVideoPaused bool `json:"is_my_video_paused"` + CanEnableVideo bool `json:"can_enable_video"` + MuteNewParticipants bool `json:"mute_new_participants"` + CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` + CanSendMessages bool `json:"can_send_messages"` + AreMessagesAllowed bool `json:"are_messages_allowed"` + CanToggleAreMessagesAllowed bool `json:"can_toggle_are_messages_allowed"` + CanDeleteMessages bool `json:"can_delete_messages"` + RecordDuration int32 `json:"record_duration"` + IsVideoRecorded bool `json:"is_video_recorded"` + Duration int32 `json:"duration"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCall.Id = tmp.Id + groupCall.UniqueId = tmp.UniqueId + groupCall.Title = tmp.Title + groupCall.InviteLink = tmp.InviteLink + groupCall.PaidMessageStarCount = tmp.PaidMessageStarCount + groupCall.ScheduledStartDate = tmp.ScheduledStartDate + groupCall.EnabledStartNotification = tmp.EnabledStartNotification + groupCall.IsActive = tmp.IsActive + groupCall.IsVideoChat = tmp.IsVideoChat + groupCall.IsLiveStory = tmp.IsLiveStory + groupCall.IsRtmpStream = tmp.IsRtmpStream + groupCall.IsJoined = tmp.IsJoined + groupCall.NeedRejoin = tmp.NeedRejoin + groupCall.IsOwned = tmp.IsOwned + groupCall.CanBeManaged = tmp.CanBeManaged + groupCall.ParticipantCount = tmp.ParticipantCount + groupCall.HasHiddenListeners = tmp.HasHiddenListeners + groupCall.LoadedAllParticipants = tmp.LoadedAllParticipants + groupCall.RecentSpeakers = tmp.RecentSpeakers + groupCall.IsMyVideoEnabled = tmp.IsMyVideoEnabled + groupCall.IsMyVideoPaused = tmp.IsMyVideoPaused + groupCall.CanEnableVideo = tmp.CanEnableVideo + groupCall.MuteNewParticipants = tmp.MuteNewParticipants + groupCall.CanToggleMuteNewParticipants = tmp.CanToggleMuteNewParticipants + groupCall.CanSendMessages = tmp.CanSendMessages + groupCall.AreMessagesAllowed = tmp.AreMessagesAllowed + groupCall.CanToggleAreMessagesAllowed = tmp.CanToggleAreMessagesAllowed + groupCall.CanDeleteMessages = tmp.CanDeleteMessages + groupCall.RecordDuration = tmp.RecordDuration + groupCall.IsVideoRecorded = tmp.IsVideoRecorded + groupCall.Duration = tmp.Duration + + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + groupCall.MessageSenderId = fieldMessageSenderId + + return nil +} + // Describes a group of video synchronization source identifiers type GroupCallVideoSourceGroup struct { meta @@ -37640,6 +41739,105 @@ func (*GroupCallInfo) GetType() string { return TypeGroupCallInfo } +// Represents a message sent in a group call +type GroupCallMessage struct { + meta + // Unique message identifier within the group call + MessageId int32 `json:"message_id"` + // Identifier of the sender of the message + SenderId MessageSender `json:"sender_id"` + // Point in time (Unix timestamp) when the message was sent + Date int32 `json:"date"` + // Text of the message. If empty, then the message is a paid reaction in a live story + Text *FormattedText `json:"text"` + // The number of Telegram Stars that were paid to send the message; for live stories only + PaidMessageStarCount int64 `json:"paid_message_star_count"` + // True, if the message is sent by the owner of the call and must be treated as a message of the maximum level; for live stories only + IsFromOwner bool `json:"is_from_owner"` + // True, if the message can be deleted by the current user; for live stories only + CanBeDeleted bool `json:"can_be_deleted"` +} + +func (entity *GroupCallMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallMessage + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallMessage) GetClass() string { + return ClassGroupCallMessage +} + +func (*GroupCallMessage) GetType() string { + return TypeGroupCallMessage +} + +func (groupCallMessage *GroupCallMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageId int32 `json:"message_id"` + SenderId json.RawMessage `json:"sender_id"` + Date int32 `json:"date"` + Text *FormattedText `json:"text"` + PaidMessageStarCount int64 `json:"paid_message_star_count"` + IsFromOwner bool `json:"is_from_owner"` + CanBeDeleted bool `json:"can_be_deleted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCallMessage.MessageId = tmp.MessageId + groupCallMessage.Date = tmp.Date + groupCallMessage.Text = tmp.Text + groupCallMessage.PaidMessageStarCount = tmp.PaidMessageStarCount + groupCallMessage.IsFromOwner = tmp.IsFromOwner + groupCallMessage.CanBeDeleted = tmp.CanBeDeleted + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + groupCallMessage.SenderId = fieldSenderId + + return nil +} + +// Represents a level of features for a message sent in a live story group call +type GroupCallMessageLevel struct { + meta + // The minimum number of Telegram Stars required to get features of the level + MinStarCount int64 `json:"min_star_count"` + // The amount of time the message of this level will be pinned, in seconds + PinDuration int32 `json:"pin_duration"` + // The maximum allowed length of the message text + MaxTextLength int32 `json:"max_text_length"` + // The maximum allowed number of custom emoji in the message text + MaxCustomEmojiCount int32 `json:"max_custom_emoji_count"` + // The first color used to show the message text in the RGB format + FirstColor int32 `json:"first_color"` + // The second color used to show the message text in the RGB format + SecondColor int32 `json:"second_color"` + // Background color for the message the RGB format + BackgroundColor int32 `json:"background_color"` +} + +func (entity *GroupCallMessageLevel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallMessageLevel + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallMessageLevel) GetClass() string { + return ClassGroupCallMessageLevel +} + +func (*GroupCallMessageLevel) GetType() string { + return TypeGroupCallMessageLevel +} + // The user can't be invited due to their privacy settings type InviteGroupCallParticipantResultUserPrivacyRestricted struct{ meta @@ -38080,6 +42278,8 @@ type Call struct { meta // Call identifier, not persistent Id int32 `json:"id"` + // Persistent unique call identifier; 0 if isn't assigned yet by the server + UniqueId JsonInt64 `json:"unique_id"` // User identifier of the other call participant UserId int64 `json:"user_id"` // True, if the call is outgoing @@ -38109,6 +42309,7 @@ func (*Call) GetType() string { func (call *Call) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` + UniqueId JsonInt64 `json:"unique_id"` UserId int64 `json:"user_id"` IsOutgoing bool `json:"is_outgoing"` IsVideo bool `json:"is_video"` @@ -38121,6 +42322,7 @@ func (call *Call) UnmarshalJSON(data []byte) error { } call.Id = tmp.Id + call.UniqueId = tmp.UniqueId call.UserId = tmp.UserId call.IsOutgoing = tmp.IsOutgoing call.IsVideo = tmp.IsVideo @@ -38610,6 +42812,35 @@ func (*DiceStickersSlotMachine) DiceStickersType() string { return TypeDiceStickersSlotMachine } +// Describes a contact to import +type ImportedContact struct { + meta + // Phone number of the user + PhoneNumber string `json:"phone_number"` + // First name of the user; 1-64 characters + FirstName string `json:"first_name"` + // Last name of the user; 0-64 characters + LastName string `json:"last_name"` + // Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed; pass null to keep the current user's note + Note *FormattedText `json:"note"` +} + +func (entity *ImportedContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ImportedContact + + return json.Marshal((*stub)(entity)) +} + +func (*ImportedContact) GetClass() string { + return ClassImportedContact +} + +func (*ImportedContact) GetType() string { + return TypeImportedContact +} + // Represents the result of an importContacts request type ImportedContacts struct { meta @@ -38721,7 +42952,7 @@ type BusinessConnection struct { meta // Unique identifier of the connection Id string `json:"id"` - // Identifier of the business user that created the connection + // Identifier of the business user who created the connection UserId int64 `json:"user_id"` // Chat identifier of the private chat with the user UserChatId int64 `json:"user_chat_id"` @@ -43883,6 +48114,31 @@ func (*PremiumFeatureChecklists) PremiumFeatureType() string { return TypePremiumFeatureChecklists } +// The ability to require a payment for incoming messages in new chats +type PremiumFeaturePaidMessages struct{ + meta +} + +func (entity *PremiumFeaturePaidMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeaturePaidMessages + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeaturePaidMessages) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeaturePaidMessages) GetType() string { + return TypePremiumFeaturePaidMessages +} + +func (*PremiumFeaturePaidMessages) PremiumFeatureType() string { + return TypePremiumFeaturePaidMessages +} + // The ability to set location type BusinessFeatureLocation struct{ meta @@ -44642,7 +48898,7 @@ func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data [ return nil } -// A user opened an internal link of the type internalLinkTypePremiumFeatures +// A user opened an internal link of the type internalLinkTypePremiumFeaturesPage type PremiumSourceLink struct { meta // The referrer from the link @@ -44983,6 +49239,8 @@ type StorePaymentPurposeStars struct { Amount int64 `json:"amount"` // Number of bought Telegram Stars StarCount int64 `json:"star_count"` + // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none + ChatId int64 `json:"chat_id"` } func (entity *StorePaymentPurposeStars) MarshalJSON() ([]byte, error) { @@ -45212,6 +49470,8 @@ type TelegramPaymentPurposeStars struct { Amount int64 `json:"amount"` // Number of bought Telegram Stars StarCount int64 `json:"star_count"` + // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none + ChatId int64 `json:"chat_id"` } func (entity *TelegramPaymentPurposeStars) MarshalJSON() ([]byte, error) { @@ -45903,10 +50163,10 @@ 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 +// A background from a chat theme based on an emoji; can be used only as a chat background in channels type BackgroundTypeChatTheme struct { meta - // Name of the chat theme + // Name of the emoji chat theme ThemeName string `json:"theme_name"` } @@ -46027,8 +50287,8 @@ func (*InputBackgroundPrevious) InputBackgroundType() string { return TypeInputBackgroundPrevious } -// Describes a chat theme -type ChatTheme struct { +// Describes a chat theme based on an emoji +type EmojiChatTheme struct { meta // Theme name Name string `json:"name"` @@ -46038,20 +50298,180 @@ type ChatTheme struct { DarkSettings *ThemeSettings `json:"dark_settings"` } -func (entity *ChatTheme) MarshalJSON() ([]byte, error) { +func (entity *EmojiChatTheme) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatTheme + type stub EmojiChatTheme return json.Marshal((*stub)(entity)) } -func (*ChatTheme) GetClass() string { +func (*EmojiChatTheme) GetClass() string { + return ClassEmojiChatTheme +} + +func (*EmojiChatTheme) GetType() string { + return TypeEmojiChatTheme +} + +// Describes a chat theme based on an upgraded gift +type GiftChatTheme struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` + // Theme settings for a light chat theme + LightSettings *ThemeSettings `json:"light_settings"` + // Theme settings for a dark chat theme + DarkSettings *ThemeSettings `json:"dark_settings"` +} + +func (entity *GiftChatTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftChatTheme + + return json.Marshal((*stub)(entity)) +} + +func (*GiftChatTheme) GetClass() string { + return ClassGiftChatTheme +} + +func (*GiftChatTheme) GetType() string { + return TypeGiftChatTheme +} + +// Contains a list of chat themes based on upgraded gifts +type GiftChatThemes struct { + meta + // A list of chat themes + Themes []*GiftChatTheme `json:"themes"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *GiftChatThemes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftChatThemes + + return json.Marshal((*stub)(entity)) +} + +func (*GiftChatThemes) GetClass() string { + return ClassGiftChatThemes +} + +func (*GiftChatThemes) GetType() string { + return TypeGiftChatThemes +} + +// A chat theme based on an emoji +type ChatThemeEmoji struct { + meta + // Name of the theme; full theme description is received through updateEmojiChatThemes + Name string `json:"name"` +} + +func (entity *ChatThemeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatThemeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ChatThemeEmoji) GetClass() string { return ClassChatTheme } -func (*ChatTheme) GetType() string { - return TypeChatTheme +func (*ChatThemeEmoji) GetType() string { + return TypeChatThemeEmoji +} + +func (*ChatThemeEmoji) ChatThemeType() string { + return TypeChatThemeEmoji +} + +// A chat theme based on an upgraded gift +type ChatThemeGift struct { + meta + // The chat theme + GiftTheme *GiftChatTheme `json:"gift_theme"` +} + +func (entity *ChatThemeGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatThemeGift + + return json.Marshal((*stub)(entity)) +} + +func (*ChatThemeGift) GetClass() string { + return ClassChatTheme +} + +func (*ChatThemeGift) GetType() string { + return TypeChatThemeGift +} + +func (*ChatThemeGift) ChatThemeType() string { + return TypeChatThemeGift +} + +// A theme based on an emoji +type InputChatThemeEmoji struct { + meta + // Name of the theme + Name string `json:"name"` +} + +func (entity *InputChatThemeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatThemeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatThemeEmoji) GetClass() string { + return ClassInputChatTheme +} + +func (*InputChatThemeEmoji) GetType() string { + return TypeInputChatThemeEmoji +} + +func (*InputChatThemeEmoji) InputChatThemeType() string { + return TypeInputChatThemeEmoji +} + +// A theme based on an upgraded gift +type InputChatThemeGift struct { + meta + // Name of the upgraded gift. A gift can be used only in one chat in a time. When the same gift is used in another chat, theme in the previous chat is reset to default + Name string `json:"name"` +} + +func (entity *InputChatThemeGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatThemeGift + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatThemeGift) GetClass() string { + return ClassInputChatTheme +} + +func (*InputChatThemeGift) GetType() string { + return TypeInputChatThemeGift +} + +func (*InputChatThemeGift) InputChatThemeType() string { + return TypeInputChatThemeGift } // Describes a time zone @@ -46232,7 +50652,7 @@ func (*CanPostStoryResultActiveStoryLimitExceeded) CanPostStoryResultType() stri // The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time type CanPostStoryResultWeeklyLimitExceeded struct { meta - // Time left before the user can post the next story + // Time left before the user can post the next story, in seconds RetryAfter int32 `json:"retry_after"` } @@ -46259,7 +50679,7 @@ func (*CanPostStoryResultWeeklyLimitExceeded) CanPostStoryResultType() string { // The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time type CanPostStoryResultMonthlyLimitExceeded struct { meta - // Time left before the user can post the next story + // Time left before the user can post the next story, in seconds RetryAfter int32 `json:"retry_after"` } @@ -46283,6 +50703,103 @@ func (*CanPostStoryResultMonthlyLimitExceeded) CanPostStoryResultType() string { return TypeCanPostStoryResultMonthlyLimitExceeded } +// The user or the chat has an active live story. The live story must be deleted first +type CanPostStoryResultLiveStoryIsActive struct { + meta + // Identifier of the active live story + StoryId int32 `json:"story_id"` +} + +func (entity *CanPostStoryResultLiveStoryIsActive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanPostStoryResultLiveStoryIsActive + + return json.Marshal((*stub)(entity)) +} + +func (*CanPostStoryResultLiveStoryIsActive) GetClass() string { + return ClassCanPostStoryResult +} + +func (*CanPostStoryResultLiveStoryIsActive) GetType() string { + return TypeCanPostStoryResultLiveStoryIsActive +} + +func (*CanPostStoryResultLiveStoryIsActive) CanPostStoryResultType() string { + return TypeCanPostStoryResultLiveStoryIsActive +} + +// The live story was successfully posted +type StartLiveStoryResultOk struct { + meta + // The live story + Story *Story `json:"story"` +} + +func (entity *StartLiveStoryResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StartLiveStoryResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*StartLiveStoryResultOk) GetClass() string { + return ClassStartLiveStoryResult +} + +func (*StartLiveStoryResultOk) GetType() string { + return TypeStartLiveStoryResultOk +} + +func (*StartLiveStoryResultOk) StartLiveStoryResultType() string { + return TypeStartLiveStoryResultOk +} + +// The live story failed to post with an error to be handled +type StartLiveStoryResultFail struct { + meta + // Type of the error; other error types may be returned as regular errors + ErrorType CanPostStoryResult `json:"error_type"` +} + +func (entity *StartLiveStoryResultFail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StartLiveStoryResultFail + + return json.Marshal((*stub)(entity)) +} + +func (*StartLiveStoryResultFail) GetClass() string { + return ClassStartLiveStoryResult +} + +func (*StartLiveStoryResultFail) GetType() string { + return TypeStartLiveStoryResultFail +} + +func (*StartLiveStoryResultFail) StartLiveStoryResultType() string { + return TypeStartLiveStoryResultFail +} + +func (startLiveStoryResultFail *StartLiveStoryResultFail) UnmarshalJSON(data []byte) error { + var tmp struct { + ErrorType json.RawMessage `json:"error_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldErrorType, _ := UnmarshalCanPostStoryResult(tmp.ErrorType) + startLiveStoryResultFail.ErrorType = fieldErrorType + + return nil +} + // The session can be used type CanTransferOwnershipResultOk struct{ meta @@ -46887,8 +51404,10 @@ func (*PushMessageContentContact) PushMessageContentType() string { } // A contact has registered with Telegram -type PushMessageContentContactRegistered struct{ +type PushMessageContentContactRegistered struct { meta + // True, if the user joined Telegram as a Telegram Premium account + AsPremiumAccount bool `json:"as_premium_account"` } func (entity *PushMessageContentContactRegistered) MarshalJSON() ([]byte, error) { @@ -47235,6 +51754,8 @@ type PushMessageContentGift struct { meta // Number of Telegram Stars that sender paid for the gift StarCount int64 `json:"star_count"` + // True, if the message is about prepaid upgrade of the gift by another user instead of actual receiving of a new gift + IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` } func (entity *PushMessageContentGift) MarshalJSON() ([]byte, error) { @@ -47260,8 +51781,10 @@ func (*PushMessageContentGift) PushMessageContentType() string { // A message with an upgraded gift type PushMessageContentUpgradedGift struct { meta - // True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred or resold gift + // True, if the gift was obtained by upgrading of a previously received gift; otherwise, if is_prepaid_upgrade == false, then this is a transferred or resold gift IsUpgrade bool `json:"is_upgrade"` + // True, if the message is about completion of prepaid upgrade of the gift instead of actual receiving of a new gift + IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` } func (entity *PushMessageContentUpgradedGift) MarshalJSON() ([]byte, error) { @@ -47733,8 +52256,8 @@ func (*PushMessageContentChatSetBackground) PushMessageContentType() string { // A chat theme was edited type PushMessageContentChatSetTheme struct { meta - // If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one - ThemeName string `json:"theme_name"` + // If non-empty, human-readable name of the new theme. Otherwise, the chat theme was reset to the default one + Name string `json:"name"` } func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) { @@ -47890,6 +52413,31 @@ func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string { return TypePushMessageContentSuggestProfilePhoto } +// A birthdate was suggested to be set +type PushMessageContentSuggestBirthdate struct{ + meta +} + +func (entity *PushMessageContentSuggestBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentSuggestBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentSuggestBirthdate) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentSuggestBirthdate) GetType() string { + return TypePushMessageContentSuggestBirthdate +} + +func (*PushMessageContentSuggestBirthdate) PushMessageContentType() string { + return TypePushMessageContentSuggestBirthdate +} + // A user in the chat came within proximity alert range from the current user type PushMessageContentProximityAlertTriggered struct { meta @@ -48440,6 +52988,54 @@ func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error { return nil } +// Describes a proxy server +type Proxy struct { + meta + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Type of the proxy + Type ProxyType `json:"type"` +} + +func (entity *Proxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Proxy + + return json.Marshal((*stub)(entity)) +} + +func (*Proxy) GetClass() string { + return ClassProxy +} + +func (*Proxy) GetType() string { + return TypeProxy +} + +func (proxy *Proxy) UnmarshalJSON(data []byte) error { + var tmp struct { + Server string `json:"server"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + proxy.Server = tmp.Server + proxy.Port = tmp.Port + + fieldType, _ := UnmarshalProxyType(tmp.Type) + proxy.Type = fieldType + + return nil +} + // Represents a boolean option type OptionValueBoolean struct { meta @@ -49344,6 +53940,31 @@ func (*UserPrivacySettingShowBirthdate) UserPrivacySettingType() string { return TypeUserPrivacySettingShowBirthdate } +// A privacy setting for managing whether the user's profile audio files are visible +type UserPrivacySettingShowProfileAudio struct{ + meta +} + +func (entity *UserPrivacySettingShowProfileAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowProfileAudio + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowProfileAudio) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowProfileAudio) GetType() string { + return TypeUserPrivacySettingShowProfileAudio +} + +func (*UserPrivacySettingShowProfileAudio) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowProfileAudio +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct{ meta @@ -50805,29 +55426,557 @@ func (*ReportStoryResultTextRequired) ReportStoryResultType() string { return TypeReportStoryResultTextRequired } -// 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{ +// The appearance section +type SettingsSectionAppearance struct { meta + // Subsection of the section; may be one of "", "themes", "themes/edit", "themes/create", "wallpapers", "wallpapers/edit", "wallpapers/set", "wallpapers/choose-photo", "your-color/profile", "your-color/profile/add-icons", "your-color/profile/use-gift", "your-color/profile/reset", "your-color/name", "your-color/name/add-icons", "your-color/name/use-gift", "night-mode", "auto-night-mode", "text-size", "text-size/use-system", "message-corners", "animations", "stickers-and-emoji", "stickers-and-emoji/edit", "stickers-and-emoji/trending", "stickers-and-emoji/archived", "stickers-and-emoji/archived/edit", "stickers-and-emoji/emoji", "stickers-and-emoji/emoji/edit", "stickers-and-emoji/emoji/archived", "stickers-and-emoji/emoji/archived/edit", "stickers-and-emoji/emoji/suggest", "stickers-and-emoji/emoji/quick-reaction", "stickers-and-emoji/emoji/quick-reaction/choose", "stickers-and-emoji/suggest-by-emoji", "stickers-and-emoji/large-emoji", "stickers-and-emoji/dynamic-order", "stickers-and-emoji/emoji/show-more", "app-icon", "tap-for-next-media" + Subsection string `json:"subsection"` } -func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) { +func (entity *SettingsSectionAppearance) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeActiveSessions + type stub SettingsSectionAppearance return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeActiveSessions) GetClass() string { - return ClassInternalLinkType +func (*SettingsSectionAppearance) GetClass() string { + return ClassSettingsSection } -func (*InternalLinkTypeActiveSessions) GetType() string { - return TypeInternalLinkTypeActiveSessions +func (*SettingsSectionAppearance) GetType() string { + return TypeSettingsSectionAppearance } -func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { - return TypeInternalLinkTypeActiveSessions +func (*SettingsSectionAppearance) SettingsSectionType() string { + return TypeSettingsSectionAppearance +} + +// The "Ask a question" section +type SettingsSectionAskQuestion struct{ + meta +} + +func (entity *SettingsSectionAskQuestion) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionAskQuestion + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionAskQuestion) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionAskQuestion) GetType() string { + return TypeSettingsSectionAskQuestion +} + +func (*SettingsSectionAskQuestion) SettingsSectionType() string { + return TypeSettingsSectionAskQuestion +} + +// The "Telegram Business" section +type SettingsSectionBusiness struct { + meta + // Subsection of the section; may be one of "", "do-not-hide-ads" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionBusiness) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionBusiness + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionBusiness) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionBusiness) GetType() string { + return TypeSettingsSectionBusiness +} + +func (*SettingsSectionBusiness) SettingsSectionType() string { + return TypeSettingsSectionBusiness +} + +// The chat folder settings section +type SettingsSectionChatFolders struct { + meta + // Subsection of the section; may be one of "", "edit", "create", "add-recommended", "show-tags", "tab-view" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionChatFolders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionChatFolders + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionChatFolders) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionChatFolders) GetType() string { + return TypeSettingsSectionChatFolders +} + +func (*SettingsSectionChatFolders) SettingsSectionType() string { + return TypeSettingsSectionChatFolders +} + +// The data and storage settings section +type SettingsSectionDataAndStorage struct { + meta + // Subsection of the section; may be one of "", "storage", "storage/edit", "storage/auto-remove", "storage/clear-cache", "storage/max-cache", "usage", "usage/mobile", "usage/wifi", "usage/reset", "usage/roaming", "auto-download/mobile", "auto-download/mobile/enable", "auto-download/mobile/usage", "auto-download/mobile/photos", "auto-download/mobile/stories", "auto-download/mobile/videos", "auto-download/mobile/files", "auto-download/wifi", "auto-download/wifi/enable", "auto-download/wifi/usage", "auto-download/wifi/photos", "auto-download/wifi/stories", "auto-download/wifi/videos", "auto-download/wifi/files", "auto-download/roaming", "auto-download/roaming/enable", "auto-download/roaming/usage", "auto-download/roaming/photos", "auto-download/roaming/stories", "auto-download/roaming/videos", "auto-download/roaming/files", "auto-download/reset", "save-to-photos/chats", "save-to-photos/chats/max-video-size", "save-to-photos/chats/add-exception", "save-to-photos/chats/delete-all", "save-to-photos/groups", "save-to-photos/groups/max-video-size", "save-to-photos/groups/add-exception", "save-to-photos/groups/delete-all", "save-to-photos/channels", "save-to-photos/channels/max-video-size", "save-to-photos/channels/add-exception", "save-to-photos/channels/delete-all", "less-data-calls", "open-links", "share-sheet", "share-sheet/suggested-chats", "share-sheet/suggest-by", "share-sheet/reset", "saved-edited-photos", "pause-music", "raise-to-listen", "raise-to-speak", "show-18-content", "proxy", "proxy/edit", "proxy/use-proxy", "proxy/add-proxy", "proxy/share-list", "proxy/use-for-calls" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionDataAndStorage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionDataAndStorage + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionDataAndStorage) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionDataAndStorage) GetType() string { + return TypeSettingsSectionDataAndStorage +} + +func (*SettingsSectionDataAndStorage) SettingsSectionType() string { + return TypeSettingsSectionDataAndStorage +} + +// The Devices section +type SettingsSectionDevices struct { + meta + // Subsection of the section; may be one of "", "edit", "link-desktop", "terminate-sessions", "auto-terminate" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionDevices) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionDevices + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionDevices) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionDevices) GetType() string { + return TypeSettingsSectionDevices +} + +func (*SettingsSectionDevices) SettingsSectionType() string { + return TypeSettingsSectionDevices +} + +// The profile edit section +type SettingsSectionEditProfile struct { + meta + // Subsection of the section; may be one of "", "set-photo", "first-name", "last-name", "emoji-status", "bio", "birthday", "change-number", "username", "your-color", "channel", "add-account", "log-out", "profile-color/profile", "profile-color/profile/add-icons", "profile-color/profile/use-gift", "profile-color/name", "profile-color/name/add-icons", "profile-color/name/use-gift", "profile-photo/use-emoji" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionEditProfile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionEditProfile + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionEditProfile) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionEditProfile) GetType() string { + return TypeSettingsSectionEditProfile +} + +func (*SettingsSectionEditProfile) SettingsSectionType() string { + return TypeSettingsSectionEditProfile +} + +// The FAQ section +type SettingsSectionFaq struct{ + meta +} + +func (entity *SettingsSectionFaq) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionFaq + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionFaq) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionFaq) GetType() string { + return TypeSettingsSectionFaq +} + +func (*SettingsSectionFaq) SettingsSectionType() string { + return TypeSettingsSectionFaq +} + +// The "Telegram Features" section +type SettingsSectionFeatures struct{ + meta +} + +func (entity *SettingsSectionFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionFeatures) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionFeatures) GetType() string { + return TypeSettingsSectionFeatures +} + +func (*SettingsSectionFeatures) SettingsSectionType() string { + return TypeSettingsSectionFeatures +} + +// The in-app browser settings section +type SettingsSectionInAppBrowser struct { + meta + // Subsection of the section; may be one of "", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionInAppBrowser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionInAppBrowser + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionInAppBrowser) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionInAppBrowser) GetType() string { + return TypeSettingsSectionInAppBrowser +} + +func (*SettingsSectionInAppBrowser) SettingsSectionType() string { + return TypeSettingsSectionInAppBrowser +} + +// The application language section +type SettingsSectionLanguage struct { + meta + // Subsection of the section; may be one of "", "show-button" for Show Translate Button toggle, "translate-chats" for Translate Entire Chats toggle, "do-not-translate" - for Do Not Translate language list + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionLanguage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionLanguage + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionLanguage) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionLanguage) GetType() string { + return TypeSettingsSectionLanguage +} + +func (*SettingsSectionLanguage) SettingsSectionType() string { + return TypeSettingsSectionLanguage +} + +// The Telegram Star balance and transaction section +type SettingsSectionMyStars struct { + meta + // Subsection of the section; may be one of "", "top-up", "stats", "gift", "earn" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionMyStars) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionMyStars + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionMyStars) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionMyStars) GetType() string { + return TypeSettingsSectionMyStars +} + +func (*SettingsSectionMyStars) SettingsSectionType() string { + return TypeSettingsSectionMyStars +} + +// The Toncoin balance and transaction section +type SettingsSectionMyToncoins struct{ + meta +} + +func (entity *SettingsSectionMyToncoins) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionMyToncoins + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionMyToncoins) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionMyToncoins) GetType() string { + return TypeSettingsSectionMyToncoins +} + +func (*SettingsSectionMyToncoins) SettingsSectionType() string { + return TypeSettingsSectionMyToncoins +} + +// The notification settings section +type SettingsSectionNotifications struct { + meta + // Subsection of the section; may be one of "", "accounts", "private-chats", "private-chats/edit", "private-chats/show", "private-chats/preview", "private-chats/sound", "private-chats/add-exception", "private-chats/delete-exceptions", "private-chats/light-color", "private-chats/vibrate", "private-chats/priority", "groups", "groups/edit", "groups/show", "groups/preview", "groups/sound", "groups/add-exception", "groups/delete-exceptions", "groups/light-color", "groups/vibrate", "groups/priority", "channels", "channels/edit", "channels/show", "channels/preview", "channels/sound", "channels/add-exception", "channels/delete-exceptions", "channels/light-color", "channels/vibrate", "channels/priority", "stories", "stories/new", "stories/important", "stories/show-sender", "stories/sound", "stories/add-exception", "stories/delete-exceptions", "stories/light-color", "stories/vibrate", "stories/priority", "reactions", "reactions/messages", "reactions/stories", "reactions/show-sender", "reactions/sound", "reactions/light-color", "reactions/vibrate", "reactions/priority", "in-app-sounds", "in-app-vibrate", "in-app-preview", "in-chat-sounds", "in-app-popup", "lock-screen-names", "include-channels", "include-muted-chats", "count-unread-messages", "new-contacts", "pinned-messages", "reset", "web" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionNotifications) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionNotifications + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionNotifications) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionNotifications) GetType() string { + return TypeSettingsSectionNotifications +} + +func (*SettingsSectionNotifications) SettingsSectionType() string { + return TypeSettingsSectionNotifications +} + +// The power saving settings section +type SettingsSectionPowerSaving struct { + meta + // Subsection of the section; may be one of "", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionPowerSaving) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPowerSaving + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPowerSaving) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPowerSaving) GetType() string { + return TypeSettingsSectionPowerSaving +} + +func (*SettingsSectionPowerSaving) SettingsSectionType() string { + return TypeSettingsSectionPowerSaving +} + +// The "Telegram Premium" section +type SettingsSectionPremium struct{ + meta +} + +func (entity *SettingsSectionPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPremium + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPremium) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPremium) GetType() string { + return TypeSettingsSectionPremium +} + +func (*SettingsSectionPremium) SettingsSectionType() string { + return TypeSettingsSectionPremium +} + +// The privacy and security section +type SettingsSectionPrivacyAndSecurity struct { + meta + // Subsection of the section; may be one of "", "blocked", "blocked/edit", "blocked/block-user", "blocked/block-user/chats", "blocked/block-user/contacts", "active-websites", "active-websites/edit", "active-websites/disconnect-all", "passcode", "passcode/disable", "passcode/change", "passcode/auto-lock", "passcode/face-id", "passcode/fingerprint", "2sv", "2sv/change", "2sv/disable", "2sv/change-email", "passkey", "passkey/create", "auto-delete", "auto-delete/set-custom", "login-email", "phone-number", "phone-number/never", "phone-number/always", "last-seen", "last-seen/never", "last-seen/always", "last-seen/hide-read-time", "profile-photos", "profile-photos/never", "profile-photos/always", "profile-photos/set-public", "profile-photos/update-public", "profile-photos/remove-public", "bio", "bio/never", "bio/always", "gifts", "gifts/show-icon", "gifts/never", "gifts/always", "gifts/accepted-types", "birthday", "birthday/add", "birthday/never", "birthday/always", "saved-music", "saved-music/never", "saved-music/always", "forwards", "forwards/never", "forwards/always", "calls", "calls/never", "calls/always", "calls/p2p", "calls/p2p/never", "calls/p2p/always", "calls/ios-integration", "voice", "voice/never", "voice/always", "messages", "messages/set-price", "messages/exceptions", "invites", "invites/never", "invites/always", "self-destruct", "data-settings", "data-settings/sync-contacts", "data-settings/delete-synced", "data-settings/suggest-contacts", "data-settings/delete-cloud-drafts", "data-settings/clear-payment-info", "data-settings/link-previews", "data-settings/bot-settings", "data-settings/map-provider", "archive-and-mute" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionPrivacyAndSecurity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPrivacyAndSecurity + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPrivacyAndSecurity) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPrivacyAndSecurity) GetType() string { + return TypeSettingsSectionPrivacyAndSecurity +} + +func (*SettingsSectionPrivacyAndSecurity) SettingsSectionType() string { + return TypeSettingsSectionPrivacyAndSecurity +} + +// The "Privacy Policy" section +type SettingsSectionPrivacyPolicy struct{ + meta +} + +func (entity *SettingsSectionPrivacyPolicy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPrivacyPolicy + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPrivacyPolicy) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPrivacyPolicy) GetType() string { + return TypeSettingsSectionPrivacyPolicy +} + +func (*SettingsSectionPrivacyPolicy) SettingsSectionType() string { + return TypeSettingsSectionPrivacyPolicy +} + +// The current user's QR code section +type SettingsSectionQrCode struct { + meta + // Subsection of the section; may be one of "", "share", "scan" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionQrCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionQrCode + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionQrCode) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionQrCode) GetType() string { + return TypeSettingsSectionQrCode +} + +func (*SettingsSectionQrCode) SettingsSectionType() string { + return TypeSettingsSectionQrCode +} + +// Search in Settings +type SettingsSectionSearch struct{ + meta +} + +func (entity *SettingsSectionSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionSearch + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionSearch) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionSearch) GetType() string { + return TypeSettingsSectionSearch +} + +func (*SettingsSectionSearch) SettingsSectionType() string { + return TypeSettingsSectionSearch +} + +// The "Send a gift" section +type SettingsSectionSendGift struct { + meta + // Subsection of the section; may be one of "", "self" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionSendGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionSendGift + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionSendGift) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionSendGift) GetType() string { + return TypeSettingsSectionSendGift +} + +func (*SettingsSectionSendGift) SettingsSectionType() string { + return TypeSettingsSectionSendGift } // 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. Then, 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 attachment menu, then show a disclaimer about Mini Apps being third-party applications, 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 attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL @@ -51054,58 +56203,31 @@ func (*InternalLinkTypeBusinessChat) InternalLinkTypeType() string { return TypeInternalLinkTypeBusinessChat } -// The link is a link to the Telegram Star purchase section of the application -type InternalLinkTypeBuyStars struct { +// The link is a link to the Call tab or page +type InternalLinkTypeCallsPage struct { meta - // The number of Telegram Stars that must be owned by the user - StarCount int64 `json:"star_count"` - // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions - Purpose string `json:"purpose"` + // Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call" + Section string `json:"section"` } -func (entity *InternalLinkTypeBuyStars) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeCallsPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeBuyStars + type stub InternalLinkTypeCallsPage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeBuyStars) GetClass() string { +func (*InternalLinkTypeCallsPage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeBuyStars) GetType() string { - return TypeInternalLinkTypeBuyStars +func (*InternalLinkTypeCallsPage) GetType() string { + return TypeInternalLinkTypeCallsPage } -func (*InternalLinkTypeBuyStars) InternalLinkTypeType() string { - return TypeInternalLinkTypeBuyStars -} - -// The link is a link to the change phone number section of the application -type InternalLinkTypeChangePhoneNumber struct{ - meta -} - -func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeChangePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeChangePhoneNumber) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeChangePhoneNumber) GetType() string { - return TypeInternalLinkTypeChangePhoneNumber -} - -func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { - return TypeInternalLinkTypeChangePhoneNumber +func (*InternalLinkTypeCallsPage) InternalLinkTypeType() string { + return TypeInternalLinkTypeCallsPage } // The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link @@ -51191,31 +56313,6 @@ func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatFolderInvite } -// The link is a link to the folder section of the application settings -type InternalLinkTypeChatFolderSettings struct{ - meta -} - -func (entity *InternalLinkTypeChatFolderSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeChatFolderSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeChatFolderSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeChatFolderSettings) GetType() string { - return TypeInternalLinkTypeChatFolderSettings -} - -func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeChatFolderSettings -} - // 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 @@ -51243,54 +56340,83 @@ func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatInvite } -// The link is a link to the default message auto-delete timer settings section of the application settings -type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct{ +// The link is a link that allows to select some chats +type InternalLinkTypeChatSelection struct{ meta } -func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeChatSelection) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + type stub InternalLinkTypeChatSelection return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { +func (*InternalLinkTypeChatSelection) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func (*InternalLinkTypeChatSelection) GetType() string { + return TypeInternalLinkTypeChatSelection } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func (*InternalLinkTypeChatSelection) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatSelection } -// The link is a link to the edit profile section of the application settings -type InternalLinkTypeEditProfileSettings struct{ +// The link is a link to the Contacts tab or page +type InternalLinkTypeContactsPage struct { meta + // Section of the page; may be one of "", "search", "sort", "new", "invite", "manage" + Section string `json:"section"` } -func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeContactsPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeEditProfileSettings + type stub InternalLinkTypeContactsPage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeEditProfileSettings) GetClass() string { +func (*InternalLinkTypeContactsPage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeEditProfileSettings) GetType() string { - return TypeInternalLinkTypeEditProfileSettings +func (*InternalLinkTypeContactsPage) GetType() string { + return TypeInternalLinkTypeContactsPage } -func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeEditProfileSettings +func (*InternalLinkTypeContactsPage) InternalLinkTypeType() string { + return TypeInternalLinkTypeContactsPage +} + +// The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. If the chat is found and is channel, open the direct messages chat of the channel +type InternalLinkTypeDirectMessagesChat struct { + meta + // Username of the channel + ChannelUsername string `json:"channel_username"` +} + +func (entity *InternalLinkTypeDirectMessagesChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeDirectMessagesChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeDirectMessagesChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeDirectMessagesChat) GetType() string { + return TypeInternalLinkTypeDirectMessagesChat +} + +func (*InternalLinkTypeDirectMessagesChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeDirectMessagesChat } // 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 @@ -51322,6 +56448,62 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string { return TypeInternalLinkTypeGame } +// The link is a link to a gift auction. Call getGiftAuctionState with the given auction identifier to process the link +type InternalLinkTypeGiftAuction struct { + meta + // Unique identifier of the auction + AuctionId string `json:"auction_id"` +} + +func (entity *InternalLinkTypeGiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeGiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeGiftAuction) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeGiftAuction) GetType() string { + return TypeInternalLinkTypeGiftAuction +} + +func (*InternalLinkTypeGiftAuction) InternalLinkTypeType() string { + return TypeInternalLinkTypeGiftAuction +} + +// The link is a link to a gift collection. Call searchPublicChat with the given username, then call getReceivedGifts with the received gift owner identifier and the given collection identifier, then show the collection if received +type InternalLinkTypeGiftCollection struct { + meta + // Username of the owner of the gift collection + GiftOwnerUsername string `json:"gift_owner_username"` + // Gift collection identifier + CollectionId int32 `json:"collection_id"` +} + +func (entity *InternalLinkTypeGiftCollection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeGiftCollection + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeGiftCollection) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeGiftCollection) GetType() string { + return TypeInternalLinkTypeGiftCollection +} + +func (*InternalLinkTypeGiftCollection) InternalLinkTypeType() string { + return TypeInternalLinkTypeGiftCollection +} + // The link is a link to a group call that isn't bound to a chat. Use getGroupCallParticipants to get the list of group call participants and show them on the join group call screen. Call joinGroupCall with the given invite_link to join the call type InternalLinkTypeGroupCall struct { meta @@ -51432,29 +56614,31 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// The link is a link to the language section of the application settings -type InternalLinkTypeLanguageSettings struct{ +// The link is a link to a live story. Call searchPublicChat with the given chat username, then getChatActiveStories to get active stories in the chat, then find a live story among active stories of the chat, and then joinLiveStory to join the live story +type InternalLinkTypeLiveStory struct { meta + // Username of the poster of the story + StoryPosterUsername string `json:"story_poster_username"` } -func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeLiveStory) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeLanguageSettings + type stub InternalLinkTypeLiveStory return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeLanguageSettings) GetClass() string { +func (*InternalLinkTypeLiveStory) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeLanguageSettings) GetType() string { - return TypeInternalLinkTypeLanguageSettings +func (*InternalLinkTypeLiveStory) GetType() string { + return TypeInternalLinkTypeLiveStory } -func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeLanguageSettings +func (*InternalLinkTypeLiveStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeLiveStory } // The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and mode and open the returned URL as a Web App @@ -51565,54 +56749,149 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { return TypeInternalLinkTypeMessageDraft } -// The link is a link to the screen with information about Telegram Star balance and transactions of the current user -type InternalLinkTypeMyStars struct{ +// The link is a link to the My Profile application page +type InternalLinkTypeMyProfilePage struct { meta + // Section of the page; may be one of "", "posts", "posts/all-stories", "posts/add-album", "gifts", "archived-posts" + Section string `json:"section"` } -func (entity *InternalLinkTypeMyStars) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeMyProfilePage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMyStars + type stub InternalLinkTypeMyProfilePage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeMyStars) GetClass() string { +func (*InternalLinkTypeMyProfilePage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeMyStars) GetType() string { - return TypeInternalLinkTypeMyStars +func (*InternalLinkTypeMyProfilePage) GetType() string { + return TypeInternalLinkTypeMyProfilePage } -func (*InternalLinkTypeMyStars) InternalLinkTypeType() string { - return TypeInternalLinkTypeMyStars +func (*InternalLinkTypeMyProfilePage) InternalLinkTypeType() string { + return TypeInternalLinkTypeMyProfilePage } -// The link is a link to the screen with information about Toncoin balance and transactions of the current user -type InternalLinkTypeMyToncoins struct{ +// The link is a link to the screen for creating a new channel chat +type InternalLinkTypeNewChannelChat struct{ meta } -func (entity *InternalLinkTypeMyToncoins) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeNewChannelChat) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMyToncoins + type stub InternalLinkTypeNewChannelChat return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeMyToncoins) GetClass() string { +func (*InternalLinkTypeNewChannelChat) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeMyToncoins) GetType() string { - return TypeInternalLinkTypeMyToncoins +func (*InternalLinkTypeNewChannelChat) GetType() string { + return TypeInternalLinkTypeNewChannelChat } -func (*InternalLinkTypeMyToncoins) InternalLinkTypeType() string { - return TypeInternalLinkTypeMyToncoins +func (*InternalLinkTypeNewChannelChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewChannelChat +} + +// The link is a link to the screen for creating a new group chat +type InternalLinkTypeNewGroupChat struct{ + meta +} + +func (entity *InternalLinkTypeNewGroupChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewGroupChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewGroupChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewGroupChat) GetType() string { + return TypeInternalLinkTypeNewGroupChat +} + +func (*InternalLinkTypeNewGroupChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewGroupChat +} + +// The link is a link to the screen for creating a new private chat with a contact +type InternalLinkTypeNewPrivateChat struct{ + meta +} + +func (entity *InternalLinkTypeNewPrivateChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewPrivateChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewPrivateChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewPrivateChat) GetType() string { + return TypeInternalLinkTypeNewPrivateChat +} + +func (*InternalLinkTypeNewPrivateChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewPrivateChat +} + +// The link is a link to open the story posting interface +type InternalLinkTypeNewStory struct { + meta + // The type of the content of the story to post; may be null if unspecified + ContentType StoryContentType `json:"content_type"` +} + +func (entity *InternalLinkTypeNewStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewStory) GetType() string { + return TypeInternalLinkTypeNewStory +} + +func (*InternalLinkTypeNewStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewStory +} + +func (internalLinkTypeNewStory *InternalLinkTypeNewStory) UnmarshalJSON(data []byte) error { + var tmp struct { + ContentType json.RawMessage `json:"content_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldContentType, _ := UnmarshalStoryContentType(tmp.ContentType) + internalLinkTypeNewStory.ContentType = fieldContentType + + return nil } // The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it @@ -51680,57 +56959,30 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { } // 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 -type InternalLinkTypePremiumFeatures struct { +type InternalLinkTypePremiumFeaturesPage struct { meta // Referrer specified in the link Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePremiumFeaturesPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePremiumFeatures + type stub InternalLinkTypePremiumFeaturesPage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePremiumFeatures) GetClass() string { +func (*InternalLinkTypePremiumFeaturesPage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePremiumFeatures) GetType() string { - return TypeInternalLinkTypePremiumFeatures +func (*InternalLinkTypePremiumFeaturesPage) GetType() string { + return TypeInternalLinkTypePremiumFeaturesPage } -func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumFeatures -} - -// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift 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 +func (*InternalLinkTypePremiumFeaturesPage) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumFeaturesPage } // 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 @@ -51760,40 +57012,38 @@ func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { return TypeInternalLinkTypePremiumGiftCode } -// The link is a link to the privacy and security section of the application settings -type InternalLinkTypePrivacyAndSecuritySettings struct{ +// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases +type InternalLinkTypePremiumGiftPurchase struct { meta + // Referrer specified in the link + Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePremiumGiftPurchase) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePrivacyAndSecuritySettings + type stub InternalLinkTypePremiumGiftPurchase return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { +func (*InternalLinkTypePremiumGiftPurchase) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings +func (*InternalLinkTypePremiumGiftPurchase) GetType() string { + return TypeInternalLinkTypePremiumGiftPurchase } -func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings +func (*InternalLinkTypePremiumGiftPurchase) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGiftPurchase } // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Type of the proxy - Type ProxyType `json:"type"` + // The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user + Proxy *Proxy `json:"proxy"` } func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) { @@ -51816,27 +57066,6 @@ func (*InternalLinkTypeProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeProxy } -func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Server string `json:"server"` - Port int32 `json:"port"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - internalLinkTypeProxy.Server = tmp.Server - internalLinkTypeProxy.Port = tmp.Port - - fieldType, _ := UnmarshalProxyType(tmp.Type) - internalLinkTypeProxy.Type = fieldType - - return nil -} - // 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. If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field type InternalLinkTypePublicChat struct { meta @@ -51918,11 +57147,63 @@ func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { return TypeInternalLinkTypeRestorePurchases } -// The link is a link to application settings -type InternalLinkTypeSettings struct{ +// The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat +type InternalLinkTypeSavedMessages struct{ meta } +func (entity *InternalLinkTypeSavedMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSavedMessages + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSavedMessages) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSavedMessages) GetType() string { + return TypeInternalLinkTypeSavedMessages +} + +func (*InternalLinkTypeSavedMessages) InternalLinkTypeType() string { + return TypeInternalLinkTypeSavedMessages +} + +// The link is a link to the global chat and messages search field +type InternalLinkTypeSearch struct{ + meta +} + +func (entity *InternalLinkTypeSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSearch + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSearch) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSearch) GetType() string { + return TypeInternalLinkTypeSearch +} + +func (*InternalLinkTypeSearch) InternalLinkTypeType() string { + return TypeInternalLinkTypeSearch +} + +// The link is a link to application settings +type InternalLinkTypeSettings struct { + meta + // Section of the application settings to open; may be null if none + Section SettingsSection `json:"section"` +} + func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() @@ -51943,6 +57224,51 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } +func (internalLinkTypeSettings *InternalLinkTypeSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Section json.RawMessage `json:"section"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldSection, _ := UnmarshalSettingsSection(tmp.Section) + internalLinkTypeSettings.Section = fieldSection + + return nil +} + +// The link is a link to the Telegram Star purchase section of the application +type InternalLinkTypeStarPurchase struct { + meta + // The number of Telegram Stars that must be owned by the user + StarCount int64 `json:"star_count"` + // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions + Purpose string `json:"purpose"` +} + +func (entity *InternalLinkTypeStarPurchase) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStarPurchase + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStarPurchase) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStarPurchase) GetType() string { + return TypeInternalLinkTypeStarPurchase +} + +func (*InternalLinkTypeStarPurchase) InternalLinkTypeType() string { + return TypeInternalLinkTypeStarPurchase +} + // 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 @@ -52001,6 +57327,35 @@ func (*InternalLinkTypeStory) InternalLinkTypeType() string { return TypeInternalLinkTypeStory } +// The link is a link to an album of stories. Call searchPublicChat with the given username, then call getStoryAlbumStories with the received chat identifier and the given story album identifier, then show the story album if received +type InternalLinkTypeStoryAlbum struct { + meta + // Username of the owner of the story album + StoryAlbumOwnerUsername string `json:"story_album_owner_username"` + // Story album identifier + StoryAlbumId int32 `json:"story_album_id"` +} + +func (entity *InternalLinkTypeStoryAlbum) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStoryAlbum + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStoryAlbum) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStoryAlbum) GetType() string { + return TypeInternalLinkTypeStoryAlbum +} + +func (*InternalLinkTypeStoryAlbum) InternalLinkTypeType() string { + return TypeInternalLinkTypeStoryAlbum +} + // The link is a link to a cloud theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { meta @@ -52028,31 +57383,6 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } -// The link is a link to the theme section of the application settings -type InternalLinkTypeThemeSettings struct{ - meta -} - -func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeThemeSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeThemeSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeThemeSettings) GetType() string { - return TypeInternalLinkTypeThemeSettings -} - -func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeThemeSettings -} - // The link is an unknown tg: link. Call getDeepLinkInfo to process the link type InternalLinkTypeUnknownDeepLink struct { meta @@ -52080,31 +57410,6 @@ func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string { return TypeInternalLinkTypeUnknownDeepLink } -// The link is a link to an unsupported proxy. An alert can be shown to the user -type InternalLinkTypeUnsupportedProxy struct{ - meta -} - -func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeUnsupportedProxy - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeUnsupportedProxy) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeUnsupportedProxy) GetType() string { - return TypeInternalLinkTypeUnsupportedProxy -} - -func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { - return TypeInternalLinkTypeUnsupportedProxy -} - // The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link type InternalLinkTypeUpgradedGift struct { meta @@ -52309,8 +57614,8 @@ type MessageLinkInfo struct { IsPublic bool `json:"is_public"` // If found, identifier of the chat to which the link points, 0 otherwise ChatId int64 `json:"chat_id"` - // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing - MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the specific topic in which the message must be opened, or a topic to open if the message is missing; may be null if none + TopicId MessageTopic `json:"topic_id"` // If found, the linked message; may be null Message *Message `json:"message"` // Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview @@ -52335,6 +57640,33 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } +func (messageLinkInfo *MessageLinkInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + IsPublic bool `json:"is_public"` + ChatId int64 `json:"chat_id"` + TopicId json.RawMessage `json:"topic_id"` + Message *Message `json:"message"` + MediaTimestamp int32 `json:"media_timestamp"` + ForAlbum bool `json:"for_album"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageLinkInfo.IsPublic = tmp.IsPublic + messageLinkInfo.ChatId = tmp.ChatId + messageLinkInfo.Message = tmp.Message + messageLinkInfo.MediaTimestamp = tmp.MediaTimestamp + messageLinkInfo.ForAlbum = tmp.ForAlbum + + fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) + messageLinkInfo.TopicId = fieldTopicId + + return nil +} + // Contains an HTTPS link to boost a chat type ChatBoostLink struct { meta @@ -53825,6 +59157,33 @@ func (*ConnectionStateReady) ConnectionStateType() string { return TypeConnectionStateReady } +// Describes parameters for age verification of the current user +type AgeVerificationParameters struct { + meta + // The minimum age required to view restricted content + MinAge int32 `json:"min_age"` + // Username of the bot which main Web App may be used to verify age of the user + VerificationBotUsername string `json:"verification_bot_username"` + // Unique name for the country or region, which legislation required age verification. May be used to get the corresponding localization key + Country string `json:"country"` +} + +func (entity *AgeVerificationParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AgeVerificationParameters + + return json.Marshal((*stub)(entity)) +} + +func (*AgeVerificationParameters) GetClass() string { + return ClassAgeVerificationParameters +} + +func (*AgeVerificationParameters) GetType() string { + return TypeAgeVerificationParameters +} + // A category containing frequently used private chats with non-bot users type TopChatCategoryUsers struct{ meta @@ -54637,6 +59996,58 @@ func (*SuggestedActionCustom) SuggestedActionType() string { return TypeSuggestedActionCustom } +// Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address +type SuggestedActionSetLoginEmailAddress struct { + meta + // True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the app without setting up the email address + CanBeHidden bool `json:"can_be_hidden"` +} + +func (entity *SuggestedActionSetLoginEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSetLoginEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSetLoginEmailAddress) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSetLoginEmailAddress) GetType() string { + return TypeSuggestedActionSetLoginEmailAddress +} + +func (*SuggestedActionSetLoginEmailAddress) SuggestedActionType() string { + return TypeSuggestedActionSetLoginEmailAddress +} + +// Suggests the user to add a passkey for login using addLoginPasskey +type SuggestedActionAddLoginPasskey struct{ + meta +} + +func (entity *SuggestedActionAddLoginPasskey) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionAddLoginPasskey + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionAddLoginPasskey) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionAddLoginPasskey) GetType() string { + return TypeSuggestedActionAddLoginPasskey +} + +func (*SuggestedActionAddLoginPasskey) SuggestedActionType() string { + return TypeSuggestedActionAddLoginPasskey +} + // Contains a counter type Count struct { meta @@ -54939,87 +60350,56 @@ func (*ProxyTypeMtproto) ProxyTypeType() string { return TypeProxyTypeMtproto } -// Contains information about a proxy server -type Proxy struct { +// Contains information about a proxy server added to the list of proxies +type AddedProxy struct { meta // Unique identifier of the proxy Id int32 `json:"id"` - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` // Point in time (Unix timestamp) when the proxy was last used; 0 if never LastUsedDate int32 `json:"last_used_date"` // True, if the proxy is enabled now IsEnabled bool `json:"is_enabled"` - // Type of the proxy - Type ProxyType `json:"type"` + // The proxy + Proxy *Proxy `json:"proxy"` } -func (entity *Proxy) MarshalJSON() ([]byte, error) { +func (entity *AddedProxy) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub Proxy + type stub AddedProxy return json.Marshal((*stub)(entity)) } -func (*Proxy) GetClass() string { - return ClassProxy +func (*AddedProxy) GetClass() string { + return ClassAddedProxy } -func (*Proxy) GetType() string { - return TypeProxy +func (*AddedProxy) GetType() string { + return TypeAddedProxy } -func (proxy *Proxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int32 `json:"id"` - Server string `json:"server"` - Port int32 `json:"port"` - LastUsedDate int32 `json:"last_used_date"` - IsEnabled bool `json:"is_enabled"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - proxy.Id = tmp.Id - proxy.Server = tmp.Server - proxy.Port = tmp.Port - proxy.LastUsedDate = tmp.LastUsedDate - proxy.IsEnabled = tmp.IsEnabled - - fieldType, _ := UnmarshalProxyType(tmp.Type) - proxy.Type = fieldType - - return nil -} - -// Represents a list of proxy servers -type Proxies struct { +// Represents a list of added proxy servers +type AddedProxies struct { meta // List of proxy servers - Proxies []*Proxy `json:"proxies"` + Proxies []*AddedProxy `json:"proxies"` } -func (entity *Proxies) MarshalJSON() ([]byte, error) { +func (entity *AddedProxies) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub Proxies + type stub AddedProxies return json.Marshal((*stub)(entity)) } -func (*Proxies) GetClass() string { - return ClassProxies +func (*AddedProxies) GetClass() string { + return ClassAddedProxies } -func (*Proxies) GetType() string { - return TypeProxies +func (*AddedProxies) GetType() string { + return TypeAddedProxies } // A sticker to be added to a sticker set @@ -55981,7 +61361,7 @@ func (*ChatRevenueTransactionTypeSponsoredMessageEarnings) ChatRevenueTransactio // Describes earnings from a published suggested post type ChatRevenueTransactionTypeSuggestedPostEarnings struct { meta - // Identifier of the user that paid for the suggested post + // Identifier of the user who paid for the suggested post UserId int64 `json:"user_id"` } @@ -56155,14 +61535,14 @@ func (*ChatRevenueTransactions) GetType() string { return TypeChatRevenueTransactions } -// Contains information about Telegram Stars earned by a bot or a chat +// Contains information about Telegram Stars earned by a user or a chat type StarRevenueStatus struct { meta - // Total amount of Telegram Stars earned + // Total Telegram Star amount earned TotalAmount *StarAmount `json:"total_amount"` - // The amount of Telegram Stars that aren't withdrawn yet + // The Telegram Star amount that isn't withdrawn yet CurrentAmount *StarAmount `json:"current_amount"` - // The amount of Telegram Stars that are available for withdrawal + // The Telegram Star amount that is available for withdrawal AvailableAmount *StarAmount `json:"available_amount"` // True, if Telegram Stars can be withdrawn now or later WithdrawalEnabled bool `json:"withdrawal_enabled"` @@ -56186,7 +61566,7 @@ func (*StarRevenueStatus) GetType() string { return TypeStarRevenueStatus } -// A detailed statistics about Telegram Stars earned by a bot or a chat +// A detailed statistics about Telegram Stars earned by a user or a chat type StarRevenueStatistics struct { meta // A graph containing amount of revenue in a given day @@ -56234,6 +61614,83 @@ func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) e return nil } +// Contains information about Toncoins earned by the current user +type TonRevenueStatus struct { + meta + // Total Toncoin amount earned; in the smallest units of the cryptocurrency + TotalAmount JsonInt64 `json:"total_amount"` + // The Toncoin amount that isn't withdrawn yet; in the smallest units of the cryptocurrency + BalanceAmount JsonInt64 `json:"balance_amount"` + // The Toncoin amount that is available for withdrawal; in the smallest units of the cryptocurrency + AvailableAmount JsonInt64 `json:"available_amount"` + // True, if Toncoins can be withdrawn + WithdrawalEnabled bool `json:"withdrawal_enabled"` +} + +func (entity *TonRevenueStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonRevenueStatus + + return json.Marshal((*stub)(entity)) +} + +func (*TonRevenueStatus) GetClass() string { + return ClassTonRevenueStatus +} + +func (*TonRevenueStatus) GetType() string { + return TypeTonRevenueStatus +} + +// A detailed statistics about Toncoins earned by the current user +type TonRevenueStatistics struct { + meta + // A graph containing amount of revenue in a given day + RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` + // Amount of earned revenue + Status *TonRevenueStatus `json:"status"` + // Current conversion rate of nanotoncoin to USD cents + UsdRate float64 `json:"usd_rate"` +} + +func (entity *TonRevenueStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonRevenueStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*TonRevenueStatistics) GetClass() string { + return ClassTonRevenueStatistics +} + +func (*TonRevenueStatistics) GetType() string { + return TypeTonRevenueStatistics +} + +func (tonRevenueStatistics *TonRevenueStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + RevenueByDayGraph json.RawMessage `json:"revenue_by_day_graph"` + Status *TonRevenueStatus `json:"status"` + UsdRate float64 `json:"usd_rate"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + tonRevenueStatistics.Status = tmp.Status + tonRevenueStatistics.UsdRate = tmp.UsdRate + + fieldRevenueByDayGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueByDayGraph) + tonRevenueStatistics.RevenueByDayGraph = fieldRevenueByDayGraph + + return nil +} + // A point on a Cartesian plane type Point struct { meta @@ -57213,6 +62670,8 @@ type UpdateChatAccentColors struct { AccentColorId int32 `json:"accent_color_id"` // 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"` + // Color scheme based on an upgraded gift to be used for the chat instead of accent_color_id and background_custom_emoji_id; may be null if none + UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // 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 @@ -57867,8 +63326,8 @@ type UpdateChatTheme struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new name of the chat theme; may be empty if theme was reset to default - ThemeName string `json:"theme_name"` + // The new theme of the chat; may be null if theme was reset to default + Theme ChatTheme `json:"theme"` } func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { @@ -57891,6 +63350,25 @@ func (*UpdateChatTheme) UpdateType() string { return TypeUpdateChatTheme } +func (updateChatTheme *UpdateChatTheme) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + Theme json.RawMessage `json:"theme"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatTheme.ChatId = tmp.ChatId + + fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) + updateChatTheme.Theme = fieldTheme + + return nil +} + // The chat unread_mention_count has changed type UpdateChatUnreadMentionCount struct { meta @@ -58348,7 +63826,7 @@ type UpdateTopicMessageCount struct { ChatId int64 `json:"chat_id"` // Identifier of the topic TopicId MessageTopic `json:"topic_id"` - // Approximate number of messages in the topics + // Approximate number of messages in the topic MessageCount int32 `json:"message_count"` } @@ -58535,8 +64013,8 @@ type UpdateForumTopic struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // Message thread identifier of the topic - MessageThreadId int64 `json:"message_thread_id"` + // Forum topic identifier of the topic + ForumTopicId int32 `json:"forum_topic_id"` // True, if the topic is pinned in the topic list IsPinned bool `json:"is_pinned"` // Identifier of the last read incoming message @@ -58549,6 +64027,8 @@ type UpdateForumTopic struct { UnreadReactionCount int32 `json:"unread_reaction_count"` // Notification settings for the topic NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // A draft of a message in the topic; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` } func (entity *UpdateForumTopic) MarshalJSON() ([]byte, error) { @@ -58841,8 +64321,8 @@ type UpdateChatAction struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, the message thread identifier in which the action was performed - MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the specific topic in which the action was performed; may be null if none + TopicId MessageTopic `json:"topic_id"` // Identifier of a message sender performing the action SenderId MessageSender `json:"sender_id"` // The action @@ -58872,7 +64352,7 @@ func (*UpdateChatAction) UpdateType() string { func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` - MessageThreadId int64 `json:"message_thread_id"` + TopicId json.RawMessage `json:"topic_id"` SenderId json.RawMessage `json:"sender_id"` Action json.RawMessage `json:"action"` } @@ -58883,7 +64363,9 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { } updateChatAction.ChatId = tmp.ChatId - updateChatAction.MessageThreadId = tmp.MessageThreadId + + fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) + updateChatAction.TopicId = fieldTopicId fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) updateChatAction.SenderId = fieldSenderId @@ -58894,6 +64376,39 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { return nil } +// A new pending text message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received +type UpdatePendingTextMessage struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The forum topic identifier in which the message will be sent; 0 if none + ForumTopicId int32 `json:"forum_topic_id"` + // Unique identifier of the message draft within the message thread + DraftId JsonInt64 `json:"draft_id"` + // Text of the pending message + Text *FormattedText `json:"text"` +} + +func (entity *UpdatePendingTextMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdatePendingTextMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdatePendingTextMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdatePendingTextMessage) GetType() string { + return TypeUpdatePendingTextMessage +} + +func (*UpdatePendingTextMessage) UpdateType() string { + return TypeUpdatePendingTextMessage +} + // The user went online or offline type UpdateUserStatus struct { meta @@ -59599,6 +65114,176 @@ func (*UpdateGroupCallVerificationState) UpdateType() string { return TypeUpdateGroupCallVerificationState } +// A new message was received in a group call +type UpdateNewGroupCallMessage struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // The message + Message *GroupCallMessage `json:"message"` +} + +func (entity *UpdateNewGroupCallMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewGroupCallMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewGroupCallMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewGroupCallMessage) GetType() string { + return TypeUpdateNewGroupCallMessage +} + +func (*UpdateNewGroupCallMessage) UpdateType() string { + return TypeUpdateNewGroupCallMessage +} + +// A new paid reaction was received in a live story group call +type UpdateNewGroupCallPaidReaction struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Identifier of the sender of the reaction + SenderId MessageSender `json:"sender_id"` + // The number of Telegram Stars that were paid to send the reaction + StarCount int64 `json:"star_count"` +} + +func (entity *UpdateNewGroupCallPaidReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewGroupCallPaidReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewGroupCallPaidReaction) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewGroupCallPaidReaction) GetType() string { + return TypeUpdateNewGroupCallPaidReaction +} + +func (*UpdateNewGroupCallPaidReaction) UpdateType() string { + return TypeUpdateNewGroupCallPaidReaction +} + +func (updateNewGroupCallPaidReaction *UpdateNewGroupCallPaidReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + GroupCallId int32 `json:"group_call_id"` + SenderId json.RawMessage `json:"sender_id"` + StarCount int64 `json:"star_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewGroupCallPaidReaction.GroupCallId = tmp.GroupCallId + updateNewGroupCallPaidReaction.StarCount = tmp.StarCount + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + updateNewGroupCallPaidReaction.SenderId = fieldSenderId + + return nil +} + +// A group call message failed to send +type UpdateGroupCallMessageSendFailed struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Message identifier + MessageId int32 `json:"message_id"` + // The cause of the message sending failure + Error *Error `json:"error"` +} + +func (entity *UpdateGroupCallMessageSendFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessageSendFailed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessageSendFailed) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessageSendFailed) GetType() string { + return TypeUpdateGroupCallMessageSendFailed +} + +func (*UpdateGroupCallMessageSendFailed) UpdateType() string { + return TypeUpdateGroupCallMessageSendFailed +} + +// Some group call messages were deleted +type UpdateGroupCallMessagesDeleted struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Identifiers of the deleted messages + MessageIds []int32 `json:"message_ids"` +} + +func (entity *UpdateGroupCallMessagesDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessagesDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessagesDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessagesDeleted) GetType() string { + return TypeUpdateGroupCallMessagesDeleted +} + +func (*UpdateGroupCallMessagesDeleted) UpdateType() string { + return TypeUpdateGroupCallMessagesDeleted +} + +// The list of top donors in live story group call has changed +type UpdateLiveStoryTopDonors struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // New list of live story donors + Donors *LiveStoryDonors `json:"donors"` +} + +func (entity *UpdateLiveStoryTopDonors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateLiveStoryTopDonors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateLiveStoryTopDonors) GetClass() string { + return ClassUpdate +} + +func (*UpdateLiveStoryTopDonors) GetType() string { + return TypeUpdateLiveStoryTopDonors +} + +func (*UpdateLiveStoryTopDonors) UpdateType() string { + return TypeUpdateLiveStoryTopDonors +} + // New call signaling data arrived type UpdateNewCallSignalingData struct { meta @@ -59628,6 +65313,60 @@ func (*UpdateNewCallSignalingData) UpdateType() string { return TypeUpdateNewCallSignalingData } +// State of a gift auction was updated +type UpdateGiftAuctionState struct { + meta + // New state of the auction + State *GiftAuctionState `json:"state"` +} + +func (entity *UpdateGiftAuctionState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGiftAuctionState + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGiftAuctionState) GetClass() string { + return ClassUpdate +} + +func (*UpdateGiftAuctionState) GetType() string { + return TypeUpdateGiftAuctionState +} + +func (*UpdateGiftAuctionState) UpdateType() string { + return TypeUpdateGiftAuctionState +} + +// The list of auctions in which participate the current user has changed +type UpdateActiveGiftAuctions struct { + meta + // New states of the auctions + States []*GiftAuctionState `json:"states"` +} + +func (entity *UpdateActiveGiftAuctions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateActiveGiftAuctions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateActiveGiftAuctions) GetClass() string { + return ClassUpdate +} + +func (*UpdateActiveGiftAuctions) GetType() string { + return TypeUpdateActiveGiftAuctions +} + +func (*UpdateActiveGiftAuctions) UpdateType() string { + return TypeUpdateActiveGiftAuctions +} + // Some privacy setting rules have been changed type UpdateUserPrivacySettingRules struct { meta @@ -60033,6 +65772,33 @@ func (*UpdateStoryStealthMode) UpdateType() string { return TypeUpdateStoryStealthMode } +// Lists of bots which Mini Apps must be allowed to read text from clipboard and must be opened without a warning +type UpdateTrustedMiniAppBots struct { + meta + // List of user identifiers of the bots; the corresponding users may not be sent using updateUser updates and may not be accessible + BotUserIds []int64 `json:"bot_user_ids"` +} + +func (entity *UpdateTrustedMiniAppBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTrustedMiniAppBots + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTrustedMiniAppBots) GetClass() string { + return ClassUpdate +} + +func (*UpdateTrustedMiniAppBots) GetType() string { + return TypeUpdateTrustedMiniAppBots +} + +func (*UpdateTrustedMiniAppBots) UpdateType() string { + return TypeUpdateTrustedMiniAppBots +} + // An option changed its value type UpdateOption struct { meta @@ -60343,31 +66109,31 @@ func (*UpdateDefaultBackground) UpdateType() string { return TypeUpdateDefaultBackground } -// The list of available chat themes has changed -type UpdateChatThemes struct { +// The list of available emoji chat themes has changed +type UpdateEmojiChatThemes struct { meta - // The new list of chat themes - ChatThemes []*ChatTheme `json:"chat_themes"` + // The new list of emoji chat themes + ChatThemes []*EmojiChatTheme `json:"chat_themes"` } -func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) { +func (entity *UpdateEmojiChatThemes) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatThemes + type stub UpdateEmojiChatThemes return json.Marshal((*stub)(entity)) } -func (*UpdateChatThemes) GetClass() string { +func (*UpdateEmojiChatThemes) GetClass() string { return ClassUpdate } -func (*UpdateChatThemes) GetType() string { - return TypeUpdateChatThemes +func (*UpdateEmojiChatThemes) GetType() string { + return TypeUpdateEmojiChatThemes } -func (*UpdateChatThemes) UpdateType() string { - return TypeUpdateChatThemes +func (*UpdateEmojiChatThemes) UpdateType() string { + return TypeUpdateEmojiChatThemes } // The list of supported accent colors has changed @@ -60535,6 +66301,33 @@ func (*UpdateFreezeState) UpdateType() string { return TypeUpdateFreezeState } +// The parameters for age verification of the current user's account has changed +type UpdateAgeVerificationParameters struct { + meta + // Parameters for the age verification; may be null if age verification isn't needed + Parameters *AgeVerificationParameters `json:"parameters"` +} + +func (entity *UpdateAgeVerificationParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAgeVerificationParameters + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAgeVerificationParameters) GetClass() string { + return ClassUpdate +} + +func (*UpdateAgeVerificationParameters) GetType() string { + return TypeUpdateAgeVerificationParameters +} + +func (*UpdateAgeVerificationParameters) UpdateType() string { + return TypeUpdateAgeVerificationParameters +} + // New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" type UpdateTermsOfService struct { meta @@ -60926,7 +66719,7 @@ func (*UpdateChatRevenueAmount) UpdateType() string { return TypeUpdateChatRevenueAmount } -// The Telegram Star revenue earned by a bot or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +// The Telegram Star revenue earned by a user or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions type UpdateStarRevenueStatus struct { meta // Identifier of the owner of the Telegram Stars @@ -60974,6 +66767,33 @@ func (updateStarRevenueStatus *UpdateStarRevenueStatus) UnmarshalJSON(data []byt return nil } +// The Toncoin revenue earned by the current user has changed. If Toncoin transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions +type UpdateTonRevenueStatus struct { + meta + // New Toncoin revenue status + Status *TonRevenueStatus `json:"status"` +} + +func (entity *UpdateTonRevenueStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTonRevenueStatus + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTonRevenueStatus) GetClass() string { + return ClassUpdate +} + +func (*UpdateTonRevenueStatus) GetType() string { + return TypeUpdateTonRevenueStatus +} + +func (*UpdateTonRevenueStatus) UpdateType() string { + return TypeUpdateTonRevenueStatus +} + // The parameters of speech recognition without Telegram Premium subscription has changed type UpdateSpeechRecognitionTrial struct { meta @@ -61007,6 +66827,33 @@ func (*UpdateSpeechRecognitionTrial) UpdateType() string { return TypeUpdateSpeechRecognitionTrial } +// The levels of live story group call messages have changed +type UpdateGroupCallMessageLevels struct { + meta + // New description of the levels in decreasing order of groupCallMessageLevel.min_star_count + Levels []*GroupCallMessageLevel `json:"levels"` +} + +func (entity *UpdateGroupCallMessageLevels) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessageLevels + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessageLevels) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessageLevels) GetType() string { + return TypeUpdateGroupCallMessageLevels +} + +func (*UpdateGroupCallMessageLevels) UpdateType() string { + return TypeUpdateGroupCallMessageLevels +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -61034,6 +66881,33 @@ func (*UpdateDiceEmojis) UpdateType() string { return TypeUpdateDiceEmojis } +// The stake dice state has changed +type UpdateStakeDiceState struct { + meta + // The new state. The state can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState + State *StakeDiceState `json:"state"` +} + +func (entity *UpdateStakeDiceState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStakeDiceState + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStakeDiceState) GetClass() string { + return ClassUpdate +} + +func (*UpdateStakeDiceState) GetType() string { + return TypeUpdateStakeDiceState +} + +func (*UpdateStakeDiceState) UpdateType() string { + return TypeUpdateStakeDiceState +} + // Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played type UpdateAnimatedEmojiMessageClicked struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 829ea95..5319fa2 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -511,6 +511,58 @@ func UnmarshalListOfPollType(dataList []json.RawMessage) ([]PollType, error) { return list, nil } +func UnmarshalProfileTab(data json.RawMessage) (ProfileTab, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeProfileTabPosts: + return UnmarshalProfileTabPosts(data) + + case TypeProfileTabGifts: + return UnmarshalProfileTabGifts(data) + + case TypeProfileTabMedia: + return UnmarshalProfileTabMedia(data) + + case TypeProfileTabFiles: + return UnmarshalProfileTabFiles(data) + + case TypeProfileTabLinks: + return UnmarshalProfileTabLinks(data) + + case TypeProfileTabMusic: + return UnmarshalProfileTabMusic(data) + + case TypeProfileTabVoice: + return UnmarshalProfileTabVoice(data) + + case TypeProfileTabGifs: + return UnmarshalProfileTabGifs(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfProfileTab(dataList []json.RawMessage) ([]ProfileTab, error) { + list := []ProfileTab{} + + for _, data := range dataList { + entity, err := UnmarshalProfileTab(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUserType(data json.RawMessage) (UserType, error) { var meta meta @@ -662,6 +714,77 @@ func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto return list, nil } +func UnmarshalGiftResalePrice(data json.RawMessage) (GiftResalePrice, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeGiftResalePriceStar: + return UnmarshalGiftResalePriceStar(data) + + case TypeGiftResalePriceTon: + return UnmarshalGiftResalePriceTon(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfGiftResalePrice(dataList []json.RawMessage) ([]GiftResalePrice, error) { + list := []GiftResalePrice{} + + for _, data := range dataList { + entity, err := UnmarshalGiftResalePrice(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalGiftPurchaseOfferState(data json.RawMessage) (GiftPurchaseOfferState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeGiftPurchaseOfferStatePending: + return UnmarshalGiftPurchaseOfferStatePending(data) + + case TypeGiftPurchaseOfferStateAccepted: + return UnmarshalGiftPurchaseOfferStateAccepted(data) + + case TypeGiftPurchaseOfferStateRejected: + return UnmarshalGiftPurchaseOfferStateRejected(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfGiftPurchaseOfferState(dataList []json.RawMessage) ([]GiftPurchaseOfferState, error) { + list := []GiftPurchaseOfferState{} + + for _, data := range dataList { + entity, err := UnmarshalGiftPurchaseOfferState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalSuggestedPostPrice(data json.RawMessage) (SuggestedPostPrice, error) { var meta meta @@ -875,6 +998,40 @@ func UnmarshalListOfAffiliateProgramSortOrder(dataList []json.RawMessage) ([]Aff return list, nil } +func UnmarshalCanSendGiftResult(data json.RawMessage) (CanSendGiftResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanSendGiftResultOk: + return UnmarshalCanSendGiftResultOk(data) + + case TypeCanSendGiftResultFail: + return UnmarshalCanSendGiftResultFail(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCanSendGiftResult(dataList []json.RawMessage) ([]CanSendGiftResult, error) { + list := []CanSendGiftResult{} + + for _, data := range dataList { + entity, err := UnmarshalCanSendGiftResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUpgradedGiftOrigin(data json.RawMessage) (UpgradedGiftOrigin, error) { var meta meta @@ -893,6 +1050,18 @@ func UnmarshalUpgradedGiftOrigin(data json.RawMessage) (UpgradedGiftOrigin, erro case TypeUpgradedGiftOriginResale: return UnmarshalUpgradedGiftOriginResale(data) + case TypeUpgradedGiftOriginBlockchain: + return UnmarshalUpgradedGiftOriginBlockchain(data) + + case TypeUpgradedGiftOriginPrepaidUpgrade: + return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) + + case TypeUpgradedGiftOriginOffer: + return UnmarshalUpgradedGiftOriginOffer(data) + + case TypeUpgradedGiftOriginCraft: + return UnmarshalUpgradedGiftOriginCraft(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -912,6 +1081,89 @@ func UnmarshalListOfUpgradedGiftOrigin(dataList []json.RawMessage) ([]UpgradedGi return list, nil } +func UnmarshalUpgradedGiftAttributeRarity(data json.RawMessage) (UpgradedGiftAttributeRarity, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeUpgradedGiftAttributeRarityPerMille: + return UnmarshalUpgradedGiftAttributeRarityPerMille(data) + + case TypeUpgradedGiftAttributeRarityUncommon: + return UnmarshalUpgradedGiftAttributeRarityUncommon(data) + + case TypeUpgradedGiftAttributeRarityRare: + return UnmarshalUpgradedGiftAttributeRarityRare(data) + + case TypeUpgradedGiftAttributeRarityEpic: + return UnmarshalUpgradedGiftAttributeRarityEpic(data) + + case TypeUpgradedGiftAttributeRarityLegendary: + return UnmarshalUpgradedGiftAttributeRarityLegendary(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfUpgradedGiftAttributeRarity(dataList []json.RawMessage) ([]UpgradedGiftAttributeRarity, error) { + list := []UpgradedGiftAttributeRarity{} + + for _, data := range dataList { + entity, err := UnmarshalUpgradedGiftAttributeRarity(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalCraftGiftResult(data json.RawMessage) (CraftGiftResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCraftGiftResult(dataList []json.RawMessage) ([]CraftGiftResult, error) { + list := []CraftGiftResult{} + + for _, data := range dataList { + entity, err := UnmarshalCraftGiftResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUpgradedGiftAttributeId(data json.RawMessage) (UpgradedGiftAttributeId, error) { var meta meta @@ -986,6 +1238,40 @@ func UnmarshalListOfGiftForResaleOrder(dataList []json.RawMessage) ([]GiftForRes return list, nil } +func UnmarshalGiftResaleResult(data json.RawMessage) (GiftResaleResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeGiftResaleResultOk: + return UnmarshalGiftResaleResultOk(data) + + case TypeGiftResaleResultPriceIncreased: + return UnmarshalGiftResaleResultPriceIncreased(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfGiftResaleResult(dataList []json.RawMessage) ([]GiftResaleResult, error) { + list := []GiftResaleResult{} + + for _, data := range dataList { + entity, err := UnmarshalGiftResaleResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalSentGift(data json.RawMessage) (SentGift, error) { var meta meta @@ -1020,6 +1306,40 @@ func UnmarshalListOfSentGift(dataList []json.RawMessage) ([]SentGift, error) { return list, nil } +func UnmarshalAuctionState(data json.RawMessage) (AuctionState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeAuctionStateActive: + return UnmarshalAuctionStateActive(data) + + case TypeAuctionStateFinished: + return UnmarshalAuctionStateFinished(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfAuctionState(dataList []json.RawMessage) ([]AuctionState, error) { + list := []AuctionState{} + + for _, data := range dataList { + entity, err := UnmarshalAuctionState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalTransactionDirection(data json.RawMessage) (TransactionDirection, error) { var meta meta @@ -1120,18 +1440,30 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypeChannelSubscriptionSale: return UnmarshalStarTransactionTypeChannelSubscriptionSale(data) + case TypeStarTransactionTypeGiftAuctionBid: + return UnmarshalStarTransactionTypeGiftAuctionBid(data) + case TypeStarTransactionTypeGiftPurchase: return UnmarshalStarTransactionTypeGiftPurchase(data) + case TypeStarTransactionTypeGiftPurchaseOffer: + return UnmarshalStarTransactionTypeGiftPurchaseOffer(data) + case TypeStarTransactionTypeGiftTransfer: return UnmarshalStarTransactionTypeGiftTransfer(data) + case TypeStarTransactionTypeGiftOriginalDetailsDrop: + return UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data) + case TypeStarTransactionTypeGiftSale: return UnmarshalStarTransactionTypeGiftSale(data) case TypeStarTransactionTypeGiftUpgrade: return UnmarshalStarTransactionTypeGiftUpgrade(data) + case TypeStarTransactionTypeGiftUpgradePurchase: + return UnmarshalStarTransactionTypeGiftUpgradePurchase(data) + case TypeStarTransactionTypeUpgradedGiftPurchase: return UnmarshalStarTransactionTypeUpgradedGiftPurchase(data) @@ -1153,6 +1485,18 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypePaidMessageReceive: return UnmarshalStarTransactionTypePaidMessageReceive(data) + case TypeStarTransactionTypePaidGroupCallMessageSend: + return UnmarshalStarTransactionTypePaidGroupCallMessageSend(data) + + case TypeStarTransactionTypePaidGroupCallMessageReceive: + return UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data) + + case TypeStarTransactionTypePaidGroupCallReactionSend: + return UnmarshalStarTransactionTypePaidGroupCallReactionSend(data) + + case TypeStarTransactionTypePaidGroupCallReactionReceive: + return UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data) + case TypeStarTransactionTypeSuggestedPostPaymentSend: return UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data) @@ -1168,6 +1512,9 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypeBusinessBotTransferReceive: return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data) + case TypeStarTransactionTypePublicPostSearch: + return UnmarshalStarTransactionTypePublicPostSearch(data) + case TypeStarTransactionTypeUnsupported: return UnmarshalStarTransactionTypeUnsupported(data) @@ -1202,9 +1549,27 @@ func UnmarshalTonTransactionType(data json.RawMessage) (TonTransactionType, erro case TypeTonTransactionTypeFragmentDeposit: return UnmarshalTonTransactionTypeFragmentDeposit(data) + case TypeTonTransactionTypeFragmentWithdrawal: + return UnmarshalTonTransactionTypeFragmentWithdrawal(data) + case TypeTonTransactionTypeSuggestedPostPayment: return UnmarshalTonTransactionTypeSuggestedPostPayment(data) + case TypeTonTransactionTypeGiftPurchaseOffer: + return UnmarshalTonTransactionTypeGiftPurchaseOffer(data) + + case TypeTonTransactionTypeUpgradedGiftPurchase: + return UnmarshalTonTransactionTypeUpgradedGiftPurchase(data) + + case TypeTonTransactionTypeUpgradedGiftSale: + return UnmarshalTonTransactionTypeUpgradedGiftSale(data) + + case TypeTonTransactionTypeStakeDiceStake: + return UnmarshalTonTransactionTypeStakeDiceStake(data) + + case TypeTonTransactionTypeStakeDicePayout: + return UnmarshalTonTransactionTypeStakeDicePayout(data) + case TypeTonTransactionTypeUnsupported: return UnmarshalTonTransactionTypeUnsupported(data) @@ -1227,6 +1592,43 @@ func UnmarshalListOfTonTransactionType(dataList []json.RawMessage) ([]TonTransac return list, nil } +func UnmarshalActiveStoryState(data json.RawMessage) (ActiveStoryState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeActiveStoryStateLive: + return UnmarshalActiveStoryStateLive(data) + + case TypeActiveStoryStateUnread: + return UnmarshalActiveStoryStateUnread(data) + + case TypeActiveStoryStateRead: + return UnmarshalActiveStoryStateRead(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfActiveStoryState(dataList []json.RawMessage) ([]ActiveStoryState, error) { + list := []ActiveStoryState{} + + for _, data := range dataList { + entity, err := UnmarshalActiveStoryState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalGiveawayParticipantStatus(data json.RawMessage) (GiveawayParticipantStatus, error) { var meta meta @@ -1793,6 +2195,9 @@ func UnmarshalMessageTopic(data json.RawMessage) (MessageTopic, error) { } switch meta.Type { + case TypeMessageTopicThread: + return UnmarshalMessageTopicThread(data) + case TypeMessageTopicForum: return UnmarshalMessageTopicForum(data) @@ -2363,6 +2768,46 @@ func UnmarshalListOfChatActionBar(dataList []json.RawMessage) ([]ChatActionBar, return list, nil } +func UnmarshalButtonStyle(data json.RawMessage) (ButtonStyle, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeButtonStyleDefault: + return UnmarshalButtonStyleDefault(data) + + case TypeButtonStylePrimary: + return UnmarshalButtonStylePrimary(data) + + case TypeButtonStyleDanger: + return UnmarshalButtonStyleDanger(data) + + case TypeButtonStyleSuccess: + return UnmarshalButtonStyleSuccess(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfButtonStyle(dataList []json.RawMessage) ([]ButtonStyle, error) { + list := []ButtonStyle{} + + for _, data := range dataList { + entity, err := UnmarshalButtonStyle(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, error) { var meta meta @@ -2618,6 +3063,49 @@ func UnmarshalListOfSavedMessagesTopicType(dataList []json.RawMessage) ([]SavedM return list, nil } +func UnmarshalBuiltInTheme(data json.RawMessage) (BuiltInTheme, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBuiltInThemeClassic: + return UnmarshalBuiltInThemeClassic(data) + + case TypeBuiltInThemeDay: + return UnmarshalBuiltInThemeDay(data) + + case TypeBuiltInThemeNight: + return UnmarshalBuiltInThemeNight(data) + + case TypeBuiltInThemeTinted: + return UnmarshalBuiltInThemeTinted(data) + + case TypeBuiltInThemeArctic: + return UnmarshalBuiltInThemeArctic(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBuiltInTheme(dataList []json.RawMessage) ([]BuiltInTheme, error) { + list := []BuiltInTheme{} + + for _, data := range dataList { + entity, err := UnmarshalBuiltInTheme(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalRichText(data json.RawMessage) (RichText, error) { var meta meta @@ -2953,6 +3441,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeChat: return UnmarshalLinkPreviewTypeChat(data) + case TypeLinkPreviewTypeDirectMessagesChat: + return UnmarshalLinkPreviewTypeDirectMessagesChat(data) + case TypeLinkPreviewTypeDocument: return UnmarshalLinkPreviewTypeDocument(data) @@ -2971,12 +3462,21 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + + case TypeLinkPreviewTypeGiftCollection: + return UnmarshalLinkPreviewTypeGiftCollection(data) + case TypeLinkPreviewTypeGroupCall: return UnmarshalLinkPreviewTypeGroupCall(data) case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -2998,6 +3498,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeStory: return UnmarshalLinkPreviewTypeStory(data) + case TypeLinkPreviewTypeStoryAlbum: + return UnmarshalLinkPreviewTypeStoryAlbum(data) + case TypeLinkPreviewTypeSupergroupBoost: return UnmarshalLinkPreviewTypeSupergroupBoost(data) @@ -3689,6 +4192,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStakeDice: + return UnmarshalMessageStakeDice(data) + case TypeMessageStory: return UnmarshalMessageStory(data) @@ -3731,6 +4237,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageChatOwnerLeft: + return UnmarshalMessageChatOwnerLeft(data) + + case TypeMessageChatOwnerChanged: + return UnmarshalMessageChatOwnerChanged(data) + case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -3782,6 +4294,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageSuggestProfilePhoto: return UnmarshalMessageSuggestProfilePhoto(data) + case TypeMessageSuggestBirthdate: + return UnmarshalMessageSuggestBirthdate(data) + case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -3833,6 +4348,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageRefundedUpgradedGift: return UnmarshalMessageRefundedUpgradedGift(data) + case TypeMessageUpgradedGiftPurchaseOffer: + return UnmarshalMessageUpgradedGiftPurchaseOffer(data) + + case TypeMessageUpgradedGiftPurchaseOfferRejected: + return UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data) + case TypeMessagePaidMessagesRefunded: return UnmarshalMessagePaidMessagesRefunded(data) @@ -4171,6 +4692,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStakeDice: + return UnmarshalInputMessageStakeDice(data) + case TypeInputMessageStory: return UnmarshalInputMessageStory(data) @@ -4609,6 +5133,46 @@ func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStory return list, nil } +func UnmarshalStoryContentType(data json.RawMessage) (StoryContentType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryContentTypePhoto: + return UnmarshalStoryContentTypePhoto(data) + + case TypeStoryContentTypeVideo: + return UnmarshalStoryContentTypeVideo(data) + + case TypeStoryContentTypeLive: + return UnmarshalStoryContentTypeLive(data) + + case TypeStoryContentTypeUnsupported: + return UnmarshalStoryContentTypeUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryContentType(dataList []json.RawMessage) ([]StoryContentType, error) { + list := []StoryContentType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryContentType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { var meta meta @@ -4624,6 +5188,9 @@ func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) + case TypeStoryContentLive: + return UnmarshalStoryContentLive(data) + case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -6021,6 +6588,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureChecklists: return UnmarshalPremiumFeatureChecklists(data) + case TypePremiumFeaturePaidMessages: + return UnmarshalPremiumFeaturePaidMessages(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6506,6 +7076,74 @@ func UnmarshalListOfInputBackground(dataList []json.RawMessage) ([]InputBackgrou return list, nil } +func UnmarshalChatTheme(data json.RawMessage) (ChatTheme, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatThemeEmoji: + return UnmarshalChatThemeEmoji(data) + + case TypeChatThemeGift: + return UnmarshalChatThemeGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatTheme(dataList []json.RawMessage) ([]ChatTheme, error) { + list := []ChatTheme{} + + for _, data := range dataList { + entity, err := UnmarshalChatTheme(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputChatTheme(data json.RawMessage) (InputChatTheme, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputChatThemeEmoji: + return UnmarshalInputChatThemeEmoji(data) + + case TypeInputChatThemeGift: + return UnmarshalInputChatThemeGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputChatTheme(dataList []json.RawMessage) ([]InputChatTheme, error) { + list := []InputChatTheme{} + + for _, data := range dataList { + entity, err := UnmarshalInputChatTheme(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCanPostStoryResult(data json.RawMessage) (CanPostStoryResult, error) { var meta meta @@ -6533,6 +7171,9 @@ func UnmarshalCanPostStoryResult(data json.RawMessage) (CanPostStoryResult, erro case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6552,6 +7193,40 @@ func UnmarshalListOfCanPostStoryResult(dataList []json.RawMessage) ([]CanPostSto return list, nil } +func UnmarshalStartLiveStoryResult(data json.RawMessage) (StartLiveStoryResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStartLiveStoryResult(dataList []json.RawMessage) ([]StartLiveStoryResult, error) { + list := []StartLiveStoryResult{} + + for _, data := range dataList { + entity, err := UnmarshalStartLiveStoryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { var meta meta @@ -6875,6 +7550,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentSuggestProfilePhoto: return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentSuggestBirthdate: + return UnmarshalPushMessageContentSuggestBirthdate(data) + case TypePushMessageContentProximityAlertTriggered: return UnmarshalPushMessageContentProximityAlertTriggered(data) @@ -7203,6 +7881,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingShowProfileAudio: + return UnmarshalUserPrivacySettingShowProfileAudio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -7497,6 +8178,97 @@ func UnmarshalListOfReportStoryResult(dataList []json.RawMessage) ([]ReportStory return list, nil } +func UnmarshalSettingsSection(data json.RawMessage) (SettingsSection, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSettingsSectionAppearance: + return UnmarshalSettingsSectionAppearance(data) + + case TypeSettingsSectionAskQuestion: + return UnmarshalSettingsSectionAskQuestion(data) + + case TypeSettingsSectionBusiness: + return UnmarshalSettingsSectionBusiness(data) + + case TypeSettingsSectionChatFolders: + return UnmarshalSettingsSectionChatFolders(data) + + case TypeSettingsSectionDataAndStorage: + return UnmarshalSettingsSectionDataAndStorage(data) + + case TypeSettingsSectionDevices: + return UnmarshalSettingsSectionDevices(data) + + case TypeSettingsSectionEditProfile: + return UnmarshalSettingsSectionEditProfile(data) + + case TypeSettingsSectionFaq: + return UnmarshalSettingsSectionFaq(data) + + case TypeSettingsSectionFeatures: + return UnmarshalSettingsSectionFeatures(data) + + case TypeSettingsSectionInAppBrowser: + return UnmarshalSettingsSectionInAppBrowser(data) + + case TypeSettingsSectionLanguage: + return UnmarshalSettingsSectionLanguage(data) + + case TypeSettingsSectionMyStars: + return UnmarshalSettingsSectionMyStars(data) + + case TypeSettingsSectionMyToncoins: + return UnmarshalSettingsSectionMyToncoins(data) + + case TypeSettingsSectionNotifications: + return UnmarshalSettingsSectionNotifications(data) + + case TypeSettingsSectionPowerSaving: + return UnmarshalSettingsSectionPowerSaving(data) + + case TypeSettingsSectionPremium: + return UnmarshalSettingsSectionPremium(data) + + case TypeSettingsSectionPrivacyAndSecurity: + return UnmarshalSettingsSectionPrivacyAndSecurity(data) + + case TypeSettingsSectionPrivacyPolicy: + return UnmarshalSettingsSectionPrivacyPolicy(data) + + case TypeSettingsSectionQrCode: + return UnmarshalSettingsSectionQrCode(data) + + case TypeSettingsSectionSearch: + return UnmarshalSettingsSectionSearch(data) + + case TypeSettingsSectionSendGift: + return UnmarshalSettingsSectionSendGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSettingsSection(dataList []json.RawMessage) ([]SettingsSection, error) { + list := []SettingsSection{} + + for _, data := range dataList { + entity, err := UnmarshalSettingsSection(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { var meta meta @@ -7506,9 +8278,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { } switch meta.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -7530,11 +8299,8 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -7545,21 +8311,27 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) + + case TypeInternalLinkTypeDirectMessagesChat: + return UnmarshalInternalLinkTypeDirectMessagesChat(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + + case TypeInternalLinkTypeGiftCollection: + return UnmarshalInternalLinkTypeGiftCollection(data) + case TypeInternalLinkTypeGroupCall: return UnmarshalInternalLinkTypeGroupCall(data) @@ -7572,8 +8344,8 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -7584,11 +8356,20 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) @@ -7596,17 +8377,14 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -7620,27 +8398,33 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeStoryAlbum: + return UnmarshalInternalLinkTypeStoryAlbum(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -8112,6 +8896,12 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionCustom: return UnmarshalSuggestedActionCustom(data) + case TypeSuggestedActionSetLoginEmailAddress: + return UnmarshalSuggestedActionSetLoginEmailAddress(data) + + case TypeSuggestedActionAddLoginPasskey: + return UnmarshalSuggestedActionAddLoginPasskey(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -8723,6 +9513,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) + case TypeUpdatePendingTextMessage: + return UnmarshalUpdatePendingTextMessage(data) + case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -8792,9 +9585,30 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -8825,6 +9639,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -8852,8 +9669,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(data) - case TypeUpdateChatThemes: - return UnmarshalUpdateChatThemes(data) + case TypeUpdateEmojiChatThemes: + return UnmarshalUpdateEmojiChatThemes(data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) @@ -8870,6 +9687,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) + case TypeUpdateAgeVerificationParameters: + return UnmarshalUpdateAgeVerificationParameters(data) + case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) @@ -8912,12 +9732,21 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) + case TypeUpdateTonRevenueStatus: + return UnmarshalUpdateTonRevenueStatus(data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(data) @@ -9239,6 +10068,22 @@ func UnmarshalTermsOfService(data json.RawMessage) (*TermsOfService, error) { return &resp, err } +func UnmarshalPasskey(data json.RawMessage) (*Passkey, error) { + var resp Passkey + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPasskeys(data json.RawMessage) (*Passkeys, error) { + var resp Passkeys + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthorizationStateWaitTdlibParameters(data json.RawMessage) (*AuthorizationStateWaitTdlibParameters, error) { var resp AuthorizationStateWaitTdlibParameters @@ -9719,6 +10564,14 @@ func UnmarshalAudio(data json.RawMessage) (*Audio, error) { return &resp, err } +func UnmarshalAudios(data json.RawMessage) (*Audios, error) { + var resp Audios + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDocument(data json.RawMessage) (*Document, error) { var resp Document @@ -9807,6 +10660,14 @@ func UnmarshalGame(data json.RawMessage) (*Game, error) { return &resp, err } +func UnmarshalStakeDiceState(data json.RawMessage) (*StakeDiceState, error) { + var resp StakeDiceState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalWebApp(data json.RawMessage) (*WebApp, error) { var resp WebApp @@ -9879,6 +10740,70 @@ func UnmarshalChatPhotoInfo(data json.RawMessage) (*ChatPhotoInfo, error) { return &resp, err } +func UnmarshalProfileTabPosts(data json.RawMessage) (*ProfileTabPosts, error) { + var resp ProfileTabPosts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabGifts(data json.RawMessage) (*ProfileTabGifts, error) { + var resp ProfileTabGifts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabMedia(data json.RawMessage) (*ProfileTabMedia, error) { + var resp ProfileTabMedia + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabFiles(data json.RawMessage) (*ProfileTabFiles, error) { + var resp ProfileTabFiles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabLinks(data json.RawMessage) (*ProfileTabLinks, error) { + var resp ProfileTabLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabMusic(data json.RawMessage) (*ProfileTabMusic, error) { + var resp ProfileTabMusic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabVoice(data json.RawMessage) (*ProfileTabVoice, error) { + var resp ProfileTabVoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileTabGifs(data json.RawMessage) (*ProfileTabGifs, error) { + var resp ProfileTabGifs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserTypeRegular(data json.RawMessage) (*UserTypeRegular, error) { var resp UserTypeRegular @@ -10223,6 +11148,46 @@ func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorR return &resp, err } +func UnmarshalGiftResalePriceStar(data json.RawMessage) (*GiftResalePriceStar, error) { + var resp GiftResalePriceStar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftResalePriceTon(data json.RawMessage) (*GiftResalePriceTon, error) { + var resp GiftResalePriceTon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseOfferStatePending(data json.RawMessage) (*GiftPurchaseOfferStatePending, error) { + var resp GiftPurchaseOfferStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseOfferStateAccepted(data json.RawMessage) (*GiftPurchaseOfferStateAccepted, error) { + var resp GiftPurchaseOfferStateAccepted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseOfferStateRejected(data json.RawMessage) (*GiftPurchaseOfferStateRejected, error) { + var resp GiftPurchaseOfferStateRejected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSuggestedPostPriceStar(data json.RawMessage) (*SuggestedPostPriceStar, error) { var resp SuggestedPostPriceStar @@ -10567,6 +11532,70 @@ func UnmarshalGiftSettings(data json.RawMessage) (*GiftSettings, error) { return &resp, err } +func UnmarshalGiftAuction(data json.RawMessage) (*GiftAuction, error) { + var resp GiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftBackground(data json.RawMessage) (*GiftBackground, error) { + var resp GiftBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseLimits(data json.RawMessage) (*GiftPurchaseLimits, error) { + var resp GiftPurchaseLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftResaleParameters(data json.RawMessage) (*GiftResaleParameters, error) { + var resp GiftResaleParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftCollection(data json.RawMessage) (*GiftCollection, error) { + var resp GiftCollection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftCollections(data json.RawMessage) (*GiftCollections, error) { + var resp GiftCollections + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendGiftResultOk(data json.RawMessage) (*CanSendGiftResultOk, error) { + var resp CanSendGiftResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendGiftResultFail(data json.RawMessage) (*CanSendGiftResultFail, error) { + var resp CanSendGiftResultFail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradedGiftOriginUpgrade(data json.RawMessage) (*UpgradedGiftOriginUpgrade, error) { var resp UpgradedGiftOriginUpgrade @@ -10591,6 +11620,78 @@ func UnmarshalUpgradedGiftOriginResale(data json.RawMessage) (*UpgradedGiftOrigi return &resp, err } +func UnmarshalUpgradedGiftOriginBlockchain(data json.RawMessage) (*UpgradedGiftOriginBlockchain, error) { + var resp UpgradedGiftOriginBlockchain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftOriginPrepaidUpgrade(data json.RawMessage) (*UpgradedGiftOriginPrepaidUpgrade, error) { + var resp UpgradedGiftOriginPrepaidUpgrade + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftOriginOffer(data json.RawMessage) (*UpgradedGiftOriginOffer, error) { + var resp UpgradedGiftOriginOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftOriginCraft(data json.RawMessage) (*UpgradedGiftOriginCraft, error) { + var resp UpgradedGiftOriginCraft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityPerMille(data json.RawMessage) (*UpgradedGiftAttributeRarityPerMille, error) { + var resp UpgradedGiftAttributeRarityPerMille + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityUncommon(data json.RawMessage) (*UpgradedGiftAttributeRarityUncommon, error) { + var resp UpgradedGiftAttributeRarityUncommon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityRare(data json.RawMessage) (*UpgradedGiftAttributeRarityRare, error) { + var resp UpgradedGiftAttributeRarityRare + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityEpic(data json.RawMessage) (*UpgradedGiftAttributeRarityEpic, error) { + var resp UpgradedGiftAttributeRarityEpic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityLegendary(data json.RawMessage) (*UpgradedGiftAttributeRarityLegendary, error) { + var resp UpgradedGiftAttributeRarityLegendary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) { var resp UpgradedGiftModel @@ -10631,6 +11732,14 @@ func UnmarshalUpgradedGiftOriginalDetails(data json.RawMessage) (*UpgradedGiftOr return &resp, err } +func UnmarshalUpgradedGiftColors(data json.RawMessage) (*UpgradedGiftColors, error) { + var resp UpgradedGiftColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGift(data json.RawMessage) (*Gift, error) { var resp Gift @@ -10647,6 +11756,14 @@ func UnmarshalUpgradedGift(data json.RawMessage) (*UpgradedGift, error) { return &resp, err } +func UnmarshalUpgradedGiftValueInfo(data json.RawMessage) (*UpgradedGiftValueInfo, error) { + var resp UpgradedGiftValueInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error) { var resp UpgradeGiftResult @@ -10655,6 +11772,38 @@ func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error return &resp, err } +func UnmarshalCraftGiftResultSuccess(data json.RawMessage) (*CraftGiftResultSuccess, error) { + var resp CraftGiftResultSuccess + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultTooEarly(data json.RawMessage) (*CraftGiftResultTooEarly, error) { + var resp CraftGiftResultTooEarly + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultInvalidGift(data json.RawMessage) (*CraftGiftResultInvalidGift, error) { + var resp CraftGiftResultInvalidGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultFail(data json.RawMessage) (*CraftGiftResultFail, error) { + var resp CraftGiftResultFail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAvailableGift(data json.RawMessage) (*AvailableGift, error) { var resp AvailableGift @@ -10671,6 +11820,14 @@ func UnmarshalAvailableGifts(data json.RawMessage) (*AvailableGifts, error) { return &resp, err } +func UnmarshalGiftUpgradePrice(data json.RawMessage) (*GiftUpgradePrice, error) { + var resp GiftUpgradePrice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradedGiftAttributeIdModel(data json.RawMessage) (*UpgradedGiftAttributeIdModel, error) { var resp UpgradedGiftAttributeIdModel @@ -10759,6 +11916,22 @@ func UnmarshalGiftsForResale(data json.RawMessage) (*GiftsForResale, error) { return &resp, err } +func UnmarshalGiftResaleResultOk(data json.RawMessage) (*GiftResaleResultOk, error) { + var resp GiftResaleResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftResaleResultPriceIncreased(data json.RawMessage) (*GiftResaleResultPriceIncreased, error) { + var resp GiftResaleResultPriceIncreased + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSentGiftRegular(data json.RawMessage) (*SentGiftRegular, error) { var resp SentGiftRegular @@ -10791,6 +11964,22 @@ func UnmarshalReceivedGifts(data json.RawMessage) (*ReceivedGifts, error) { return &resp, err } +func UnmarshalAttributeCraftPersistenceProbability(data json.RawMessage) (*AttributeCraftPersistenceProbability, error) { + var resp AttributeCraftPersistenceProbability + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftsForCrafting(data json.RawMessage) (*GiftsForCrafting, error) { + var resp GiftsForCrafting + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, error) { var resp GiftUpgradePreview @@ -10799,6 +11988,78 @@ func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, err return &resp, err } +func UnmarshalGiftUpgradeVariants(data json.RawMessage) (*GiftUpgradeVariants, error) { + var resp GiftUpgradeVariants + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionBid(data json.RawMessage) (*AuctionBid, error) { + var resp AuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserAuctionBid(data json.RawMessage) (*UserAuctionBid, error) { + var resp UserAuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionRound(data json.RawMessage) (*AuctionRound, error) { + var resp AuctionRound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionStateActive(data json.RawMessage) (*AuctionStateActive, error) { + var resp AuctionStateActive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionStateFinished(data json.RawMessage) (*AuctionStateFinished, error) { + var resp AuctionStateFinished + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionState(data json.RawMessage) (*GiftAuctionState, error) { + var resp GiftAuctionState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionAcquiredGift(data json.RawMessage) (*GiftAuctionAcquiredGift, error) { + var resp GiftAuctionAcquiredGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionAcquiredGifts(data json.RawMessage) (*GiftAuctionAcquiredGifts, error) { + var resp GiftAuctionAcquiredGifts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTransactionDirectionIncoming(data json.RawMessage) (*TransactionDirectionIncoming, error) { var resp TransactionDirectionIncoming @@ -10967,6 +12228,14 @@ func UnmarshalStarTransactionTypeChannelSubscriptionSale(data json.RawMessage) ( return &resp, err } +func UnmarshalStarTransactionTypeGiftAuctionBid(data json.RawMessage) (*StarTransactionTypeGiftAuctionBid, error) { + var resp StarTransactionTypeGiftAuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeGiftPurchase(data json.RawMessage) (*StarTransactionTypeGiftPurchase, error) { var resp StarTransactionTypeGiftPurchase @@ -10975,6 +12244,14 @@ func UnmarshalStarTransactionTypeGiftPurchase(data json.RawMessage) (*StarTransa return &resp, err } +func UnmarshalStarTransactionTypeGiftPurchaseOffer(data json.RawMessage) (*StarTransactionTypeGiftPurchaseOffer, error) { + var resp StarTransactionTypeGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeGiftTransfer(data json.RawMessage) (*StarTransactionTypeGiftTransfer, error) { var resp StarTransactionTypeGiftTransfer @@ -10983,6 +12260,14 @@ func UnmarshalStarTransactionTypeGiftTransfer(data json.RawMessage) (*StarTransa return &resp, err } +func UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data json.RawMessage) (*StarTransactionTypeGiftOriginalDetailsDrop, error) { + var resp StarTransactionTypeGiftOriginalDetailsDrop + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeGiftSale(data json.RawMessage) (*StarTransactionTypeGiftSale, error) { var resp StarTransactionTypeGiftSale @@ -10999,6 +12284,14 @@ func UnmarshalStarTransactionTypeGiftUpgrade(data json.RawMessage) (*StarTransac return &resp, err } +func UnmarshalStarTransactionTypeGiftUpgradePurchase(data json.RawMessage) (*StarTransactionTypeGiftUpgradePurchase, error) { + var resp StarTransactionTypeGiftUpgradePurchase + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeUpgradedGiftPurchase(data json.RawMessage) (*StarTransactionTypeUpgradedGiftPurchase, error) { var resp StarTransactionTypeUpgradedGiftPurchase @@ -11055,6 +12348,38 @@ func UnmarshalStarTransactionTypePaidMessageReceive(data json.RawMessage) (*Star return &resp, err } +func UnmarshalStarTransactionTypePaidGroupCallMessageSend(data json.RawMessage) (*StarTransactionTypePaidGroupCallMessageSend, error) { + var resp StarTransactionTypePaidGroupCallMessageSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data json.RawMessage) (*StarTransactionTypePaidGroupCallMessageReceive, error) { + var resp StarTransactionTypePaidGroupCallMessageReceive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallReactionSend(data json.RawMessage) (*StarTransactionTypePaidGroupCallReactionSend, error) { + var resp StarTransactionTypePaidGroupCallReactionSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data json.RawMessage) (*StarTransactionTypePaidGroupCallReactionReceive, error) { + var resp StarTransactionTypePaidGroupCallReactionReceive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data json.RawMessage) (*StarTransactionTypeSuggestedPostPaymentSend, error) { var resp StarTransactionTypeSuggestedPostPaymentSend @@ -11095,6 +12420,14 @@ func UnmarshalStarTransactionTypeBusinessBotTransferReceive(data json.RawMessage return &resp, err } +func UnmarshalStarTransactionTypePublicPostSearch(data json.RawMessage) (*StarTransactionTypePublicPostSearch, error) { + var resp StarTransactionTypePublicPostSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeUnsupported(data json.RawMessage) (*StarTransactionTypeUnsupported, error) { var resp StarTransactionTypeUnsupported @@ -11127,6 +12460,14 @@ func UnmarshalTonTransactionTypeFragmentDeposit(data json.RawMessage) (*TonTrans return &resp, err } +func UnmarshalTonTransactionTypeFragmentWithdrawal(data json.RawMessage) (*TonTransactionTypeFragmentWithdrawal, error) { + var resp TonTransactionTypeFragmentWithdrawal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTonTransactionTypeSuggestedPostPayment(data json.RawMessage) (*TonTransactionTypeSuggestedPostPayment, error) { var resp TonTransactionTypeSuggestedPostPayment @@ -11135,6 +12476,46 @@ func UnmarshalTonTransactionTypeSuggestedPostPayment(data json.RawMessage) (*Ton return &resp, err } +func UnmarshalTonTransactionTypeGiftPurchaseOffer(data json.RawMessage) (*TonTransactionTypeGiftPurchaseOffer, error) { + var resp TonTransactionTypeGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonTransactionTypeUpgradedGiftPurchase(data json.RawMessage) (*TonTransactionTypeUpgradedGiftPurchase, error) { + var resp TonTransactionTypeUpgradedGiftPurchase + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonTransactionTypeUpgradedGiftSale(data json.RawMessage) (*TonTransactionTypeUpgradedGiftSale, error) { + var resp TonTransactionTypeUpgradedGiftSale + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonTransactionTypeStakeDiceStake(data json.RawMessage) (*TonTransactionTypeStakeDiceStake, error) { + var resp TonTransactionTypeStakeDiceStake + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonTransactionTypeStakeDicePayout(data json.RawMessage) (*TonTransactionTypeStakeDicePayout, error) { + var resp TonTransactionTypeStakeDicePayout + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTonTransactionTypeUnsupported(data json.RawMessage) (*TonTransactionTypeUnsupported, error) { var resp TonTransactionTypeUnsupported @@ -11159,6 +12540,30 @@ func UnmarshalTonTransactions(data json.RawMessage) (*TonTransactions, error) { return &resp, err } +func UnmarshalActiveStoryStateLive(data json.RawMessage) (*ActiveStoryStateLive, error) { + var resp ActiveStoryStateLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalActiveStoryStateUnread(data json.RawMessage) (*ActiveStoryStateUnread, error) { + var resp ActiveStoryStateUnread + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalActiveStoryStateRead(data json.RawMessage) (*ActiveStoryStateRead, error) { + var resp ActiveStoryStateRead + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiveawayParticipantStatusEligible(data json.RawMessage) (*GiveawayParticipantStatusEligible, error) { var resp GiveawayParticipantStatusEligible @@ -11255,6 +12660,22 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err return &resp, err } +func UnmarshalUserRating(data json.RawMessage) (*UserRating, error) { + var resp UserRating + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRestrictionInfo(data json.RawMessage) (*RestrictionInfo, error) { + var resp RestrictionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalEmojiStatusTypeCustomEmoji(data json.RawMessage) (*EmojiStatusTypeCustomEmoji, error) { var resp EmojiStatusTypeCustomEmoji @@ -11719,6 +13140,14 @@ func UnmarshalSecretChat(data json.RawMessage) (*SecretChat, error) { return &resp, err } +func UnmarshalPublicPostSearchLimits(data json.RawMessage) (*PublicPostSearchLimits, error) { + var resp PublicPostSearchLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSenderUser(data json.RawMessage) (*MessageSenderUser, error) { var resp MessageSenderUser @@ -11911,6 +13340,14 @@ func UnmarshalPaidReactor(data json.RawMessage) (*PaidReactor, error) { return &resp, err } +func UnmarshalLiveStoryDonors(data json.RawMessage) (*LiveStoryDonors, error) { + var resp LiveStoryDonors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { var resp MessageForwardInfo @@ -11967,6 +13404,14 @@ func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { return &resp, err } +func UnmarshalMessageTopicThread(data json.RawMessage) (*MessageTopicThread, error) { + var resp MessageTopicThread + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageTopicForum(data json.RawMessage) (*MessageTopicForum, error) { var resp MessageTopicForum @@ -12127,6 +13572,14 @@ func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error return &resp, err } +func UnmarshalFoundPublicPosts(data json.RawMessage) (*FoundPublicPosts, error) { + var resp FoundPublicPosts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { var resp MessagePosition @@ -12799,6 +14252,38 @@ func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoin return &resp, err } +func UnmarshalButtonStyleDefault(data json.RawMessage) (*ButtonStyleDefault, error) { + var resp ButtonStyleDefault + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStylePrimary(data json.RawMessage) (*ButtonStylePrimary, error) { + var resp ButtonStylePrimary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStyleDanger(data json.RawMessage) (*ButtonStyleDanger, error) { + var resp ButtonStyleDanger + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStyleSuccess(data json.RawMessage) (*ButtonStyleSuccess, error) { + var resp ButtonStyleSuccess + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -13167,6 +14652,46 @@ func UnmarshalSharedChat(data json.RawMessage) (*SharedChat, error) { return &resp, err } +func UnmarshalBuiltInThemeClassic(data json.RawMessage) (*BuiltInThemeClassic, error) { + var resp BuiltInThemeClassic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBuiltInThemeDay(data json.RawMessage) (*BuiltInThemeDay, error) { + var resp BuiltInThemeDay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBuiltInThemeNight(data json.RawMessage) (*BuiltInThemeNight, error) { + var resp BuiltInThemeNight + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBuiltInThemeTinted(data json.RawMessage) (*BuiltInThemeTinted, error) { + var resp BuiltInThemeTinted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBuiltInThemeArctic(data json.RawMessage) (*BuiltInThemeArctic, error) { + var resp BuiltInThemeArctic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { var resp ThemeSettings @@ -13711,6 +15236,14 @@ func UnmarshalLinkPreviewTypeChat(data json.RawMessage) (*LinkPreviewTypeChat, e return &resp, err } +func UnmarshalLinkPreviewTypeDirectMessagesChat(data json.RawMessage) (*LinkPreviewTypeDirectMessagesChat, error) { + var resp LinkPreviewTypeDirectMessagesChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeDocument(data json.RawMessage) (*LinkPreviewTypeDocument, error) { var resp LinkPreviewTypeDocument @@ -13759,6 +15292,22 @@ func UnmarshalLinkPreviewTypeExternalVideo(data json.RawMessage) (*LinkPreviewTy return &resp, err } +func UnmarshalLinkPreviewTypeGiftAuction(data json.RawMessage) (*LinkPreviewTypeGiftAuction, error) { + var resp LinkPreviewTypeGiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeGiftCollection(data json.RawMessage) (*LinkPreviewTypeGiftCollection, error) { + var resp LinkPreviewTypeGiftCollection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeGroupCall(data json.RawMessage) (*LinkPreviewTypeGroupCall, error) { var resp LinkPreviewTypeGroupCall @@ -13775,6 +15324,14 @@ func UnmarshalLinkPreviewTypeInvoice(data json.RawMessage) (*LinkPreviewTypeInvo return &resp, err } +func UnmarshalLinkPreviewTypeLiveStory(data json.RawMessage) (*LinkPreviewTypeLiveStory, error) { + var resp LinkPreviewTypeLiveStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeMessage(data json.RawMessage) (*LinkPreviewTypeMessage, error) { var resp LinkPreviewTypeMessage @@ -13831,6 +15388,14 @@ func UnmarshalLinkPreviewTypeStory(data json.RawMessage) (*LinkPreviewTypeStory, return &resp, err } +func UnmarshalLinkPreviewTypeStoryAlbum(data json.RawMessage) (*LinkPreviewTypeStoryAlbum, error) { + var resp LinkPreviewTypeStoryAlbum + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeSupergroupBoost(data json.RawMessage) (*LinkPreviewTypeSupergroupBoost, error) { var resp LinkPreviewTypeSupergroupBoost @@ -14991,6 +16556,14 @@ func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { return &resp, err } +func UnmarshalMessageStakeDice(data json.RawMessage) (*MessageStakeDice, error) { + var resp MessageStakeDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { var resp MessageStory @@ -15103,6 +16676,22 @@ func UnmarshalMessageChatDeletePhoto(data json.RawMessage) (*MessageChatDeletePh return &resp, err } +func UnmarshalMessageChatOwnerLeft(data json.RawMessage) (*MessageChatOwnerLeft, error) { + var resp MessageChatOwnerLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatOwnerChanged(data json.RawMessage) (*MessageChatOwnerChanged, error) { + var resp MessageChatOwnerChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) { var resp MessageChatAddMembers @@ -15239,6 +16828,14 @@ func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestP return &resp, err } +func UnmarshalMessageSuggestBirthdate(data json.RawMessage) (*MessageSuggestBirthdate, error) { + var resp MessageSuggestBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) { var resp MessageCustomServiceAction @@ -15375,6 +16972,22 @@ func UnmarshalMessageRefundedUpgradedGift(data json.RawMessage) (*MessageRefunde return &resp, err } +func UnmarshalMessageUpgradedGiftPurchaseOffer(data json.RawMessage) (*MessageUpgradedGiftPurchaseOffer, error) { + var resp MessageUpgradedGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data json.RawMessage) (*MessageUpgradedGiftPurchaseOfferRejected, error) { + var resp MessageUpgradedGiftPurchaseOfferRejected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePaidMessagesRefunded(data json.RawMessage) (*MessagePaidMessagesRefunded, error) { var resp MessagePaidMessagesRefunded @@ -15935,6 +17548,14 @@ func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) return &resp, err } +func UnmarshalInputMessageStakeDice(data json.RawMessage) (*InputMessageStakeDice, error) { + var resp InputMessageStakeDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error) { var resp InputMessageStory @@ -16591,6 +18212,38 @@ func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { return &resp, err } +func UnmarshalStoryContentTypePhoto(data json.RawMessage) (*StoryContentTypePhoto, error) { + var resp StoryContentTypePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeVideo(data json.RawMessage) (*StoryContentTypeVideo, error) { + var resp StoryContentTypeVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeLive(data json.RawMessage) (*StoryContentTypeLive, error) { + var resp StoryContentTypeLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeUnsupported(data json.RawMessage) (*StoryContentTypeUnsupported, error) { + var resp StoryContentTypeUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { var resp StoryContentPhoto @@ -16607,6 +18260,14 @@ func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error return &resp, err } +func UnmarshalStoryContentLive(data json.RawMessage) (*StoryContentLive, error) { + var resp StoryContentLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) { var resp StoryContentUnsupported @@ -16703,6 +18364,22 @@ func UnmarshalFoundStories(data json.RawMessage) (*FoundStories, error) { return &resp, err } +func UnmarshalStoryAlbum(data json.RawMessage) (*StoryAlbum, error) { + var resp StoryAlbum + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAlbums(data json.RawMessage) (*StoryAlbums, error) { + var resp StoryAlbums + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryFullId(data json.RawMessage) (*StoryFullId, error) { var resp StoryFullId @@ -17119,16 +18796,16 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } -func UnmarshalVideoChatStream(data json.RawMessage) (*VideoChatStream, error) { - var resp VideoChatStream +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalVideoChatStreams(data json.RawMessage) (*VideoChatStreams, error) { - var resp VideoChatStreams +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams err := json.Unmarshal(data, &resp) @@ -17199,6 +18876,22 @@ func UnmarshalGroupCallInfo(data json.RawMessage) (*GroupCallInfo, error) { return &resp, err } +func UnmarshalGroupCallMessage(data json.RawMessage) (*GroupCallMessage, error) { + var resp GroupCallMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallMessageLevel(data json.RawMessage) (*GroupCallMessageLevel, error) { + var resp GroupCallMessageLevel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data json.RawMessage) (*InviteGroupCallParticipantResultUserPrivacyRestricted, error) { var resp InviteGroupCallParticipantResultUserPrivacyRestricted @@ -17447,6 +19140,14 @@ func UnmarshalDiceStickersSlotMachine(data json.RawMessage) (*DiceStickersSlotMa return &resp, err } +func UnmarshalImportedContact(data json.RawMessage) (*ImportedContact, error) { + var resp ImportedContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) { var resp ImportedContacts @@ -18735,6 +20436,14 @@ func UnmarshalPremiumFeatureChecklists(data json.RawMessage) (*PremiumFeatureChe return &resp, err } +func UnmarshalPremiumFeaturePaidMessages(data json.RawMessage) (*PremiumFeaturePaidMessages, error) { + var resp PremiumFeaturePaidMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { var resp BusinessFeatureLocation @@ -19287,8 +20996,56 @@ func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPre return &resp, err } -func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) { - var resp ChatTheme +func UnmarshalEmojiChatTheme(data json.RawMessage) (*EmojiChatTheme, error) { + var resp EmojiChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftChatTheme(data json.RawMessage) (*GiftChatTheme, error) { + var resp GiftChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftChatThemes(data json.RawMessage) (*GiftChatThemes, error) { + var resp GiftChatThemes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatThemeEmoji(data json.RawMessage) (*ChatThemeEmoji, error) { + var resp ChatThemeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatThemeGift(data json.RawMessage) (*ChatThemeGift, error) { + var resp ChatThemeGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatThemeEmoji(data json.RawMessage) (*InputChatThemeEmoji, error) { + var resp InputChatThemeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatThemeGift(data json.RawMessage) (*InputChatThemeGift, error) { + var resp InputChatThemeGift err := json.Unmarshal(data, &resp) @@ -19367,6 +21124,30 @@ func UnmarshalCanPostStoryResultMonthlyLimitExceeded(data json.RawMessage) (*Can return &resp, err } +func UnmarshalCanPostStoryResultLiveStoryIsActive(data json.RawMessage) (*CanPostStoryResultLiveStoryIsActive, error) { + var resp CanPostStoryResultLiveStoryIsActive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStartLiveStoryResultOk(data json.RawMessage) (*StartLiveStoryResultOk, error) { + var resp StartLiveStoryResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStartLiveStoryResultFail(data json.RawMessage) (*StartLiveStoryResultFail, error) { + var resp StartLiveStoryResultFail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { var resp CanTransferOwnershipResultOk @@ -19831,6 +21612,14 @@ func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*Push return &resp, err } +func UnmarshalPushMessageContentSuggestBirthdate(data json.RawMessage) (*PushMessageContentSuggestBirthdate, error) { + var resp PushMessageContentSuggestBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentProximityAlertTriggered(data json.RawMessage) (*PushMessageContentProximityAlertTriggered, error) { var resp PushMessageContentProximityAlertTriggered @@ -19967,6 +21756,14 @@ func UnmarshalNotificationGroup(data json.RawMessage) (*NotificationGroup, error return &resp, err } +func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { + var resp Proxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalOptionValueBoolean(data json.RawMessage) (*OptionValueBoolean, error) { var resp OptionValueBoolean @@ -20231,6 +22028,14 @@ func UnmarshalUserPrivacySettingShowBirthdate(data json.RawMessage) (*UserPrivac return &resp, err } +func UnmarshalUserPrivacySettingShowProfileAudio(data json.RawMessage) (*UserPrivacySettingShowProfileAudio, error) { + var resp UserPrivacySettingShowProfileAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -20663,8 +22468,168 @@ func UnmarshalReportStoryResultTextRequired(data json.RawMessage) (*ReportStoryR return &resp, err } -func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { - var resp InternalLinkTypeActiveSessions +func UnmarshalSettingsSectionAppearance(data json.RawMessage) (*SettingsSectionAppearance, error) { + var resp SettingsSectionAppearance + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionAskQuestion(data json.RawMessage) (*SettingsSectionAskQuestion, error) { + var resp SettingsSectionAskQuestion + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionBusiness(data json.RawMessage) (*SettingsSectionBusiness, error) { + var resp SettingsSectionBusiness + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionChatFolders(data json.RawMessage) (*SettingsSectionChatFolders, error) { + var resp SettingsSectionChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionDataAndStorage(data json.RawMessage) (*SettingsSectionDataAndStorage, error) { + var resp SettingsSectionDataAndStorage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionDevices(data json.RawMessage) (*SettingsSectionDevices, error) { + var resp SettingsSectionDevices + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionEditProfile(data json.RawMessage) (*SettingsSectionEditProfile, error) { + var resp SettingsSectionEditProfile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionFaq(data json.RawMessage) (*SettingsSectionFaq, error) { + var resp SettingsSectionFaq + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionFeatures(data json.RawMessage) (*SettingsSectionFeatures, error) { + var resp SettingsSectionFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionInAppBrowser(data json.RawMessage) (*SettingsSectionInAppBrowser, error) { + var resp SettingsSectionInAppBrowser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionLanguage(data json.RawMessage) (*SettingsSectionLanguage, error) { + var resp SettingsSectionLanguage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionMyStars(data json.RawMessage) (*SettingsSectionMyStars, error) { + var resp SettingsSectionMyStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionMyToncoins(data json.RawMessage) (*SettingsSectionMyToncoins, error) { + var resp SettingsSectionMyToncoins + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionNotifications(data json.RawMessage) (*SettingsSectionNotifications, error) { + var resp SettingsSectionNotifications + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPowerSaving(data json.RawMessage) (*SettingsSectionPowerSaving, error) { + var resp SettingsSectionPowerSaving + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPremium(data json.RawMessage) (*SettingsSectionPremium, error) { + var resp SettingsSectionPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPrivacyAndSecurity(data json.RawMessage) (*SettingsSectionPrivacyAndSecurity, error) { + var resp SettingsSectionPrivacyAndSecurity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPrivacyPolicy(data json.RawMessage) (*SettingsSectionPrivacyPolicy, error) { + var resp SettingsSectionPrivacyPolicy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionQrCode(data json.RawMessage) (*SettingsSectionQrCode, error) { + var resp SettingsSectionQrCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionSearch(data json.RawMessage) (*SettingsSectionSearch, error) { + var resp SettingsSectionSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionSendGift(data json.RawMessage) (*SettingsSectionSendGift, error) { + var resp SettingsSectionSendGift err := json.Unmarshal(data, &resp) @@ -20727,16 +22692,8 @@ func UnmarshalInternalLinkTypeBusinessChat(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeBuyStars(data json.RawMessage) (*InternalLinkTypeBuyStars, error) { - var resp InternalLinkTypeBuyStars - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { - var resp InternalLinkTypeChangePhoneNumber +func UnmarshalInternalLinkTypeCallsPage(data json.RawMessage) (*InternalLinkTypeCallsPage, error) { + var resp InternalLinkTypeCallsPage err := json.Unmarshal(data, &resp) @@ -20767,14 +22724,6 @@ func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalL return &resp, err } -func UnmarshalInternalLinkTypeChatFolderSettings(data json.RawMessage) (*InternalLinkTypeChatFolderSettings, error) { - var resp InternalLinkTypeChatFolderSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { var resp InternalLinkTypeChatInvite @@ -20783,16 +22732,24 @@ func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTyp return &resp, err } -func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { - var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func UnmarshalInternalLinkTypeChatSelection(data json.RawMessage) (*InternalLinkTypeChatSelection, error) { + var resp InternalLinkTypeChatSelection err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { - var resp InternalLinkTypeEditProfileSettings +func UnmarshalInternalLinkTypeContactsPage(data json.RawMessage) (*InternalLinkTypeContactsPage, error) { + var resp InternalLinkTypeContactsPage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeDirectMessagesChat(data json.RawMessage) (*InternalLinkTypeDirectMessagesChat, error) { + var resp InternalLinkTypeDirectMessagesChat err := json.Unmarshal(data, &resp) @@ -20807,6 +22764,22 @@ func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, return &resp, err } +func UnmarshalInternalLinkTypeGiftAuction(data json.RawMessage) (*InternalLinkTypeGiftAuction, error) { + var resp InternalLinkTypeGiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeGiftCollection(data json.RawMessage) (*InternalLinkTypeGiftCollection, error) { + var resp InternalLinkTypeGiftCollection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeGroupCall(data json.RawMessage) (*InternalLinkTypeGroupCall, error) { var resp InternalLinkTypeGroupCall @@ -20839,8 +22812,8 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { - var resp InternalLinkTypeLanguageSettings +func UnmarshalInternalLinkTypeLiveStory(data json.RawMessage) (*InternalLinkTypeLiveStory, error) { + var resp InternalLinkTypeLiveStory err := json.Unmarshal(data, &resp) @@ -20871,16 +22844,40 @@ func UnmarshalInternalLinkTypeMessageDraft(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeMyStars(data json.RawMessage) (*InternalLinkTypeMyStars, error) { - var resp InternalLinkTypeMyStars +func UnmarshalInternalLinkTypeMyProfilePage(data json.RawMessage) (*InternalLinkTypeMyProfilePage, error) { + var resp InternalLinkTypeMyProfilePage err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInternalLinkTypeMyToncoins(data json.RawMessage) (*InternalLinkTypeMyToncoins, error) { - var resp InternalLinkTypeMyToncoins +func UnmarshalInternalLinkTypeNewChannelChat(data json.RawMessage) (*InternalLinkTypeNewChannelChat, error) { + var resp InternalLinkTypeNewChannelChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewGroupChat(data json.RawMessage) (*InternalLinkTypeNewGroupChat, error) { + var resp InternalLinkTypeNewGroupChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewPrivateChat(data json.RawMessage) (*InternalLinkTypeNewPrivateChat, error) { + var resp InternalLinkTypeNewPrivateChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewStory(data json.RawMessage) (*InternalLinkTypeNewStory, error) { + var resp InternalLinkTypeNewStory err := json.Unmarshal(data, &resp) @@ -20903,16 +22900,8 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } -func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { - var resp InternalLinkTypePremiumFeatures - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) { - var resp InternalLinkTypePremiumGift +func UnmarshalInternalLinkTypePremiumFeaturesPage(data json.RawMessage) (*InternalLinkTypePremiumFeaturesPage, error) { + var resp InternalLinkTypePremiumFeaturesPage err := json.Unmarshal(data, &resp) @@ -20927,8 +22916,8 @@ func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { - var resp InternalLinkTypePrivacyAndSecuritySettings +func UnmarshalInternalLinkTypePremiumGiftPurchase(data json.RawMessage) (*InternalLinkTypePremiumGiftPurchase, error) { + var resp InternalLinkTypePremiumGiftPurchase err := json.Unmarshal(data, &resp) @@ -20967,6 +22956,22 @@ func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeSavedMessages(data json.RawMessage) (*InternalLinkTypeSavedMessages, error) { + var resp InternalLinkTypeSavedMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeSearch(data json.RawMessage) (*InternalLinkTypeSearch, error) { + var resp InternalLinkTypeSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { var resp InternalLinkTypeSettings @@ -20975,6 +22980,14 @@ func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeS return &resp, err } +func UnmarshalInternalLinkTypeStarPurchase(data json.RawMessage) (*InternalLinkTypeStarPurchase, error) { + var resp InternalLinkTypeStarPurchase + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { var resp InternalLinkTypeStickerSet @@ -20991,6 +23004,14 @@ func UnmarshalInternalLinkTypeStory(data json.RawMessage) (*InternalLinkTypeStor return &resp, err } +func UnmarshalInternalLinkTypeStoryAlbum(data json.RawMessage) (*InternalLinkTypeStoryAlbum, error) { + var resp InternalLinkTypeStoryAlbum + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { var resp InternalLinkTypeTheme @@ -20999,14 +23020,6 @@ func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeThem return &resp, err } -func UnmarshalInternalLinkTypeThemeSettings(data json.RawMessage) (*InternalLinkTypeThemeSettings, error) { - var resp InternalLinkTypeThemeSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { var resp InternalLinkTypeUnknownDeepLink @@ -21015,14 +23028,6 @@ func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalLinkTypeUnsupportedProxy, error) { - var resp InternalLinkTypeUnsupportedProxy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeUpgradedGift(data json.RawMessage) (*InternalLinkTypeUpgradedGift, error) { var resp InternalLinkTypeUpgradedGift @@ -21511,6 +23516,14 @@ func UnmarshalConnectionStateReady(data json.RawMessage) (*ConnectionStateReady, return &resp, err } +func UnmarshalAgeVerificationParameters(data json.RawMessage) (*AgeVerificationParameters, error) { + var resp AgeVerificationParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTopChatCategoryUsers(data json.RawMessage) (*TopChatCategoryUsers, error) { var resp TopChatCategoryUsers @@ -21759,6 +23772,22 @@ func UnmarshalSuggestedActionCustom(data json.RawMessage) (*SuggestedActionCusto return &resp, err } +func UnmarshalSuggestedActionSetLoginEmailAddress(data json.RawMessage) (*SuggestedActionSetLoginEmailAddress, error) { + var resp SuggestedActionSetLoginEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionAddLoginPasskey(data json.RawMessage) (*SuggestedActionAddLoginPasskey, error) { + var resp SuggestedActionAddLoginPasskey + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -21855,16 +23884,16 @@ func UnmarshalProxyTypeMtproto(data json.RawMessage) (*ProxyTypeMtproto, error) return &resp, err } -func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { - var resp Proxy +func UnmarshalAddedProxy(data json.RawMessage) (*AddedProxy, error) { + var resp AddedProxy err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { - var resp Proxies +func UnmarshalAddedProxies(data json.RawMessage) (*AddedProxies, error) { + var resp AddedProxies err := json.Unmarshal(data, &resp) @@ -22111,6 +24140,22 @@ func UnmarshalStarRevenueStatistics(data json.RawMessage) (*StarRevenueStatistic return &resp, err } +func UnmarshalTonRevenueStatus(data json.RawMessage) (*TonRevenueStatus, error) { + var resp TonRevenueStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonRevenueStatistics(data json.RawMessage) (*TonRevenueStatistics, error) { + var resp TonRevenueStatistics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPoint(data json.RawMessage) (*Point, error) { var resp Point @@ -22767,6 +24812,14 @@ func UnmarshalUpdateChatAction(data json.RawMessage) (*UpdateChatAction, error) return &resp, err } +func UnmarshalUpdatePendingTextMessage(data json.RawMessage) (*UpdatePendingTextMessage, error) { + var resp UpdatePendingTextMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateUserStatus(data json.RawMessage) (*UpdateUserStatus, error) { var resp UpdateUserStatus @@ -22951,6 +25004,46 @@ func UnmarshalUpdateGroupCallVerificationState(data json.RawMessage) (*UpdateGro return &resp, err } +func UnmarshalUpdateNewGroupCallMessage(data json.RawMessage) (*UpdateNewGroupCallMessage, error) { + var resp UpdateNewGroupCallMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewGroupCallPaidReaction(data json.RawMessage) (*UpdateNewGroupCallPaidReaction, error) { + var resp UpdateNewGroupCallPaidReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateGroupCallMessageSendFailed(data json.RawMessage) (*UpdateGroupCallMessageSendFailed, error) { + var resp UpdateGroupCallMessageSendFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateGroupCallMessagesDeleted(data json.RawMessage) (*UpdateGroupCallMessagesDeleted, error) { + var resp UpdateGroupCallMessagesDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateLiveStoryTopDonors(data json.RawMessage) (*UpdateLiveStoryTopDonors, error) { + var resp UpdateLiveStoryTopDonors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSignalingData, error) { var resp UpdateNewCallSignalingData @@ -22959,6 +25052,22 @@ func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSi return &resp, err } +func UnmarshalUpdateGiftAuctionState(data json.RawMessage) (*UpdateGiftAuctionState, error) { + var resp UpdateGiftAuctionState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateActiveGiftAuctions(data json.RawMessage) (*UpdateActiveGiftAuctions, error) { + var resp UpdateActiveGiftAuctions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateUserPrivacySettingRules(data json.RawMessage) (*UpdateUserPrivacySettingRules, error) { var resp UpdateUserPrivacySettingRules @@ -23039,6 +25148,14 @@ func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthM return &resp, err } +func UnmarshalUpdateTrustedMiniAppBots(data json.RawMessage) (*UpdateTrustedMiniAppBots, error) { + var resp UpdateTrustedMiniAppBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { var resp UpdateOption @@ -23111,8 +25228,8 @@ func UnmarshalUpdateDefaultBackground(data json.RawMessage) (*UpdateDefaultBackg return &resp, err } -func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) { - var resp UpdateChatThemes +func UnmarshalUpdateEmojiChatThemes(data json.RawMessage) (*UpdateEmojiChatThemes, error) { + var resp UpdateEmojiChatThemes err := json.Unmarshal(data, &resp) @@ -23159,6 +25276,14 @@ func UnmarshalUpdateFreezeState(data json.RawMessage) (*UpdateFreezeState, error return &resp, err } +func UnmarshalUpdateAgeVerificationParameters(data json.RawMessage) (*UpdateAgeVerificationParameters, error) { + var resp UpdateAgeVerificationParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, error) { var resp UpdateTermsOfService @@ -23271,6 +25396,14 @@ func UnmarshalUpdateStarRevenueStatus(data json.RawMessage) (*UpdateStarRevenueS return &resp, err } +func UnmarshalUpdateTonRevenueStatus(data json.RawMessage) (*UpdateTonRevenueStatus, error) { + var resp UpdateTonRevenueStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) { var resp UpdateSpeechRecognitionTrial @@ -23279,6 +25412,14 @@ func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechR return &resp, err } +func UnmarshalUpdateGroupCallMessageLevels(data json.RawMessage) (*UpdateGroupCallMessageLevels, error) { + var resp UpdateGroupCallMessageLevels + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -23287,6 +25428,14 @@ func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) return &resp, err } +func UnmarshalUpdateStakeDiceState(data json.RawMessage) (*UpdateStakeDiceState, error) { + var resp UpdateStakeDiceState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAnimatedEmojiMessageClicked(data json.RawMessage) (*UpdateAnimatedEmojiMessageClicked, error) { var resp UpdateAnimatedEmojiMessageClicked @@ -23693,6 +25842,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTermsOfService: return UnmarshalTermsOfService(data) + case TypePasskey: + return UnmarshalPasskey(data) + + case TypePasskeys: + return UnmarshalPasskeys(data) + case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) @@ -23873,6 +26028,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAudio: return UnmarshalAudio(data) + case TypeAudios: + return UnmarshalAudios(data) + case TypeDocument: return UnmarshalDocument(data) @@ -23906,6 +26064,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGame: return UnmarshalGame(data) + case TypeStakeDiceState: + return UnmarshalStakeDiceState(data) + case TypeWebApp: return UnmarshalWebApp(data) @@ -23933,6 +26094,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPhotoInfo: return UnmarshalChatPhotoInfo(data) + case TypeProfileTabPosts: + return UnmarshalProfileTabPosts(data) + + case TypeProfileTabGifts: + return UnmarshalProfileTabGifts(data) + + case TypeProfileTabMedia: + return UnmarshalProfileTabMedia(data) + + case TypeProfileTabFiles: + return UnmarshalProfileTabFiles(data) + + case TypeProfileTabLinks: + return UnmarshalProfileTabLinks(data) + + case TypeProfileTabMusic: + return UnmarshalProfileTabMusic(data) + + case TypeProfileTabVoice: + return UnmarshalProfileTabVoice(data) + + case TypeProfileTabGifs: + return UnmarshalProfileTabGifs(data) + case TypeUserTypeRegular: return UnmarshalUserTypeRegular(data) @@ -24062,6 +26247,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministratorRights: return UnmarshalChatAdministratorRights(data) + case TypeGiftResalePriceStar: + return UnmarshalGiftResalePriceStar(data) + + case TypeGiftResalePriceTon: + return UnmarshalGiftResalePriceTon(data) + + case TypeGiftPurchaseOfferStatePending: + return UnmarshalGiftPurchaseOfferStatePending(data) + + case TypeGiftPurchaseOfferStateAccepted: + return UnmarshalGiftPurchaseOfferStateAccepted(data) + + case TypeGiftPurchaseOfferStateRejected: + return UnmarshalGiftPurchaseOfferStateRejected(data) + case TypeSuggestedPostPriceStar: return UnmarshalSuggestedPostPriceStar(data) @@ -24191,6 +26391,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiftSettings: return UnmarshalGiftSettings(data) + case TypeGiftAuction: + return UnmarshalGiftAuction(data) + + case TypeGiftBackground: + return UnmarshalGiftBackground(data) + + case TypeGiftPurchaseLimits: + return UnmarshalGiftPurchaseLimits(data) + + case TypeGiftResaleParameters: + return UnmarshalGiftResaleParameters(data) + + case TypeGiftCollection: + return UnmarshalGiftCollection(data) + + case TypeGiftCollections: + return UnmarshalGiftCollections(data) + + case TypeCanSendGiftResultOk: + return UnmarshalCanSendGiftResultOk(data) + + case TypeCanSendGiftResultFail: + return UnmarshalCanSendGiftResultFail(data) + case TypeUpgradedGiftOriginUpgrade: return UnmarshalUpgradedGiftOriginUpgrade(data) @@ -24200,6 +26424,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginResale: return UnmarshalUpgradedGiftOriginResale(data) + case TypeUpgradedGiftOriginBlockchain: + return UnmarshalUpgradedGiftOriginBlockchain(data) + + case TypeUpgradedGiftOriginPrepaidUpgrade: + return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) + + case TypeUpgradedGiftOriginOffer: + return UnmarshalUpgradedGiftOriginOffer(data) + + case TypeUpgradedGiftOriginCraft: + return UnmarshalUpgradedGiftOriginCraft(data) + + case TypeUpgradedGiftAttributeRarityPerMille: + return UnmarshalUpgradedGiftAttributeRarityPerMille(data) + + case TypeUpgradedGiftAttributeRarityUncommon: + return UnmarshalUpgradedGiftAttributeRarityUncommon(data) + + case TypeUpgradedGiftAttributeRarityRare: + return UnmarshalUpgradedGiftAttributeRarityRare(data) + + case TypeUpgradedGiftAttributeRarityEpic: + return UnmarshalUpgradedGiftAttributeRarityEpic(data) + + case TypeUpgradedGiftAttributeRarityLegendary: + return UnmarshalUpgradedGiftAttributeRarityLegendary(data) + case TypeUpgradedGiftModel: return UnmarshalUpgradedGiftModel(data) @@ -24215,21 +26466,42 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginalDetails: return UnmarshalUpgradedGiftOriginalDetails(data) + case TypeUpgradedGiftColors: + return UnmarshalUpgradedGiftColors(data) + case TypeGift: return UnmarshalGift(data) case TypeUpgradedGift: return UnmarshalUpgradedGift(data) + case TypeUpgradedGiftValueInfo: + return UnmarshalUpgradedGiftValueInfo(data) + case TypeUpgradeGiftResult: return UnmarshalUpgradeGiftResult(data) + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(data) + case TypeAvailableGift: return UnmarshalAvailableGift(data) case TypeAvailableGifts: return UnmarshalAvailableGifts(data) + case TypeGiftUpgradePrice: + return UnmarshalGiftUpgradePrice(data) + case TypeUpgradedGiftAttributeIdModel: return UnmarshalUpgradedGiftAttributeIdModel(data) @@ -24263,6 +26535,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiftsForResale: return UnmarshalGiftsForResale(data) + case TypeGiftResaleResultOk: + return UnmarshalGiftResaleResultOk(data) + + case TypeGiftResaleResultPriceIncreased: + return UnmarshalGiftResaleResultPriceIncreased(data) + case TypeSentGiftRegular: return UnmarshalSentGiftRegular(data) @@ -24275,9 +26553,42 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReceivedGifts: return UnmarshalReceivedGifts(data) + case TypeAttributeCraftPersistenceProbability: + return UnmarshalAttributeCraftPersistenceProbability(data) + + case TypeGiftsForCrafting: + return UnmarshalGiftsForCrafting(data) + case TypeGiftUpgradePreview: return UnmarshalGiftUpgradePreview(data) + case TypeGiftUpgradeVariants: + return UnmarshalGiftUpgradeVariants(data) + + case TypeAuctionBid: + return UnmarshalAuctionBid(data) + + case TypeUserAuctionBid: + return UnmarshalUserAuctionBid(data) + + case TypeAuctionRound: + return UnmarshalAuctionRound(data) + + case TypeAuctionStateActive: + return UnmarshalAuctionStateActive(data) + + case TypeAuctionStateFinished: + return UnmarshalAuctionStateFinished(data) + + case TypeGiftAuctionState: + return UnmarshalGiftAuctionState(data) + + case TypeGiftAuctionAcquiredGift: + return UnmarshalGiftAuctionAcquiredGift(data) + + case TypeGiftAuctionAcquiredGifts: + return UnmarshalGiftAuctionAcquiredGifts(data) + case TypeTransactionDirectionIncoming: return UnmarshalTransactionDirectionIncoming(data) @@ -24341,18 +26652,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypeChannelSubscriptionSale: return UnmarshalStarTransactionTypeChannelSubscriptionSale(data) + case TypeStarTransactionTypeGiftAuctionBid: + return UnmarshalStarTransactionTypeGiftAuctionBid(data) + case TypeStarTransactionTypeGiftPurchase: return UnmarshalStarTransactionTypeGiftPurchase(data) + case TypeStarTransactionTypeGiftPurchaseOffer: + return UnmarshalStarTransactionTypeGiftPurchaseOffer(data) + case TypeStarTransactionTypeGiftTransfer: return UnmarshalStarTransactionTypeGiftTransfer(data) + case TypeStarTransactionTypeGiftOriginalDetailsDrop: + return UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data) + case TypeStarTransactionTypeGiftSale: return UnmarshalStarTransactionTypeGiftSale(data) case TypeStarTransactionTypeGiftUpgrade: return UnmarshalStarTransactionTypeGiftUpgrade(data) + case TypeStarTransactionTypeGiftUpgradePurchase: + return UnmarshalStarTransactionTypeGiftUpgradePurchase(data) + case TypeStarTransactionTypeUpgradedGiftPurchase: return UnmarshalStarTransactionTypeUpgradedGiftPurchase(data) @@ -24374,6 +26697,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypePaidMessageReceive: return UnmarshalStarTransactionTypePaidMessageReceive(data) + case TypeStarTransactionTypePaidGroupCallMessageSend: + return UnmarshalStarTransactionTypePaidGroupCallMessageSend(data) + + case TypeStarTransactionTypePaidGroupCallMessageReceive: + return UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data) + + case TypeStarTransactionTypePaidGroupCallReactionSend: + return UnmarshalStarTransactionTypePaidGroupCallReactionSend(data) + + case TypeStarTransactionTypePaidGroupCallReactionReceive: + return UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data) + case TypeStarTransactionTypeSuggestedPostPaymentSend: return UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data) @@ -24389,6 +26724,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypeBusinessBotTransferReceive: return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data) + case TypeStarTransactionTypePublicPostSearch: + return UnmarshalStarTransactionTypePublicPostSearch(data) + case TypeStarTransactionTypeUnsupported: return UnmarshalStarTransactionTypeUnsupported(data) @@ -24401,9 +26739,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactionTypeFragmentDeposit: return UnmarshalTonTransactionTypeFragmentDeposit(data) + case TypeTonTransactionTypeFragmentWithdrawal: + return UnmarshalTonTransactionTypeFragmentWithdrawal(data) + case TypeTonTransactionTypeSuggestedPostPayment: return UnmarshalTonTransactionTypeSuggestedPostPayment(data) + case TypeTonTransactionTypeGiftPurchaseOffer: + return UnmarshalTonTransactionTypeGiftPurchaseOffer(data) + + case TypeTonTransactionTypeUpgradedGiftPurchase: + return UnmarshalTonTransactionTypeUpgradedGiftPurchase(data) + + case TypeTonTransactionTypeUpgradedGiftSale: + return UnmarshalTonTransactionTypeUpgradedGiftSale(data) + + case TypeTonTransactionTypeStakeDiceStake: + return UnmarshalTonTransactionTypeStakeDiceStake(data) + + case TypeTonTransactionTypeStakeDicePayout: + return UnmarshalTonTransactionTypeStakeDicePayout(data) + case TypeTonTransactionTypeUnsupported: return UnmarshalTonTransactionTypeUnsupported(data) @@ -24413,6 +26769,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactions: return UnmarshalTonTransactions(data) + case TypeActiveStoryStateLive: + return UnmarshalActiveStoryStateLive(data) + + case TypeActiveStoryStateUnread: + return UnmarshalActiveStoryStateUnread(data) + + case TypeActiveStoryStateRead: + return UnmarshalActiveStoryStateRead(data) + case TypeGiveawayParticipantStatusEligible: return UnmarshalGiveawayParticipantStatusEligible(data) @@ -24449,6 +26814,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfileAccentColor: return UnmarshalProfileAccentColor(data) + case TypeUserRating: + return UnmarshalUserRating(data) + + case TypeRestrictionInfo: + return UnmarshalRestrictionInfo(data) + case TypeEmojiStatusTypeCustomEmoji: return UnmarshalEmojiStatusTypeCustomEmoji(data) @@ -24623,6 +26994,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSecretChat: return UnmarshalSecretChat(data) + case TypePublicPostSearchLimits: + return UnmarshalPublicPostSearchLimits(data) + case TypeMessageSenderUser: return UnmarshalMessageSenderUser(data) @@ -24695,6 +27069,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaidReactor: return UnmarshalPaidReactor(data) + case TypeLiveStoryDonors: + return UnmarshalLiveStoryDonors(data) + case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) @@ -24716,6 +27093,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUnreadReaction: return UnmarshalUnreadReaction(data) + case TypeMessageTopicThread: + return UnmarshalMessageTopicThread(data) + case TypeMessageTopicForum: return UnmarshalMessageTopicForum(data) @@ -24776,6 +27156,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundChatMessages: return UnmarshalFoundChatMessages(data) + case TypeFoundPublicPosts: + return UnmarshalFoundPublicPosts(data) + case TypeMessagePosition: return UnmarshalMessagePosition(data) @@ -25028,6 +27411,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionBarJoinRequest: return UnmarshalChatActionBarJoinRequest(data) + case TypeButtonStyleDefault: + return UnmarshalButtonStyleDefault(data) + + case TypeButtonStylePrimary: + return UnmarshalButtonStylePrimary(data) + + case TypeButtonStyleDanger: + return UnmarshalButtonStyleDanger(data) + + case TypeButtonStyleSuccess: + return UnmarshalButtonStyleSuccess(data) + case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -25166,6 +27561,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSharedChat: return UnmarshalSharedChat(data) + case TypeBuiltInThemeClassic: + return UnmarshalBuiltInThemeClassic(data) + + case TypeBuiltInThemeDay: + return UnmarshalBuiltInThemeDay(data) + + case TypeBuiltInThemeNight: + return UnmarshalBuiltInThemeNight(data) + + case TypeBuiltInThemeTinted: + return UnmarshalBuiltInThemeTinted(data) + + case TypeBuiltInThemeArctic: + return UnmarshalBuiltInThemeArctic(data) + case TypeThemeSettings: return UnmarshalThemeSettings(data) @@ -25370,6 +27780,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeChat: return UnmarshalLinkPreviewTypeChat(data) + case TypeLinkPreviewTypeDirectMessagesChat: + return UnmarshalLinkPreviewTypeDirectMessagesChat(data) + case TypeLinkPreviewTypeDocument: return UnmarshalLinkPreviewTypeDocument(data) @@ -25388,12 +27801,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + + case TypeLinkPreviewTypeGiftCollection: + return UnmarshalLinkPreviewTypeGiftCollection(data) + case TypeLinkPreviewTypeGroupCall: return UnmarshalLinkPreviewTypeGroupCall(data) case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -25415,6 +27837,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeStory: return UnmarshalLinkPreviewTypeStory(data) + case TypeLinkPreviewTypeStoryAlbum: + return UnmarshalLinkPreviewTypeStoryAlbum(data) + case TypeLinkPreviewTypeSupergroupBoost: return UnmarshalLinkPreviewTypeSupergroupBoost(data) @@ -25850,6 +28275,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStakeDice: + return UnmarshalMessageStakeDice(data) + case TypeMessageStory: return UnmarshalMessageStory(data) @@ -25892,6 +28320,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageChatOwnerLeft: + return UnmarshalMessageChatOwnerLeft(data) + + case TypeMessageChatOwnerChanged: + return UnmarshalMessageChatOwnerChanged(data) + case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -25943,6 +28377,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSuggestProfilePhoto: return UnmarshalMessageSuggestProfilePhoto(data) + case TypeMessageSuggestBirthdate: + return UnmarshalMessageSuggestBirthdate(data) + case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -25994,6 +28431,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageRefundedUpgradedGift: return UnmarshalMessageRefundedUpgradedGift(data) + case TypeMessageUpgradedGiftPurchaseOffer: + return UnmarshalMessageUpgradedGiftPurchaseOffer(data) + + case TypeMessageUpgradedGiftPurchaseOfferRejected: + return UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data) + case TypeMessagePaidMessagesRefunded: return UnmarshalMessagePaidMessagesRefunded(data) @@ -26204,6 +28647,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStakeDice: + return UnmarshalInputMessageStakeDice(data) + case TypeInputMessageStory: return UnmarshalInputMessageStory(data) @@ -26450,12 +28896,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryVideo: return UnmarshalStoryVideo(data) + case TypeStoryContentTypePhoto: + return UnmarshalStoryContentTypePhoto(data) + + case TypeStoryContentTypeVideo: + return UnmarshalStoryContentTypeVideo(data) + + case TypeStoryContentTypeLive: + return UnmarshalStoryContentTypeLive(data) + + case TypeStoryContentTypeUnsupported: + return UnmarshalStoryContentTypeUnsupported(data) + case TypeStoryContentPhoto: return UnmarshalStoryContentPhoto(data) case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) + case TypeStoryContentLive: + return UnmarshalStoryContentLive(data) + case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -26492,6 +28953,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundStories: return UnmarshalFoundStories(data) + case TypeStoryAlbum: + return UnmarshalStoryAlbum(data) + + case TypeStoryAlbums: + return UnmarshalStoryAlbums(data) + case TypeStoryFullId: return UnmarshalStoryFullId(data) @@ -26648,11 +29115,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) - case TypeVideoChatStream: - return UnmarshalVideoChatStream(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) - case TypeVideoChatStreams: - return UnmarshalVideoChatStreams(data) + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) case TypeRtmpUrl: return UnmarshalRtmpUrl(data) @@ -26678,6 +29145,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallInfo: return UnmarshalGroupCallInfo(data) + case TypeGroupCallMessage: + return UnmarshalGroupCallMessage(data) + + case TypeGroupCallMessageLevel: + return UnmarshalGroupCallMessageLevel(data) + case TypeInviteGroupCallParticipantResultUserPrivacyRestricted: return UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data) @@ -26771,6 +29244,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeDiceStickersSlotMachine: return UnmarshalDiceStickersSlotMachine(data) + case TypeImportedContact: + return UnmarshalImportedContact(data) + case TypeImportedContacts: return UnmarshalImportedContacts(data) @@ -27254,6 +29730,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureChecklists: return UnmarshalPremiumFeatureChecklists(data) + case TypePremiumFeaturePaidMessages: + return UnmarshalPremiumFeaturePaidMessages(data) + case TypeBusinessFeatureLocation: return UnmarshalBusinessFeatureLocation(data) @@ -27461,8 +29940,26 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputBackgroundPrevious: return UnmarshalInputBackgroundPrevious(data) - case TypeChatTheme: - return UnmarshalChatTheme(data) + case TypeEmojiChatTheme: + return UnmarshalEmojiChatTheme(data) + + case TypeGiftChatTheme: + return UnmarshalGiftChatTheme(data) + + case TypeGiftChatThemes: + return UnmarshalGiftChatThemes(data) + + case TypeChatThemeEmoji: + return UnmarshalChatThemeEmoji(data) + + case TypeChatThemeGift: + return UnmarshalChatThemeGift(data) + + case TypeInputChatThemeEmoji: + return UnmarshalInputChatThemeEmoji(data) + + case TypeInputChatThemeGift: + return UnmarshalInputChatThemeGift(data) case TypeTimeZone: return UnmarshalTimeZone(data) @@ -27491,6 +29988,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(data) + + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(data) + case TypeCanTransferOwnershipResultOk: return UnmarshalCanTransferOwnershipResultOk(data) @@ -27665,6 +30171,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentSuggestProfilePhoto: return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentSuggestBirthdate: + return UnmarshalPushMessageContentSuggestBirthdate(data) + case TypePushMessageContentProximityAlertTriggered: return UnmarshalPushMessageContentProximityAlertTriggered(data) @@ -27716,6 +30225,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroup: return UnmarshalNotificationGroup(data) + case TypeProxy: + return UnmarshalProxy(data) + case TypeOptionValueBoolean: return UnmarshalOptionValueBoolean(data) @@ -27815,6 +30327,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingShowProfileAudio: + return UnmarshalUserPrivacySettingShowProfileAudio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -27977,8 +30492,68 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReportStoryResultTextRequired: return UnmarshalReportStoryResultTextRequired(data) - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeSettingsSectionAppearance: + return UnmarshalSettingsSectionAppearance(data) + + case TypeSettingsSectionAskQuestion: + return UnmarshalSettingsSectionAskQuestion(data) + + case TypeSettingsSectionBusiness: + return UnmarshalSettingsSectionBusiness(data) + + case TypeSettingsSectionChatFolders: + return UnmarshalSettingsSectionChatFolders(data) + + case TypeSettingsSectionDataAndStorage: + return UnmarshalSettingsSectionDataAndStorage(data) + + case TypeSettingsSectionDevices: + return UnmarshalSettingsSectionDevices(data) + + case TypeSettingsSectionEditProfile: + return UnmarshalSettingsSectionEditProfile(data) + + case TypeSettingsSectionFaq: + return UnmarshalSettingsSectionFaq(data) + + case TypeSettingsSectionFeatures: + return UnmarshalSettingsSectionFeatures(data) + + case TypeSettingsSectionInAppBrowser: + return UnmarshalSettingsSectionInAppBrowser(data) + + case TypeSettingsSectionLanguage: + return UnmarshalSettingsSectionLanguage(data) + + case TypeSettingsSectionMyStars: + return UnmarshalSettingsSectionMyStars(data) + + case TypeSettingsSectionMyToncoins: + return UnmarshalSettingsSectionMyToncoins(data) + + case TypeSettingsSectionNotifications: + return UnmarshalSettingsSectionNotifications(data) + + case TypeSettingsSectionPowerSaving: + return UnmarshalSettingsSectionPowerSaving(data) + + case TypeSettingsSectionPremium: + return UnmarshalSettingsSectionPremium(data) + + case TypeSettingsSectionPrivacyAndSecurity: + return UnmarshalSettingsSectionPrivacyAndSecurity(data) + + case TypeSettingsSectionPrivacyPolicy: + return UnmarshalSettingsSectionPrivacyPolicy(data) + + case TypeSettingsSectionQrCode: + return UnmarshalSettingsSectionQrCode(data) + + case TypeSettingsSectionSearch: + return UnmarshalSettingsSectionSearch(data) + + case TypeSettingsSectionSendGift: + return UnmarshalSettingsSectionSendGift(data) case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -28001,11 +30576,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -28016,21 +30588,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) + + case TypeInternalLinkTypeDirectMessagesChat: + return UnmarshalInternalLinkTypeDirectMessagesChat(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + + case TypeInternalLinkTypeGiftCollection: + return UnmarshalInternalLinkTypeGiftCollection(data) + case TypeInternalLinkTypeGroupCall: return UnmarshalInternalLinkTypeGroupCall(data) @@ -28043,8 +30621,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -28055,11 +30633,20 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) @@ -28067,17 +30654,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -28091,27 +30675,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeStoryAlbum: + return UnmarshalInternalLinkTypeStoryAlbum(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -28295,6 +30885,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeConnectionStateReady: return UnmarshalConnectionStateReady(data) + case TypeAgeVerificationParameters: + return UnmarshalAgeVerificationParameters(data) + case TypeTopChatCategoryUsers: return UnmarshalTopChatCategoryUsers(data) @@ -28388,6 +30981,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionCustom: return UnmarshalSuggestedActionCustom(data) + case TypeSuggestedActionSetLoginEmailAddress: + return UnmarshalSuggestedActionSetLoginEmailAddress(data) + + case TypeSuggestedActionAddLoginPasskey: + return UnmarshalSuggestedActionAddLoginPasskey(data) + case TypeCount: return UnmarshalCount(data) @@ -28424,11 +31023,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxyTypeMtproto: return UnmarshalProxyTypeMtproto(data) - case TypeProxy: - return UnmarshalProxy(data) + case TypeAddedProxy: + return UnmarshalAddedProxy(data) - case TypeProxies: - return UnmarshalProxies(data) + case TypeAddedProxies: + return UnmarshalAddedProxies(data) case TypeInputSticker: return UnmarshalInputSticker(data) @@ -28520,6 +31119,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarRevenueStatistics: return UnmarshalStarRevenueStatistics(data) + case TypeTonRevenueStatus: + return UnmarshalTonRevenueStatus(data) + + case TypeTonRevenueStatistics: + return UnmarshalTonRevenueStatistics(data) + case TypePoint: return UnmarshalPoint(data) @@ -28766,6 +31371,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) + case TypeUpdatePendingTextMessage: + return UnmarshalUpdatePendingTextMessage(data) + case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -28835,9 +31443,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -28868,6 +31497,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -28895,8 +31527,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(data) - case TypeUpdateChatThemes: - return UnmarshalUpdateChatThemes(data) + case TypeUpdateEmojiChatThemes: + return UnmarshalUpdateEmojiChatThemes(data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) @@ -28913,6 +31545,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) + case TypeUpdateAgeVerificationParameters: + return UnmarshalUpdateAgeVerificationParameters(data) + case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) @@ -28955,12 +31590,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) + case TypeUpdateTonRevenueStatus: + return UnmarshalUpdateTonRevenueStatus(data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(data) diff --git a/data/td_api.tl b/data/td_api.tl index 60c5f4f..1423dab 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -120,18 +120,32 @@ formattedText text:string entities:vector = FormattedText; //@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; +//@description Describes a passkey +//@id Unique identifier of the passkey +//@name Name of the passkey +//@addition_date Point in time (Unix timestamp) when the passkey was added +//@last_usage_date Point in time (Unix timestamp) when the passkey was used last time; 0 if never +//@software_icon_custom_emoji_id Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown +passkey id:string name:string addition_date:int32 last_usage_date:int32 software_icon_custom_emoji_id:int64 = Passkey; + +//@description Contains a list of passkeys @passkeys List of passkeys +passkeys passkeys:vector = Passkeys; + //@class AuthorizationState @description Represents the current authorization state of the TDLib client //@description Initialization parameters are needed. Call setTdlibParameters to provide them authorizationStateWaitTdlibParameters = AuthorizationState; -//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options +//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, +//-or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; //@description The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction //@store_product_id Identifier of the store product that must be bought -authorizationStateWaitPremiumPurchase store_product_id:string = AuthorizationState; +//@support_email_address Email address to use for support if the user has issues with Telegram Premium purchase +//@support_email_subject Subject for the email sent to the support email address +authorizationStateWaitPremiumPurchase store_product_id:string support_email_address:string support_email_subject:string = AuthorizationState; //@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed //@allow_apple_id True, if authorization through Apple ID is allowed @@ -391,9 +405,9 @@ pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType; //@description Describes a task in a checklist //@id Unique identifier of the task //@text Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities -//@completed_by_user_id Identifier of the user that completed the task; 0 if the task isn't completed +//@completed_by Identifier of the user or chat that completed the task; may be null if the task isn't completed yet //@completion_date Point in time (Unix timestamp) when the task was completed; 0 if the task isn't completed -checklistTask id:int32 text:formattedText completed_by_user_id:int53 completion_date:int32 = ChecklistTask; +checklistTask id:int32 text:formattedText completed_by:MessageSender completion_date:int32 = ChecklistTask; //@description Describes a task in a checklist to be sent //@id Unique identifier of the task; must be positive @@ -441,6 +455,9 @@ animation duration:int32 width:int32 height:int32 file_name:string mime_type:str //@audio File containing the audio audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector audio:file = Audio; +//@description Contains a list of audio files @total_count Approximate total number of audio files found @audios List of audio files +audios total_count:int32 audios:vector