diff --git a/client/function.go b/client/function.go index 46bce98..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"` @@ -3468,7 +3512,7 @@ type SearchPublicPostsRequest struct { 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 amount of Telegram Stars the user agreed to pay for the search; pass 0 for free searches + // The Telegram Star amount the user agreed to pay for the search; pass 0 for free searches StarCount int64 `json:"star_count"` } @@ -3836,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"` @@ -3871,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"` @@ -3906,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"` @@ -4516,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"` } @@ -4543,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"` @@ -4662,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 @@ -4682,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, @@ -4703,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 @@ -4721,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, @@ -4773,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 @@ -4795,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, @@ -4817,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 @@ -4839,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, @@ -6222,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{ @@ -6250,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{ @@ -6645,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{ @@ -6658,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, }, }) @@ -6675,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 @@ -6685,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{ @@ -6693,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, @@ -6713,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{ @@ -6725,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 { @@ -6739,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{ @@ -6754,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 { @@ -6769,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"` @@ -6777,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{ @@ -6794,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, }, }) @@ -6812,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{ @@ -6826,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, }, }) @@ -6844,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"` } @@ -6858,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, }, }) @@ -6905,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{ @@ -6919,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, }, }) @@ -6937,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{ @@ -6949,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 { @@ -6966,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{ @@ -6978,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 { @@ -8231,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"` } @@ -8376,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"` @@ -8706,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 @@ -8726,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, }, @@ -9108,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{ @@ -9133,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 @@ -9149,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, }, @@ -9165,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"` @@ -9363,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) @@ -9387,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) @@ -9402,24 +9725,24 @@ 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 TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(result.Data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(result.Data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(result.Data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(result.Data) @@ -9435,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) @@ -9447,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) @@ -9459,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) @@ -9483,9 +9812,18 @@ 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) @@ -9498,15 +9836,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte 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) @@ -9565,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{ @@ -9578,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 { @@ -9617,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{ @@ -9672,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"` @@ -10904,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{ @@ -10918,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, }, }) @@ -11287,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"` } @@ -11403,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"` @@ -11584,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"` } @@ -11678,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"` @@ -11794,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"` @@ -12086,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{ @@ -12226,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") } @@ -12242,7 +12538,7 @@ 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_story_count_max") + // 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"` @@ -12284,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"` @@ -12361,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{ @@ -12732,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{ @@ -13008,7 +13354,7 @@ type CreateStoryAlbumRequest struct { 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_story_count_max") identifiers + // Identifiers of stories to add to the album; 0-getOption("story_album_size_max") identifiers StoryIds []int32 `json:"story_ids"` } @@ -13130,7 +13476,7 @@ type AddStoryAlbumStoriesRequest struct { 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_story_count_max") identifiers. If after addition the album has more than getOption("story_album_story_count_max") stories, then the last one are removed from the album + // 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"` } @@ -13810,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{ @@ -14206,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{ @@ -14807,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"` @@ -14941,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{ @@ -15217,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"` } @@ -15356,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"` @@ -15444,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{ @@ -15469,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"` @@ -15501,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"` @@ -15510,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{ @@ -15540,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{ @@ -15567,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{ @@ -15646,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"` @@ -15954,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"` @@ -16004,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{ @@ -16036,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{ @@ -16127,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{ @@ -16180,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{ @@ -16201,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, @@ -16224,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 @@ -16240,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, @@ -16432,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"` } @@ -16445,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, }, @@ -16461,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 @@ -16580,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 @@ -16698,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"` @@ -16727,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"` @@ -17043,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"` @@ -17787,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{ @@ -18276,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"` @@ -18816,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{ @@ -19578,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{ @@ -19700,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{ @@ -20467,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"` @@ -21183,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"` @@ -21300,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 @@ -21311,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 { @@ -21325,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"` @@ -21332,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"` } @@ -21365,7 +22456,7 @@ type BuyGiftUpgradeRequest struct { OwnerId MessageSender `json:"owner_id"` // Prepaid upgrade hash as received along with the gift PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - // The amount of Telegram Stars the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count + // 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"` } @@ -21392,6 +22483,47 @@ func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) { 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"` @@ -21399,7 +22531,7 @@ 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"` } @@ -21427,6 +22559,35 @@ 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"` @@ -21468,6 +22629,73 @@ func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (GiftResaleResu } } +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 { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetReceivedGiftsRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -21487,6 +22715,10 @@ type GetReceivedGiftsRequest struct { 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 @@ -21511,6 +22743,8 @@ func (client *Client) GetReceivedGifts(req *GetReceivedGiftsRequest) (*ReceivedG "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, @@ -21553,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"` @@ -21634,6 +22900,25 @@ 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"` @@ -21668,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 @@ -21685,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, @@ -21732,7 +23020,7 @@ type CreateGiftCollectionRequest struct { 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_gift_count_max") identifiers + // Identifier of the gifts to add to the collection; 0-getOption("gift_collection_size_max") identifiers ReceivedGiftIds []string `json:"received_gift_ids"` } @@ -21854,7 +23142,7 @@ type AddGiftCollectionGiftsRequest struct { 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_gift_count_max") identifiers. If after addition the collection has more than getOption("gift_collection_gift_count_max") gifts, then the last one are removed from the collection + // 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"` } @@ -21975,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"` @@ -22003,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{ @@ -22768,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{ @@ -22797,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{ @@ -24166,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{ @@ -25156,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{ @@ -25331,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"` } @@ -25742,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{ @@ -26214,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 { @@ -26245,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 { @@ -26283,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 { @@ -26358,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", @@ -26373,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 @@ -26414,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 { @@ -26968,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 @@ -26987,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, }, @@ -27248,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) @@ -27317,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) @@ -27350,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) @@ -27446,9 +28717,15 @@ func (client *Client) TestUseUpdate() (Update, error) { 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 6490a7a..feb0c58 100755 --- a/client/type.go +++ b/client/type.go @@ -25,6 +25,7 @@ const ( ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" ClassGiftResalePrice = "GiftResalePrice" + ClassGiftPurchaseOfferState = "GiftPurchaseOfferState" ClassSuggestedPostPrice = "SuggestedPostPrice" ClassSuggestedPostState = "SuggestedPostState" ClassSuggestedPostRefundReason = "SuggestedPostRefundReason" @@ -33,13 +34,17 @@ const ( 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" @@ -69,6 +74,7 @@ const ( ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" + ClassButtonStyle = "ButtonStyle" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" ClassReplyMarkup = "ReplyMarkup" @@ -108,6 +114,7 @@ const ( ClassEmojiCategoryType = "EmojiCategoryType" ClassStoryAreaType = "StoryAreaType" ClassInputStoryAreaType = "InputStoryAreaType" + ClassStoryContentType = "StoryContentType" ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" @@ -151,6 +158,7 @@ const ( ClassChatTheme = "ChatTheme" ClassInputChatTheme = "InputChatTheme" ClassCanPostStoryResult = "CanPostStoryResult" + ClassStartLiveStoryResult = "StartLiveStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -169,6 +177,7 @@ const ( ClassReportReason = "ReportReason" ClassReportChatResult = "ReportChatResult" ClassReportStoryResult = "ReportStoryResult" + ClassSettingsSection = "SettingsSection" ClassInternalLinkType = "InternalLinkType" ClassBlockList = "BlockList" ClassFileType = "FileType" @@ -199,6 +208,8 @@ const ( ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" ClassTermsOfService = "TermsOfService" + ClassPasskey = "Passkey" + ClassPasskeys = "Passkeys" ClassPasswordState = "PasswordState" ClassRecoveryEmailAddress = "RecoveryEmailAddress" ClassTemporaryPasswordState = "TemporaryPasswordState" @@ -230,6 +241,7 @@ const ( ClassLocation = "Location" ClassVenue = "Venue" ClassGame = "Game" + ClassStakeDiceState = "StakeDiceState" ClassWebApp = "WebApp" ClassPoll = "Poll" ClassAlternativeVideo = "AlternativeVideo" @@ -297,6 +309,8 @@ const ( ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions" ClassAcceptedGiftTypes = "AcceptedGiftTypes" ClassGiftSettings = "GiftSettings" + ClassGiftAuction = "GiftAuction" + ClassGiftBackground = "GiftBackground" ClassGiftPurchaseLimits = "GiftPurchaseLimits" ClassGiftResaleParameters = "GiftResaleParameters" ClassGiftCollection = "GiftCollection" @@ -306,12 +320,14 @@ const ( 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" @@ -319,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" @@ -366,6 +391,7 @@ const ( ClassMessageViewers = "MessageViewers" ClassForwardSource = "ForwardSource" ClassPaidReactor = "PaidReactor" + ClassLiveStoryDonors = "LiveStoryDonors" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" @@ -537,8 +563,8 @@ const ( ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" ClassGroupCallJoinParameters = "GroupCallJoinParameters" - ClassVideoChatStream = "VideoChatStream" - ClassVideoChatStreams = "VideoChatStreams" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" @@ -547,6 +573,8 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassGroupCallParticipants = "GroupCallParticipants" ClassGroupCallInfo = "GroupCallInfo" + ClassGroupCallMessage = "GroupCallMessage" + ClassGroupCallMessageLevel = "GroupCallMessageLevel" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" ClassAddedReaction = "AddedReaction" @@ -555,6 +583,7 @@ const ( ClassAvailableReactions = "AvailableReactions" ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" + ClassImportedContact = "ImportedContact" ClassImportedContacts = "ImportedContacts" ClassBusinessConnection = "BusinessConnection" ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" @@ -595,6 +624,7 @@ const ( ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" + ClassProxy = "Proxy" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassReadDatePrivacySettings = "ReadDatePrivacySettings" @@ -633,8 +663,8 @@ const ( ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassStarCount = "StarCount" ClassDeepLinkInfo = "DeepLinkInfo" - ClassProxy = "Proxy" - ClassProxies = "Proxies" + ClassAddedProxy = "AddedProxy" + ClassAddedProxies = "AddedProxies" ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" @@ -690,6 +720,8 @@ const ( TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" TypeTermsOfService = "termsOfService" + TypePasskey = "passkey" + TypePasskeys = "passkeys" TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitPremiumPurchase = "authorizationStateWaitPremiumPurchase" @@ -762,6 +794,7 @@ const ( TypeLocation = "location" TypeVenue = "venue" TypeGame = "game" + TypeStakeDiceState = "stakeDiceState" TypeWebApp = "webApp" TypePoll = "poll" TypeAlternativeVideo = "alternativeVideo" @@ -824,6 +857,9 @@ const ( TypeChatAdministratorRights = "chatAdministratorRights" TypeGiftResalePriceStar = "giftResalePriceStar" TypeGiftResalePriceTon = "giftResalePriceTon" + TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" + TypeGiftPurchaseOfferStateAccepted = "giftPurchaseOfferStateAccepted" + TypeGiftPurchaseOfferStateRejected = "giftPurchaseOfferStateRejected" TypeSuggestedPostPriceStar = "suggestedPostPriceStar" TypeSuggestedPostPriceTon = "suggestedPostPriceTon" TypeSuggestedPostStatePending = "suggestedPostStatePending" @@ -867,6 +903,8 @@ const ( TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions" TypeAcceptedGiftTypes = "acceptedGiftTypes" TypeGiftSettings = "giftSettings" + TypeGiftAuction = "giftAuction" + TypeGiftBackground = "giftBackground" TypeGiftPurchaseLimits = "giftPurchaseLimits" TypeGiftResaleParameters = "giftResaleParameters" TypeGiftCollection = "giftCollection" @@ -876,18 +914,32 @@ const ( 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" @@ -905,7 +957,18 @@ const ( 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" @@ -927,8 +990,11 @@ const ( TypeStarTransactionTypeBotSubscriptionSale = "starTransactionTypeBotSubscriptionSale" TypeStarTransactionTypeChannelSubscriptionPurchase = "starTransactionTypeChannelSubscriptionPurchase" TypeStarTransactionTypeChannelSubscriptionSale = "starTransactionTypeChannelSubscriptionSale" + TypeStarTransactionTypeGiftAuctionBid = "starTransactionTypeGiftAuctionBid" TypeStarTransactionTypeGiftPurchase = "starTransactionTypeGiftPurchase" + TypeStarTransactionTypeGiftPurchaseOffer = "starTransactionTypeGiftPurchaseOffer" TypeStarTransactionTypeGiftTransfer = "starTransactionTypeGiftTransfer" + TypeStarTransactionTypeGiftOriginalDetailsDrop = "starTransactionTypeGiftOriginalDetailsDrop" TypeStarTransactionTypeGiftSale = "starTransactionTypeGiftSale" TypeStarTransactionTypeGiftUpgrade = "starTransactionTypeGiftUpgrade" TypeStarTransactionTypeGiftUpgradePurchase = "starTransactionTypeGiftUpgradePurchase" @@ -939,6 +1005,10 @@ const ( TypeStarTransactionTypeAffiliateProgramCommission = "starTransactionTypeAffiliateProgramCommission" TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend" TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive" + TypeStarTransactionTypePaidGroupCallMessageSend = "starTransactionTypePaidGroupCallMessageSend" + TypeStarTransactionTypePaidGroupCallMessageReceive = "starTransactionTypePaidGroupCallMessageReceive" + TypeStarTransactionTypePaidGroupCallReactionSend = "starTransactionTypePaidGroupCallReactionSend" + TypeStarTransactionTypePaidGroupCallReactionReceive = "starTransactionTypePaidGroupCallReactionReceive" TypeStarTransactionTypeSuggestedPostPaymentSend = "starTransactionTypeSuggestedPostPaymentSend" TypeStarTransactionTypeSuggestedPostPaymentReceive = "starTransactionTypeSuggestedPostPaymentReceive" TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase" @@ -949,12 +1019,19 @@ const ( 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" @@ -1052,6 +1129,7 @@ const ( TypePaidReactionTypeAnonymous = "paidReactionTypeAnonymous" TypePaidReactionTypeChat = "paidReactionTypeChat" TypePaidReactor = "paidReactor" + TypeLiveStoryDonors = "liveStoryDonors" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageImportInfo = "messageImportInfo" TypeMessageReplyInfo = "messageReplyInfo" @@ -1059,6 +1137,7 @@ const ( TypeMessageReactions = "messageReactions" TypeMessageInteractionInfo = "messageInteractionInfo" TypeUnreadReaction = "unreadReaction" + TypeMessageTopicThread = "messageTopicThread" TypeMessageTopicForum = "messageTopicForum" TypeMessageTopicDirectMessages = "messageTopicDirectMessages" TypeMessageTopicSavedMessages = "messageTopicSavedMessages" @@ -1164,6 +1243,10 @@ const ( TypeChatActionBarAddContact = "chatActionBarAddContact" TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" + TypeButtonStyleDefault = "buttonStyleDefault" + TypeButtonStylePrimary = "buttonStylePrimary" + TypeButtonStyleDanger = "buttonStyleDanger" + TypeButtonStyleSuccess = "buttonStyleSuccess" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -1290,9 +1373,11 @@ const ( TypeLinkPreviewTypeEmbeddedVideoPlayer = "linkPreviewTypeEmbeddedVideoPlayer" TypeLinkPreviewTypeExternalAudio = "linkPreviewTypeExternalAudio" TypeLinkPreviewTypeExternalVideo = "linkPreviewTypeExternalVideo" + TypeLinkPreviewTypeGiftAuction = "linkPreviewTypeGiftAuction" TypeLinkPreviewTypeGiftCollection = "linkPreviewTypeGiftCollection" TypeLinkPreviewTypeGroupCall = "linkPreviewTypeGroupCall" TypeLinkPreviewTypeInvoice = "linkPreviewTypeInvoice" + TypeLinkPreviewTypeLiveStory = "linkPreviewTypeLiveStory" TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" @@ -1446,6 +1531,7 @@ const ( TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" + TypeMessageStakeDice = "messageStakeDice" TypeMessageStory = "messageStory" TypeMessageChecklist = "messageChecklist" TypeMessageInvoice = "messageInvoice" @@ -1460,6 +1546,8 @@ const ( TypeMessageChatChangeTitle = "messageChatChangeTitle" TypeMessageChatChangePhoto = "messageChatChangePhoto" TypeMessageChatDeletePhoto = "messageChatDeletePhoto" + TypeMessageChatOwnerLeft = "messageChatOwnerLeft" + TypeMessageChatOwnerChanged = "messageChatOwnerChanged" TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" @@ -1477,6 +1565,7 @@ const ( TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" + TypeMessageSuggestBirthdate = "messageSuggestBirthdate" TypeMessageCustomServiceAction = "messageCustomServiceAction" TypeMessageGameScore = "messageGameScore" TypeMessagePaymentSuccessful = "messagePaymentSuccessful" @@ -1494,6 +1583,8 @@ const ( TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" + TypeMessageUpgradedGiftPurchaseOffer = "messageUpgradedGiftPurchaseOffer" + TypeMessageUpgradedGiftPurchaseOfferRejected = "messageUpgradedGiftPurchaseOfferRejected" TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded" TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged" TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged" @@ -1564,6 +1655,7 @@ const ( TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageStakeDice = "inputMessageStakeDice" TypeInputMessageStory = "inputMessageStory" TypeInputMessageChecklist = "inputMessageChecklist" TypeInputMessageForwarded = "inputMessageForwarded" @@ -1646,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" @@ -1714,8 +1811,8 @@ const ( TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeVideoChatStream = "videoChatStream" - TypeVideoChatStreams = "videoChatStreams" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" TypeRtmpUrl = "rtmpUrl" TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" TypeGroupCall = "groupCall" @@ -1724,6 +1821,8 @@ const ( TypeGroupCallParticipant = "groupCallParticipant" TypeGroupCallParticipants = "groupCallParticipants" TypeGroupCallInfo = "groupCallInfo" + TypeGroupCallMessage = "groupCallMessage" + TypeGroupCallMessageLevel = "groupCallMessageLevel" TypeInviteGroupCallParticipantResultUserPrivacyRestricted = "inviteGroupCallParticipantResultUserPrivacyRestricted" TypeInviteGroupCallParticipantResultUserAlreadyParticipant = "inviteGroupCallParticipantResultUserAlreadyParticipant" TypeInviteGroupCallParticipantResultUserWasBanned = "inviteGroupCallParticipantResultUserWasBanned" @@ -1755,6 +1854,7 @@ const ( TypeAnimations = "animations" TypeDiceStickersRegular = "diceStickersRegular" TypeDiceStickersSlotMachine = "diceStickersSlotMachine" + TypeImportedContact = "importedContact" TypeImportedContacts = "importedContacts" TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" TypeSpeechRecognitionResultText = "speechRecognitionResultText" @@ -1916,6 +2016,7 @@ const ( TypePremiumFeatureBusiness = "premiumFeatureBusiness" TypePremiumFeatureMessageEffects = "premiumFeatureMessageEffects" TypePremiumFeatureChecklists = "premiumFeatureChecklists" + TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -2001,6 +2102,9 @@ const ( TypeCanPostStoryResultActiveStoryLimitExceeded = "canPostStoryResultActiveStoryLimitExceeded" TypeCanPostStoryResultWeeklyLimitExceeded = "canPostStoryResultWeeklyLimitExceeded" TypeCanPostStoryResultMonthlyLimitExceeded = "canPostStoryResultMonthlyLimitExceeded" + TypeCanPostStoryResultLiveStoryIsActive = "canPostStoryResultLiveStoryIsActive" + TypeStartLiveStoryResultOk = "startLiveStoryResultOk" + TypeStartLiveStoryResultFail = "startLiveStoryResultFail" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" @@ -2059,6 +2163,7 @@ const ( TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" + TypePushMessageContentSuggestBirthdate = "pushMessageContentSuggestBirthdate" TypePushMessageContentProximityAlertTriggered = "pushMessageContentProximityAlertTriggered" TypePushMessageContentChecklistTasksAdded = "pushMessageContentChecklistTasksAdded" TypePushMessageContentChecklistTasksDone = "pushMessageContentChecklistTasksDone" @@ -2076,6 +2181,7 @@ const ( TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" + TypeProxy = "proxy" TypeOptionValueBoolean = "optionValueBoolean" TypeOptionValueEmpty = "optionValueEmpty" TypeOptionValueInteger = "optionValueInteger" @@ -2109,6 +2215,7 @@ const ( TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" + TypeUserPrivacySettingShowProfileAudio = "userPrivacySettingShowProfileAudio" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -2163,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" @@ -2171,46 +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" + TypeInternalLinkTypeChatSelection = "internalLinkTypeChatSelection" + TypeInternalLinkTypeContactsPage = "internalLinkTypeContactsPage" TypeInternalLinkTypeDirectMessagesChat = "internalLinkTypeDirectMessagesChat" - TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" 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" @@ -2304,6 +2433,8 @@ const ( TypeSuggestedActionExtendPremium = "suggestedActionExtendPremium" TypeSuggestedActionExtendStarSubscriptions = "suggestedActionExtendStarSubscriptions" TypeSuggestedActionCustom = "suggestedActionCustom" + TypeSuggestedActionSetLoginEmailAddress = "suggestedActionSetLoginEmailAddress" + TypeSuggestedActionAddLoginPasskey = "suggestedActionAddLoginPasskey" TypeCount = "count" TypeText = "text" TypeData = "data" @@ -2316,8 +2447,8 @@ const ( TypeProxyTypeSocks5 = "proxyTypeSocks5" TypeProxyTypeHttp = "proxyTypeHttp" TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeProxy = "proxy" - TypeProxies = "proxies" + TypeAddedProxy = "addedProxy" + TypeAddedProxies = "addedProxies" TypeInputSticker = "inputSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" @@ -2432,6 +2563,7 @@ const ( TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" TypeUpdateDeleteMessages = "updateDeleteMessages" TypeUpdateChatAction = "updateChatAction" + TypeUpdatePendingTextMessage = "updatePendingTextMessage" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" TypeUpdateBasicGroup = "updateBasicGroup" @@ -2455,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" @@ -2466,6 +2605,7 @@ const ( TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateTrustedMiniAppBots = "updateTrustedMiniAppBots" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -2498,7 +2638,9 @@ const ( TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" TypeUpdateTonRevenueStatus = "updateTonRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" + TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateStakeDiceState = "updateStakeDiceState" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" @@ -2632,6 +2774,11 @@ 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 @@ -2672,6 +2819,16 @@ 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 @@ -2692,6 +2849,11 @@ 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 @@ -2707,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 @@ -2852,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 @@ -3047,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 @@ -3262,6 +3439,11 @@ 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 @@ -3352,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 @@ -4144,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 @@ -4169,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 } @@ -5702,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"` } @@ -5724,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 @@ -5983,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"` @@ -6238,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"` @@ -6364,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 @@ -6482,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"` @@ -6968,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) @@ -7239,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 @@ -7501,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"` @@ -8225,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"` @@ -8266,7 +8567,7 @@ func (*ChatAdministratorRights) GetType() string { // Describes price of a resold gift in Telegram Stars type GiftResalePriceStar struct { meta - // The amount of Telegram Stars expected to be paid for the gift. Must be in range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale + // 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"` } @@ -8293,7 +8594,7 @@ func (*GiftResalePriceStar) GiftResalePriceType() string { // 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 range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") + // 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"` } @@ -8317,10 +8618,85 @@ 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 expected to be paid 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"` } @@ -8598,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"` @@ -8690,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"` } @@ -9016,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"` } @@ -9104,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) { @@ -9273,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"` @@ -9383,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 @@ -9422,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"` } @@ -9435,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 @@ -9594,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"` } @@ -9639,6 +10021,60 @@ 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 @@ -9798,7 +10234,7 @@ func (*CanSendGiftResultFail) CanSendGiftResultType() string { // 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"` } @@ -9850,7 +10286,7 @@ func (*UpgradedGiftOriginTransfer) UpgradedGiftOriginType() string { // The gift was bought from another user type UpgradedGiftOriginResale struct { meta - // Price paid by the sender for the gift + // Price paid for the gift Price GiftResalePrice `json:"price"` } @@ -9890,6 +10326,31 @@ func (upgradedGiftOriginResale *UpgradedGiftOriginResale) UnmarshalJSON(data []b 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 @@ -9915,6 +10376,201 @@ 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 @@ -9922,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) { @@ -9942,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 @@ -9949,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) { @@ -9969,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 @@ -10007,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) { @@ -10027,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 @@ -10081,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 @@ -10096,16 +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"` // True, if the gift can be bought only by Telegram Premium subscribers IsPremium bool `json:"is_premium"` - // Point in time (Unix timestamp) when the gift can be sent next time by the current user; can 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 + // 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 @@ -10147,12 +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 @@ -10169,12 +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"` + // 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) { @@ -10203,9 +10985,12 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { 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"` @@ -10214,9 +10999,13 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { Symbol *UpgradedGiftSymbol `json:"symbol"` Backdrop *UpgradedGiftBackdrop `json:"backdrop"` OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` + 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) @@ -10232,6 +11021,8 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { 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 @@ -10242,9 +11033,16 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.Symbol = tmp.Symbol upgradedGift.Backdrop = tmp.Backdrop upgradedGift.OriginalDetails = tmp.OriginalDetails + 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 @@ -10263,7 +11061,7 @@ type UpgradedGiftValueInfo struct { 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"` - // Amount of Telegram Stars that were paid for the gift + // 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"` @@ -10314,6 +11112,8 @@ 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"` + // 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; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift @@ -10338,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 @@ -10390,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 @@ -10680,8 +11611,10 @@ func (*GiftsForResale) GetType() string { } // Operation was successfully completed -type GiftResaleResultOk struct{ +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) { @@ -10810,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 @@ -10836,6 +11771,8 @@ type ReceivedGift struct { 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"` + // 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; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift @@ -10844,6 +11781,8 @@ type ReceivedGift struct { 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) { @@ -10867,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"` @@ -10880,10 +11820,12 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { 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) @@ -10893,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 @@ -10905,10 +11848,12 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { 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 @@ -10948,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 @@ -10957,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) { @@ -10975,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 @@ -11025,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 } @@ -11050,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 } @@ -11075,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 } @@ -11100,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 } @@ -11125,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"` @@ -11154,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"` } @@ -11183,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 @@ -11226,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 } @@ -11251,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 @@ -11278,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"` @@ -11326,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"` @@ -11382,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"` @@ -11434,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"` @@ -11486,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"` @@ -11515,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"` @@ -11548,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"` @@ -11579,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"` @@ -11614,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 @@ -11643,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"` @@ -11672,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 @@ -11720,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 @@ -11768,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"` @@ -11797,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"` @@ -11826,7 +13314,7 @@ func (*StarTransactionTypeGiftUpgrade) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftUpgrade } -// The transaction is a purchase of an upgrade of a gift owned by another 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 @@ -11874,10 +13362,10 @@ func (starTransactionTypeGiftUpgradePurchase *StarTransactionTypeGiftUpgradePurc return nil } -// 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 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"` @@ -11903,17 +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"` // 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 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"` + // True, if the gift was sold through a purchase offer + ViaOffer bool `json:"via_offer"` } func (entity *StarTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { @@ -11936,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"` } @@ -11965,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"` } @@ -11994,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 @@ -12023,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 @@ -12052,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 @@ -12061,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"` } @@ -12108,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 @@ -12135,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"` } @@ -12162,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"` @@ -12193,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 @@ -12220,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"` } @@ -12247,7 +13895,7 @@ func (*StarTransactionTypeBusinessBotTransferReceive) StarTransactionTypeType() return TypeStarTransactionTypeBusinessBotTransferReceive } -// The transaction is a payment for search of posts in public Telegram channels; for regular users only +// The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only type StarTransactionTypePublicPostSearch struct{ meta } @@ -12409,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 @@ -12436,10 +14127,37 @@ func (*TonTransactionTypeSuggestedPostPayment) TonTransactionTypeType() string { return TypeTonTransactionTypeSuggestedPostPayment } -// The transaction is a purchase of an upgraded gift for some user or channel; for regular users only +// 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 that sold the gift + // Identifier of the user who sold the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` @@ -12465,17 +14183,19 @@ func (*TonTransactionTypeUpgradedGiftPurchase) TonTransactionTypeType() string { return TypeTonTransactionTypeUpgradedGiftPurchase } -// The transaction is a sale of an upgraded gift; for regular users only +// The transaction is a sale of an upgraded gift type TonTransactionTypeUpgradedGiftSale 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"` // 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 amount of Toncoins that were received by the Telegram; in the smallest units of the currency + // 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) { @@ -12498,6 +14218,56 @@ 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 @@ -12606,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 @@ -12806,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"` } @@ -13190,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) { @@ -13233,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 @@ -13253,10 +15104,8 @@ type User struct { IsSupport bool `json:"is_support"` // Information about restrictions that must be applied to the corresponding private chat; may be null if none RestrictionInfo *RestrictionInfo `json:"restriction_info"` - // 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"` + // 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 @@ -13299,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"` @@ -13309,8 +15159,7 @@ func (user *User) UnmarshalJSON(data []byte) error { IsPremium bool `json:"is_premium"` IsSupport bool `json:"is_support"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + 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"` @@ -13333,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 @@ -13343,8 +15193,6 @@ func (user *User) UnmarshalJSON(data []byte) error { user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport user.RestrictionInfo = tmp.RestrictionInfo - user.HasActiveStories = tmp.HasActiveStories - user.HasUnreadActiveStories = tmp.HasUnreadActiveStories user.RestrictsNewChats = tmp.RestrictsNewChats user.PaidMessageStarCount = tmp.PaidMessageStarCount user.HaveAccess = tmp.HaveAccess @@ -13354,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 @@ -13547,6 +15398,8 @@ type UserFullInfo struct { 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 @@ -13598,6 +15451,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { 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"` } @@ -13632,6 +15486,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.Rating = tmp.Rating userFullInfo.PendingRating = tmp.PendingRating userFullInfo.PendingRatingDate = tmp.PendingRatingDate + userFullInfo.Note = tmp.Note userFullInfo.BusinessInfo = tmp.BusinessInfo userFullInfo.BotInfo = tmp.BotInfo @@ -13921,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"` @@ -14073,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) { @@ -14097,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 @@ -14335,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) { @@ -14359,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 @@ -14752,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 @@ -14951,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"` @@ -14975,10 +16865,8 @@ type Supergroup struct { 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) { @@ -15024,8 +16912,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { HasForumTabs bool `json:"has_forum_tabs"` 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) @@ -15057,12 +16944,13 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.HasForumTabs = tmp.HasForumTabs 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 } @@ -15407,7 +17295,7 @@ type PublicPostSearchLimits struct { // 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 JsonInt64 `json:"star_count"` + StarCount int64 `json:"star_count"` // True, if the search for the specified query isn't charged IsCurrentQueryFree bool `json:"is_current_query_free"` } @@ -15431,7 +17319,7 @@ func (*PublicPostSearchLimits) GetType() string { // 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"` } @@ -15771,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"` } @@ -16098,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 @@ -16132,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"` @@ -16154,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 @@ -16455,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) { @@ -16781,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"` } @@ -17032,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"` @@ -17058,6 +18996,8 @@ type Message struct { EffectId JsonInt64 `json:"effect_id"` // 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 @@ -17105,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"` @@ -17118,6 +19057,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { MediaAlbumId JsonInt64 `json:"media_album_id"` EffectId JsonInt64 `json:"effect_id"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` + SummaryLanguageCode string `json:"summary_language_code"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` } @@ -17146,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 @@ -17157,6 +19096,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.MediaAlbumId = tmp.MediaAlbumId message.EffectId = tmp.EffectId message.RestrictionInfo = tmp.RestrictionInfo + message.SummaryLanguageCode = tmp.SummaryLanguageCode fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId @@ -18500,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"` @@ -19413,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 @@ -19509,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"` @@ -19556,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 @@ -19635,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 @@ -19760,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 @@ -19953,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 @@ -20183,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"` } @@ -20206,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"` } @@ -20215,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 @@ -20518,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"` } @@ -20541,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"` } @@ -20550,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 @@ -20717,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) { @@ -21192,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"` @@ -21291,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 @@ -21305,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"` @@ -21313,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) { @@ -21334,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"` @@ -21344,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) @@ -21353,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 @@ -21361,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 @@ -21422,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) { @@ -24601,6 +26675,35 @@ 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 @@ -24678,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 @@ -29244,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"` @@ -29351,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 @@ -29540,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 @@ -29574,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"` @@ -29586,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 @@ -29844,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 @@ -30191,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"` } @@ -30327,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 @@ -30390,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"` @@ -30538,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"` @@ -30552,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"` } @@ -30581,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"` @@ -30597,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 @@ -30636,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"` } @@ -30653,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 @@ -30748,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"` @@ -30865,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"` @@ -30908,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"` @@ -30949,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"` @@ -30990,12 +33277,16 @@ 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 @@ -31043,9 +33334,11 @@ 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"` @@ -31065,9 +33358,11 @@ 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 @@ -31108,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"` + // 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; 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; 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) { @@ -31147,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) @@ -31163,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 @@ -31239,6 +33542,120 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da 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 +} + // Paid messages were refunded type MessagePaidMessagesRefunded struct { meta @@ -31327,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"` @@ -31358,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"` @@ -31387,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"` @@ -31435,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"` @@ -31487,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"` @@ -31516,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"` @@ -31547,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"` @@ -32681,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) { @@ -32810,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 @@ -32828,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"` @@ -32854,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"` @@ -32873,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 @@ -32927,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"` } @@ -33804,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 @@ -36289,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 @@ -36345,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 @@ -36678,16 +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 + // 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 @@ -36746,6 +39323,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { 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"` @@ -36778,6 +39356,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { 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 @@ -36943,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) { @@ -37436,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"` } @@ -37647,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"` @@ -38646,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"` @@ -38657,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 @@ -38770,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 @@ -38782,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"` @@ -38790,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"` @@ -38798,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 @@ -38810,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 @@ -38834,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 @@ -39063,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 @@ -39503,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 @@ -39532,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"` @@ -39544,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 @@ -40033,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 @@ -40144,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"` @@ -45306,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 @@ -46065,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 @@ -47819,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"` } @@ -47846,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"` } @@ -47870,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 @@ -49483,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 @@ -50033,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 @@ -50937,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 @@ -52398,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 @@ -52647,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 @@ -52784,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 @@ -52836,29 +56340,56 @@ 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 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 *InternalLinkTypeContactsPage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeContactsPage + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeContactsPage) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeContactsPage) GetType() string { + return TypeInternalLinkTypeContactsPage +} + +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 @@ -52888,31 +56419,6 @@ func (*InternalLinkTypeDirectMessagesChat) InternalLinkTypeType() string { return TypeInternalLinkTypeDirectMessagesChat } -// The link is a link to the edit profile section of the application settings -type InternalLinkTypeEditProfileSettings struct{ - meta -} - -func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeEditProfileSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeEditProfileSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeEditProfileSettings) GetType() string { - return TypeInternalLinkTypeEditProfileSettings -} - -func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeEditProfileSettings -} - // 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 type InternalLinkTypeGame struct { meta @@ -52942,6 +56448,33 @@ 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 @@ -53081,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 @@ -53214,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 @@ -53329,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 @@ -53409,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) { @@ -53465,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 @@ -53567,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() @@ -53592,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 @@ -53706,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 @@ -53758,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 @@ -53987,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 @@ -54013,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 @@ -56342,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 @@ -56644,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 @@ -57686,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"` } @@ -57863,11 +61538,11 @@ func (*ChatRevenueTransactions) GetType() string { // 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"` @@ -57942,11 +61617,11 @@ func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) e // Contains information about Toncoins earned by the current user type TonRevenueStatus struct { meta - // Total amount of Toncoins earned; in the smallest units of the cryptocurrency + // Total Toncoin amount earned; in the smallest units of the cryptocurrency TotalAmount JsonInt64 `json:"total_amount"` - // Amount of Toncoins that aren't withdrawn yet; in the smallest units of the cryptocurrency + // The Toncoin amount that isn't withdrawn yet; in the smallest units of the cryptocurrency BalanceAmount JsonInt64 `json:"balance_amount"` - // Amount of Toncoins that are available for withdrawal; in the smallest units of the cryptocurrency + // 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"` @@ -58995,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 @@ -60336,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 @@ -60350,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) { @@ -60642,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 @@ -60673,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"` } @@ -60684,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 @@ -60695,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 @@ -61400,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 @@ -61429,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 @@ -61834,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 @@ -62862,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 @@ -62889,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 0fbe52e..5319fa2 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -748,6 +748,43 @@ func UnmarshalListOfGiftResalePrice(dataList []json.RawMessage) ([]GiftResalePri 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 @@ -1013,9 +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) } @@ -1035,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 @@ -1177,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 @@ -1277,12 +1440,21 @@ 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) @@ -1313,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) @@ -1365,15 +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) @@ -1396,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 @@ -1962,6 +2195,9 @@ func UnmarshalMessageTopic(data json.RawMessage) (MessageTopic, error) { } switch meta.Type { + case TypeMessageTopicThread: + return UnmarshalMessageTopicThread(data) + case TypeMessageTopicForum: return UnmarshalMessageTopicForum(data) @@ -2532,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 @@ -3186,6 +3462,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + case TypeLinkPreviewTypeGiftCollection: return UnmarshalLinkPreviewTypeGiftCollection(data) @@ -3195,6 +3474,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -3910,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) @@ -3952,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) @@ -4003,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) @@ -4054,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) @@ -4392,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) @@ -4830,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 @@ -4845,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) @@ -6242,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) } @@ -6822,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) } @@ -6841,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 @@ -7164,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) @@ -7492,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) @@ -7786,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 @@ -7795,9 +8278,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { } switch meta.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -7819,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) @@ -7834,24 +8311,24 @@ 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 TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(data) @@ -7867,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) @@ -7879,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) @@ -7891,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) @@ -7915,9 +8398,18 @@ 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) @@ -7930,15 +8422,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { 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) @@ -8410,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) } @@ -9021,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) @@ -9090,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) @@ -9123,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) @@ -9219,9 +9738,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { 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) @@ -9543,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 @@ -10119,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 @@ -10615,6 +11164,30 @@ func UnmarshalGiftResalePriceTon(data json.RawMessage) (*GiftResalePriceTon, err 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 @@ -10959,6 +11532,22 @@ 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 @@ -11031,6 +11620,14 @@ 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 @@ -11039,6 +11636,62 @@ func UnmarshalUpgradedGiftOriginPrepaidUpgrade(data json.RawMessage) (*UpgradedG 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 @@ -11079,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 @@ -11111,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 @@ -11127,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 @@ -11263,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 @@ -11271,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 @@ -11439,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 @@ -11447,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 @@ -11455,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 @@ -11535,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 @@ -11615,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 @@ -11623,6 +12476,14 @@ 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 @@ -11639,6 +12500,22 @@ func UnmarshalTonTransactionTypeUpgradedGiftSale(data json.RawMessage) (*TonTran 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 @@ -11663,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 @@ -12439,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 @@ -12495,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 @@ -13335,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 @@ -14343,6 +15292,14 @@ 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 @@ -14367,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 @@ -15591,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 @@ -15703,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 @@ -15839,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 @@ -15975,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 @@ -16535,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 @@ -17191,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 @@ -17207,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 @@ -17735,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) @@ -17815,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 @@ -18063,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 @@ -19351,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 @@ -20031,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 @@ -20495,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 @@ -20631,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 @@ -20895,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 @@ -21327,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) @@ -21391,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) @@ -21431,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 @@ -21447,8 +22732,16 @@ 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 UnmarshalInternalLinkTypeContactsPage(data json.RawMessage) (*InternalLinkTypeContactsPage, error) { + var resp InternalLinkTypeContactsPage err := json.Unmarshal(data, &resp) @@ -21463,16 +22756,16 @@ func UnmarshalInternalLinkTypeDirectMessagesChat(data json.RawMessage) (*Interna return &resp, err } -func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { - var resp InternalLinkTypeEditProfileSettings +func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { + var resp InternalLinkTypeGame err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { - var resp InternalLinkTypeGame +func UnmarshalInternalLinkTypeGiftAuction(data json.RawMessage) (*InternalLinkTypeGiftAuction, error) { + var resp InternalLinkTypeGiftAuction err := json.Unmarshal(data, &resp) @@ -21519,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) @@ -21551,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) @@ -21583,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) @@ -21607,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) @@ -21647,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 @@ -21655,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 @@ -21687,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 @@ -21703,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 @@ -22455,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 @@ -22551,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) @@ -23479,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 @@ -23663,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 @@ -23671,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 @@ -23751,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 @@ -24007,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 @@ -24015,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 @@ -24421,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) @@ -24637,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) @@ -24823,6 +26253,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { 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) @@ -24952,6 +26391,12 @@ 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) @@ -24979,9 +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) @@ -24997,6 +26466,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginalDetails: return UnmarshalUpgradedGiftOriginalDetails(data) + case TypeUpgradedGiftColors: + return UnmarshalUpgradedGiftColors(data) + case TypeGift: return UnmarshalGift(data) @@ -25009,12 +26481,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { 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) @@ -25066,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) @@ -25132,12 +26652,21 @@ 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) @@ -25168,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) @@ -25198,15 +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) @@ -25216,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) @@ -25507,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) @@ -25528,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) @@ -25843,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) @@ -26221,6 +27801,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + case TypeLinkPreviewTypeGiftCollection: return UnmarshalLinkPreviewTypeGiftCollection(data) @@ -26230,6 +27813,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -26689,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) @@ -26731,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) @@ -26782,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) @@ -26833,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) @@ -27043,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) @@ -27289,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) @@ -27493,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) @@ -27523,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) @@ -27616,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) @@ -28099,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) @@ -28354,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) @@ -28528,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) @@ -28579,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) @@ -28678,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) @@ -28840,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) @@ -28864,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) @@ -28879,24 +30588,24 @@ 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 TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(data) @@ -28912,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) @@ -28924,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) @@ -28936,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) @@ -28960,9 +30675,18 @@ 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) @@ -28975,15 +30699,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { 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) @@ -29263,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) @@ -29299,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) @@ -29647,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) @@ -29716,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) @@ -29749,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) @@ -29845,9 +31596,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { 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 aec4e7c..1423dab 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -120,13 +120,25 @@ 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 @@ -393,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 @@ -465,7 +477,7 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Ph //@set_id Identifier of the sticker set to which the sticker belongs; 0 if none //@width Sticker width; as defined by the sender //@height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker +//@emoji Emoji corresponding to the sticker; may be empty if unknown //@format Sticker format //@full_type Sticker's full type //@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @@ -511,10 +523,10 @@ voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_resu //@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji; -//@description Describes a user contact +//@description Describes a contact of a user //@phone_number Phone number of the user -//@first_name First name of the user; 1-255 characters in length -//@last_name Last name of the user +//@first_name First name of the user; 1-64 characters +//@last_name Last name of the user; 0-64 characters //@vcard Additional data about the user in a form of vCard; 0-2048 bytes in length //@user_id Identifier of the user, if known; 0 otherwise contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; @@ -544,6 +556,15 @@ venue location:location title:string address:string provider:string id:string ty //@animation Game animation; may be null game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game; +//@description Describes state of the stake dice +//@state_hash 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 +//@stake_toncoin_amount The Toncoin amount that was staked in the previous roll; in the smallest units of the currency +//@suggested_stake_toncoin_amounts The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency +//@current_streak The number of rolled sixes towards the streak; 0-2 +//@prize_per_mille 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 +//@streak_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 +stakeDiceState state_hash:string stake_toncoin_amount:int53 suggested_stake_toncoin_amounts:vector current_streak:int32 prize_per_mille:vector streak_prize_per_mille:int32 = StakeDiceState; + //@description Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App //@short_name Web App short name //@title Web App title @@ -570,7 +591,7 @@ poll id:int64 question:formattedText options:vector total_voter_coun //@id Unique identifier of the alternative video, which is used in the HLS file //@width Video width //@height Video height -//@codec Codec used for video file encoding, for example, "h264", "h265", or "av1" +//@codec Codec used for video file encoding, for example, "h264", "h265", "av1", or "av01" //@hls_file HLS file describing the video //@video File containing the video alternativeVideo id:int64 width:int32 height:int32 codec:string hls_file:file video:file = AlternativeVideo; @@ -657,13 +678,15 @@ userTypeDeleted = UserType; //@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages //@has_main_web_app True, if the bot has the main Web App +//@has_topics True, if the bot has topics +//@allows_users_to_create_topics True, if users can create and delete topics in the chat with the bot //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot //@can_connect_to_business True, if the bot supports connection to Telegram Business accounts //@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu //@active_user_count The number of recently active users of the bot -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool allows_users_to_create_topics:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -709,7 +732,7 @@ chatLocation location:location address:string = ChatLocation; //@description Represents a birthdate of a user @day Day of the month; 1-31 @month Month of the year; 1-12 @year Birth year; 0 if unknown birthdate day:int32 month:int32 year:int32 = Birthdate; -//@description Describes a user that had or will have a birthday soon @user_id User identifier @birthdate Birthdate of the user +//@description Describes a user who had or will have a birthday soon @user_id User identifier @birthdate Birthdate of the user closeBirthdayUser user_id:int53 birthdate:birthdate = CloseBirthdayUser; @@ -762,7 +785,7 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@can_edit_bio True, if the bot can edit bio of the business account //@can_edit_profile_photo True, if the bot can edit profile photo of the business account //@can_edit_username True, if the bot can edit username of the business account -//@can_view_gifts_and_stars True, if the bot can view gifts and amount of Telegram Stars owned by the business account +//@can_view_gifts_and_stars True, if the bot can view gifts and Telegram Star amount owned by the business account //@can_sell_gifts True, if the bot can sell regular gifts received by the business account //@can_change_gift_settings True, if the bot can change gift receiving settings of the business account //@can_transfer_and_upgrade_gifts True, if the bot can transfer and upgrade gifts received by the business account @@ -913,7 +936,7 @@ chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_docum //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_manage_topics True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them @@ -929,20 +952,32 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa //@class GiftResalePrice @description Describes price of a resold gift //@description Describes price of a resold gift in Telegram Stars -//@star_count The amount of Telegram Stars expected to be paid for the gift. Must be in range +//@star_count 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 giftResalePriceStar star_count:int53 = GiftResalePrice; //@description Describes price of a resold gift in Toncoins -//@toncoin_cent_count The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in range +//@toncoin_cent_count 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") giftResalePriceTon toncoin_cent_count:int53 = GiftResalePrice; +//@class GiftPurchaseOfferState @description Describes state of a gift purchase offer + +//@description The offer must be accepted or rejected +giftPurchaseOfferStatePending = GiftPurchaseOfferState; + +//@description The offer was accepted +giftPurchaseOfferStateAccepted = GiftPurchaseOfferState; + +//@description The offer was rejected +giftPurchaseOfferStateRejected = GiftPurchaseOfferState; + + //@class SuggestedPostPrice @description Describes price of a suggested post //@description Describes price of a suggested post in Telegram Stars -//@star_count The amount of Telegram Stars expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") +//@star_count The Telegram Star amount expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") suggestedPostPriceStar star_count:int53 = SuggestedPostPrice; //@description Describes price of a suggested post in Toncoins @@ -988,8 +1023,8 @@ suggestedPostRefundReasonPostDeleted = SuggestedPostRefundReason; suggestedPostRefundReasonPaymentRefunded = SuggestedPostRefundReason; -//@description Describes a possibly non-integer amount of Telegram Stars -//@star_count The integer amount of Telegram Stars rounded to 0 +//@description Describes a possibly non-integer Telegram Star amount +//@star_count The integer Telegram Star amount rounded to 0 //@nanostar_count The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 starAmount star_count:int53 nanostar_count:int32 = StarAmount; @@ -1011,7 +1046,7 @@ starSubscriptionTypeBot is_canceled_by_bot:Bool title:string photo:photo invoice //@description Describes subscription plan paid in Telegram Stars //@period The number of seconds between consecutive Telegram Star debiting -//@star_count The amount of Telegram Stars that must be paid for each period +//@star_count The Telegram Star amount that must be paid for each period starSubscriptionPricing period:int32 star_count:int53 = StarSubscriptionPricing; //@description Contains information about subscription to a channel chat, a bot, or a business account that was paid in Telegram Stars @@ -1072,7 +1107,7 @@ affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_ //@description Contains information about an affiliate that received commission from a Telegram Star transaction //@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner //@affiliate_chat_id Identifier of the chat which received the commission -//@star_amount The amount of Telegram Stars that were received by the affiliate; can be negative for refunds +//@star_amount The Telegram Star amount that was received by the affiliate; can be negative for refunds affiliateInfo commission_per_mille:int32 affiliate_chat_id:int53 star_amount:starAmount = AffiliateInfo; //@description Describes a found affiliate program @@ -1094,7 +1129,7 @@ foundAffiliatePrograms total_count:int32 programs:vector //@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore //@user_count The number of users that used the affiliate program //@revenue_star_count The number of Telegram Stars that were earned by the affiliate program -connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int64 = ConnectedAffiliateProgram; +connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int53 = ConnectedAffiliateProgram; //@description Represents a list of affiliate programs that were connected to an affiliate //@total_count The total number of affiliate programs that were connected to the affiliate @@ -1129,7 +1164,7 @@ premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is //@description Describes an option for gifting Telegram Premium to a user. Use telegramPaymentPurposePremiumGift for out-of-store payments or payments in Telegram Stars //@currency ISO 4217 currency code for the payment //@amount The amount to pay, in the smallest units of the currency -//@star_count The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible +//@star_count The alternative Telegram Star amount to pay; 0 if payment in Telegram Stars is not possible //@discount_percentage The discount associated with this option, as a percentage //@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option @@ -1152,14 +1187,15 @@ premiumGiveawayPaymentOption currency:string amount:int53 winner_count:int32 mon premiumGiveawayPaymentOptions options:vector = PremiumGiveawayPaymentOptions; //@description Contains information about a Telegram Premium gift code -//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used +//@creator_id 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 //@creation_date Point in time (Unix timestamp) when the code was created //@is_from_giveaway True, if the gift code was created for a giveaway -//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message -//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; may be 0 or an identifier of a deleted message +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active after code activation //@user_id Identifier of a user for which the code was created; 0 if none //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none -premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; +premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 day_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; //@description Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments //@currency ISO 4217 currency code for the payment @@ -1197,8 +1233,9 @@ starGiveawayPaymentOptions options:vector = StarGivea //@unlimited_gifts True, if unlimited regular gifts are accepted //@limited_gifts True, if limited regular gifts are accepted //@upgraded_gifts True, if upgraded gifts and regular gifts that can be upgraded for free are accepted +//@gifts_from_channels True, if gifts from channels are accepted subject to other restrictions //@premium_subscription True, if Telegram Premium subscription is accepted -acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool premium_subscription:Bool = AcceptedGiftTypes; +acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool gifts_from_channels:Bool premium_subscription:Bool = AcceptedGiftTypes; //@description Contains settings for gift receiving for a user //@show_gift_button True, if a button for sending a gift to the user or by the user must always be shown in the input field @@ -1206,6 +1243,18 @@ acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool pr giftSettings show_gift_button:Bool accepted_gift_types:acceptedGiftTypes = GiftSettings; +//@description Describes an auction on which a gift can be purchased +//@id Identifier of the auction +//@gifts_per_round Number of gifts distributed in each round +//@start_date Point in time (Unix timestamp) when the auction will start +giftAuction id:string gifts_per_round:int32 start_date:int32 = GiftAuction; + +//@description Describes background of a gift +//@center_color Center color in RGB format +//@edge_color Edge color in RGB format +//@text_color Text color in RGB format +giftBackground center_color:int32 edge_color:int32 text_color:int32 = GiftBackground; + //@description Describes the maximum number of times that a specific gift can be purchased //@total_count The maximum number of times the gifts can be purchased //@remaining_count Number of remaining times the gift can be purchased @@ -1240,30 +1289,59 @@ canSendGiftResultFail reason:formattedText = CanSendGiftResult; //@class UpgradedGiftOrigin @description Describes origin from which the upgraded gift was obtained //@description The gift was obtained by upgrading of a previously received gift -//@gift_message_id Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message +//@gift_message_id Identifier of the message with the regular gift that was upgraded; may be 0 or an identifier of a deleted message upgradedGiftOriginUpgrade gift_message_id:int53 = UpgradedGiftOrigin; //@description The gift was transferred from another owner upgradedGiftOriginTransfer = UpgradedGiftOrigin; -//@description The gift was bought from another user @price Price paid by the sender for the gift +//@description The gift was bought from another user @price Price paid for the gift upgradedGiftOriginResale price:GiftResalePrice = UpgradedGiftOrigin; +//@description 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 +upgradedGiftOriginBlockchain = UpgradedGiftOrigin; + //@description The sender or receiver of the message has paid for upgraid of the gift, which has been completed upgradedGiftOriginPrepaidUpgrade = UpgradedGiftOrigin; +//@description The gift was bought through an offer @price Price paid for the gift +upgradedGiftOriginOffer price:GiftResalePrice = UpgradedGiftOrigin; + +//@description The gift was crafted from other gifts +upgradedGiftOriginCraft = UpgradedGiftOrigin; + + +//@class UpgradedGiftAttributeRarity @description Describes rarity of an upgraded gift attribute + +//@description The rarity is represented as the numeric frequence of the model +//@per_mille The number of upgraded gifts that receive this attribute for each 1000 gifts upgraded; if 0, then it can be shown as "<0.1%" +upgradedGiftAttributeRarityPerMille per_mille:int32 = UpgradedGiftAttributeRarity; + +//@description The attribute is uncommon +upgradedGiftAttributeRarityUncommon = UpgradedGiftAttributeRarity; + +//@description The attribute is rare +upgradedGiftAttributeRarityRare = UpgradedGiftAttributeRarity; + +//@description The attribute is epic +upgradedGiftAttributeRarityEpic = UpgradedGiftAttributeRarity; + +//@description The attribute is legendary +upgradedGiftAttributeRarityLegendary = UpgradedGiftAttributeRarity; + //@description Describes a model of an upgraded gift //@name Name of the model //@sticker The sticker representing the upgraded gift -//@rarity_per_mille The number of upgraded gifts that receive this model for each 1000 gifts upgraded -upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel; +//@rarity The rarity of the model +//@is_crafted True, if the model can be obtained only through gift crafting +upgradedGiftModel name:string sticker:sticker rarity:UpgradedGiftAttributeRarity is_crafted:Bool = UpgradedGiftModel; //@description Describes a symbol shown on the pattern of an upgraded gift //@name Name of the symbol //@sticker The sticker representing the symbol -//@rarity_per_mille The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded -upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol; +//@rarity The rarity of the symbol +upgradedGiftSymbol name:string sticker:sticker rarity:UpgradedGiftAttributeRarity = UpgradedGiftSymbol; //@description Describes colors of a backdrop of an upgraded gift //@center_color A color in the center of the backdrop in the RGB format @@ -1276,8 +1354,8 @@ upgradedGiftBackdropColors center_color:int32 edge_color:int32 symbol_color:int3 //@id Unique identifier of the backdrop //@name Name of the backdrop //@colors Colors of the backdrop -//@rarity_per_mille The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded -upgradedGiftBackdrop id:int32 name:string colors:upgradedGiftBackdropColors rarity_per_mille:int32 = UpgradedGiftBackdrop; +//@rarity The rarity of the backdrop +upgradedGiftBackdrop id:int32 name:string colors:upgradedGiftBackdropColors rarity:UpgradedGiftAttributeRarity = UpgradedGiftBackdrop; //@description Describes the original details about the gift //@sender_id Identifier of the user or the chat that sent the gift; may be null if the gift was private @@ -1286,6 +1364,16 @@ upgradedGiftBackdrop id:int32 name:string colors:upgradedGiftBackdropColors rari //@date Point in time (Unix timestamp) when the gift was sent upgradedGiftOriginalDetails sender_id:MessageSender receiver_id:MessageSender text:formattedText date:int32 = UpgradedGiftOriginalDetails; +//@description Contains information about color scheme for user's name, background of empty chat photo, replies to messages and link previews +//@id Unique identifier of the upgraded gift colors +//@model_custom_emoji_id Custom emoji identifier of the model of the upgraded gift +//@symbol_custom_emoji_id Custom emoji identifier of the symbol of the upgraded gift +//@light_theme_accent_color Accent color to use in light themes in RGB format +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_accent_color Accent color to use in dark themes in RGB format +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +upgradedGiftColors id:int64 model_custom_emoji_id:int64 symbol_custom_emoji_id:int64 light_theme_accent_color:int32 light_theme_colors:vector dark_theme_accent_color:int32 dark_theme_colors:vector = UpgradedGiftColors; + //@description Describes a gift that can be sent to another user or channel chat //@id Unique identifier of the gift //@publisher_chat_id Identifier of the chat that published the gift; 0 if none @@ -1293,15 +1381,19 @@ upgradedGiftOriginalDetails sender_id:MessageSender receiver_id:MessageSender te //@star_count Number of Telegram Stars that must be paid for the gift //@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed //@upgrade_star_count Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible +//@upgrade_variant_count Number of unique gift variants that are available for the upgraded gift; 0 if unknown +//@has_colors True, if the gift can be used to customize the user's name, and backgrounds of profile photo, reply header, and link preview //@is_for_birthday True, if the gift is a birthday gift //@is_premium True, if the gift can be bought only by Telegram Premium subscribers -//@next_send_date Point in time (Unix timestamp) when the gift can be sent next time by the current user; can be 0 or a date in the past. +//@auction_info Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly +//@next_send_date 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 //@user_limits Number of times the gift can be purchased by the current user; may be null if not limited //@overall_limits Number of times the gift can be purchased all users; may be null if not limited +//@background Background of the gift //@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only -gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 is_for_birthday:Bool is_premium:Bool next_send_date:int32 user_limits:giftPurchaseLimits overall_limits:giftPurchaseLimits first_send_date:int32 last_send_date:int32 = Gift; +gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 upgrade_variant_count:int32 has_colors:Bool is_for_birthday:Bool is_premium:Bool auction_info:giftAuction next_send_date:int32 user_limits:giftPurchaseLimits overall_limits:giftPurchaseLimits background:giftBackground first_send_date:int32 last_send_date:int32 = Gift; //@description Describes an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT //@id Unique identifier of the gift @@ -1312,9 +1404,12 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@number Unique number of the upgraded gift among gifts upgraded from the same gift //@total_upgraded_count Total number of gifts that were upgraded from the same gift //@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift +//@is_burned True, if the gift was used to craft another gift +//@is_crafted True, if the gift was craft from another gifts //@is_premium True, if the original gift could have been bought only by Telegram Premium subscribers //@is_theme_available True, if the gift can be used to set a theme in a chat //@used_theme_chat_id 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 +//@host_id Identifier of the user or the chat to which the upgraded gift was assigned from blockchain; may be null if none or unknown //@owner_id Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown //@owner_address 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 //@owner_name Name of the owner for the case when owner identifier and address aren't known @@ -1323,17 +1418,21 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@symbol Symbol of the upgraded gift //@backdrop Backdrop of the upgraded gift //@original_details Information about the originally sent gift; may be null if unknown +//@colors 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 //@resale_parameters Resale parameters of the gift; may be null if resale isn't possible +//@can_send_purchase_offer True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer +//@craft_probability_per_mille 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 //@value_currency ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable //@value_amount Estimated value of the gift; in the smallest units of the currency; 0 if unavailable -upgradedGift id:int64 regular_gift_id:int64 publisher_chat_id:int53 title:string name:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 is_premium:Bool is_theme_available:Bool used_theme_chat_id:int53 owner_id:MessageSender owner_address:string owner_name:string gift_address:string model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails resale_parameters:giftResaleParameters value_currency:string value_amount:int53 = UpgradedGift; +//@value_usd_amount Estimated value of the gift in USD; in USD cents; 0 if unavailable +upgradedGift id:int64 regular_gift_id:int64 publisher_chat_id:int53 title:string name:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 is_burned:Bool is_crafted:Bool is_premium:Bool is_theme_available:Bool used_theme_chat_id:int53 host_id:MessageSender owner_id:MessageSender owner_address:string owner_name:string gift_address:string model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails colors:upgradedGiftColors resale_parameters:giftResaleParameters can_send_purchase_offer:Bool craft_probability_per_mille:int32 value_currency:string value_amount:int53 value_usd_amount:int53 = UpgradedGift; //@description Contains information about value of an upgraded gift //@currency ISO 4217 currency code of the currency in which the prices are represented //@value Estimated value of the gift; in the smallest units of the currency //@is_value_average True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift //@initial_sale_date Point in time (Unix timestamp) when the corresponding regular gift was originally purchased -//@initial_sale_star_count Amount of Telegram Stars that were paid for the gift +//@initial_sale_star_count The Telegram Star amount that was paid for the gift //@initial_sale_price Initial price of the gift; in the smallest units of the currency //@last_sale_date Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never //@last_sale_price Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold @@ -1351,10 +1450,29 @@ upgradedGiftValueInfo currency:string value:int53 is_value_average:Bool initial_ //@is_saved True, if the gift is displayed on the user's or the channel's profile page //@can_be_transferred True, if the gift can be transferred to another owner //@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift +//@drop_original_details_star_count Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available //@next_transfer_date 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 //@next_resale_date 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 //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past -upgradeGiftResult gift:upgradedGift received_gift_id:string is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 = UpgradeGiftResult; +upgradeGiftResult gift:upgradedGift received_gift_id:string is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 = UpgradeGiftResult; + + +//@class CraftGiftResult @description Contains result of gift crafting + +//@description Crafting was successful +//@gift The created gift +//@received_gift_id Unique identifier of the received gift for the current user +craftGiftResultSuccess gift:upgradedGift received_gift_id:string = CraftGiftResult; + +//@description Crafting isn't possible because one of the gifts can't be used for crafting yet @retry_after Time left before the gift can be used for crafting +craftGiftResultTooEarly retry_after:int32 = CraftGiftResult; + +//@description Crafting isn't possible because one of the gifts isn't suitable for crafting +craftGiftResultInvalidGift = CraftGiftResult; + +//@description Crafting has failed +craftGiftResultFail = CraftGiftResult; + //@description Describes a gift that is available for purchase //@gift The gift @@ -1367,6 +1485,12 @@ availableGift gift:gift resale_count:int32 min_resale_star_count:int53 title:str availableGifts gifts:vector = AvailableGifts; +//@description Describes a price required to pay to upgrade a gift +//@date Point in time (Unix timestamp) when the price will be in effect +//@star_count The Telegram Star amount required to pay to upgrade the gift +giftUpgradePrice date:int32 star_count:int53 = GiftUpgradePrice; + + //@class UpgradedGiftAttributeId @description Contains identifier of an upgraded gift attribute to search for //@description Identifier of a gift model @sticker_id Identifier of the sticker representing the model @@ -1419,7 +1543,8 @@ giftsForResale total_count:int32 gifts:vector models:vector sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool transfer_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 prepaid_upgrade_hash:string = ReceivedGift; +//@craft_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 +receivedGift received_gift_id:string sender_id:MessageSender text:formattedText unique_gift_number:int32 is_private:Bool is_saved:Bool is_pinned:Bool can_be_upgraded:Bool can_be_transferred:Bool was_refunded:Bool date:int32 gift:SentGift collection_ids:vector sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 prepaid_upgrade_hash:string craft_date:int32 = ReceivedGift; //@description Represents a list of gifts received by a user or a chat //@total_count The total number of received gifts @@ -1464,11 +1592,103 @@ receivedGift received_gift_id:string sender_id:MessageSender text:formattedText //@next_offset The offset for the next request. If empty, then there are no more results receivedGifts total_count:int32 gifts:vector are_notifications_enabled:Bool next_offset:string = ReceivedGifts; +//@description Describes chance of the crafted gift to have the backdrop or symbol of one of the original gifts +//@persistence_chance_per_mille 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 +attributeCraftPersistenceProbability persistence_chance_per_mille:vector = AttributeCraftPersistenceProbability; + +//@description Represents a list of gifts received by a user or a chat +//@total_count The total number of received gifts +//@gifts The list of gifts +//@attribute_persistence_probabilities 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 +//@next_offset The offset for the next request. If empty, then there are no more results +giftsForCrafting total_count:int32 gifts:vector attribute_persistence_probabilities:vector next_offset:string = GiftsForCrafting; + //@description Contains examples of possible upgraded gifts for the given regular gift //@models Examples of possible models that can be chosen for the gift after upgrade //@symbols Examples of possible symbols that can be chosen for the gift after upgrade //@backdrops Examples of possible backdrops that can be chosen for the gift after upgrade -giftUpgradePreview models:vector symbols:vector backdrops:vector = GiftUpgradePreview; +//@prices Examples of price for gift upgrade from the maximum price to the minimum price +//@next_prices Next changes for the price for gift upgrade with more granularity than in prices +giftUpgradePreview models:vector symbols:vector backdrops:vector prices:vector next_prices:vector = GiftUpgradePreview; + +//@description Contains all possible variants of upgraded gifts for the given regular gift +//@models Models that can be chosen for the gift after upgrade +//@symbols Symbols that can be chosen for the gift after upgrade +//@backdrops Backdrops that can be chosen for the gift after upgrade +giftUpgradeVariants models:vector symbols:vector backdrops:vector = GiftUpgradeVariants; + + +//@description Describes a bid in an auction +//@star_count The number of Telegram Stars that were put in the bid +//@bid_date Point in time (Unix timestamp) when the bid was made +//@position Position of the bid in the list of all bids +auctionBid star_count:int53 bid_date:int32 position:int32 = AuctionBid; + +//@description Describes a bid of the current user in an auction +//@star_count The number of Telegram Stars that were put in the bid +//@bid_date Point in time (Unix timestamp) when the bid was made +//@next_bid_star_count The minimum number of Telegram Stars that can be put for the next bid +//@owner_id 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 +//@was_returned True, if the bid was returned to the user, because it was outbid and can't win anymore +userAuctionBid star_count:int53 bid_date:int32 next_bid_star_count:int53 owner_id:MessageSender was_returned:Bool = UserAuctionBid; + +//@description Describes a round of an auction +//@number 1-based number of the round +//@duration Duration of the round, in seconds +//@extend_time The number of seconds for which the round will be extended if there are changes in the top winners +//@top_winner_count The number of top winners who trigger round extension if changed +auctionRound number:int32 duration:int32 extend_time:int32 top_winner_count:int32 = AuctionRound; + + +//@class AuctionState @description Describes state of an auction + +//@description Contains information about an ongoing or scheduled auction +//@start_date Point in time (Unix timestamp) when the auction started or will start +//@end_date Point in time (Unix timestamp) when the auction will be ended +//@min_bid The minimum possible bid in the auction in Telegram Stars +//@bid_levels A sparse list of bids that were made in the auction +//@top_bidder_user_ids User identifiers of at most 3 users with the biggest bids +//@rounds Rounds of the auction in which their duration or extension rules are changed +//@current_round_end_date Point in time (Unix timestamp) when the current round will end +//@current_round_number 1-based number of the current round +//@total_round_count The total number of rounds +//@distributed_item_count The number of items that were purchased on the auction by all users +//@left_item_count The number of items that have to be distributed on the auction +//@acquired_item_count The number of items that were purchased by the current user on the auction +//@user_bid Bid of the current user in the auction; may be null if none +auctionStateActive start_date:int32 end_date:int32 min_bid:int53 bid_levels:vector top_bidder_user_ids:vector rounds:vector current_round_end_date:int32 current_round_number:int32 total_round_count:int32 distributed_item_count:int32 left_item_count:int32 acquired_item_count:int32 user_bid:userAuctionBid = AuctionState; + +//@description Contains information about a finished auction +//@start_date Point in time (Unix timestamp) when the auction started +//@end_date Point in time (Unix timestamp) when the auction will be ended +//@average_price Average price of bought items in Telegram Stars +//@acquired_item_count The number of items that were purchased by the current user on the auction +//@telegram_listed_item_count Number of items from the auction being resold on Telegram +//@fragment_listed_item_count Number of items from the auction being resold on Fragment +//@fragment_url The HTTPS link to the Fragment for the resold items; may be empty if there are no such items being sold on Fragment +auctionStateFinished start_date:int32 end_date:int32 average_price:int53 acquired_item_count:int32 telegram_listed_item_count:int32 fragment_listed_item_count:int32 fragment_url:string = AuctionState; + + +//@description Represent auction state of a gift +//@gift The gift +//@state Auction state of the gift +giftAuctionState gift:gift state:AuctionState = GiftAuctionState; + +//@description Represents a gift that was acquired by the current user on an auction +//@receiver_id Receiver of the gift +//@date Point in time (Unix timestamp) when the gift was acquired +//@star_count The number of Telegram Stars that were paid for the gift +//@auction_round_number Identifier of the auction round in which the gift was acquired +//@auction_round_position Position of the user in the round among all auction participants +//@unique_gift_number Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned +//@text Message added to the gift +//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them +giftAuctionAcquiredGift receiver_id:MessageSender date:int32 star_count:int53 auction_round_number:int32 auction_round_position:int32 unique_gift_number:int32 text:formattedText is_private:Bool = GiftAuctionAcquiredGift; + +//@description Represents a list of gifts that were acquired by the current user on an auction @gifts The list of acquired gifts +giftAuctionAcquiredGifts gifts:vector = GiftAuctionAcquiredGifts; //@class TransactionDirection @description Describes direction of transactions in a transaction list @@ -1482,169 +1702,197 @@ transactionDirectionOutgoing = TransactionDirection; //@class StarTransactionType @description Describes type of transaction with Telegram Stars -//@description The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only +//@description The transaction is a deposit of Telegram Stars from the Premium bot; relevant for regular users only starTransactionTypePremiumBotDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from App Store; for regular users only +//@description The transaction is a deposit of Telegram Stars from App Store; relevant for regular users only starTransactionTypeAppStoreDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from Google Play; for regular users only +//@description The transaction is a deposit of Telegram Stars from Google Play; relevant for regular users only starTransactionTypeGooglePlayDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only +//@description The transaction is a deposit of Telegram Stars from Fragment; relevant for regular users and bots only starTransactionTypeFragmentDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars by another user; for regular users only -//@user_id Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous +//@description The transaction is a deposit of Telegram Stars by another user; relevant for regular users only +//@user_id Identifier of the user who gifted Telegram Stars; 0 if the user was anonymous //@sticker The sticker to be shown in the transaction information; may be null if unknown starTransactionTypeUserDeposit user_id:int53 sticker:sticker = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from a giveaway; for regular users only +//@description The transaction is a deposit of Telegram Stars from a giveaway; relevant for regular users only //@chat_id Identifier of a supergroup or a channel chat that created the giveaway -//@giveaway_message_id Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message +//@giveaway_message_id Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message starTransactionTypeGiveawayDeposit chat_id:int53 giveaway_message_id:int53 = StarTransactionType; -//@description The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only +//@description The transaction is a withdrawal of earned Telegram Stars to Fragment; relevant for regular users, bots, supergroup and channel chats only //@withdrawal_state State of the withdrawal; may be null for refunds from Fragment starTransactionTypeFragmentWithdrawal withdrawal_state:RevenueWithdrawalState = StarTransactionType; -//@description The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only +//@description The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; relevant for bots and channel chats only starTransactionTypeTelegramAdsWithdrawal = StarTransactionType; -//@description The transaction is a payment for Telegram API usage; for bots only @request_count The number of billed requests +//@description The transaction is a payment for Telegram API usage; relevant for bots only @request_count The number of billed requests starTransactionTypeTelegramApiUsage request_count:int32 = StarTransactionType; -//@description The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only -//@user_id Identifier of the bot or the business account user that sent the paid media +//@description The transaction is a purchase of paid media from a bot or a business account by the current user; relevant for regular users only +//@user_id Identifier of the bot or the business account user who sent the paid media //@media The bought media if the transaction wasn't refunded starTransactionTypeBotPaidMediaPurchase user_id:int53 media:vector = StarTransactionType; -//@description The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only -//@user_id Identifier of the user that bought the media +//@description The transaction is a sale of paid media by the bot or a business account managed by the bot; relevant for bots only +//@user_id Identifier of the user who bought the media //@media The bought media //@payload Bot-provided payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotPaidMediaSale user_id:int53 media:vector payload:string affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a purchase of paid media from a channel by the current user; for regular users only +//@description The transaction is a purchase of paid media from a channel by the current user; relevant for regular users only //@chat_id Identifier of the channel chat that sent the paid media -//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@message_id Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message //@media The bought media if the transaction wasn't refunded starTransactionTypeChannelPaidMediaPurchase chat_id:int53 message_id:int53 media:vector = StarTransactionType; -//@description The transaction is a sale of paid media by the channel chat; for channel chats only -//@user_id Identifier of the user that bought the media -//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@description The transaction is a sale of paid media by the channel chat; relevant for channel chats only +//@user_id Identifier of the user who bought the media +//@message_id Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message //@media The bought media starTransactionTypeChannelPaidMediaSale user_id:int53 message_id:int53 media:vector = StarTransactionType; -//@description The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only -//@user_id Identifier of the bot or the business account user that created the invoice +//@description The transaction is a purchase of a product from a bot or a business account by the current user; relevant for regular users only +//@user_id Identifier of the bot or the business account user who created the invoice //@product_info Information about the bought product starTransactionTypeBotInvoicePurchase user_id:int53 product_info:productInfo = StarTransactionType; -//@description The transaction is a sale of a product by the bot; for bots only -//@user_id Identifier of the user that bought the product +//@description The transaction is a sale of a product by the bot; relevant for bots only +//@user_id Identifier of the user who bought the product //@product_info Information about the bought product //@invoice_payload Invoice payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotInvoiceSale user_id:int53 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only -//@user_id Identifier of the bot or the business account user that created the subscription link +//@description The transaction is a purchase of a subscription from a bot or a business account by the current user; relevant for regular users only +//@user_id Identifier of the bot or the business account user who created the subscription link //@subscription_period The number of seconds between consecutive Telegram Star debitings //@product_info Information about the bought subscription starTransactionTypeBotSubscriptionPurchase user_id:int53 subscription_period:int32 product_info:productInfo = StarTransactionType; -//@description The transaction is a sale of a subscription by the bot; for bots only -//@user_id Identifier of the user that bought the subscription +//@description The transaction is a sale of a subscription by the bot; relevant for bots only +//@user_id Identifier of the user who bought the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings //@product_info Information about the bought subscription //@invoice_payload Invoice payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotSubscriptionSale user_id:int53 subscription_period:int32 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only +//@description The transaction is a purchase of a subscription to a channel chat by the current user; relevant for regular users only //@chat_id Identifier of the channel chat that created the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings starTransactionTypeChannelSubscriptionPurchase chat_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a sale of a subscription by the channel chat; for channel chats only -//@user_id Identifier of the user that bought the subscription +//@description The transaction is a sale of a subscription by the channel chat; relevant for channel chats only +//@user_id Identifier of the user who bought the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a purchase of a regular gift; for regular users and bots only @owner_id Identifier of the user or the channel that received the gift @gift The gift +//@description The transaction is a bid on a gift auction; relevant for regular users only @owner_id Identifier of the user who will receive the gift @gift The gift +starTransactionTypeGiftAuctionBid owner_id:MessageSender gift:gift = StarTransactionType; + +//@description The transaction is a purchase of a regular gift; relevant for regular users and bots only @owner_id Identifier of the user or the channel that received the gift @gift The gift starTransactionTypeGiftPurchase owner_id:MessageSender gift:gift = StarTransactionType; -//@description The transaction is a transfer of an upgraded gift; for regular users only @owner_id Identifier of the user or the channel that received the gift @gift The gift +//@description The transaction is an offer of gift purchase; relevant for regular users only @gift The gift +starTransactionTypeGiftPurchaseOffer gift:upgradedGift = StarTransactionType; + +//@description The transaction is a transfer of an upgraded gift; relevant for regular users only @owner_id Identifier of the user or the channel that received the gift @gift The gift starTransactionTypeGiftTransfer owner_id:MessageSender gift:upgradedGift = StarTransactionType; -//@description The transaction is a sale of a received gift; for regular users and channel chats only @user_id Identifier of the user that sent the gift @gift The gift +//@description The transaction is a drop of original details of an upgraded gift; relevant for regular users only @owner_id Identifier of the user or the channel that owns the gift @gift The gift +starTransactionTypeGiftOriginalDetailsDrop owner_id:MessageSender gift:upgradedGift = StarTransactionType; + +//@description The transaction is a sale of a received gift; relevant for regular users and channel chats only @user_id Identifier of the user who sent the gift @gift The gift starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; -//@description The transaction is an upgrade of a gift; for regular users only @user_id Identifier of the user that initially sent the gift @gift The upgraded gift +//@description The transaction is an upgrade of a gift; relevant for regular users only @user_id Identifier of the user who initially sent the gift @gift The upgraded gift starTransactionTypeGiftUpgrade user_id:int53 gift:upgradedGift = StarTransactionType; -//@description The transaction is a purchase of an upgrade of a gift owned by another user or channel; for regular users only @owner_id Owner of the upgraded gift @gift The gift +//@description The transaction is a purchase of an upgrade of a gift owned by another user or channel; relevant for regular users only @owner_id Owner of the upgraded gift @gift The gift starTransactionTypeGiftUpgradePurchase owner_id:MessageSender gift:gift = StarTransactionType; -//@description The transaction is a purchase of an upgraded gift for some user or channel; for regular users only @user_id Identifier of the user that sold the gift @gift The gift +//@description The transaction is a purchase of an upgraded gift for some user or channel; relevant for regular users only @user_id Identifier of the user who sold the gift @gift The gift starTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = StarTransactionType; -//@description The transaction is a sale of an upgraded gift; for regular users only -//@user_id Identifier of the user that bought the gift +//@description The transaction is a sale of an upgraded gift; relevant for regular users only +//@user_id Identifier of the user who bought the gift //@gift The gift //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds -starTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds +//@via_offer True, if the gift was sold through a purchase offer +starTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_star_amount:starAmount via_offer:Bool = StarTransactionType; -//@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only +//@description 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 //@chat_id Identifier of the channel chat -//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +//@message_id Identifier of the reacted message; may be 0 or an identifier of a deleted message starTransactionTypeChannelPaidReactionSend chat_id:int53 message_id:int53 = StarTransactionType; -//@description The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only -//@user_id Identifier of the user that added the paid reaction -//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +//@description The transaction is a receiving of a paid reaction to a message by the channel chat; relevant for channel chats only +//@user_id Identifier of the user who added the paid reaction +//@message_id Identifier of the reacted message; may be 0 or an identifier of a deleted message starTransactionTypeChannelPaidReactionReceive user_id:int53 message_id:int53 = StarTransactionType; -//@description The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only +//@description The transaction is a receiving of a commission from an affiliate program; relevant for regular users, bots and channel chats only //@chat_id Identifier of the chat that created the affiliate program //@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner starTransactionTypeAffiliateProgramCommission chat_id:int53 commission_per_mille:int32 = StarTransactionType; -//@description The transaction is a sending of a paid message; for regular users only @chat_id Identifier of the chat that received the payment @message_count Number of sent paid messages +//@description The transaction is a sending of a paid message; relevant for regular users only @chat_id Identifier of the chat that received the payment @message_count Number of sent paid messages starTransactionTypePaidMessageSend chat_id:int53 message_count:int32 = StarTransactionType; -//@description The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only +//@description The transaction is a receiving of a paid message; relevant for regular users, supergroup and channel chats only //@sender_id Identifier of the sender of the message //@message_count Number of received paid messages //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds starTransactionTypePaidMessageReceive sender_id:MessageSender message_count:int32 commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; -//@description The transaction is a payment for a suggested post; for regular users only +//@description The transaction is a sending of a paid group call message; relevant for regular users only @chat_id Identifier of the chat that received the payment +starTransactionTypePaidGroupCallMessageSend chat_id:int53 = StarTransactionType; + +//@description The transaction is a receiving of a paid group call message; relevant for regular users and channel chats only +//@sender_id Identifier of the sender of the message +//@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds +starTransactionTypePaidGroupCallMessageReceive sender_id:MessageSender commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; + +//@description The transaction is a sending of a paid group reaction; relevant for regular users only @chat_id Identifier of the chat that received the payment +starTransactionTypePaidGroupCallReactionSend chat_id:int53 = StarTransactionType; + +//@description The transaction is a receiving of a paid group call reaction; relevant for regular users and channel chats only +//@sender_id Identifier of the sender of the reaction +//@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for reaction sending +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds +starTransactionTypePaidGroupCallReactionReceive sender_id:MessageSender commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; + +//@description The transaction is a payment for a suggested post; relevant for regular users only //@chat_id Identifier of the channel chat that posted the post starTransactionTypeSuggestedPostPaymentSend chat_id:int53 = StarTransactionType; -//@description The transaction is a receiving of a payment for a suggested post by the channel chat; for channel chats only -//@user_id Identifier of the user that paid for the suggested post +//@description The transaction is a receiving of a payment for a suggested post by the channel chat; relevant for channel chats only +//@user_id Identifier of the user who paid for the suggested post starTransactionTypeSuggestedPostPaymentReceive user_id:int53 = StarTransactionType; -//@description The transaction is a purchase of Telegram Premium subscription; for regular users and bots only -//@user_id Identifier of the user that received the Telegram Premium subscription +//@description The transaction is a purchase of Telegram Premium subscription; relevant for regular users and bots only +//@user_id Identifier of the user who received the Telegram Premium subscription //@month_count Number of months the Telegram Premium subscription will be active //@sticker A sticker to be shown in the transaction information; may be null if unknown starTransactionTypePremiumPurchase user_id:int53 month_count:int32 sticker:sticker = StarTransactionType; -//@description The transaction is a transfer of Telegram Stars to a business bot; for regular users only @user_id Identifier of the bot that received Telegram Stars +//@description The transaction is a transfer of Telegram Stars to a business bot; relevant for regular users only @user_id Identifier of the bot that received Telegram Stars starTransactionTypeBusinessBotTransferSend user_id:int53 = StarTransactionType; -//@description The transaction is a transfer of Telegram Stars from a business account; for bots only @user_id Identifier of the user that sent Telegram Stars +//@description The transaction is a transfer of Telegram Stars from a business account; relevant for bots only @user_id Identifier of the user who sent Telegram Stars starTransactionTypeBusinessBotTransferReceive user_id:int53 = StarTransactionType; -//@description The transaction is a payment for search of posts in public Telegram channels; for regular users only +//@description The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only starTransactionTypePublicPostSearch = StarTransactionType; //@description The transaction is a transaction of an unsupported type @@ -1673,18 +1921,31 @@ starTransactions star_amount:starAmount transactions:vector nex //@sticker The sticker to be shown in the transaction information; may be null if unknown tonTransactionTypeFragmentDeposit is_gift:Bool sticker:sticker = TonTransactionType; +//@description The transaction is a withdrawal of earned Toncoins to Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment +tonTransactionTypeFragmentWithdrawal withdrawal_state:RevenueWithdrawalState = TonTransactionType; + //@description The transaction is a payment for a suggested post @chat_id Identifier of the channel chat that posted the post tonTransactionTypeSuggestedPostPayment chat_id:int53 = TonTransactionType; -//@description The transaction is a purchase of an upgraded gift for some user or channel; for regular users only @user_id Identifier of the user that sold the gift @gift The gift +//@description The transaction is an offer of gift purchase @gift The gift +tonTransactionTypeGiftPurchaseOffer gift:upgradedGift = TonTransactionType; + +//@description The transaction is a purchase of an upgraded gift for some user or channel @user_id Identifier of the user who sold the gift @gift The gift tonTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = TonTransactionType; -//@description The transaction is a sale of an upgraded gift; for regular users only -//@user_id Identifier of the user that bought the gift +//@description The transaction is a sale of an upgraded gift +//@user_id Identifier of the user who bought the gift //@gift The gift //@commission_per_mille The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift -//@commission_toncoin_amount The amount of Toncoins that were received by the Telegram; in the smallest units of the currency -tonTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_toncoin_amount:int53 = TonTransactionType; +//@commission_toncoin_amount The Toncoin amount that was received by the Telegram; in the smallest units of the currency +//@via_offer True, if the gift was sold through a purchase offer +tonTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_toncoin_amount:int53 via_offer:Bool = TonTransactionType; + +//@description The transaction is a payment for stake dice throw +tonTransactionTypeStakeDiceStake = TonTransactionType; + +//@description The transaction is a payment for successful stake dice throw +tonTransactionTypeStakeDicePayout = TonTransactionType; //@description The transaction is a transaction of an unsupported type tonTransactionTypeUnsupported = TonTransactionType; @@ -1705,6 +1966,18 @@ tonTransaction id:string ton_amount:int53 is_refund:Bool date:int32 type:TonTran tonTransactions ton_amount:int53 transactions:vector next_offset:string = TonTransactions; +//@class ActiveStoryState @description Describes state of active stories posted by a chat + +//@description The chat has an active live story @story_id Identifier of the active live story +activeStoryStateLive story_id:int32 = ActiveStoryState; + +//@description The chat has some unread active stories +activeStoryStateUnread = ActiveStoryState; + +//@description The chat has active stories, all of which were read +activeStoryStateRead = ActiveStoryState; + + //@class GiveawayParticipantStatus @description Contains information about status of a user in a giveaway //@description The user is eligible for the giveaway @@ -1740,7 +2013,7 @@ giveawayInfoOngoing creation_date:int32 status:GiveawayParticipantStatus is_ende //@winner_count Number of winners in the giveaway //@activation_count Number of winners, which activated their gift codes; for Telegram Premium giveaways only //@gift_code 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 -//@won_star_count 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 +//@won_star_count 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 giveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool is_winner:Bool winner_count:int32 activation_count:int32 gift_code:string won_star_count:int53 = GiveawayInfo; @@ -1824,8 +2097,9 @@ emojiStatusCustomEmojis custom_emoji_ids:vector = EmojiStatusCustomEmojis //@description Describes usernames assigned to a user, a supergroup, or a channel //@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames //@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive -//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo -usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; +//@editable_username Active or disabled username, which may be changed with setUsername or setSupergroupUsername +//@collectible_usernames Collectible usernames that were purchased at https://fragment.com and can be passed to getCollectibleItemInfo for more details +usernames active_usernames:vector disabled_usernames:vector editable_username:string collectible_usernames:vector = Usernames; //@description Represents a user @@ -1839,6 +2113,7 @@ usernames active_usernames:vector disabled_usernames:vector edit //@profile_photo Profile photo of the user; may be null //@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview //@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +//@upgraded_gift_colors 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 //@profile_accent_color_id Identifier of the accent color for the user's profile; -1 if none //@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null @@ -1849,15 +2124,14 @@ usernames active_usernames:vector disabled_usernames:vector edit //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_info Information about restrictions that must be applied to the corresponding private chat; may be null if none -//@has_active_stories True, if the user has non-expired stories available to the current user -//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user +//@active_story_state State of active stories of the user; may be null if the user has no active stories //@restricts_new_chats 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 //@paid_message_star_count 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 //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_info:restrictionInfo has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool paid_message_star_count:int53 have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_info:restrictionInfo active_story_state:ActiveStoryState restricts_new_chats:Bool paid_message_star_count:int53 have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -1916,9 +2190,10 @@ botInfo short_description:string description:string photo:photo animation:animat //@rating The current rating of the user; may be null if none //@pending_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 //@pending_rating_date 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 +//@note Note added to the user's contact; may be null if none //@business_info Information about business settings for Telegram Business accounts; may be null if none //@bot_info For bots, information about the bot; may be null if the user isn't a bot -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 gift_settings:giftSettings bot_verification:botVerification main_profile_tab:ProfileTab first_profile_audio:audio rating:userRating pending_rating:userRating pending_rating_date:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 gift_settings:giftSettings bot_verification:botVerification main_profile_tab:ProfileTab first_profile_audio:audio rating:userRating pending_rating:userRating pending_rating_date:int32 note:formattedText business_info:businessInfo bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -1969,7 +2244,7 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@description Describes a user or a chat as a member of another chat //@member_id 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 -//@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown +//@inviter_user_id Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown //@joined_chat_date Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; @@ -1989,8 +2264,8 @@ chatMembersFilterAdministrators = ChatMembersFilter; //@description Returns all chat members, including restricted chat members chatMembersFilterMembers = ChatMembersFilter; -//@description Returns users which can be mentioned in the chat @message_thread_id If non-zero, the identifier of the current message thread -chatMembersFilterMention message_thread_id:int53 = ChatMembersFilter; +//@description Returns users which can be mentioned in the chat @topic_id Identifier of the topic in which the users will be mentioned; pass null if none +chatMembersFilterMention topic_id:MessageTopic = ChatMembersFilter; //@description Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup chatMembersFilterRestricted = ChatMembersFilter; @@ -2022,8 +2297,8 @@ supergroupMembersFilterRestricted query:string = SupergroupMembersFilter; //@description Returns users banned from the supergroup or channel; can be used only by administrators @query Query to search for supergroupMembersFilterBanned query:string = SupergroupMembersFilter; -//@description Returns users which can be mentioned in the supergroup @query Query to search for @message_thread_id If non-zero, the identifier of the current message thread -supergroupMembersFilterMention query:string message_thread_id:int53 = SupergroupMembersFilter; +//@description Returns users which can be mentioned in the supergroup @query Query to search for @topic_id Identifier of the topic in which the users will be mentioned; pass null if none +supergroupMembersFilterMention query:string topic_id:MessageTopic = SupergroupMembersFilter; //@description Returns bot members of the supergroup or channel supergroupMembersFilterBots = SupergroupMembersFilter; @@ -2104,7 +2379,7 @@ chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool fo chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool verification_status:verificationStatus = ChatInviteLinkInfo; -//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user +//@description Describes a user who sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; //@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests @@ -2153,7 +2428,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@sign_messages True, if messages sent to the channel contains name of the sender. This field is only applicable to channels //@show_message_sender True, if messages sent to the channel have information about the sender user. This field is only applicable to channels //@join_to_send_messages 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 -//@join_by_request 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 +//@join_by_request 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 //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members @@ -2165,9 +2440,8 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@has_forum_tabs True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups //@restriction_info Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none //@paid_message_star_count Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message -//@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user -//@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user -supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_automatic_translation:Bool has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_direct_messages_group:Bool is_administered_direct_messages_group:Bool verification_status:verificationStatus has_direct_messages_group:Bool has_forum_tabs:Bool restriction_info:restrictionInfo paid_message_star_count:int53 has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; +//@active_story_state State of active stories of the supergroup or channel; may be null if there are no active stories +supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_automatic_translation:Bool has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_direct_messages_group:Bool is_administered_direct_messages_group:Bool verification_status:verificationStatus has_direct_messages_group:Bool has_forum_tabs:Bool restriction_info:restrictionInfo paid_message_star_count:int53 active_story_state:ActiveStoryState = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -2244,12 +2518,12 @@ secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_has //@next_free_query_in Amount of time till the next free query can be sent; 0 if it can be sent now //@star_count Number of Telegram Stars that must be paid for each non-free query //@is_current_query_free True, if the search for the specified query isn't charged -publicPostSearchLimits daily_free_query_count:int32 remaining_free_query_count:int32 next_free_query_in:int32 star_count:int64 is_current_query_free:Bool = PublicPostSearchLimits; +publicPostSearchLimits daily_free_query_count:int32 remaining_free_query_count:int32 next_free_query_in:int32 star_count:int53 is_current_query_free:Bool = PublicPostSearchLimits; //@class MessageSender @description Contains information about the sender of a message -//@description The message was sent by a known user @user_id Identifier of the user that sent the message +//@description The message was sent by a known user @user_id Identifier of the user who sent the message messageSenderUser user_id:int53 = MessageSender; //@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message @@ -2294,7 +2568,7 @@ messageViewers viewers:vector = MessageViewers; //@class MessageOrigin @description Contains information about the origin of a message -//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message +//@description The message was originally sent by a known user @sender_user_id Identifier of the user who originally sent the message messageOriginUser sender_user_id:int53 = MessageOrigin; //@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender @@ -2346,13 +2620,18 @@ paidReactionTypeAnonymous = PaidReactionType; paidReactionTypeChat chat_id:int53 = PaidReactionType; -//@description Contains information about a user that added paid reactions +//@description Contains information about a user who added paid reactions //@sender_id Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user //@star_count Number of Telegram Stars added //@is_top True, if the reactor is one of the most active reactors; may be false if the reactor is the current user //@is_me True, if the paid reaction was added by the current user //@is_anonymous True, if the reactor is anonymous -paidReactor sender_id:MessageSender star_count:int32 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; +paidReactor sender_id:MessageSender star_count:int53 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; + +//@description Contains a list of users and chats that spend most money on paid messages and reactions in a live story +//@total_star_count Total amount of spend Telegram Stars +//@top_donors List of top donors in the live story +liveStoryDonors total_star_count:int53 top_donors:vector = LiveStoryDonors; //@description Contains information about a forwarded message //@origin Origin of the forwarded message @@ -2405,8 +2684,11 @@ unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadRea //@class MessageTopic @description Describes a topic of messages in a chat -//@description A topic in a forum supergroup chat @forum_topic_id Unique identifier of the forum topic; all messages in a non-forum supergroup chats belongs to the General topic -messageTopicForum forum_topic_id:int53 = MessageTopic; +//@description A topic in a non-forum supergroup chat @message_thread_id Unique identifier of the message thread +messageTopicThread message_thread_id:int53 = MessageTopic; + +//@description A topic in a forum supergroup chat or a chat with a bot @forum_topic_id Unique identifier of the forum topic +messageTopicForum forum_topic_id:int32 = MessageTopic; //@description A topic in a channel direct messages chat administered by the current user @direct_messages_chat_topic_id Unique identifier of the topic messageTopicDirectMessages direct_messages_chat_topic_id:int53 = MessageTopic; @@ -2472,7 +2754,7 @@ inputTextQuote text:formattedText position:int32 = InputTextQuote; //@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat //@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. //-Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, -//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, +//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, messageSticker, messageStory, //-messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote checklist_task_id:int32 origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; @@ -2531,8 +2813,7 @@ factCheck text:formattedText country_code:string = FactCheck; //@fact_check Information about fact-check added to the message; may be null if none //@suggested_post_info Information about the suggested post; may be null if the message isn't a suggested post //@reply_to Information about the message or the story this message is replying to; may be null if none -//@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs -//@topic_id Identifier of the topic within the chat to which the message belongs; may be null if none +//@topic_id 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 //@self_destruct_type The message's self-destruct type; may be null if none //@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet //@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never @@ -2544,9 +2825,10 @@ factCheck text:formattedText country_code:string = FactCheck; //@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums //@effect_id Unique identifier of the effect added to the message; 0 if none //@restriction_info Information about the restrictions that must be applied to the message content; may be null if none +//@summary_language_code IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message //@content Content of the message //@reply_markup Reply markup for the message; may be null if none -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_ton_suggested_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo message_thread_id:int53 topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_ton_suggested_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo summary_language_code:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null @@ -2779,7 +3061,7 @@ reactionNotificationSettings message_reaction_source:ReactionNotificationSource //@description Contains information about a message draft -//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none +//@reply_to Information about the message to be replied; inputMessageReplyToStory is unsupported; may be null if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote //@effect_id Identifier of the effect to apply to the message when it is sent; 0 if none @@ -2940,6 +3222,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@photo Chat photo; may be null //@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview //@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none +//@upgraded_gift_colors 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 //@profile_accent_color_id Identifier of the profile accent color for the chat's profile; -1 if none //@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat @@ -2975,13 +3258,13 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme:ChatTheme action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme:ChatTheme action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; -//@description Contains information about a user that has failed to be added to a chat +//@description Contains information about a user who has failed to be added to a chat //@user_id User identifier //@premium_would_allow_invite True, if subscription to Telegram Premium would have allowed to add the user to the chat //@premium_required_to_send_messages True, if subscription to Telegram Premium is required to send the user chat invite link @@ -3004,7 +3287,7 @@ publicChatTypeHasUsername = PublicChatType; publicChatTypeIsLocationBased = PublicChatType; -//@description Contains basic information about another user that started a chat with the current user +//@description Contains basic information about another user who started a chat with the current user //@registration_month Month when the user was registered in Telegram; 0-12; may be 0 if unknown //@registration_year Year when the user was registered in Telegram; 0-9999; may be 0 if unknown //@phone_number_country_code A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user; may be empty if unknown @@ -3041,6 +3324,21 @@ chatActionBarSharePhoneNumber = ChatActionBar; chatActionBarJoinRequest title:string is_channel:Bool request_date:int32 = ChatActionBar; +//@class ButtonStyle @description Describes style of a button + +//@description The button has default style +buttonStyleDefault = ButtonStyle; + +//@description The button has dark blue color +buttonStylePrimary = ButtonStyle; + +//@description The button has red color +buttonStyleDanger = ButtonStyle; + +//@description The button has green color +buttonStyleSuccess = ButtonStyle; + + //@class KeyboardButtonType @description Describes a keyboard button type //@description A simple button, with text that must be sent when the button is pressed @@ -3087,8 +3385,12 @@ keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_for keyboardButtonTypeWebApp url:string = KeyboardButtonType; -//@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button -keyboardButton text:string type:KeyboardButtonType = KeyboardButton; +//@description Represents a single button in a bot keyboard +//@text Text of the button +//@icon_custom_emoji_id Identifier of the custom emoji that must be shown on the button; 0 if none +//@style Style of the button +//@type Type of the button +keyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:KeyboardButtonType = KeyboardButton; //@class InlineKeyboardButtonType @description Describes the type of inline keyboard button @@ -3124,8 +3426,12 @@ inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; inlineKeyboardButtonTypeCopyText text:string = InlineKeyboardButtonType; -//@description Represents a single button in an inline keyboard @text Text of the button @type Type of the button -inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton; +//@description Represents a single button in an inline keyboard +//@text Text of the button +//@icon_custom_emoji_id Identifier of the custom emoji that must be shown on the button; 0 if none +//@style Style of the button +//@type Type of the button +inlineKeyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:InlineKeyboardButtonType = InlineKeyboardButton; //@class ReplyMarkup @description Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots @@ -3163,7 +3469,12 @@ loginUrlInfoOpen url:string skip_confirmation:Bool = LoginUrlInfo; //@domain A domain of the URL //@bot_user_id User identifier of a bot linked with the website //@request_write_access True, if the user must be asked for the permission to the bot to send them messages -loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo; +//@request_phone_number_access True, if the user must be asked for the permission to share their phone number +//@browser The version of a browser used for the authorization; may be empty if irrelevant +//@platform Operating system the browser is running on; may be empty if irrelevant +//@ip_address IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant +//@location 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 +loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool browser:string platform:string ip_address:string location:string = LoginUrlInfo; //@description Contains parameters of the application theme @@ -3254,7 +3565,7 @@ savedMessagesTopic id:int53 type:SavedMessagesTopicType is_pinned:Bool order:int //@sender_id Identifier of the user or chat that sends the messages to the topic //@order A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order //@can_send_unpaid_messages True, if the other party can send unpaid messages even if the chat has paid messages enabled -//@is_marked_as_unread True, if the forum topic is marked as unread +//@is_marked_as_unread True, if the topic is marked as unread //@unread_count Number of unread messages in the chat //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message @@ -3268,18 +3579,18 @@ directMessagesChatTopic chat_id:int53 id:int53 sender_id:MessageSender order:int forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; //@description Contains basic information about a forum topic -//@chat_id Identifier of the forum chat to which the topic belongs +//@chat_id Identifier of a forum supergroup chat or a chat with a bot to which the topic belongs //@forum_topic_id Forum topic identifier of the topic -//@message_thread_id Message thread identifier of the topic //@name Name of the topic //@icon Icon of the topic //@creation_date Point in time (Unix timestamp) when the topic was created //@creator_id Identifier of the creator of the topic -//@is_general True, if the topic is the General topic list +//@is_general True, if the topic is the General topic //@is_outgoing True, if the topic was created by the current user //@is_closed True, if the topic is closed. If the topic is closed, then the user must have can_manage_topics administrator right in the supergroup or must be the creator of the topic to send messages there //@is_hidden True, if the topic is hidden above the topic list and closed; for General topic only -forumTopicInfo chat_id:int53 forum_topic_id:int53 message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_general:Bool is_outgoing:Bool is_closed:Bool is_hidden:Bool = ForumTopicInfo; +//@is_name_implicit True, if the name of the topic wasn't added explicitly +forumTopicInfo chat_id:int53 forum_topic_id:int32 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_general:Bool is_outgoing:Bool is_closed:Bool is_hidden:Bool is_name_implicit:Bool = ForumTopicInfo; //@description Describes a forum topic //@info Basic information about the topic @@ -3300,8 +3611,8 @@ forumTopic info:forumTopicInfo last_message:message order:int64 is_pinned:Bool u //@topics List of forum topics //@next_offset_date Offset date for the next getForumTopics request //@next_offset_message_id Offset message identifier for the next getForumTopics request -//@next_offset_message_thread_id Offset message thread identifier for the next getForumTopics request -forumTopics total_count:int32 topics:vector next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics; +//@next_offset_forum_topic_id Offset forum topic identifier for the next getForumTopics request +forumTopics total_count:int32 topics:vector next_offset_date:int32 next_offset_message_id:int53 next_offset_forum_topic_id:int32 = ForumTopics; //@description Options to be used for generation of a link preview @@ -3701,6 +4012,11 @@ linkPreviewTypeExternalAudio url:string mime_type:string duration:int32 = LinkPr //@duration Duration of the video, in seconds; 0 if unknown linkPreviewTypeExternalVideo url:string mime_type:string width:int32 height:int32 duration:int32 = LinkPreviewType; +//@description The link is a link to a gift auction +//@gift The gift +//@auction_end_date Point in time (Unix timestamp) when the auction will be ended +linkPreviewTypeGiftAuction gift:gift auction_end_date:int32 = LinkPreviewType; + //@description The link is a link to a gift collection @icons Icons for some gifts from the collection; may be empty linkPreviewTypeGiftCollection icons:vector = LinkPreviewType; @@ -3710,6 +4026,11 @@ linkPreviewTypeGroupCall = LinkPreviewType; //@description The link is a link to an invoice linkPreviewTypeInvoice = LinkPreviewType; +//@description The link is a link to a live story group call +//@story_poster_chat_id The identifier of the chat that posted the story +//@story_id Story identifier +linkPreviewTypeLiveStory story_poster_chat_id:int53 story_id:int32 = LinkPreviewType; + //@description The link is a link to a text or a poll Telegram message linkPreviewTypeMessage = LinkPreviewType; @@ -4404,7 +4725,7 @@ messageAnimatedEmoji animated_emoji:animatedEmoji emoji:string = MessageContent; //@initial_state The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known //@final_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 //@emoji Emoji on which the dice throw animation is based -//@value The dice value. If the value is 0, the dice don't have final state yet +//@value The dice value. If the value is 0, then the dice don't have final state yet //@success_animation_frame_number Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded messageDice initial_state:DiceStickers final_state:DiceStickers emoji:string value:int32 success_animation_frame_number:int32 = MessageContent; @@ -4414,6 +4735,14 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; +//@description A stake dice message. The dice value is randomly generated by the server +//@initial_state The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known +//@final_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 +//@value The dice value. If the value is 0, then the dice don't have final state yet +//@stake_toncoin_amount The Toncoin amount that was staked; in the smallest units of the currency +//@prize_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 +messageStakeDice initial_state:DiceStickers final_state:DiceStickers value:int32 stake_toncoin_amount:int53 prize_toncoin_amount:int53 = MessageContent; + //@description A message with a forwarded story //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Story identifier @@ -4441,12 +4770,13 @@ messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = Mess //@description 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 +//@unique_id Persistent unique group call identifier //@is_active True, if the call is active, i.e. the called user joined the call //@was_missed True, if the called user missed or declined the call //@is_video True, if the call is a video call //@duration Call duration, in seconds; for left calls only //@other_participant_ids Identifiers of some other call participants -messageGroupCall is_active:Bool was_missed:Bool is_video:Bool duration:int32 other_participant_ids:vector = MessageContent; +messageGroupCall unique_id:int64 is_active:Bool was_missed:Bool is_video:Bool duration:int32 other_participant_ids:vector = MessageContent; //@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator messageVideoChatScheduled group_call_id:int32 start_date:int32 = MessageContent; @@ -4475,6 +4805,12 @@ messageChatChangePhoto photo:chatPhoto = MessageContent; //@description A deleted chat photo messageChatDeletePhoto = MessageContent; +//@description The owner of the chat has left @new_owner_user_id Identifier of the user who will become the new owner of the chat if the previous owner isn't return; 0 if none +messageChatOwnerLeft new_owner_user_id:int53 = MessageContent; + +//@description The owner of the chat has changed @new_owner_user_id Identifier of the user who is the new owner of the chat +messageChatOwnerChanged new_owner_user_id:int53 = MessageContent; + //@description New chat members were added @member_user_ids User identifiers of the new members messageChatAddMembers member_user_ids:vector = MessageContent; @@ -4514,8 +4850,11 @@ messageChatSetMessageAutoDeleteTime message_auto_delete_time:int32 from_user_id: //@description The chat was boosted by the sender of the message @boost_count Number of times the chat was boosted messageChatBoost boost_count:int32 = MessageContent; -//@description A forum topic has been created @name Name of the topic @icon Icon of the topic -messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent; +//@description A forum topic has been created +//@name Name of the topic +//@is_name_implicit True, if the name of the topic wasn't added explicitly +//@icon Icon of the topic +messageForumTopicCreated name:string is_name_implicit:Bool icon:forumTopicIcon = MessageContent; //@description A forum topic has been edited //@name If non-empty, the new name of the topic @@ -4532,6 +4871,9 @@ messageForumTopicIsHiddenToggled is_hidden:Bool = MessageContent; //@description A profile photo was suggested to a user in a private chat @photo The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo messageSuggestProfilePhoto photo:chatPhoto = MessageContent; +//@description A birthdate was suggested to be set @birthdate The suggested birthdate. Use the method setBirthdate to apply the birthdate +messageSuggestBirthdate birthdate:birthdate = MessageContent; + //@description A non-standard action has happened in the chat @text Message text to be shown in the chat messageCustomServiceAction text:string = MessageContent; @@ -4540,7 +4882,7 @@ messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageConten //@description A payment has been sent to a bot or a business account //@invoice_chat_id Identifier of the chat, containing the corresponding invoice message -//@invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message +//@invoice_message_id Identifier of the message with the corresponding invoice; may be 0 or an identifier of a deleted message //@currency Currency for the price of the product //@total_amount Total price for the product, in the smallest units of the currency //@subscription_until_date Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn't recurring @@ -4572,19 +4914,20 @@ messagePaymentSuccessfulBot currency:string total_amount:int53 subscription_unti messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 invoice_payload:bytes telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description Telegram Premium was gifted to a user -//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Telegram Premium; 0 if the gift is incoming +//@gifter_user_id The identifier of a user who gifted Telegram Premium; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Telegram Premium; 0 if the gift is incoming //@text Message added to the gifted Telegram Premium by the sender //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none //@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none -//@month_count Number of months the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedText currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; +messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedText currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 day_count:int32 sticker:sticker = MessageContent; //@description A Telegram Premium gift code was created for the user -//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown +//@creator_id Identifier of a chat or a user who created the gift code; may be null if unknown //@text Message added to the gift //@is_from_giveaway True, if the gift code was created for a giveaway //@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen @@ -4592,10 +4935,11 @@ messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedT //@amount The paid amount, in the smallest units of the currency; 0 if unknown //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none or unknown //@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if unknown -//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown //@code The gift code -messagePremiumGiftCode creator_id:MessageSender text:formattedText is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; +messagePremiumGiftCode creator_id:MessageSender text:formattedText is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 day_count:int32 sticker:sticker code:string = MessageContent; //@description A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway //@star_count Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways @@ -4609,7 +4953,7 @@ messageGiveawayCreated star_count:int53 = MessageContent; messageGiveaway parameters:giveawayParameters winner_count:int32 prize:GiveawayPrize sticker:sticker = MessageContent; //@description A giveaway without public winners has been completed for the chat -//@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted +//@giveaway_message_id Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message //@winner_count Number of winners in the giveaway //@is_star_giveaway True, if the giveaway is a Telegram Star giveaway //@unclaimed_prize_count Number of undistributed prizes; for Telegram Premium giveaways only @@ -4630,8 +4974,8 @@ messageGiveawayCompleted giveaway_message_id:int53 winner_count:int32 is_star_gi messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool prize:GiveawayPrize prize_description:string winner_count:int32 winner_user_ids:vector unclaimed_prize_count:int32 = MessageContent; //@description Telegram Stars were gifted to a user -//@gifter_user_id The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Telegram Stars; 0 if the gift is incoming +//@gifter_user_id The identifier of a user who gifted Telegram Stars; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Telegram Stars; 0 if the gift is incoming //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none @@ -4642,9 +4986,9 @@ messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additiona messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 star_count:int53 transaction_id:string sticker:sticker = MessageContent; //@description Toncoins were gifted to a user -//@gifter_user_id The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Toncoins; 0 if the gift is incoming -//@ton_amount The received amount of Toncoins, in the smallest units of the cryptocurrency +//@gifter_user_id The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Toncoins; 0 if the gift is incoming +//@ton_amount The received Toncoin amount, in the smallest units of the cryptocurrency //@transaction_id Identifier of the transaction for Toncoin credit; for receiver only //@sticker A sticker to be shown in the message; may be null if unknown messageGiftedTon gifter_user_id:int53 receiver_user_id:int53 ton_amount:int53 transaction_id:string sticker:sticker = MessageContent; @@ -4653,7 +4997,7 @@ messageGiftedTon gifter_user_id:int53 receiver_user_id:int53 ton_amount:int53 tr //@star_count Number of Telegram Stars that were received //@transaction_id Identifier of the transaction for Telegram Stars credit //@boosted_chat_id Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway -//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat; may be 0 or an identifier of a deleted message //@is_unclaimed True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat //@sticker A sticker to be shown in the message; may be null if unknown messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent; @@ -4664,9 +5008,11 @@ messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id //@receiver_id Receiver of the gift //@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift //@text Message added to the gift +//@unique_gift_number Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned //@sell_star_count 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 //@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift //@is_upgrade_separate 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 +//@is_from_auction True, if the message is a notification about a gift won on an auction //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_saved True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift //@is_prepaid_upgrade True, if the message is about prepaid upgrade of the gift by another user @@ -4676,7 +5022,7 @@ messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id //@was_refunded True, if the gift was refunded and isn't available anymore //@upgraded_received_gift_id Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift //@prepaid_upgrade_hash If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade -messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received_gift_id:string text:formattedText sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool is_private:Bool is_saved:Bool is_prepaid_upgrade:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgraded_received_gift_id:string prepaid_upgrade_hash:string = MessageContent; +messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received_gift_id:string text:formattedText unique_gift_number:int32 sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool is_from_auction:Bool is_private:Bool is_saved:Bool is_prepaid_upgrade:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgraded_received_gift_id:string prepaid_upgrade_hash:string = MessageContent; //@description An upgraded gift was received or sent by the current user, or the current user was notified about a channel gift //@gift The gift @@ -4688,10 +5034,12 @@ messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received //@can_be_transferred True, if the gift can be transferred to another owner; only for the receiver of the gift //@was_transferred True, if the gift has already been transferred to another owner; only for the receiver of the gift //@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift +//@drop_original_details_star_count 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 //@next_transfer_date 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 //@next_resale_date 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 //@export_date 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 -messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 = MessageContent; +//@craft_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 +messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 craft_date:int32 = MessageContent; //@description A gift which purchase, upgrade or transfer were refunded //@gift The gift @@ -4700,6 +5048,20 @@ messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:Messag //@origin Origin of the upgraded gift messageRefundedUpgradedGift gift:gift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin = MessageContent; +//@description An offer to purchase an upgraded gift was sent or received +//@gift The gift +//@state State of the offer +//@price The proposed price +//@expiration_date Point in time (Unix timestamp) when the offer will expire or has expired +messageUpgradedGiftPurchaseOffer gift:upgradedGift state:GiftPurchaseOfferState price:GiftResalePrice expiration_date:int32 = MessageContent; + +//@description An offer to purchase a gift was rejected or expired +//@gift The gift +//@price The proposed price +//@offer_message_id Identifier of the message with purchase offer which was rejected or expired; may be 0 or an identifier of a deleted message +//@was_expired True, if the offer has expired; otherwise, the offer was explicitly rejected +messageUpgradedGiftPurchaseOfferRejected gift:upgradedGift price:GiftResalePrice offer_message_id:int53 was_expired:Bool = MessageContent; + //@description Paid messages were refunded @message_count The number of refunded messages @star_count The number of refunded Telegram Stars messagePaidMessagesRefunded message_count:int32 star_count:int53 = MessageContent; @@ -4713,40 +5075,40 @@ messagePaidMessagePriceChanged paid_message_star_count:int53 = MessageContent; messageDirectMessagePriceChanged is_enabled:Bool paid_message_star_count:int53 = MessageContent; //@description Some tasks from a checklist were marked as done or not done -//@checklist_message_id Identifier of the message with the checklist; can be 0 if the message was deleted +//@checklist_message_id Identifier of the message with the checklist; may be 0 or an identifier of a deleted message //@marked_as_done_task_ids Identifiers of tasks that were marked as done //@marked_as_not_done_task_ids Identifiers of tasks that were marked as not done messageChecklistTasksDone checklist_message_id:int53 marked_as_done_task_ids:vector marked_as_not_done_task_ids:vector = MessageContent; //@description Some tasks were added to a checklist -//@checklist_message_id Identifier of the message with the checklist; can be 0 if the message was deleted +//@checklist_message_id Identifier of the message with the checklist; may be 0 or an identifier of a deleted message //@tasks List of tasks added to the checklist messageChecklistTasksAdded checklist_message_id:int53 tasks:vector = MessageContent; //@description Approval of suggested post has failed, because the user which proposed the post had no enough funds -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@price Price of the suggested post messageSuggestedPostApprovalFailed suggested_post_message_id:int53 price:SuggestedPostPrice = MessageContent; //@description A suggested post was approved -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@price Price of the suggested post; may be null if the post is non-paid //@send_date Point in time (Unix timestamp) when the post is expected to be published messageSuggestedPostApproved suggested_post_message_id:int53 price:SuggestedPostPrice send_date:int32 = MessageContent; //@description A suggested post was declined -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@comment Comment added by administrator of the channel when the post was declined messageSuggestedPostDeclined suggested_post_message_id:int53 comment:string = MessageContent; //@description A suggested post was published for getOption("suggested_post_lifetime_min") seconds and payment for the post was received -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@star_amount The amount of received Telegram Stars //@ton_amount The amount of received Toncoins; in the smallest units of the cryptocurrency messageSuggestedPostPaid suggested_post_message_id:int53 star_amount:starAmount ton_amount:int53 = MessageContent; //@description A suggested post was refunded -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@reason Reason of the refund messageSuggestedPostRefunded suggested_post_message_id:int53 reason:SuggestedPostRefundReason = MessageContent; @@ -4882,8 +5244,11 @@ inputPaidMedia type:InputPaidMediaType media:InputFile thumbnail:inputThumbnail //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent -//@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future -messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; +//@description The message will be sent at the specified date +//@send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future +//@repeat_period 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 +messageSchedulingStateSendAtDate send_date:int32 repeat_period:int32 = MessageSchedulingState; //@description The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known messageSchedulingStateSendWhenOnline = MessageSchedulingState; @@ -4903,7 +5268,6 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@description Options to be used when a message is sent -//@direct_messages_chat_topic_id 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 //@suggested_post_info Information about the suggested post; pass null if none. For messages to channel direct messages chat only. Applicable only to sendMessage and addOffer //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background @@ -4913,10 +5277,10 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state 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 -//@effect_id Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats +//@effect_id 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 //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates //@only_preview Pass true to get a fake message instead of actually sending them -messageSendOptions direct_messages_chat_topic_id:int53 suggested_post_info:inputSuggestedPostInfo disable_notification:Bool from_background:Bool protect_content:Bool allow_paid_broadcast:Bool paid_message_star_count:int53 update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; +messageSendOptions suggested_post_info:inputSuggestedPostInfo disable_notification:Bool from_background:Bool protect_content:Bool allow_paid_broadcast:Bool paid_message_star_count:int53 update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; //@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. @@ -4933,7 +5297,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, //-Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@link_preview_options Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options -//@clear_draft True, if a chat message draft must be deleted +//@clear_draft True, if the chat message draft must be deleted inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). @@ -5069,6 +5433,13 @@ inputMessageInvoice invoice:invoice title:string description:string photo_url:st //@is_closed True, if the poll needs to be sent already closed; for bots only inputMessagePoll question:formattedText options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +//@description A stake dice message +//@state_hash 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 +//@stake_toncoin_amount 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") +//@clear_draft True, if the chat message draft must be deleted +inputMessageStakeDice state_hash:string stake_toncoin_amount:int53 clear_draft:Bool = InputMessageContent; + //@description 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 //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Story identifier @@ -5474,6 +5845,21 @@ inputStoryAreas areas:vector = InputStoryAreas; storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 cover_frame_timestamp:double video:file = StoryVideo; +//@class StoryContentType @description Contains the type of the content of a story + +//@description A photo story +storyContentTypePhoto = StoryContentType; + +//@description A video story +storyContentTypeVideo = StoryContentType; + +//@description A live story +storyContentTypeLive = StoryContentType; + +//@description A story of unknown content type +storyContentTypeUnsupported = StoryContentType; + + //@class StoryContent @description Contains the content of a story //@description A photo story @photo The photo @@ -5482,6 +5868,11 @@ storyContentPhoto photo:photo = StoryContent; //@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent; +//@description A live story +//@group_call_id Identifier of the corresponding group call. The group call can be received through the method getGroupCall +//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary group call +storyContentLive group_call_id:int32 is_rtmp_stream:Bool = StoryContent; + //@description A story content that is not supported in the current TDLib version storyContentUnsupported = StoryContent; @@ -5542,11 +5933,12 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@is_edited True, if the story was edited //@is_posted_to_chat_page True, if the story is saved in the profile of the chat that posted it and will be available there after expiration //@is_visible_only_for_self True, if the story is visible only for the current user -//@can_be_added_to_album True, if the story can be added to an album +//@can_be_added_to_album True, if the story can be added to an album using createStoryAlbum and addStoryAlbumStories //@can_be_deleted True, if the story can be deleted //@can_be_edited True, if the story can be edited -//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden -//@can_be_replied True, if the story can be replied in the chat with the user that posted the story +//@can_be_forwarded 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 +//@can_be_replied True, if the story can be replied in the chat with the user who posted the story +//@can_set_privacy_settings True, if the story privacy settings can be changed //@can_toggle_is_posted_to_chat_page True, if the story's is_posted_to_chat_page value can be changed //@can_get_statistics True, if the story statistics are available through getStoryStatistics //@can_get_interactions True, if interactions with the story can be received through getStoryInteractions @@ -5559,7 +5951,7 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@areas Clickable areas to be shown on the story content //@caption Caption of the story //@album_ids Identifiers of story albums to which the story is added; only for manageable stories -story id:int32 poster_chat_id:int53 poster_id:MessageSender date:int32 is_being_posted:Bool is_being_edited:Bool is_edited:Bool is_posted_to_chat_page:Bool is_visible_only_for_self:Bool can_be_added_to_album:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_posted_to_chat_page:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText album_ids:vector = Story; +story id:int32 poster_chat_id:int53 poster_id:MessageSender date:int32 is_being_posted:Bool is_being_edited:Bool is_edited:Bool is_posted_to_chat_page:Bool is_visible_only_for_self:Bool can_be_added_to_album:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_set_privacy_settings:Bool can_toggle_is_posted_to_chat_page:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText album_ids:vector = Story; //@description Represents a list of stories //@total_count Approximate total number of stories found @@ -5589,7 +5981,8 @@ storyFullId poster_chat_id:int53 story_id:int32 = StoryFullId; //@story_id Unique story identifier among stories of the chat //@date Point in time (Unix timestamp) when the story was published //@is_for_close_friends True, if the story is available only to close friends -storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; +//@is_live True, if the story is a live story +storyInfo story_id:int32 date:int32 is_for_close_friends:Bool is_live:Bool = StoryInfo; //@description Describes active stories posted by a chat //@chat_id Identifier of the chat that posted the stories @@ -5670,7 +6063,7 @@ publicForwards total_count:int32 forwards:vector next_offset:stri //@description Describes media previews of a bot //@date Point in time (Unix timestamp) when the preview was added or changed last time -//@content Content of the preview +//@content Content of the preview; may only be of the types storyContentPhoto, storyContentVideo, or storyContentUnsupported botMediaPreview date:int32 content:StoryContent = BotMediaPreview; //@description Contains a list of media previews of a bot @previews List of media previews @@ -5722,7 +6115,7 @@ chatBoostFeatures features:vector min_profile_background chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; //@description The chat created a giveaway -//@user_id Identifier of a user that won in the giveaway; 0 if none +//@user_id Identifier of a user who won in the giveaway; 0 if none //@gift_code 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 //@star_count Number of Telegram Stars distributed among winners of the giveaway //@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message @@ -5903,14 +6296,14 @@ groupCallVideoQualityMedium = GroupCallVideoQuality; groupCallVideoQualityFull = GroupCallVideoQuality; -//@description Describes an available stream in a video chat +//@description Describes an available stream in a video chat or a live story //@channel_id Identifier of an audio/video channel //@scale Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds //@time_offset Point in time when the stream currently ends; Unix timestamp in milliseconds -videoChatStream channel_id:int32 scale:int32 time_offset:int53 = VideoChatStream; +groupCallStream channel_id:int32 scale:int32 time_offset:int53 = GroupCallStream; -//@description Represents a list of video chat streams @streams A list of video chat streams -videoChatStreams streams:vector = VideoChatStreams; +//@description Represents a list of group call streams @streams A list of group call streams +groupCallStreams streams:vector = GroupCallStreams; //@description Represents an RTMP URL @url The URL @stream_key Stream key rtmpUrl url:string stream_key:string = RtmpUrl; @@ -5921,30 +6314,39 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@description Describes a group call //@id Group call identifier +//@unique_id Persistent unique group call identifier //@title Group call title; for video chats only -//@invite_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 +//@invite_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 +//@paid_message_star_count The minimum number of Telegram Stars that must be paid by general participant for each sent message to the call; for live stories only //@scheduled_start_date 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 //@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts; for video chats only //@is_active True, if the call is active //@is_video_chat True, if the call is bound to a chat -//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only +//@is_live_story True, if the call is a live story of a chat +//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary video chat; for video chats and live stories only //@is_joined True, if the call is joined //@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined //@is_owned 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 -//@can_be_managed True, if the current user can manage the group call; for video chats only +//@can_be_managed True, if the current user can manage the group call; for video chats and live stories only //@participant_count Number of participants in the group call //@has_hidden_listeners True, if group call participants, which are muted, aren't returned in participant list; for video chats only //@loaded_all_participants True, if all group call participants are loaded +//@message_sender_id 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 //@recent_speakers At most 3 recently speaking users in the group call //@is_my_video_enabled True, if the current user's video is enabled //@is_my_video_paused True, if the current user's video is paused //@can_enable_video True, if the current user can broadcast video or share screen //@mute_new_participants True, if only group call administrators can unmute new participants; for video chats only //@can_toggle_mute_new_participants True, if the current user can enable or disable mute_new_participants setting; for video chats only +//@can_send_messages True, if the current user can send messages to the group call +//@are_messages_allowed True, if sending of messages is allowed in the group call +//@can_toggle_are_messages_allowed True, if the current user can enable or disable sending of messages in the group call +//@can_delete_messages True, if the user can delete messages in the group call //@record_duration 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 //@is_video_recorded True, if a video file is being recorded for the call //@duration Call duration, in seconds; for ended calls only -groupCall id:int32 title:string invite_link:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_video_chat:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool is_owned:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; +groupCall id:int32 unique_id:int64 title:string invite_link:string paid_message_star_count:int53 scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_video_chat:Bool is_live_story:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool is_owned:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool message_sender_id:MessageSender recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool can_send_messages:Bool are_messages_allowed:Bool can_toggle_are_messages_allowed:Bool can_delete_messages:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; //@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers groupCallVideoSourceGroup semantics:string source_ids:vector = GroupCallVideoSourceGroup; @@ -5982,6 +6384,26 @@ groupCallParticipants total_count:int32 participant_ids:vector = //@description Contains information about a just created or just joined group call @group_call_id Identifier of the group call @join_payload Join response payload for tgcalls; empty if the call isn't joined groupCallInfo group_call_id:int32 join_payload:string = GroupCallInfo; +//@description Represents a message sent in a group call +//@message_id Unique message identifier within the group call +//@sender_id Identifier of the sender of the message +//@date Point in time (Unix timestamp) when the message was sent +//@text Text of the message. If empty, then the message is a paid reaction in a live story +//@paid_message_star_count The number of Telegram Stars that were paid to send the message; for live stories only +//@is_from_owner 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 +//@can_be_deleted True, if the message can be deleted by the current user; for live stories only +groupCallMessage message_id:int32 sender_id:MessageSender date:int32 text:formattedText paid_message_star_count:int53 is_from_owner:Bool can_be_deleted:Bool = GroupCallMessage; + +//@description Represents a level of features for a message sent in a live story group call +//@min_star_count The minimum number of Telegram Stars required to get features of the level +//@pin_duration The amount of time the message of this level will be pinned, in seconds +//@max_text_length The maximum allowed length of the message text +//@max_custom_emoji_count The maximum allowed number of custom emoji in the message text +//@first_color The first color used to show the message text in the RGB format +//@second_color The second color used to show the message text in the RGB format +//@background_color Background color for the message the RGB format +groupCallMessageLevel min_star_count:int53 pin_duration:int32 max_text_length:int32 max_custom_emoji_count:int32 first_color:int32 second_color:int32 background_color:int32 = GroupCallMessageLevel; + //@class InviteGroupCallParticipantResult @description Describes result of group call participant invitation @@ -6052,11 +6474,12 @@ callProblemPixelatedVideo = CallProblem; //@description Describes a call //@id Call identifier, not persistent +//@unique_id Persistent unique call identifier; 0 if isn't assigned yet by the server //@user_id User identifier of the other call participant //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state -call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; +call id:int32 unique_id:int64 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; //@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications @@ -6142,6 +6565,14 @@ diceStickersRegular sticker:sticker = DiceStickers; diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker center_reel:sticker right_reel:sticker = DiceStickers; +//@description Describes a contact to import +//@phone_number Phone number of the user +//@first_name First name of the user; 1-64 characters +//@last_name Last name of the user; 0-64 characters +//@note 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 +importedContact phone_number:string first_name:string last_name:string note:formattedText = ImportedContact; + //@description Represents the result of an importContacts request //@user_ids User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user //@importer_count The number of users that imported the corresponding contact; 0 for already registered users or if unavailable @@ -6162,7 +6593,7 @@ speechRecognitionResultError error:error = SpeechRecognitionResult; //@description Describes a connection of the bot with a business account //@id Unique identifier of the connection -//@user_id Identifier of the business user that created the connection +//@user_id Identifier of the business user who created the connection //@user_chat_id Chat identifier of the private chat with the user //@date Point in time (Unix timestamp) when the connection was established //@rights Rights of the bot; may be null if the connection was disabled @@ -6895,6 +7326,9 @@ premiumFeatureMessageEffects = PremiumFeature; //@description The ability to create and use checklist messages premiumFeatureChecklists = PremiumFeature; +//@description The ability to require a payment for incoming messages in new chats +premiumFeaturePaidMessages = PremiumFeature; + //@class BusinessFeature @description Describes a feature available to Business user accounts @@ -6983,7 +7417,7 @@ premiumSourceBusinessFeature feature:BusinessFeature = PremiumSource; //@description A user tried to use a Premium story feature @feature The used feature premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; -//@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link +//@description A user opened an internal link of the type internalLinkTypePremiumFeaturesPage @referrer The referrer from the link premiumSourceLink referrer:string = PremiumSource; //@description A user opened the Premium features screen from settings @@ -7278,12 +7712,24 @@ canPostStoryResultBoostNeeded = CanPostStoryResult; //@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire canPostStoryResultActiveStoryLimitExceeded = CanPostStoryResult; -//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story +//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story, in seconds canPostStoryResultWeeklyLimitExceeded retry_after:int32 = CanPostStoryResult; -//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story +//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story, in seconds canPostStoryResultMonthlyLimitExceeded retry_after:int32 = CanPostStoryResult; +//@description The user or the chat has an active live story. The live story must be deleted first @story_id Identifier of the active live story +canPostStoryResultLiveStoryIsActive story_id:int32 = CanPostStoryResult; + + +//@class StartLiveStoryResult @description Represents result of starting a live story + +//@description The live story was successfully posted @story The live story +startLiveStoryResultOk story:story = StartLiveStoryResult; + +//@description The live story failed to post with an error to be handled @error_type Type of the error; other error types may be returned as regular errors +startLiveStoryResultFail error_type:CanPostStoryResult = StartLiveStoryResult; + //@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user @@ -7508,6 +7954,9 @@ pushMessageContentRecurringPayment amount:string = PushMessageContent; //@description A profile photo was suggested to the user pushMessageContentSuggestProfilePhoto = PushMessageContent; +//@description A birthdate was suggested to be set +pushMessageContentSuggestBirthdate = PushMessageContent; + //@description A user in the chat came within proximity alert range from the current user @distance The distance to the user pushMessageContentProximityAlertTriggered distance:int32 = PushMessageContent; @@ -7593,6 +8042,13 @@ notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notifica notificationGroup id:int32 type:NotificationGroupType chat_id:int53 total_count:int32 notifications:vector = NotificationGroup; +//@description Describes a proxy server +//@server Proxy server domain or IP address +//@port Proxy server port +//@type Type of the proxy +proxy server:string port:int32 type:ProxyType = Proxy; + + //@class OptionValue @description Represents the value of an option //@description Represents a boolean option @value The value of the option @@ -7706,6 +8162,9 @@ userPrivacySettingShowBio = UserPrivacySetting; //@description A privacy setting for managing whether the user's birthdate is visible userPrivacySettingShowBirthdate = UserPrivacySetting; +//@description A privacy setting for managing whether the user's profile audio files are visible +userPrivacySettingShowProfileAudio = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -7926,10 +8385,140 @@ reportStoryResultOptionRequired title:string options:vector = Repo reportStoryResultTextRequired option_id:bytes is_optional:Bool = ReportStoryResult; -//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way +//@class SettingsSection @description Describes a section of the application settings -//@description The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user -internalLinkTypeActiveSessions = InternalLinkType; +//@description The appearance section @subsection 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" +settingsSectionAppearance subsection:string = SettingsSection; + +//@description The "Ask a question" section +settingsSectionAskQuestion = SettingsSection; + +//@description The "Telegram Business" section @subsection Subsection of the section; may be one of +//-"", "do-not-hide-ads" +settingsSectionBusiness subsection:string = SettingsSection; + +//@description The chat folder settings section @subsection Subsection of the section; may be one of +//-"", "edit", "create", "add-recommended", "show-tags", "tab-view" +settingsSectionChatFolders subsection:string = SettingsSection; + +//@description The data and storage settings section @subsection 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" +settingsSectionDataAndStorage subsection:string = SettingsSection; + +//@description The Devices section @subsection Subsection of the section; may be one of +//-"", "edit", "link-desktop", "terminate-sessions", "auto-terminate" +settingsSectionDevices subsection:string = SettingsSection; + +//@description The profile edit section @subsection 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" +settingsSectionEditProfile subsection:string = SettingsSection; + +//@description The FAQ section +settingsSectionFaq = SettingsSection; + +//@description The "Telegram Features" section +settingsSectionFeatures = SettingsSection; + +//@description The in-app browser settings section @subsection Subsection of the section; may be one of +//-"", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search" +settingsSectionInAppBrowser subsection:string = SettingsSection; + +//@description The application language section @subsection 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 +settingsSectionLanguage subsection:string = SettingsSection; + +//@description The Telegram Star balance and transaction section @subsection Subsection of the section; may be one of +//-"", "top-up", "stats", "gift", "earn" +settingsSectionMyStars subsection:string = SettingsSection; + +//@description The Toncoin balance and transaction section +settingsSectionMyToncoins = SettingsSection; + +//@description The notification settings section @subsection 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" +settingsSectionNotifications subsection:string = SettingsSection; + +//@description The power saving settings section @subsection Subsection of the section; may be one of +//-"", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions" +settingsSectionPowerSaving subsection:string = SettingsSection; + +//@description The "Telegram Premium" section +settingsSectionPremium = SettingsSection; + +//@description The privacy and security section @subsection 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" +settingsSectionPrivacyAndSecurity subsection:string = SettingsSection; + +//@description The "Privacy Policy" section +settingsSectionPrivacyPolicy = SettingsSection; + +//@description The current user's QR code section @subsection Subsection of the section; may be one of +//-"", "share", "scan" +settingsSectionQrCode subsection:string = SettingsSection; + +//@description Search in Settings +settingsSectionSearch = SettingsSection; + +//@description The "Send a gift" section @subsection Subsection of the section; may be one of +//-"", "self" +settingsSectionSendGift subsection:string = SettingsSection; + + +//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way //@description The link is a link to 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. @@ -7979,13 +8568,9 @@ internalLinkTypeBotStartInGroup bot_username:string start_parameter:string admin //@link_name Name of the link internalLinkTypeBusinessChat link_name:string = InternalLinkType; -//@description The link is a link to the Telegram Star purchase section of the application -//@star_count The number of Telegram Stars that must be owned by the user -//@purpose Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions -internalLinkTypeBuyStars star_count:int53 purpose:string = InternalLinkType; - -//@description The link is a link to the change phone number section of the application -internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is a link to the Call tab or page @section Section of the page; may be one of +//-"", "all", "missed", "edit", "show-tab", "start-call" +internalLinkTypeCallsPage section:string = InternalLinkType; //@description The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link //@username Username to be passed to searchChatAffiliateProgram @@ -8003,31 +8588,33 @@ internalLinkTypeChatBoost url:string = InternalLinkType; //@invite_link Internal representation of the invite link internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; -//@description The link is a link to the folder section of the application settings -internalLinkTypeChatFolderSettings = InternalLinkType; - //@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. //-If the link is valid and the user wants to join the chat, then call joinChatByInviteLink //@invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; -//@description The link is a link to the default message auto-delete timer settings section of the application settings -internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; +//@description The link is a link that allows to select some chats +internalLinkTypeChatSelection = InternalLinkType; + +//@description The link is a link to the Contacts tab or page @section Section of the page; may be one of +//-"", "search", "sort", "new", "invite", "manage" +internalLinkTypeContactsPage section:string = InternalLinkType; //@description 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 //@channel_username Username of the channel internalLinkTypeDirectMessagesChat channel_username:string = InternalLinkType; -//@description The link is a link to the edit profile section of the application settings -internalLinkTypeEditProfileSettings = InternalLinkType; - //@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, //-ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game //@game_short_name Short name of the game internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; +//@description The link is a link to a gift auction. Call getGiftAuctionState with the given auction identifier to process the link +//@auction_id Unique identifier of the auction +internalLinkTypeGiftAuction auction_id:string = InternalLinkType; + //@description 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 //@gift_owner_username Username of the owner of the gift collection @@ -8053,8 +8640,10 @@ internalLinkTypeInvoice invoice_name:string = InternalLinkType; //@language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; -//@description The link is a link to the language section of the application settings -internalLinkTypeLanguageSettings = InternalLinkType; +//@description 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 +//@story_poster_username Username of the poster of the story +internalLinkTypeLiveStory story_poster_username:string = InternalLinkType; //@description 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, @@ -8076,11 +8665,21 @@ internalLinkTypeMessage url:string = InternalLinkType; //@contains_link True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType; -//@description The link is a link to the screen with information about Telegram Star balance and transactions of the current user -internalLinkTypeMyStars = InternalLinkType; +//@description The link is a link to the My Profile application page @section Section of the page; may be one of +//-"", "posts", "posts/all-stories", "posts/add-album", "gifts", "archived-posts" +internalLinkTypeMyProfilePage section:string = InternalLinkType; -//@description The link is a link to the screen with information about Toncoin balance and transactions of the current user -internalLinkTypeMyToncoins = InternalLinkType; +//@description The link is a link to the screen for creating a new channel chat +internalLinkTypeNewChannelChat = InternalLinkType; + +//@description The link is a link to the screen for creating a new group chat +internalLinkTypeNewGroupChat = InternalLinkType; + +//@description The link is a link to the screen for creating a new private chat with a contact +internalLinkTypeNewPrivateChat = InternalLinkType; + +//@description The link is a link to open the story posting interface @content_type The type of the content of the story to post; may be null if unspecified +internalLinkTypeNewStory content_type:StoryContentType = InternalLinkType; //@description 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 //@bot_user_id User identifier of the service's bot; the corresponding user may be unknown yet @@ -8099,25 +8698,20 @@ internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = Intern //@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link //@referrer Referrer specified in the link -internalLinkTypePremiumFeatures referrer:string = InternalLinkType; - -//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases -//@referrer Referrer specified in the link -internalLinkTypePremiumGift referrer:string = InternalLinkType; +internalLinkTypePremiumFeaturesPage referrer:string = InternalLinkType; //@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. //-If the code is valid and the user wants to apply it, then call applyPremiumGiftCode //@code The Telegram Premium gift code internalLinkTypePremiumGiftCode code:string = InternalLinkType; -//@description The link is a link to the privacy and security section of the application settings -internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; +//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases +//@referrer Referrer specified in the link +internalLinkTypePremiumGiftPurchase referrer:string = InternalLinkType; //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy -//@server Proxy server domain or IP address -//@port Proxy server port -//@type Type of the proxy -internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; +//@proxy The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user +internalLinkTypeProxy proxy:proxy = InternalLinkType; //@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. //-If the chat is found, open its profile information screen or the chat itself. @@ -8134,8 +8728,19 @@ internalLinkTypeQrCodeAuthentication = InternalLinkType; //@description The link forces restore of App Store purchases when opened. For official iOS application only internalLinkTypeRestorePurchases = InternalLinkType; -//@description The link is a link to application settings -internalLinkTypeSettings = InternalLinkType; +//@description The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat +internalLinkTypeSavedMessages = InternalLinkType; + +//@description The link is a link to the global chat and messages search field +internalLinkTypeSearch = InternalLinkType; + +//@description The link is a link to application settings @section Section of the application settings to open; may be null if none +internalLinkTypeSettings section:SettingsSection = InternalLinkType; + +//@description The link is a link to the Telegram Star purchase section of the application +//@star_count The number of Telegram Stars that must be owned by the user +//@purpose Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions +internalLinkTypeStarPurchase star_count:int53 purpose:string = InternalLinkType; //@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. //-If the sticker set is found and the user wants to add it, then call changeStickerSet @@ -8157,15 +8762,9 @@ internalLinkTypeStoryAlbum story_album_owner_username:string story_album_id:int3 //@description The link is a link to a cloud theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; -//@description The link is a link to the theme section of the application settings -internalLinkTypeThemeSettings = InternalLinkType; - //@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo internalLinkTypeUnknownDeepLink link:string = InternalLinkType; -//@description The link is a link to an unsupported proxy. An alert can be shown to the user -internalLinkTypeUnsupportedProxy = InternalLinkType; - //@description The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link @name Name of the unique gift internalLinkTypeUpgradedGift name:string = InternalLinkType; @@ -8205,11 +8804,11 @@ messageLink link:string is_public:Bool = MessageLink; //@description Contains information about a link to a message or a forum topic in a chat //@is_public True, if the link is a public link for a message or a forum topic in a chat //@chat_id If found, identifier of the chat to which the link points, 0 otherwise -//@message_thread_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 +//@topic_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 //@message If found, the linked message; may be null //@media_timestamp 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 //@for_album True, if the whole media album to which the message belongs is linked -messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +messageLinkInfo is_public:Bool chat_id:int53 topic_id:MessageTopic message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; //@description Contains an HTTPS link to boost a chat @link The link @is_public True, if the link will work for non-members of the chat @@ -8558,6 +9157,13 @@ suggestedActionExtendStarSubscriptions = SuggestedAction; //@url The link to open when the suggestion is clicked suggestedActionCustom name:string title:formattedText description:formattedText url:string = SuggestedAction; +//@description Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address +//@can_be_hidden 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 +suggestedActionSetLoginEmailAddress can_be_hidden:Bool = SuggestedAction; + +//@description Suggests the user to add a passkey for login using addLoginPasskey +suggestedActionAddLoginPasskey = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -8604,17 +9210,15 @@ proxyTypeHttp username:string password:string http_only:Bool = ProxyType; proxyTypeMtproto secret:string = ProxyType; -//@description Contains information about a proxy server +//@description Contains information about a proxy server added to the list of proxies //@id Unique identifier of the proxy -//@server Proxy server domain or IP address -//@port Proxy server port //@last_used_date Point in time (Unix timestamp) when the proxy was last used; 0 if never //@is_enabled True, if the proxy is enabled now -//@type Type of the proxy -proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool type:ProxyType = Proxy; +//@proxy The proxy +addedProxy id:int32 last_used_date:int32 is_enabled:Bool proxy:proxy = AddedProxy; -//@description Represents a list of proxy servers @proxies List of proxy servers -proxies proxies:vector = Proxies; +//@description Represents a list of added proxy servers @proxies List of proxy servers +addedProxies proxies:vector = AddedProxies; //@description A sticker to be added to a sticker set @@ -8779,7 +9383,7 @@ chatRevenueTransactionTypeUnsupported = ChatRevenueTransactionType; //@end_date Point in time (Unix timestamp) when the earnings ended chatRevenueTransactionTypeSponsoredMessageEarnings start_date:int32 end_date:int32 = ChatRevenueTransactionType; -//@description Describes earnings from a published suggested post @user_id Identifier of the user that paid for the suggested post +//@description Describes earnings from a published suggested post @user_id Identifier of the user who paid for the suggested post chatRevenueTransactionTypeSuggestedPostEarnings user_id:int53 = ChatRevenueTransactionType; //@description Describes a withdrawal of earnings through Fragment @@ -8806,9 +9410,9 @@ chatRevenueTransactions ton_amount:int53 transactions:vector is_permanent:Bool f //@description A message sender activity in the chat has changed //@chat_id Chat identifier -//@message_thread_id If not 0, the message thread identifier in which the action was performed +//@topic_id Identifier of the specific topic in which the action was performed; may be null if none //@sender_id Identifier of a message sender performing the action //@action The action -updateChatAction chat_id:int53 message_thread_id:int53 sender_id:MessageSender action:ChatAction = Update; +updateChatAction chat_id:int53 topic_id:MessageTopic sender_id:MessageSender action:ChatAction = Update; + +//@description 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 +//@chat_id Chat identifier +//@forum_topic_id The forum topic identifier in which the message will be sent; 0 if none +//@draft_id Unique identifier of the message draft within the message thread +//@text Text of the pending message +updatePendingTextMessage chat_id:int53 forum_topic_id:int32 draft_id:int64 text:formattedText = Update; //@description The user went online or offline @user_id User identifier @status New status of the user updateUserStatus user_id:int53 status:UserStatus = Update; @@ -9277,9 +9891,38 @@ updateGroupCallParticipants group_call_id:int32 participant_user_ids:vector = Update; +//@description A new message was received in a group call @group_call_id Identifier of the group call @message The message +updateNewGroupCallMessage group_call_id:int32 message:groupCallMessage = Update; + +//@description A new paid reaction was received in a live story group call +//@group_call_id Identifier of the group call +//@sender_id Identifier of the sender of the reaction +//@star_count The number of Telegram Stars that were paid to send the reaction +updateNewGroupCallPaidReaction group_call_id:int32 sender_id:MessageSender star_count:int53 = Update; + +//@description A group call message failed to send +//@group_call_id Identifier of the group call +//@message_id Message identifier +//@error The cause of the message sending failure +updateGroupCallMessageSendFailed group_call_id:int32 message_id:int32 error:error = Update; + +//@description Some group call messages were deleted +//@group_call_id Identifier of the group call +//@message_ids Identifiers of the deleted messages +updateGroupCallMessagesDeleted group_call_id:int32 message_ids:vector = Update; + +//@description The list of top donors in live story group call has changed @group_call_id Identifier of the group call @donors New list of live story donors +updateLiveStoryTopDonors group_call_id:int32 donors:liveStoryDonors = Update; + //@description New call signaling data arrived @call_id The call identifier @data The data updateNewCallSignalingData call_id:int32 data:bytes = Update; +//@description State of a gift auction was updated @state New state of the auction +updateGiftAuctionState state:giftAuctionState = Update; + +//@description The list of auctions in which participate the current user has changed @states New states of the auctions +updateActiveGiftAuctions states:vector = Update; + //@description Some privacy setting rules have been changed @setting The privacy setting @rules New privacy rules updateUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Update; @@ -9325,6 +9968,10 @@ updateStoryListChatCount story_list:StoryList chat_count:int32 = Update; //@cooldown_until_date Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown updateStoryStealthMode active_until_date:int32 cooldown_until_date:int32 = Update; +//@description Lists of bots which Mini Apps must be allowed to read text from clipboard and must be opened without a warning +//@bot_user_ids List of user identifiers of the bots; the corresponding users may not be sent using updateUser updates and may not be accessible +updateTrustedMiniAppBots bot_user_ids:vector = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -9445,9 +10092,15 @@ updateTonRevenueStatus status:tonRevenueStatus = Update; //@next_reset_date Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown updateSpeechRecognitionTrial max_media_duration:int32 weekly_count:int32 left_count:int32 next_reset_date:int32 = Update; +//@description The levels of live story group call messages have changed @levels New description of the levels in decreasing order of groupCallMessageLevel.min_star_count +updateGroupCallMessageLevels levels:vector = Update; + //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; +//@description The stake dice state has changed @state The new state. The state can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState +updateStakeDiceState state:stakeDiceState = Update; + //@description 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 //@chat_id Chat identifier //@message_id Message identifier @@ -9713,6 +10366,19 @@ checkAuthenticationCode code:string = Ok; //@other_user_ids List of user identifiers of other users currently using the application requestQrCodeAuthentication other_user_ids:vector = Ok; +//@description Returns parameters for authentication using a passkey as JSON-serialized string +getAuthenticationPasskeyParameters = Text; + +//@description 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 +//@credential_id Base64url-encoded identifier of the credential +//@client_data JSON-encoded client data +//@authenticator_data Authenticator data of the application that created the credential +//@signature Cryptographic signature of the credential +//@user_handle User handle of the passkey +checkAuthenticationPasskey credential_id:string client_data:string authenticator_data:bytes signature:bytes user_handle:bytes = Ok; + //@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration //@first_name The first name of the user; 1-64 characters //@last_name The last name of the user; 0-64 characters @@ -9782,8 +10448,12 @@ getPasswordState = PasswordState; //@new_recovery_email_address New recovery email address; may be empty setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; -//@description 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 +//@description Checks whether the current user is required to set login email address +isLoginEmailAddressRequired = Ok; + +//@description 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 //@new_login_email_address New login email address setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo; @@ -9878,6 +10548,7 @@ getMessageLocally chat_id:int53 message_id:int53 = Message; //-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 //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message @@ -10064,12 +10735,6 @@ deleteDirectMessagesChatTopicMessagesByDate chat_id:int53 topic_id:int53 min_dat //@is_marked_as_unread New value of is_marked_as_unread setDirectMessagesChatTopicIsMarkedAsUnread chat_id:int53 topic_id:int53 is_marked_as_unread:Bool = Ok; -//@description Changes the draft message in the topic in a channel direct messages chat administered by the current user -//@chat_id Chat identifier -//@topic_id Topic identifier -//@draft_message 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 -setDirectMessagesChatTopicDraftMessage chat_id:int53 topic_id:int53 draft_message:draftMessage = Ok; - //@description Removes all pinned messages from the topic in a channel direct messages chat administered by the current user //@chat_id Identifier of the chat //@topic_id Topic identifier @@ -10230,7 +10895,7 @@ getPublicPostSearchLimits query:string = PublicPostSearchLimits; //@query Query to search for //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@star_count The amount of Telegram Stars the user agreed to pay for the search; pass 0 for free searches +//@star_count The Telegram Star amount the user agreed to pay for the search; pass 0 for free searches searchPublicPosts query:string offset:string limit:int32 star_count:int53 = FoundPublicPosts; //@description Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit @@ -10290,21 +10955,21 @@ getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_mes //@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" //@chat_id Identifier of the chat in which to return information about messages -//@topic_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 +//@topic_id 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 //@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function //@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message getChatMessageCalendar chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; //@description Returns approximate number of messages of the specified type in the chat or its topic //@chat_id Identifier of the chat in which to count messages -//@topic_id Pass topic identifier to get number of messages only in specific topic; pass null to get number of messages in all topics +//@topic_id 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 //@filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function //@return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally getChatMessageCount chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFilter return_local:Bool = Count; //@description Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat and topic. Cannot be used in secret chats //@chat_id Identifier of the chat in which to find message position -//@topic_id Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages +//@topic_id 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 //@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function //@message_id Message identifier getChatMessagePosition chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFilter message_id:int53 = Count; @@ -10396,13 +11061,15 @@ translateText text:formattedText to_language_code:string = FormattedText; //@description Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@to_language_code 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" +//@to_language_code Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; +//@description Summarizes content of the message with non-empty summary_language_code +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@translate_to_language_code 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 +summarizeMessage chat_id:int53 message_id:int53 translate_to_language_code:string = FormattedText; + //@description Recognizes speech in a video note or a voice note message //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable @@ -10420,21 +11087,21 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat -//@message_thread_id If not 0, the message thread identifier in which the message will be sent +//@topic_id Topic in which the message will be sent; pass null if none //@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 topic_id:MessageTopic reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. //-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat -//@message_thread_id If not 0, the message thread identifier in which the messages will be sent +//@topic_id Topic in which the messages will be sent; pass null if none //@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector = Messages; +sendMessageAlbum chat_id:int53 topic_id:MessageTopic reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users member right. Bots can't be invited to a private chat other than the chat with the bot. //-Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message @@ -10445,24 +11112,24 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat -//@message_thread_id If not 0, the message thread identifier in which the message will be sent +//@topic_id Topic in which the message will be sent; pass null if none //@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline query result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 topic_id:MessageTopic reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages -//@message_thread_id If not 0, the message thread identifier in which the message will be sent; for forum threads only +//@topic_id Topic in which the messages will be forwarded; message threads aren't supported; pass null if none //@from_chat_id Identifier of the chat from which to forward messages //@message_ids 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 //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. //-Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false -forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; +forwardMessages chat_id:int53 topic_id:MessageTopic from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; //@description Sends messages from a quick reply shortcut. Requires Telegram Business subscription. Can't be used to send paid messages //@chat_id Identifier of the chat to which to send messages. The chat must be a private chat with a regular user @@ -10742,10 +11409,10 @@ setBusinessAccountUsername business_connection_id:string username:string = Ok; //@settings The new settings setBusinessAccountGiftSettings business_connection_id:string settings:giftSettings = Ok; -//@description Returns the amount of Telegram Stars owned by a business account; for bots only @business_connection_id Unique identifier of business connection +//@description Returns the Telegram Star amount owned by a business account; for bots only @business_connection_id Unique identifier of business connection getBusinessAccountStarAmount business_connection_id:string = StarAmount; -//@description Transfer Telegram Stars from the business account to the business bot; for bots only +//@description Transfers Telegram Stars from the business account to the business bot; for bots only //@business_connection_id Unique identifier of business connection //@star_count Number of Telegram Stars to transfer transferBusinessAccountStars business_connection_id:string star_count:int53 = Ok; @@ -10816,65 +11483,113 @@ editQuickReplyMessage shortcut_id:int32 message_id:int53 input_message_content:I //@description Returns the list of custom emoji, which can be used as forum topic icon by all users getForumTopicDefaultIcons = Stickers; -//@description Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup +//@description 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 //@chat_id Identifier of the chat //@name Name of the topic; 1-128 characters +//@is_name_implicit Pass true if the name of the topic wasn't entered explicitly; for chats with bots only //@icon 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 -createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo; +createForumTopic chat_id:int53 name:string is_name_implicit:Bool icon:forumTopicIcon = ForumTopicInfo; -//@description 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 +//@description 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 //@chat_id Identifier of the chat -//@message_thread_id Message thread identifier of the forum topic +//@forum_topic_id Forum topic identifier //@name New name of the topic; 0-128 characters. If empty, the previous topic name is kept //@edit_icon_custom_emoji Pass true to edit the icon of the topic. Icon of the General topic can't be edited //@icon_custom_emoji_id Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons -editForumTopic chat_id:int53 message_thread_id:int53 name:string edit_icon_custom_emoji:Bool icon_custom_emoji_id:int64 = Ok; +editForumTopic chat_id:int53 forum_topic_id:int32 name:string edit_icon_custom_emoji:Bool icon_custom_emoji_id:int64 = Ok; -//@description Returns information about a forum topic @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic -getForumTopic chat_id:int53 message_thread_id:int53 = ForumTopic; +//@description Returns information about a topic in a forum supergroup chat or a chat with a bot with topics +//@chat_id Identifier of the chat +//@forum_topic_id Forum topic identifier +getForumTopic chat_id:int53 forum_topic_id:int32 = ForumTopic; -//@description Returns an HTTPS link to a topic in a forum chat. This is an offline method @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic -getForumTopicLink chat_id:int53 message_thread_id:int53 = MessageLink; +//@description 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 +//@chat_id Chat identifier +//@forum_topic_id Forum topic identifier +//@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message +//@offset 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 +//@limit 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 +getForumTopicHistory chat_id:int53 forum_topic_id:int32 from_message_id:int53 offset:int32 limit:int32 = Messages; -//@description Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server -//@chat_id Identifier of the forum chat +//@description Returns an HTTPS link to a topic in a forum supergroup chat. This is an offline method @chat_id Identifier of the chat @forum_topic_id Forum topic identifier +getForumTopicLink chat_id:int53 forum_topic_id:int32 = MessageLink; + +//@description 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 +//@chat_id Identifier of the chat //@query Query to search for in the forum topic's name //@offset_date The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic //@offset_message_id The message identifier of the last message in the last found topic, or 0 for the first request -//@offset_message_thread_id The message thread identifier of the last found topic, or 0 for the first request +//@offset_forum_topic_id The forum topic identifier of the last found topic, or 0 for the first request //@limit 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 -getForumTopics chat_id:int53 query:string offset_date:int32 offset_message_id:int53 offset_message_thread_id:int53 limit:int32 = ForumTopics; +getForumTopics chat_id:int53 query:string offset_date:int32 offset_message_id:int53 offset_forum_topic_id:int32 limit:int32 = ForumTopics; -//@description Changes the notification settings of a forum topic +//@description Changes the notification settings of a forum topic in a forum supergroup chat or a chat with a bot with topics //@chat_id Chat identifier -//@message_thread_id Message thread identifier of the forum topic +//@forum_topic_id Forum topic identifier //@notification_settings New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever -setForumTopicNotificationSettings chat_id:int53 message_thread_id:int53 notification_settings:chatNotificationSettings = Ok; +setForumTopicNotificationSettings chat_id:int53 forum_topic_id:int32 notification_settings:chatNotificationSettings = Ok; //@description Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic //@chat_id Identifier of the chat -//@message_thread_id Message thread identifier of the forum topic +//@forum_topic_id Forum topic identifier //@is_closed Pass true to close the topic; pass false to reopen it -toggleForumTopicIsClosed chat_id:int53 message_thread_id:int53 is_closed:Bool = Ok; +toggleForumTopicIsClosed chat_id:int53 forum_topic_id:int32 is_closed:Bool = Ok; //@description Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup //@chat_id Identifier of the chat //@is_hidden Pass true to hide and close the General topic; pass false to unhide it toggleGeneralForumTopicIsHidden chat_id:int53 is_hidden:Bool = Ok; -//@description 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 +//@description 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 //@chat_id Chat identifier -//@message_thread_id Message thread identifier of the forum topic +//@forum_topic_id Forum topic identifier //@is_pinned Pass true to pin the topic; pass false to unpin it -toggleForumTopicIsPinned chat_id:int53 message_thread_id:int53 is_pinned:Bool = Ok; +toggleForumTopicIsPinned chat_id:int53 forum_topic_id:int32 is_pinned:Bool = Ok; -//@description Changes the order of pinned forum topics; requires can_manage_topics administrator right in the supergroup @chat_id Chat identifier @message_thread_ids The new list of pinned forum topics -setPinnedForumTopics chat_id:int53 message_thread_ids:vector = Ok; +//@description 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 +//@chat_id Chat identifier +//@forum_topic_ids The new list of identifiers of the pinned forum topics +setPinnedForumTopics chat_id:int53 forum_topic_ids:vector = Ok; -//@description 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 +//@description 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 //@chat_id Identifier of the chat -//@message_thread_id Message thread identifier of the forum topic -deleteForumTopic chat_id:int53 message_thread_id:int53 = Ok; +//@forum_topic_id Forum topic identifier +deleteForumTopic chat_id:int53 forum_topic_id:int32 = Ok; + +//@description Marks all mentions in a topic in a forum supergroup chat as read +//@chat_id Chat identifier +//@forum_topic_id Forum topic identifier in which mentions are marked as read +readAllForumTopicMentions chat_id:int53 forum_topic_id:int32 = Ok; + +//@description Marks all reactions in a topic in a forum supergroup chat or a chat with a bot with topics as read +//@chat_id Chat identifier +//@forum_topic_id Forum topic identifier in which reactions are marked as read +readAllForumTopicReactions chat_id:int53 forum_topic_id:int32 = Ok; + +//@description 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 +//@chat_id Identifier of the chat +//@forum_topic_id Forum topic identifier in which messages will be unpinned +unpinAllForumTopicMessages chat_id:int53 forum_topic_id:int32 = Ok; + + +//@description Returns parameters for creating of a new passkey as JSON-serialized string +getPasskeyParameters = Text; + +//@description 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 +//@client_data JSON-encoded client data +//@attestation_object Passkey attestation object +addLoginPasskey client_data:string attestation_object:bytes = Passkey; + +//@description Returns the list of passkeys allowed to be used for the login by the current user +getLoginPasskeys = Passkeys; + +//@description Removes a passkey from the list of passkeys allowed to be used for the login by the current user @passkey_id Unique identifier of the passkey to remove +removeLoginPasskey passkey_id:string = Ok; //@description Returns information about an emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction @@ -11065,7 +11780,7 @@ getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; //@chat_id Chat identifier of the message with the button //@message_id Message identifier of the message with the button //@button_id Button identifier -//@allow_write_access Pass true to allow the bot to send messages to the current user +//@allow_write_access Pass true to allow the bot to send messages to the current user. Phone number access can't be requested using the button getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; @@ -11098,7 +11813,7 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que //@description Sets the result of an inline query; for bots only //@inline_query_id Identifier of the inline query -//@is_personal 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 +//@is_personal 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 //@button Button to be shown above inline query results; pass null if none //@results The results of the query //@cache_time Allowed time to cache the results of the query, in seconds @@ -11163,11 +11878,10 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@chat_id Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats //@bot_user_id Identifier of the bot, providing the Web App. If the bot is restricted for the current user, then show an error instead of calling the method //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise -//@message_thread_id If not 0, the message thread identifier to which the message will be sent -//@direct_messages_chat_topic_id If not 0, unique identifier of the topic of channel direct messages chat to which the message will be sent +//@topic_id Topic in which the message will be sent; pass null if none //@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none //@parameters Parameters to use to open the Web App -openWebApp chat_id:int53 bot_user_id:int53 url:string message_thread_id:int53 direct_messages_chat_topic_id:int53 reply_to:InputMessageReplyTo parameters:webAppOpenParameters = WebAppInfo; +openWebApp chat_id:int53 bot_user_id:int53 url:string topic_id:MessageTopic reply_to:InputMessageReplyTo parameters:webAppOpenParameters = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -11230,7 +11944,7 @@ getGameHighScores chat_id:int53 message_id:int53 user_id:int53 = GameHighScores; getInlineGameHighScores inline_message_id:string user_id:int53 = GameHighScores; -//@description 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 +//@description 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 //@chat_id Chat identifier //@message_id The message identifier of the used keyboard deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok; @@ -11238,10 +11952,17 @@ deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok; //@description Sends a notification about user activity in a chat //@chat_id Chat identifier -//@message_thread_id If not 0, the message thread identifier in which the action was performed +//@topic_id Identifier of the topic in which the action is performed; pass null if none //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@action The action description; pass null to cancel the currently active action -sendChatAction chat_id:int53 message_thread_id:int53 business_connection_id:string action:ChatAction = Ok; +sendChatAction chat_id:int53 topic_id:MessageTopic business_connection_id:string action:ChatAction = Ok; + +//@description Sends a draft for a being generated text message; for bots only +//@chat_id Chat identifier +//@forum_topic_id The forum topic identifier in which the message will be sent; pass 0 if none +//@draft_id Unique identifier of the draft +//@text Draft text of the message +sendTextMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 text:formattedText = Ok; //@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier @@ -11276,24 +11997,20 @@ getInternalLinkType link:string = InternalLinkType; //@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats @link The link getExternalLinkInfo link:string = LoginUrlInfo; -//@description 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 +//@description 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 //@link The HTTP link -//@allow_write_access Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages -getExternalLink link:string allow_write_access:Bool = HttpUrl; +//@allow_write_access Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to send them messages +//@allow_phone_number_access Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to access their phone number +getExternalLink link:string allow_write_access:Bool allow_phone_number_access:Bool = HttpUrl; //@description Marks all mentions in a chat as read @chat_id Chat identifier readAllChatMentions chat_id:int53 = Ok; -//@description Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which mentions are marked as read -readAllMessageThreadMentions chat_id:int53 message_thread_id:int53 = Ok; - -//@description Marks all reactions in a chat or a forum topic as read @chat_id Chat identifier +//@description Marks all reactions in a chat as read @chat_id Chat identifier readAllChatReactions chat_id:int53 = Ok; -//@description Marks all reactions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which reactions are marked as read -readAllMessageThreadReactions chat_id:int53 message_thread_id:int53 = Ok; - //@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createPrivateChat user_id:int53 force:Bool = Chat; @@ -11473,11 +12190,11 @@ getGiftChatThemes offset:string limit:int32 = GiftChatThemes; //@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme New chat theme; pass null to return the default theme setChatTheme chat_id:int53 theme:InputChatTheme = Ok; -//@description Changes the draft message in a chat +//@description Changes the draft message in a chat or a topic //@chat_id Chat identifier -//@message_thread_id If not 0, the message thread identifier in which the draft was changed +//@topic_id Topic in which the draft will be changed; pass null to change the draft for the chat itself //@draft_message 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 -setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok; +setChatDraftMessage chat_id:int53 topic_id:MessageTopic draft_message:draftMessage = Ok; //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed //@chat_id Chat identifier @@ -11528,7 +12245,7 @@ setChatDirectMessagesGroup chat_id:int53 is_enabled:Bool paid_message_star_count //@description Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use @chat_id Chat identifier @location New location for the chat; must be valid and not null setChatLocation chat_id:int53 location:chatLocation = Ok; -//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members administrator right @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 +//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members administrator right @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 5, 10, 30, 60, 300, 900, 3600 setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; //@description Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned @@ -11544,11 +12261,6 @@ unpinChatMessage chat_id:int53 message_id:int53 = Ok; //@description Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel @chat_id Identifier of the chat unpinAllChatMessages chat_id:int53 = Ok; -//@description Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup -//@chat_id Identifier of the chat -//@message_thread_id Message thread identifier in which messages will be unpinned -unpinAllMessageThreadMessages chat_id:int53 message_thread_id:int53 = Ok; - //@description Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created @chat_id Chat identifier joinChat chat_id:int53 = Ok; @@ -11580,7 +12292,7 @@ setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatu //@chat_id Chat identifier //@member_id Member identifier //@banned_until_date 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 -//@revoke_messages Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels +//@revoke_messages Pass true to delete all messages in the chat for the user who is being removed. Always true for supergroups and channels banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revoke_messages:Bool = Ok; //@description Checks whether the current session can be used to transfer a chat ownership to another user @@ -11592,6 +12304,11 @@ canTransferOwnership = CanTransferOwnershipResult; //@password The 2-step verification password of the current user transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; +//@description 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 +//@chat_id Chat identifier +getChatOwnerAfterLeaving chat_id:int53 = User; + //@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier getChatMember chat_id:int53 member_id:MessageSender = ChatMember; @@ -11610,6 +12327,10 @@ getChatAdministrators chat_id:int53 = ChatAdministrators; clearAllDraftMessages exclude_secret_chats:Bool = Ok; +//@description Returns the current state of stake dice +getStakeDiceState = StakeDiceState; + + //@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound getSavedNotificationSound notification_sound_id:int64 = NotificationSounds; @@ -11650,7 +12371,7 @@ toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; -//@description Traverse all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read +//@description Traverses all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read readChatList chat_list:ChatList = Ok; @@ -11677,13 +12398,22 @@ canPostStory chat_id:int53 = CanPostStoryResult; //@areas Clickable rectangle areas to be shown on the story media; pass null if none //@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") //@privacy_settings The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats -//@album_ids Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_story_count_max") +//@album_ids 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 //@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise //@from_story_full_id Full identifier of the original story, which content was used to create the story; pass null if the story isn't repost of another story //@is_posted_to_chat_page Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting postStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings album_ids:vector active_period:int32 from_story_full_id:storyFullId is_posted_to_chat_page:Bool protect_content:Bool = Story; +//@description Starts a new live story on behalf of a chat; requires can_post_stories administrator right for channel chats +//@chat_id 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 +//@privacy_settings The privacy settings for the story; ignored for stories posted on behalf of channel chats +//@protect_content Pass true if the content of the story must be protected from screenshotting +//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary group call +//@enable_messages Pass true to allow viewers of the story to send messages +//@paid_message_star_count 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") +startLiveStory chat_id:int53 privacy_settings:StoryPrivacySettings protect_content:Bool is_rtmp_stream:Bool enable_messages:Bool paid_message_star_count:int53 = StartLiveStoryResult; + //@description Changes content and caption of a story. Can be called only if story.can_be_edited == true //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Identifier of the story to edit @@ -11698,7 +12428,7 @@ editStory story_poster_chat_id:int53 story_id:int32 content:InputStoryContent ar //@cover_frame_timestamp New timestamp of the frame, which will be used as video thumbnail editStoryCover story_poster_chat_id:int53 story_id:int32 cover_frame_timestamp:double = Ok; -//@description 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 +//@description 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 //@story_id Identifier of the story //@privacy_settings The new privacy settings for the story setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; @@ -11762,7 +12492,7 @@ closeStory story_poster_chat_id:int53 story_id:int32 = Ok; //@description Returns reactions, which can be chosen for a story @row_size Number of reaction per row, 5-25 getStoryAvailableReactions row_size:int32 = AvailableReactions; -//@description Changes chosen reaction on a story that has already been sent +//@description Changes chosen reaction on a story that has already been sent; not supported for live stories //@story_poster_chat_id The identifier of the poster of the story //@story_id The identifier of the story //@reaction_type Type of the reaction to set; pass null to remove the reaction. Custom emoji reactions can be used only by Telegram Premium users. Paid reactions can't be set @@ -11820,7 +12550,7 @@ getStoryAlbumStories chat_id:int53 story_album_id:int32 offset:int32 limit:int32 //@description Creates an album of stories; requires can_edit_stories administrator right for supergroup and channel chats //@story_poster_chat_id Identifier of the chat that posted the stories //@name Name of the album; 1-12 characters -//@story_ids Identifiers of stories to add to the album; 0-getOption("story_album_story_count_max") identifiers +//@story_ids Identifiers of stories to add to the album; 0-getOption("story_album_size_max") identifiers createStoryAlbum story_poster_chat_id:int53 name:string story_ids:vector = StoryAlbum; //@description 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 @@ -11843,8 +12573,8 @@ setStoryAlbumName chat_id:int53 story_album_id:int32 name:string = StoryAlbum; //-requires can_edit_stories administrator right in the chat. Returns the changed album //@chat_id Identifier of the chat that owns the stories //@story_album_id Identifier of the story album -//@story_ids Identifier of the stories to add to the album; 1-getOption("story_album_story_count_max") identifiers. -//-If after addition the album has more than getOption("story_album_story_count_max") stories, then the last one are removed from the album +//@story_ids 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 addStoryAlbumStories chat_id:int53 story_album_id:int32 story_ids:vector = StoryAlbum; //@description Removes stories from an album. If the album is owned by a supergroup or a channel chat, then @@ -11954,7 +12684,7 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; //@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is expected to be saved getSuggestedFileName file_id:int32 directory:string = Text; -//@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. +//@description 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 //@file File to upload @@ -12025,7 +12755,7 @@ removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cac searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads; -//@description Application or reCAPTCHA verification has been completed. Can be called before authorization +//@description Informs TDLib that application or reCAPTCHA verification has been completed. Can be called before authorization //@verification_id Unique identifier for the verification process as received from updateApplicationVerificationRequired or updateApplicationRecaptchaVerificationRequired //@token Play Integrity API token for the Android application, or secret from push notification for the iOS application for application verification, or reCAPTCHA token for reCAPTCHA verifications; //-pass an empty string to abort verification and receive the error "VERIFICATION_FAILED" for the request @@ -12134,7 +12864,7 @@ joinChatByInviteLink invite_link:string = Chat; //@limit The maximum number of requests to join the chat to return getChatJoinRequests chat_id:int53 invite_link:string query:string offset_request:chatJoinRequest limit:int32 = ChatJoinRequests; -//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve Pass true to approve the request; pass false to decline it +//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user who sent the request @approve Pass true to approve the request; pass false to decline it processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok; //@description Handles all pending join requests for a given link in a chat @@ -12157,7 +12887,7 @@ approveSuggestedPost chat_id:int53 message_id:int53 send_date:int32 = Ok; //@comment Comment for the creator of the suggested post; 0-128 characters declineSuggestedPost chat_id:int53 message_id:int53 comment:string = Ok; -//@description 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. +//@description 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 //@chat_id Identifier of the channel direct messages chat //@message_id Identifier of the message in the chat which will be sent as suggested post. Use messageProperties.can_add_offer to check whether an offer can be added @@ -12204,7 +12934,9 @@ sendCallLog call_id:int32 log_file:InputFile = Ok; //@description Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined @chat_id Chat identifier getVideoChatAvailableParticipants chat_id:int53 = MessageSenders; -//@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined @chat_id Chat identifier @default_participant_id Default group call participant identifier to join the video chats +//@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined +//@chat_id Chat identifier +//@default_participant_id Default group call participant identifier to join the video chats in the chat setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSender = Ok; //@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right @@ -12223,6 +12955,12 @@ getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; //@description Replaces the current RTMP URL for streaming to the video chat of a chat; requires owner privileges in the chat @chat_id Chat identifier replaceVideoChatRtmpUrl chat_id:int53 = RtmpUrl; +//@description Returns RTMP URL for streaming to a live story; requires can_post_stories administrator right for channel chats @chat_id Chat identifier +getLiveStoryRtmpUrl chat_id:int53 = RtmpUrl; + +//@description Replaces the current RTMP URL for streaming to a live story; requires owner privileges for channel chats @chat_id Chat identifier +replaceLiveStoryRtmpUrl chat_id:int53 = RtmpUrl; + //@description Returns information about a group call @group_call_id Group call identifier getGroupCall group_call_id:int32 = GroupCall; @@ -12234,26 +12972,31 @@ startScheduledVideoChat group_call_id:int32 = Ok; //@enabled_start_notification New value of the enabled_start_notification setting toggleVideoChatEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok; -//@description Joins a group call that is not bound to a chat @input_group_call The group call to join @join_parameters Parameters to join the call +//@description Joins a regular group call that is not bound to a chat @input_group_call The group call to join @join_parameters Parameters to join the call joinGroupCall input_group_call:InputGroupCall join_parameters:groupCallJoinParameters = GroupCallInfo; //@description Joins an active video chat. Returns join response payload for tgcalls //@group_call_id Group call identifier -//@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only +//@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self //@join_parameters Parameters to join the call //@invite_hash Invite hash as received from internalLinkTypeVideoChat joinVideoChat group_call_id:int32 participant_id:MessageSender join_parameters:groupCallJoinParameters invite_hash:string = Text; -//@description Starts screen sharing in a joined group call. Returns join response payload for tgcalls +//@description Joins a group call of an active live story. Returns join response payload for tgcalls +//@group_call_id Group call identifier +//@join_parameters Parameters to join the call +joinLiveStory group_call_id:int32 join_parameters:groupCallJoinParameters = Text; + +//@description Starts screen sharing in a joined group call; not supported in live stories. Returns join response payload for tgcalls //@group_call_id Group call identifier //@audio_source_id Screen sharing audio channel synchronization source identifier; received from tgcalls //@payload Group call join payload; received from tgcalls startGroupCallScreenSharing group_call_id:int32 audio_source_id:int32 payload:string = Text; -//@description Pauses or unpauses screen sharing in a joined group call @group_call_id Group call identifier @is_paused Pass true to pause screen sharing; pass false to unpause it +//@description Pauses or unpauses screen sharing in a joined group call; not supported in live stories @group_call_id Group call identifier @is_paused Pass true to pause screen sharing; pass false to unpause it toggleGroupCallScreenSharingIsPaused group_call_id:int32 is_paused:Bool = Ok; -//@description Ends screen sharing in a joined group call @group_call_id Group call identifier +//@description Ends screen sharing in a joined group call; not supported in live stories @group_call_id Group call identifier endGroupCallScreenSharing group_call_id:int32 = Ok; //@description Sets title of a video chat; requires groupCall.can_be_managed right @group_call_id Group call identifier @title New group call title; 1-64 characters @@ -12264,6 +13007,57 @@ setVideoChatTitle group_call_id:int32 title:string = Ok; //@mute_new_participants New value of the mute_new_participants setting toggleVideoChatMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; +//@description Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_are_messages_allowed right +//@group_call_id Group call identifier +//@are_messages_allowed New value of the are_messages_allowed setting +toggleGroupCallAreMessagesAllowed group_call_id:int32 are_messages_allowed:Bool = Ok; + +//@description Returns information about the user or the chat that streams to a live story; for live stories that aren't an RTMP stream only @group_call_id Group call identifier +getLiveStoryStreamer group_call_id:int32 = GroupCallParticipant; + +//@description Returns the list of message sender identifiers, on whose behalf messages can be sent to a live story @group_call_id Group call identifier +getLiveStoryAvailableMessageSenders group_call_id:int32 = ChatMessageSenders; + +//@description Selects a message sender to send messages in a live story call +//@group_call_id Group call identifier +//@message_sender_id New message sender for the group call +setLiveStoryMessageSender group_call_id:int32 message_sender_id:MessageSender = Ok; + +//@description Sends a message to other participants of a group call. Requires groupCall.can_send_messages right +//@group_call_id Group call identifier +//@text 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 +//@paid_message_star_count 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 +sendGroupCallMessage group_call_id:int32 text:formattedText paid_message_star_count:int53 = Ok; + +//@description 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 +//@group_call_id Group call identifier +//@star_count 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") +addPendingLiveStoryReaction group_call_id:int32 star_count:int53 = Ok; + +//@description Applies all pending paid reactions in a live story group call @group_call_id Group call identifier +commitPendingLiveStoryReactions group_call_id:int32 = Ok; + +//@description Removes all pending paid reactions in a live story group call @group_call_id Group call identifier +removePendingLiveStoryReactions group_call_id:int32 = Ok; + +//@description Deletes messages in a group call; for live story calls only. Requires groupCallMessage.can_be_deleted right +//@group_call_id Group call identifier +//@message_ids Identifiers of the messages to be deleted +//@report_spam Pass true to report the messages as spam +deleteGroupCallMessages group_call_id:int32 message_ids:vector report_spam:Bool = Ok; + +//@description Deletes all messages sent by the specified message sender in a group call; for live story calls only. Requires groupCall.can_delete_messages right +//@group_call_id Group call identifier +//@sender_id Identifier of the sender of messages to delete +//@report_spam Pass true to report the messages as spam +deleteGroupCallMessagesBySender group_call_id:int32 sender_id:MessageSender report_spam:Bool = Ok; + +//@description Returns the list of top live story donors @group_call_id Group call identifier of the live story +getLiveStoryTopDonors group_call_id:int32 = LiveStoryDonors; + //@description Invites a user to an active group call; for group calls not bound to a chat only. Sends a service message of the type messageGroupCall. //-The group call can have at most getOption("group_call_participant_count_max") participants //@group_call_id Group call identifier @@ -12310,19 +13104,24 @@ toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok; //@description Toggles whether current user's video is enabled @group_call_id Group call identifier @is_my_video_enabled Pass true if the current user's video is enabled toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok; +//@description 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 +//@group_call_id Group call identifier; must be an identifier of a live story call +//@paid_message_star_count The new minimum number of Telegram Stars; 0-getOption("paid_group_call_message_star_count_max") +setGroupCallPaidMessageStarCount group_call_id:int32 paid_message_star_count:int53 = Ok; + //@description Informs TDLib that speaking state of a participant of an active group call has changed. Returns identifier of the participant if it is found //@group_call_id Group call identifier //@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user //@is_speaking Pass true if the user is speaking setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = MessageSender; -//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves; not supported for live stories //@group_call_id Group call identifier //@participant_id Participant identifier //@is_muted Pass true to mute the user; pass false to unmute them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; -//@description 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, +//@description 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 //@group_call_id Group call identifier //@participant_id Participant identifier @@ -12340,7 +13139,8 @@ toggleGroupCallParticipantIsHandRaised group_call_id:int32 participant_id:Messag //@limit The maximum number of participants to return; must be positive getGroupCallParticipants input_group_call:InputGroupCall limit:int32 = GroupCallParticipants; -//@description 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 +//@description 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 //@group_call_id Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined //@limit The maximum number of participants to load; up to 100 loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; @@ -12348,19 +13148,19 @@ loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; //@description Leaves a group call @group_call_id Group call identifier leaveGroupCall group_call_id:int32 = Ok; -//@description Ends a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise @group_call_id Group call identifier +//@description Ends a group call. Requires groupCall.can_be_managed right for video chats and live stories or groupCall.is_owned otherwise @group_call_id Group call identifier endGroupCall group_call_id:int32 = Ok; -//@description Returns information about available video chat streams @group_call_id Group call identifier -getVideoChatStreams group_call_id:int32 = VideoChatStreams; +//@description Returns information about available streams in a video chat or a live story @group_call_id Group call identifier +getGroupCallStreams group_call_id:int32 = GroupCallStreams; -//@description Returns a file with a segment of a video chat stream in a modified OGG format for audio or MPEG-4 format for video +//@description 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 //@group_call_id Group call identifier //@time_offset Point in time when the stream segment begins; Unix timestamp in milliseconds //@scale Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds //@channel_id Identifier of an audio/video channel to get as received from tgcalls //@video_quality Video quality as received from tgcalls; pass null to get the worst available quality -getVideoChatStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = Data; +getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = Data; //@description Encrypts group call data before sending them over network using tgcalls //@group_call_id Group call identifier. The call must not be a video chat @@ -12397,13 +13197,15 @@ getBlockedMessageSenders block_list:BlockList offset:int32 limit:int32 = Message //@description Adds a user to the contact list or edits an existing contact by their user identifier -//@contact The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored +//@user_id Identifier of the user +//@contact The contact to add or edit; phone number may be empty and needs to be specified only if known //@share_phone_number 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 -addContact contact:contact share_phone_number:Bool = Ok; +addContact user_id:int53 contact:importedContact share_phone_number:Bool = Ok; -//@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported -importContacts contacts:vector = ImportedContacts; +//@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored +//@contacts The list of contacts to import or edit +importContacts contacts:vector = ImportedContacts; //@description Returns all contacts of the user getContacts = Users; @@ -12421,8 +13223,8 @@ getImportedContactCount = Count; //@description 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 -//@contacts The new list of contacts, contact's vCard are ignored and are not imported -changeImportedContacts contacts:vector = ImportedContacts; +//@contacts The new list of contacts to import +changeImportedContacts contacts:vector = ImportedContacts; //@description Clears all imported contacts, contact list remains unchanged clearImportedContacts = Ok; @@ -12436,11 +13238,21 @@ getCloseFriends = Users; //@description Changes a personal profile photo of a contact user @user_id User identifier @photo Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; +//@description Changes a note of a contact user +//@user_id User identifier +//@note 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 +setUserNote user_id:int53 note:formattedText = Ok; + //@description Suggests a profile photo to another regular user with common messages and allowing non-paid messages //@user_id User identifier //@photo Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function suggestUserProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; +//@description Suggests a birthdate to another regular user with common messages and allowing non-paid messages +//@user_id User identifier +//@birthdate Birthdate to suggest +suggestUserBirthdate user_id:int53 birthdate:birthdate = Ok; + //@description Toggles whether the bot can manage emoji status of the current user @bot_user_id User identifier of the bot @can_manage_emoji_status Pass true if the bot is allowed to change emoji status of the user; pass false otherwise toggleBotCanManageEmojiStatus bot_user_id:int53 can_manage_emoji_status:Bool = Ok; @@ -12493,6 +13305,12 @@ removeProfileAudio file_id:int32 = Ok; //@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message getStickerOutline sticker_file_id:int32 for_animated_emoji:Bool for_clicked_animated_emoji_message:Bool = Outline; +//@description Returns outline of a sticker as an SVG path. This is an offline method. Returns an empty string if the outline isn't known +//@sticker_file_id File identifier of the sticker +//@for_animated_emoji Pass true to get the outline scaled for animated emoji +//@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message +getStickerOutlineSvgPath sticker_file_id:int32 for_animated_emoji:Bool for_clicked_animated_emoji_message:Bool = Text; + //@description Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned //@sticker_type Type of the stickers to return //@query Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers @@ -12600,7 +13418,7 @@ getStickerEmojis sticker:InputFile = Emojis; //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown searchEmojis text:string input_language_codes:vector = EmojiKeywords; -//@description Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +//@description Returns emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified //@text Text to search for //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown getKeywordEmojis text:string input_language_codes:vector = Emojis; @@ -12679,6 +13497,10 @@ deleteProfilePhoto profile_photo_id:int64 = Ok; //@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none setAccentColor accent_color_id:int32 background_custom_emoji_id:int64 = Ok; +//@description Changes color scheme for the current user based on an owned or a hosted upgraded gift; for Telegram Premium users only +//@upgraded_gift_colors_id Identifier of the upgradedGiftColors scheme to use +setUpgradedGiftColors upgraded_gift_colors_id:int64 = Ok; + //@description Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only //@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none //@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none @@ -12752,7 +13574,7 @@ reportPhoneNumberCodeMissing mobile_network_code:string = Ok; //@reason Reason of code resending; pass null if unknown resendPhoneNumberCode reason:ResendCodeReason = AuthenticationCodeInfo; -//@description Check the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check +//@description Checks the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check checkPhoneNumberCode code:string = Ok; @@ -12870,7 +13692,7 @@ editBotMediaPreview bot_user_id:int53 language_code:string file_id:int32 content //@file_ids File identifiers of the media in the new order reorderBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector = Ok; -//@description Delete media previews from the list of media previews of a bot +//@description Deletes media previews from the list of media previews of a bot //@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App //@language_code Language code of the media previews to delete //@file_ids File identifiers of the media to delete @@ -12891,7 +13713,8 @@ getBotName bot_user_id:int53 language_code:string = Text; //@description Changes a profile photo for a bot @bot_user_id Identifier of the target bot @photo Profile photo to set; pass null to delete the chat photo setBotProfilePhoto bot_user_id:int53 photo:InputChatPhoto = Ok; -//@description 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 +//@description 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 //@bot_user_id Identifier of the target bot //@username The username to change //@is_active Pass true to activate the username; pass false to disable it @@ -13018,7 +13841,7 @@ toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool show_message toggleSupergroupJoinToSendMessages supergroup_id:int53 join_to_send_messages:Bool = Ok; //@description Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right -//@supergroup_id Identifier of the supergroup that isn't a broadcast group +//@supergroup_id Identifier of the supergroup that isn't a broadcast group and isn't a channel direct message group //@join_by_request New value of join_by_request toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok; @@ -13143,6 +13966,32 @@ canSendGift gift_id:int64 = CanSendGiftResult; //@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free sendGift gift_id:int64 owner_id:MessageSender text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok; +//@description Returns auction state for a gift @auction_id Unique identifier of the auction +getGiftAuctionState auction_id:string = GiftAuctionState; + +//@description Returns the gifts that were acquired by the current user on a gift auction @gift_id Identifier of the auctioned gift +getGiftAuctionAcquiredGifts gift_id:int64 = GiftAuctionAcquiredGifts; + +//@description Informs TDLib that a gift auction was opened by the user @gift_id Identifier of the gift, which auction was opened +openGiftAuction gift_id:int64 = Ok; + +//@description Informs TDLib that a gift auction was closed by the user @gift_id Identifier of the gift, which auction was closed +closeGiftAuction gift_id:int64 = Ok; + +//@description Places a bid on an auction gift +//@gift_id Identifier of the gift to place the bid on +//@star_count The number of Telegram Stars to place in the bid +//@user_id Identifier of the user who will receive the gift +//@text 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 +//@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them +placeGiftAuctionBid gift_id:int64 star_count:int53 user_id:int53 text:formattedText is_private:Bool = Ok; + +//@description Increases a bid for an auction gift without changing gift text and receiver +//@gift_id Identifier of the gift to put the bid on +//@star_count The number of Telegram Stars to put in the bid +increaseGiftAuctionBid gift_id:int64 star_count:int53 = Ok; + //@description Sells a gift for Telegram Stars; requires owner privileges for gifts owned by a chat //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@received_gift_id Identifier of the gift @@ -13163,29 +14012,44 @@ setPinnedGifts owner_id:MessageSender received_gift_ids:vector = Ok; //@are_enabled Pass true to enable notifications about new gifts owned by the channel chat; pass false to disable the notifications toggleChatGiftNotifications chat_id:int53 are_enabled:Bool = Ok; -//@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift -getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview; +//@description Returns examples of possible upgraded gifts for a regular gift @regular_gift_id Identifier of the regular gift +getGiftUpgradePreview regular_gift_id:int64 = GiftUpgradePreview; + +//@description Returns all possible variants of upgraded gifts for a regular gift +//@regular_gift_id Identifier of the regular gift +//@return_upgrade_models Pass true to get models that can be obtained by upgrading a regular gift +//@return_craft_models Pass true to get models that can be obtained by crafting a gift from upgraded gifts +getUpgradedGiftVariants regular_gift_id:int64 return_upgrade_models:Bool return_craft_models:Bool = GiftUpgradeVariants; //@description Upgrades a regular gift //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@received_gift_id Identifier of the gift //@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift -//@star_count 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 +//@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 upgradeGift business_connection_id:string received_gift_id:string keep_original_details:Bool star_count:int53 = UpgradeGiftResult; //@description Pays for upgrade of a regular gift that is owned by another user or channel chat //@owner_id Identifier of the user or the channel chat that owns the gift //@prepaid_upgrade_hash Prepaid upgrade hash as received along with the gift -//@star_count The amount of Telegram Stars the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count +//@star_count The Telegram Star amount the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count buyGiftUpgrade owner_id:MessageSender prepaid_upgrade_hash:string star_count:int53 = Ok; +//@description Crafts a new gift from other gifts that will be permanently lost +//@received_gift_ids Identifier of the gifts to use for crafting +craftGift received_gift_ids:vector = CraftGiftResult; + //@description Sends an upgraded gift to another user or channel chat //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@received_gift_id Identifier of the gift //@new_owner_id Identifier of the user or the channel chat that will receive the gift -//@star_count The amount of Telegram Stars required to pay for the transfer +//@star_count The Telegram Star amount required to pay for the transfer transferGift business_connection_id:string received_gift_id:string new_owner_id:MessageSender star_count:int53 = Ok; +//@description Drops original details for an upgraded gift +//@received_gift_id Identifier of the gift +//@star_count The Telegram Star amount required to pay for the operation +dropGiftOriginalDetails received_gift_id:string star_count:int53 = Ok; + //@description 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 //@gift_name Name of the upgraded gift to send @@ -13193,6 +14057,19 @@ transferGift business_connection_id:string received_gift_id:string new_owner_id: //@price The price that the user agreed to pay for the gift sendResoldGift gift_name:string owner_id:MessageSender price:GiftResalePrice = GiftResaleResult; +//@description Sends an offer to purchase an upgraded gift +//@owner_id Identifier of the user or the channel chat that currently owns the gift and will receive the offer +//@gift_name Name of the upgraded gift +//@price The price that the user agreed to pay for the gift +//@duration 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 +//@paid_message_star_count 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 +sendGiftPurchaseOffer owner_id:MessageSender gift_name:string price:GiftResalePrice duration:int32 paid_message_star_count:int53 = Ok; + +//@description Handles a pending gift purchase offer +//@message_id Identifier of the message with the gift purchase offer +//@accept Pass true to accept the request; pass false to reject it +processGiftPurchaseOffer message_id:int53 accept:Bool = Ok; + //@description Returns gifts received by the given user or chat //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@owner_id Identifier of the gift receiver @@ -13203,14 +14080,22 @@ sendResoldGift gift_name:string owner_id:MessageSender price:GiftResalePrice = G //@exclude_upgradable Pass true to exclude gifts that can be purchased limited number of times and can be upgraded //@exclude_non_upgradable Pass true to exclude gifts that can be purchased limited number of times and can't be upgraded //@exclude_upgraded Pass true to exclude upgraded gifts +//@exclude_without_colors Pass true to exclude gifts that can't be used in setUpgradedGiftColors +//@exclude_hosted Pass true to exclude gifts that are just hosted and are not owned by the owner //@sort_by_price Pass true to sort results by gift price instead of send date //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of 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 -getReceivedGifts business_connection_id:string owner_id:MessageSender collection_id:int32 exclude_unsaved:Bool exclude_saved:Bool exclude_unlimited:Bool exclude_upgradable:Bool exclude_non_upgradable:Bool exclude_upgraded:Bool sort_by_price:Bool offset:string limit:int32 = ReceivedGifts; +getReceivedGifts business_connection_id:string owner_id:MessageSender collection_id:int32 exclude_unsaved:Bool exclude_saved:Bool exclude_unlimited:Bool exclude_upgradable:Bool exclude_non_upgradable:Bool exclude_upgraded:Bool exclude_without_colors:Bool exclude_hosted:Bool sort_by_price:Bool offset:string limit:int32 = ReceivedGifts; //@description Returns information about a received gift @received_gift_id Identifier of the gift getReceivedGift received_gift_id:string = ReceivedGift; +//@description Returns upgraded gifts of the current user who can be used to craft another gifts +//@regular_gift_id Identifier of the regular gift that will be used for crafting +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of 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 +getGiftsForCrafting regular_gift_id:int64 offset:string limit:int32 = GiftsForCrafting; + //@description Returns information about an upgraded gift by its name @name Unique name of the upgraded gift getUpgradedGift name:string = UpgradedGift; @@ -13222,6 +14107,9 @@ getUpgradedGiftValueInfo name:string = UpgradedGiftValueInfo; //@password The 2-step verification password of the current user getUpgradedGiftWithdrawalUrl received_gift_id:string password:string = HttpUrl; +//@description Returns promotional anumation for upgraded gifts +getUpgradedGiftsPromotionalAnimation = Animation; + //@description Changes resale price of a unique gift owned by the current user //@received_gift_id Identifier of the unique gift //@price The new price for the unique gift; pass null to disallow gift resale. The current user will receive @@ -13232,11 +14120,12 @@ setGiftResalePrice received_gift_id:string price:GiftResalePrice = Ok; //@description Returns upgraded gifts that can be bought from other owners using sendResoldGift //@gift_id Identifier of the regular gift that was upgraded to a unique gift //@order Order in which the results will be sorted +//@for_crafting Pass true to get only gifts suitable for crafting //@attributes 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 //@offset 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 //@limit The maximum number of gifts to return -searchGiftsForResale gift_id:int64 order:GiftForResaleOrder attributes:vector offset:string limit:int32 = GiftsForResale; +searchGiftsForResale gift_id:int64 order:GiftForResaleOrder for_crafting:Bool attributes:vector offset:string limit:int32 = GiftsForResale; //@description Returns collections of gifts owned by the given user or chat @@ -13247,7 +14136,7 @@ getGiftCollections owner_id:MessageSender = GiftCollections; //-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 //@owner_id Identifier of the user or the channel chat that received the gifts //@name Name of the collection; 1-12 characters -//@received_gift_ids Identifier of the gifts to add to the collection; 0-getOption("gift_collection_gift_count_max") identifiers +//@received_gift_ids Identifier of the gifts to add to the collection; 0-getOption("gift_collection_size_max") identifiers createGiftCollection owner_id:MessageSender name:string received_gift_ids:vector = GiftCollection; //@description 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 @@ -13269,8 +14158,8 @@ setGiftCollectionName owner_id:MessageSender collection_id:int32 name:string = G //@description 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 //@owner_id Identifier of the user or the channel chat that owns the collection //@collection_id Identifier of the gift collection -//@received_gift_ids Identifier of the gifts to add to the collection; 1-getOption("gift_collection_gift_count_max") identifiers. -//-If after addition the collection has more than getOption("gift_collection_gift_count_max") gifts, then the last one are removed from the collection +//@received_gift_ids 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 addGiftCollectionGifts owner_id:MessageSender collection_id:int32 received_gift_ids:vector = GiftCollection; //@description 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 @@ -13292,12 +14181,12 @@ reorderGiftCollectionGifts owner_id:MessageSender collection_id:int32 received_g createInvoiceLink business_connection_id:string invoice:InputMessageContent = HttpUrl; //@description Refunds a previously done payment in Telegram Stars; for bots only -//@user_id Identifier of the user that did the payment +//@user_id Identifier of the user who did the payment //@telegram_payment_charge_id Telegram payment identifier refundStarPayment user_id:int53 telegram_payment_charge_id:string = Ok; -//@description Returns a user that can be contacted to get support +//@description Returns a user who can be contacted to get support getSupportUser = User; @@ -13403,14 +14292,14 @@ getPaidMessageRevenue user_id:int53 = StarCount; //@refund_payments Pass true to refund the user previously paid messages allowUnpaidMessagesFromUser user_id:int53 refund_payments:Bool = Ok; -//@description 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 +//@description 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 //@chat_id Identifier of the supergroup chat //@paid_message_star_count The new number of Telegram Stars that must be paid for each message that is sent to the supergroup chat unless the sender is an administrator of the chat; 0-getOption("paid_message_star_count_max"). //-The supergroup will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending setChatPaidMessageStarCount chat_id:int53 paid_message_star_count:int53 = Ok; -//@description Check whether the current user can message another user or try to create a chat with them +//@description Checks whether the current user can message another user or try to create a chat with them //@user_id Identifier of the other user //@only_local Pass true to get only locally available information without sending network requests canSendMessageToUser user_id:int53 only_local:Bool = CanSendMessageToUserResult; @@ -13611,7 +14500,7 @@ setPassportElement element:InputPassportElement password:string = PassportElemen //@description Deletes a Telegram Passport element @type Element type deletePassportElement type:PassportElementType = Ok; -//@description 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 @user_id User identifier @errors The errors +//@description 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 @user_id User identifier @errors The errors setPassportElementErrors user_id:int53 errors:vector = Ok; @@ -13773,7 +14662,7 @@ getPremiumGiftPaymentOptions = PremiumGiftPaymentOptions; //@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user getPremiumGiveawayPaymentOptions boosted_chat_id:int53 = PremiumGiveawayPaymentOptions; -//@description Return information about a Telegram Premium gift code @code The code to check +//@description Returns information about a Telegram Premium gift code @code The code to check checkPremiumGiftCode code:string = PremiumGiftCodeInfo; //@description Applies a Telegram Premium gift code @code The code to apply @@ -13801,7 +14690,7 @@ getGiveawayInfo chat_id:int53 message_id:int53 = GiveawayInfo; //@description Returns available options for Telegram Stars purchase getStarPaymentOptions = StarPaymentOptions; -//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user +//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user who will receive Telegram Stars; pass 0 to get options for an unspecified user getStarGiftPaymentOptions user_id:int53 = StarPaymentOptions; //@description Returns available options for Telegram Star giveaway creation @@ -13870,7 +14759,7 @@ connectAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAff //@url The referral link of the affiliate program disconnectAffiliateProgram affiliate:AffiliateType url:string = ConnectedAffiliateProgram; -//@description Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program +//@description Returns an affiliate program that was connected to the given affiliate by identifier of the bot that created the program //@affiliate The affiliate to which the affiliate program will be connected //@bot_user_id Identifier of the bot that created the program getConnectedAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram; @@ -13944,19 +14833,15 @@ getApplicationDownloadLink = HttpUrl; //@description Adds a proxy server for network requests. Can be called before authorization -//@server Proxy server domain or IP address -//@port Proxy server port +//@proxy The proxy to add //@enable Pass true to immediately enable the proxy -//@type Proxy type -addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; +addProxy proxy:proxy enable:Bool = AddedProxy; //@description Edits an existing proxy server for network requests. Can be called before authorization //@proxy_id Proxy identifier -//@server Proxy server domain or IP address -//@port Proxy server port +//@proxy The new information about the proxy //@enable Pass true to immediately enable the proxy -//@type Proxy type -editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy; +editProxy proxy_id:int32 proxy:proxy enable:Bool = AddedProxy; //@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier enableProxy proxy_id:int32 = Ok; @@ -13968,13 +14853,11 @@ disableProxy = Ok; removeProxy proxy_id:int32 = Ok; //@description Returns the list of proxies that are currently set up. Can be called before authorization -getProxies = Proxies; +getProxies = AddedProxies; -//@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier -getProxyLink proxy_id:int32 = HttpUrl; - -//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @proxy_id Proxy identifier. Use 0 to ping a Telegram server without a proxy -pingProxy proxy_id:int32 = Seconds; +//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization +//@proxy The proxy to test; pass null to ping a Telegram server without a proxy +pingProxy proxy:proxy = Seconds; //@description Sets new log stream for internal logging of TDLib. Can be called synchronously @log_stream New log stream @@ -14046,12 +14929,10 @@ testSquareInt x:int32 = TestInt; testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization -//@server Proxy server domain or IP address -//@port Proxy server port -//@type Proxy type +//@proxy The proxy to test //@dc_id Identifier of a datacenter with which to test connection //@timeout The maximum overall timeout for the request -testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok; +testProxy proxy:proxy dc_id:int32 timeout:double = Ok; //@description Forces an updates.getDifference call to the Telegram servers; for testing only testGetDifference = Ok; diff --git a/example/media/Meru_01.png b/example/media/Meru_01.png new file mode 100644 index 0000000..05e1205 Binary files /dev/null and b/example/media/Meru_01.png differ diff --git a/example/media/Meru_02.png b/example/media/Meru_02.png new file mode 100644 index 0000000..c0ee587 Binary files /dev/null and b/example/media/Meru_02.png differ diff --git a/example/media/Photo_or_Album.go b/example/media/Photo_or_Album.go index 0b7138d..f69fbe3 100644 --- a/example/media/Photo_or_Album.go +++ b/example/media/Photo_or_Album.go @@ -101,7 +101,7 @@ func main() { }, InputMessageContent: &tdlib.InputMessagePhoto{ Photo: &tdlib.InputFileLocal{ - Path: "./myht9-1486821485193084928.jpg", + Path: "./Meru_01.png", }, Caption: text, }, @@ -123,13 +123,13 @@ func main() { InputMessageContents: []tdlib.InputMessageContent{ &tdlib.InputMessagePhoto{ Photo: &tdlib.InputFileLocal{ - Path: "./myht9-1486821485193084928.jpg", + Path: "./Meru_01.png", }, Caption: text, }, &tdlib.InputMessagePhoto{ Photo: &tdlib.InputFileLocal{ - Path: "./hisagi_02-1486983199280738309.jpg", + Path: "./Meru_02.png", }, }, }, diff --git a/example/media/hisagi_02-1486983199280738309.jpg b/example/media/hisagi_02-1486983199280738309.jpg deleted file mode 100644 index 7bc282f..0000000 Binary files a/example/media/hisagi_02-1486983199280738309.jpg and /dev/null differ diff --git a/example/media/myht9-1486821485193084928.jpg b/example/media/myht9-1486821485193084928.jpg deleted file mode 100644 index 3acc5b1..0000000 Binary files a/example/media/myht9-1486821485193084928.jpg and /dev/null differ