From 17fb32a4eb7f1f9db43c082f9651b135db950e3c Mon Sep 17 00:00:00 2001 From: c0re100 Date: Sun, 15 Nov 2026 00:40:24 +0800 Subject: [PATCH] Update to TDLib 1.8.70 --- client/function.go | 2440 +++++++++++++++++++- client/type.go | 4925 +++++++++++++++++++++++++++++++++++++---- client/unmarshaler.go | 2259 +++++++++++++++++-- data/td_api.tl | 2776 ++++++++++++++++++----- 4 files changed, 11078 insertions(+), 1322 deletions(-) diff --git a/client/function.go b/client/function.go index b9d4482..4afbf67 100755 --- a/client/function.go +++ b/client/function.go @@ -262,7 +262,7 @@ type ResendAuthenticationCodeRequest struct { Reason ResendCodeReason `json:"reason"` } -// Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode +// Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, authorization_state.code_info.next_type is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode func (client *Client) ResendAuthenticationCode(req *ResendAuthenticationCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -479,7 +479,7 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -// Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true +// Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.email_address_reset_state != null func (client *Client) ResetAuthenticationEmailAddress() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -1207,7 +1207,7 @@ type CreateTemporaryPasswordRequest struct { ValidFor int32 `json:"valid_for"` } -// Creates a new temporary password for processing payments +// Creates a new temporary password for processing payments and withdrawal of upgraded gifts func (client *Client) CreateTemporaryPassword(req *CreateTemporaryPasswordRequest) (*TemporaryPasswordState, error) { result, err := client.Send(Request{ meta: meta{ @@ -1567,7 +1567,7 @@ type GetChatPinnedMessageRequest struct { ChatId int64 `json:"chat_id"` } -// Returns information about a newest pinned message in the chat. Returns a 404 error if the message doesn't exist +// Returns information about the newest pinned message in the chat. Returns a 404 error if the message doesn't exist func (client *Client) GetChatPinnedMessage(req *GetChatPinnedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1650,7 +1650,7 @@ func (client *Client) GetMessages(req *GetMessagesRequest) (*Messages, error) { } type GetFullRichMessageRequest struct { - // Identifier of the chat the messages belong to + // Identifier of the chat the message belongs to ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` @@ -1935,7 +1935,7 @@ type LoadChatsRequest struct { Limit int32 `json:"limit"` } -// Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded +// Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chatPosition.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded func (client *Client) LoadChats(req *LoadChatsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2638,6 +2638,25 @@ func (client *Client) GetSuitablePersonalChats() (*Chats, error) { return UnmarshalChats(result.Data) } +// Returns a list of supergroup and channel chats owned by the current user, which can be added to a community +func (client *Client) GetSuitableCommunityChats() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuitableCommunityChats", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type LoadDirectMessagesChatTopicsRequest struct { // Chat identifier of the channel direct messages chat ChatId int64 `json:"chat_id"` @@ -2709,7 +2728,7 @@ type GetDirectMessagesChatTopicHistoryRequest struct { Limit int32 `json:"limit"` } -// Returns messages in the topic in a channel direct messages chat administered by the current user. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +// Returns messages in the topic in a channel direct messages chat administered by the current user. The messages are returned in reverse chronological order (i.e., in order of decreasing message.id) func (client *Client) GetDirectMessagesChatTopicHistory(req *GetDirectMessagesChatTopicHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3021,7 +3040,7 @@ type GetSavedMessagesTopicHistoryRequest struct { Limit int32 `json:"limit"` } -// Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +// Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message.id) func (client *Client) GetSavedMessagesTopicHistory(req *GetSavedMessagesTopicHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3187,16 +3206,16 @@ func (client *Client) SetPinnedSavedMessagesTopics(req *SetPinnedSavedMessagesTo return UnmarshalOk(result.Data) } -type LoadCommunityFullInfoRequest struct { +type GetCommunityFullInfoRequest struct { // Community identifier CommunityId int64 `json:"community_id"` } -// Returns full information about a community. The data will be sent through update. -func (client *Client) LoadCommunityFullInfo(req *LoadCommunityFullInfoRequest) (*Ok, error) { +// Returns full information about a community +func (client *Client) GetCommunityFullInfo(req *GetCommunityFullInfoRequest) (*CommunityFullInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "loadCommunityFullInfo", + Type: "getCommunityFullInfo", }, Data: map[string]interface{}{ "community_id": req.CommunityId, @@ -3210,7 +3229,26 @@ func (client *Client) LoadCommunityFullInfo(req *LoadCommunityFullInfoRequest) ( return nil, buildResponseError(result.Data) } - return UnmarshalOk(result.Data) + return UnmarshalCommunityFullInfo(result.Data) +} + +// Returns the list of communities joined by the current user +func (client *Client) GetJoinedCommunities() (*Communities, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getJoinedCommunities", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCommunities(result.Data) } type CreateCommunityRequest struct { @@ -3274,6 +3312,363 @@ func (client *Client) SetCommunityName(req *SetCommunityNameRequest) (*Ok, error return UnmarshalOk(result.Data) } +type SetCommunityPhotoRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // New community photo; pass null to delete the community photo + Photo InputChatPhoto `json:"photo"` +} + +// Changes the photo of a community; requires can_change_info administrator right in the community +func (client *Client) SetCommunityPhoto(req *SetCommunityPhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCommunityPhoto", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetCommunityPermissionsRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // New permissions of the community + Permissions *CommunityPermissions `json:"permissions"` +} + +// Changes permissions of regular members in the given community; requires can_ban_members administrator right in the community +func (client *Client) SetCommunityPermissions(req *SetCommunityPermissionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCommunityPermissions", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "permissions": req.Permissions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetCommunityNotificationSettingsRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // New notification settings for the community + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` +} + +// Changes notification settings of a community +func (client *Client) SetCommunityNotificationSettings(req *SetCommunityNotificationSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCommunityNotificationSettings", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "notification_settings": req.NotificationSettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddCommunityChatRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Identifier of the chat to add; only chats with owned bots and owned basic group, supergroup and channel chats are allowed; basic group chats will be automatically upgraded to supergroup chats. A community can have up to getOption("community_chat_count_max") supergroup and channel chats and up to getOption("community_bot_count_max") chats with bots; otherwise, the method fails with the error "COMMUNITY_PEERS_TOO_MUCH" + ChatId int64 `json:"chat_id"` + // Pass true if the chat will be visible only to administrators of the community + IsHidden bool `json:"is_hidden"` +} + +// Adds a chat to a community. If the current user isn't allowed to change the list of chats in the community, then a request to add the chat is sent to administrators of the community instead and the method fails with the error "COMMUNITY_REQUEST_CREATED" +func (client *Client) AddCommunityChat(req *AddCommunityChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addCommunityChat", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "chat_id": req.ChatId, + "is_hidden": req.IsHidden, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveCommunityChatRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Identifier of the chat to remove + ChatId int64 `json:"chat_id"` +} + +// Removes a chat from a community. Members of the chat, which aren't members of other chats in the community, will be removed from the community. Requires owner privileges in the supergroup or channel chat, or ownership of the bot for chats with bots, or can_edit_chat_list administrator right in the community +func (client *Client) RemoveCommunityChat(req *RemoveCommunityChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeCommunityChat", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetCommunityAddChatRequestsRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_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 requests to return + Limit int32 `json:"limit"` +} + +// Returns pending requests to add chats to a community. Administrators of the community with can_edit_chat_list right receive all requests; other users receive only requests sent by them +func (client *Client) GetCommunityAddChatRequests(req *GetCommunityAddChatRequestsRequest) (*CommunityAddChatRequests, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCommunityAddChatRequests", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCommunityAddChatRequests(result.Data) +} + +type ProcessCommunityAddChatRequestRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Identifier of the chat from the request + ChatId int64 `json:"chat_id"` + // Pass true to approve the request and add the chat to the community; pass false to decline it. If the community already has the maximum number of chats, then approval fails with the error "COMMUNITY_PEERS_TOO_MUCH" + Approve bool `json:"approve"` +} + +// Handles a pending request to add a chat to a community; requires can_edit_chat_list administrator right in the community +func (client *Client) ProcessCommunityAddChatRequest(req *ProcessCommunityAddChatRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processCommunityAddChatRequest", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "chat_id": req.ChatId, + "approve": req.Approve, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ProcessCommunityAddChatRequestsRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Pass true to approve all requests and add the chats to the community; pass false to decline them + Approve bool `json:"approve"` +} + +// Handles all pending requests to add chats to a community; requires can_edit_chat_list administrator right in the community +func (client *Client) ProcessCommunityAddChatRequests(req *ProcessCommunityAddChatRequestsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processCommunityAddChatRequests", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "approve": req.Approve, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleCommunityAreChatsCollapsedRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Pass true to collapse all chats of the community into one entry in the chat list + AreChatsCollapsed bool `json:"are_chats_collapsed"` +} + +// Changes whether all chats of a community are collapsed into one entry in the chat list. If the chats are expanded, then the community is removed from all chat folders +func (client *Client) ToggleCommunityAreChatsCollapsed(req *ToggleCommunityAreChatsCollapsedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleCommunityAreChatsCollapsed", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "are_chats_collapsed": req.AreChatsCollapsed, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleCommunityMemberIsBannedRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Identifier of the member to ban or unban + MemberId MessageSender `json:"member_id"` + // Pass true to ban the member; pass false to unban the member + IsBanned bool `json:"is_banned"` +} + +// Bans or unbans a member of a community; requires can_ban_members administrator right in the community. A banned member is banned in all chats of the community. Administrators of the community can be banned only by the owner of the community and administrators, which can edit administrator rights of the member. If an owner of a chat in the community is banned, then the chat is removed from the community; in this case, can_edit_chat_list administrator right is also required +func (client *Client) ToggleCommunityMemberIsBanned(req *ToggleCommunityMemberIsBannedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleCommunityMemberIsBanned", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "member_id": req.MemberId, + "is_banned": req.IsBanned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetCommunityMemberChatsRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // Identifier of the member + MemberId MessageSender `json:"member_id"` +} + +// Returns chats in a community, which were joined by a member of the community; requires can_ban_members administrator right in the community. Can be used to show chats that will be affected by the member ban +func (client *Client) GetCommunityMemberChats(req *GetCommunityMemberChatsRequest) (*CommunityMemberChats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCommunityMemberChats", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "member_id": req.MemberId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCommunityMemberChats(result.Data) +} + +type DeleteCommunityRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` +} + +// Deletes a community; requires owner privileges +func (client *Client) DeleteCommunity(req *DeleteCommunityRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteCommunity", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetGroupsInCommonRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -3319,7 +3714,7 @@ type GetChatHistoryRequest struct { OnlyLocal bool `json:"only_local"` } -// Returns messages in a chat. 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. This is an offline method if only_local is true +// Returns messages in a chat. 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. This is an offline method if only_local is true func (client *Client) GetChatHistory(req *GetChatHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3357,7 +3752,7 @@ type GetMessageThreadHistoryRequest struct { Limit int32 `json:"limit"` } -// Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. 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 +// Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. 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) GetMessageThreadHistory(req *GetMessageThreadHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3459,7 +3854,7 @@ type SearchChatMessagesRequest struct { Filter SearchMessagesFilter `json:"filter"` } -// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and topic_id search criteria is expected to be supported, only if it is required for Telegram official application implementation +// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message.id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and topic_id search criteria is expected to be supported, only if it is required for Telegram official application implementation func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*FoundChatMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3506,7 +3901,7 @@ type SearchMessagesRequest struct { MaxDate int32 `json:"max_date"` } -// Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +// Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (message.date, message.chat_id, message.id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit func (client *Client) SearchMessages(req *SearchMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3587,7 +3982,7 @@ type SearchSavedMessagesRequest struct { Limit int32 `json:"limit"` } -// Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +// Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message.id. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit func (client *Client) SearchSavedMessages(req *SearchSavedMessagesRequest) (*FoundChatMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3622,7 +4017,7 @@ type SearchCallMessagesRequest struct { OnlyMissed bool `json:"only_missed"` } -// Searches for call and group call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +// Searches for call and group call messages. Returns the results 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) SearchCallMessages(req *SearchCallMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -4182,7 +4577,7 @@ type GetChatScheduledMessagesRequest struct { ChatId int64 `json:"chat_id"` } -// Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +// Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message.id) func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -5107,7 +5502,7 @@ type ComposeTextWithAiRequest struct { Text *FormattedText `json:"text"` // Pass a language code to which the text will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values TranslateToLanguageCode string `json:"translate_to_language_code"` - // Name of the style of the resulted text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text + // Name of the style of the resulting text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text StyleName string `json:"style_name"` // Pass true to add emoji to the text AddEmojis bool `json:"add_emojis"` @@ -5142,7 +5537,7 @@ type ComposeRichMessageWithAiRequest struct { Message *InputRichMessage `json:"message"` // Pass a language code to which the text will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values TranslateToLanguageCode string `json:"translate_to_language_code"` - // Name of the style of the resulted text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text or if a custom prompt is used + // Name of the style of the resulting text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text or if a custom prompt is used StyleName string `json:"style_name"` // Custom prompt that will be used instead of style_name; 0-getOption("text_composition_style_prompt_length_max") characters CustomPrompt string `json:"custom_prompt"` @@ -5259,6 +5654,58 @@ func (client *Client) FixRichMessageWithAi(req *FixRichMessageWithAiRequest) (*R return UnmarshalRichMessage(result.Data) } +type FixRecognizedTextWithAiRequest struct { + // The recognized text + Text *FormattedText `json:"text"` +} + +// Fixes text received as a result of speech recognition using an AI model by correcting recognition errors and adding punctuation; must not be used in secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) FixRecognizedTextWithAi(req *FixRecognizedTextWithAiRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "fixRecognizedTextWithAi", + }, + Data: map[string]interface{}{ + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + +type FixRecognizedRichMessageWithAiRequest struct { + // The message with the recognized text + Message *InputRichMessage `json:"message"` +} + +// Fixes a rich message with text received as a result of speech recognition using an AI model by correcting recognition errors and adding punctuation. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) FixRecognizedRichMessageWithAi(req *FixRecognizedRichMessageWithAiRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "fixRecognizedRichMessageWithAi", + }, + Data: map[string]interface{}{ + "message": req.Message, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRichMessage(result.Data) +} + type RecognizeSpeechRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -5320,6 +5767,61 @@ func (client *Client) RateSpeechRecognition(req *RateSpeechRecognitionRequest) ( return UnmarshalOk(result.Data) } +type RecognizeSpeechInFileRequest struct { + // The audio file + AudioFile InputFile `json:"audio_file"` + // Unique identifier of the speech recognition, which will be used in updateSpeechRecognitionInFile to send partially recognized text; pass 0 if partial results aren't needed + RecognitionId JsonInt64 `json:"recognition_id"` +} + +// Recognizes speech in an audio file and returns the recognized text. The file must be in OGG format with Opus codec and must have size up to 1 MB. The same rules as for recognizeSpeech apply to the Telegram Premium requirement and speech recognition trial; must not be used in secret chats +func (client *Client) RecognizeSpeechInFile(req *RecognizeSpeechInFileRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "recognizeSpeechInFile", + }, + Data: map[string]interface{}{ + "audio_file": req.AudioFile, + "recognition_id": req.RecognitionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type GetSpeechRecognitionLanguagesRequest struct { + // Identifier of the chat; pass 0 if none + ChatId int64 `json:"chat_id"` +} + +// Returns 1-3 most probable languages of speech in voice notes +func (client *Client) GetSpeechRecognitionLanguages(req *GetSpeechRecognitionLanguagesRequest) (*SpeechRecognitionLanguages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSpeechRecognitionLanguages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSpeechRecognitionLanguages(result.Data) +} + type GetChatAvailableMessageSendersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5499,7 +6001,7 @@ type SendInlineQueryResultMessageRequest struct { QueryId JsonInt64 `json:"query_id"` // Identifier of the inline query result ResultId string `json:"result_id"` - // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") + // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username") and getOption("photo_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -5684,7 +6186,7 @@ type SendEphemeralMessageRequest struct { ProtectContent bool `json:"protect_content"` // 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"` - // Pass true to get a fake message instead of actually sending them + // Pass true to get a fake message instead of actually sending it OnlyPreview bool `json:"only_preview"` // Markup for replying to the message; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` @@ -6001,7 +6503,7 @@ type EditMessageMediaRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -6099,6 +6601,47 @@ func (client *Client) EditMessageReplyMarkup(req *EditMessageReplyMarkupRequest) return UnmarshalMessage(result.Data) } +type EditMessageWidgetDataRequest struct { + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the widget message + MessageId int64 `json:"message_id"` + // Pass true to edit public data of the widget + EditPublicData bool `json:"edit_public_data"` + // New public data of the widget; ignored if edit_public_data is false + PublicData string `json:"public_data"` + // Pass true to edit data of the widget, which is specific to the chat + EditChatData bool `json:"edit_chat_data"` + // New data of the widget, which is specific to the chat; ignored if edit_chat_data is false + ChatData string `json:"chat_data"` +} + +// Edits data of a widget sent by the bot; for bots only +func (client *Client) EditMessageWidgetData(req *EditMessageWidgetDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editMessageWidgetData", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "edit_public_data": req.EditPublicData, + "public_data": req.PublicData, + "edit_chat_data": req.EditChatData, + "chat_data": req.ChatData, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type EditInlineMessageTextRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` @@ -6168,7 +6711,7 @@ type EditInlineMessageMediaRequest struct { InlineMessageId string `json:"inline_message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -6259,6 +6802,76 @@ func (client *Client) EditInlineMessageReplyMarkup(req *EditInlineMessageReplyMa return UnmarshalOk(result.Data) } +type EditInlineMessageWidgetDataRequest struct { + // Inline message identifier + InlineMessageId string `json:"inline_message_id"` + // Pass true to edit public data of the widget + EditPublicData bool `json:"edit_public_data"` + // New public data of the widget; ignored if edit_public_data is false + PublicData string `json:"public_data"` + // Pass true to edit data of the widget, which is specific to the chat + EditChatData bool `json:"edit_chat_data"` + // New data of the widget, which is specific to the chat; ignored if edit_chat_data is false + ChatData string `json:"chat_data"` +} + +// Edits data of a widget in an inline message sent via the bot; for bots only +func (client *Client) EditInlineMessageWidgetData(req *EditInlineMessageWidgetDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editInlineMessageWidgetData", + }, + Data: map[string]interface{}{ + "inline_message_id": req.InlineMessageId, + "edit_public_data": req.EditPublicData, + "public_data": req.PublicData, + "edit_chat_data": req.EditChatData, + "chat_data": req.ChatData, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EditWidgetDataRequest struct { + // Identifier of the shared widget + WidgetId JsonInt64 `json:"widget_id"` + // New public data of the widget + PublicData string `json:"public_data"` + // Time during which the public data can be cached, in seconds; 5-3600. Pass 0 to keep the current value, which is 30 by default + CacheTime int32 `json:"cache_time"` +} + +// Edits public data of a shared widget created by the bot; for bots only +func (client *Client) EditWidgetData(req *EditWidgetDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editWidgetData", + }, + Data: map[string]interface{}{ + "widget_id": req.WidgetId, + "public_data": req.PublicData, + "cache_time": req.CacheTime, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type EditEphemeralMessageRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` @@ -6338,25 +6951,28 @@ func (client *Client) EditEphemeralMessageCaption(req *EditEphemeralMessageCapti return UnmarshalOk(result.Data) } -type EditCallbackQueryMessageRequest struct { +type ReplyToCallbackQueryWithEphemeralMessageRequest struct { // Identifier of the callback query CallbackQueryId JsonInt64 `json:"callback_query_id"` + // Pass true if the ephemeral message must replace the message from which the callback query originated + ReplaceCallbackQueryMessage bool `json:"replace_callback_query_message"` // Pass true if the content of the message must be protected from forwarding and saving ProtectContent bool `json:"protect_content"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote + // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, inputMessageLocation, inputMessageVenue, inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } -// Edits the message from which a callback query has originated with an ephemeral message; for bots only -func (client *Client) EditCallbackQueryMessage(req *EditCallbackQueryMessageRequest) (*Ok, error) { +// Replies to a callback query with an ephemeral message; for bots only. Returns the sent message +func (client *Client) ReplyToCallbackQueryWithEphemeralMessage(req *ReplyToCallbackQueryWithEphemeralMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ - Type: "editCallbackQueryMessage", + Type: "replyToCallbackQueryWithEphemeralMessage", }, Data: map[string]interface{}{ "callback_query_id": req.CallbackQueryId, + "replace_callback_query_message": req.ReplaceCallbackQueryMessage, "protect_content": req.ProtectContent, "reply_markup": req.ReplyMarkup, "input_message_content": req.InputMessageContent, @@ -6370,7 +6986,7 @@ func (client *Client) EditCallbackQueryMessage(req *EditCallbackQueryMessageRequ return nil, buildResponseError(result.Data) } - return UnmarshalOk(result.Data) + return UnmarshalMessage(result.Data) } type EditMessageSchedulingStateRequest struct { @@ -6680,7 +7296,7 @@ type EditBusinessMessageMediaRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -7383,7 +7999,7 @@ type AddQuickReplyShortcutMessageRequest struct { ShortcutName string `json:"shortcut_name"` // Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` - // The content of the message to be added; inputMessagePaidMedia, inputMessageForwarded and inputMessageLiveLocation + // The content of the message to be added; inputMessagePaidMedia, inputMessageForwarded and inputMessageLiveLocation aren't supported InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -7419,7 +8035,7 @@ type AddQuickReplyShortcutInlineQueryResultMessageRequest struct { QueryId JsonInt64 `json:"query_id"` // Identifier of the inline query result ResultId string `json:"result_id"` - // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") + // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username") and getOption("photo_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -7518,7 +8134,7 @@ type EditQuickReplyMessageRequest struct { InputMessageContent InputMessageContent `json:"input_message_content"` } -// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Media message can be edited only to a media message. Checklist messages can be edited only to a checklist message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa +// Asynchronously edits the text, media, or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Media message can be edited only to a media message. Checklist messages can be edited only to a checklist message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7817,7 +8433,7 @@ type GetForumTopicHistoryRequest struct { 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 +// 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{ @@ -7849,7 +8465,7 @@ type GetForumTopicLinkRequest struct { ForumTopicId int32 `json:"forum_topic_id"` } -// Returns an HTTPS link to a topic in a forum supergroup chat. This is an offline method +// Returns an HTTPS link to a topic in a forum supergroup chat or a chat with a bot. This is an offline method func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*MessageLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -8354,7 +8970,7 @@ type GetMessageAvailableReactionsRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // Number of reaction per row, 5-25 + // Number of reactions per row, 5-25 RowSize int32 `json:"row_size"` } @@ -8904,7 +9520,7 @@ type GetTextEntitiesRequest struct { Text string `json:"text"` } -// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, TON blockchain addresses, URLs, and email addresses) found in the text. Can be called synchronously func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { result, err := Execute(Request{ meta: meta{ @@ -8926,10 +9542,41 @@ func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { } // deprecated -// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, TON blockchain addresses, URLs, and email addresses) found in the text. Can be called synchronously func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { return GetTextEntities(req)} +type GetTextEmojiRangesRequest struct { + // The text in which to look for emoji + Text string `json:"text"` +} + +// Returns positions of all emoji found in the text in order of their appearance. Can be called synchronously +func GetTextEmojiRanges(req *GetTextEmojiRangesRequest) (*TextRanges, error) { + result, err := Execute(Request{ + meta: meta{ + Type: "getTextEmojiRanges", + }, + Data: map[string]interface{}{ + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTextRanges(result.Data) +} + +// deprecated +// Returns positions of all emoji found in the text in order of their appearance. Can be called synchronously +func (client *Client) GetTextEmojiRanges(req *GetTextEmojiRangesRequest) (*TextRanges, error) { + return GetTextEmojiRanges(req)} + type ParseTextEntitiesRequest struct { // The text to parse Text string `json:"text"` @@ -9385,7 +10032,7 @@ type SetPollAnswerRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message containing the poll MessageId int64 `json:"message_id"` - // 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers + // 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only if the poll allows multiple answers OptionIds []int32 `json:"option_ids"` } @@ -9557,7 +10204,7 @@ type MarkChecklistTasksAsDoneRequest struct { MarkedAsNotDoneTaskIds []int32 `json:"marked_as_not_done_task_ids"` } -// Adds tasks of a checklist in a message as done or not done +// Marks tasks of a checklist in a message as done or not done func (client *Client) MarkChecklistTasksAsDone(req *MarkChecklistTasksAsDoneRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9739,7 +10386,7 @@ type ShareUsersWithBotRequest struct { OnlyCheck bool `json:"only_check"` } -// Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot +// Shares users after pressing a keyboardButtonTypeRequestUsers or keyboardButtonTypeRequestManagedBot button with the bot func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9945,7 +10592,7 @@ type GetPreparedInlineMessageRequest struct { PreparedMessageId string `json:"prepared_message_id"` } -// Saves an inline message to be sent by the given user +// Returns an inline message prepared by a bot to be sent by the current user func (client *Client) GetPreparedInlineMessage(req *GetPreparedInlineMessageRequest) (*PreparedInlineMessage, error) { result, err := client.Send(Request{ meta: meta{ @@ -10409,9 +11056,9 @@ func (client *Client) CheckWebAppFileDownload(req *CheckWebAppFileDownloadReques type AnswerChatJoinRequestQueryRequest struct { // Identifier of the query QueryId JsonInt64 `json:"query_id"` - // The result + // The result; must be null if a URL is passed Result ChatJoinRequestResult `json:"result"` - // URL of the Web App to open + // URL of the Web App to open; must be empty if a result is passed Url string `json:"url"` } @@ -10508,6 +11155,99 @@ func (client *Client) AnswerCallbackQuery(req *AnswerCallbackQueryRequest) (*Ok, return UnmarshalOk(result.Data) } +type AnswerWidgetQueryRequest struct { + // Identifier of the widget query + WidgetQueryId JsonInt64 `json:"widget_query_id"` + // Data to be returned to the widget + Data string `json:"data"` +} + +// Sets the result of a widget query; for bots only +func (client *Client) AnswerWidgetQuery(req *AnswerWidgetQueryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerWidgetQuery", + }, + Data: map[string]interface{}{ + "widget_query_id": req.WidgetQueryId, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetWidgetQueryAnswerRequest struct { + // Identifier of the chat with the message + ChatId int64 `json:"chat_id"` + // Identifier of the widget message from which the query originated. The message must not be scheduled + MessageId int64 `json:"message_id"` + // Type of the query + QueryType WidgetQueryType `json:"query_type"` + // Data of the query + Data []byte `json:"data"` +} + +// Sends a widget query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires +func (client *Client) GetWidgetQueryAnswer(req *GetWidgetQueryAnswerRequest) (*WidgetQueryAnswer, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWidgetQueryAnswer", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "query_type": req.QueryType, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWidgetQueryAnswer(result.Data) +} + +type GetWidgetPublicDataRequest struct { + // Identifier of the chat with the message + ChatId int64 `json:"chat_id"` + // Identifier of the widget message. The message must not be scheduled + MessageId int64 `json:"message_id"` +} + +// Returns the current public data of a widget. Must be called only if the widget is visible on the screen and asked to poll its public data +func (client *Client) GetWidgetPublicData(req *GetWidgetPublicDataRequest) (*WidgetPublicData, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWidgetPublicData", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWidgetPublicData(result.Data) +} + type AnswerShippingQueryRequest struct { // Identifier of the shipping query ShippingQueryId JsonInt64 `json:"shipping_query_id"` @@ -10981,7 +11721,7 @@ type OpenMessageContentRequest struct { MessageId int64 `json:"message_id"` } -// Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed +// Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location, or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed func (client *Client) OpenMessageContent(req *OpenMessageContentRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11308,6 +12048,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) + case TypeInternalLinkTypeTonConnect: + return UnmarshalInternalLinkTypeTonConnect(result.Data) + + case TypeInternalLinkTypeTonWalletTransfer: + return UnmarshalInternalLinkTypeTonWalletTransfer(result.Data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(result.Data) @@ -11437,7 +12183,7 @@ type GetOauthLinkInfoRequest struct { InAppOrigin string `json:"in_app_origin"` } -// Returns information about an OAuth deep link. Use checkOauthRequestMatchCode, acceptOauthRequest or declineOauthRequest to process the link +// Returns information about an OAuth deep link. Use checkOauthRequestMatchCode, acceptOauthRequest, or declineOauthRequest to process the link func (client *Client) GetOauthLinkInfo(req *GetOauthLinkInfoRequest) (*OauthLinkInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11497,6 +12243,8 @@ type AcceptOauthRequestRequest struct { AllowWriteAccess bool `json:"allow_write_access"` // Pass true if the current user allowed the bot that was returned in getOauthLinkInfo, to access their phone number AllowPhoneNumberAccess bool `json:"allow_phone_number_access"` + // Pass data required to access the user's TON wallet via TON Connect if the current user allowed this; pass null if the access wasn't requested or the user declined access + TonConnectConnectData *TonConnectConnectData `json:"ton_connect_connect_data"` } // Accepts an OAuth authorization request. Returns an HTTP URL to open after successful authorization. May return an empty link if just a toast about successful login has to be shown @@ -11510,6 +12258,7 @@ func (client *Client) AcceptOauthRequest(req *AcceptOauthRequestRequest) (*HttpU "match_code": req.MatchCode, "allow_write_access": req.AllowWriteAccess, "allow_phone_number_access": req.AllowPhoneNumberAccess, + "ton_connect_connect_data": req.TonConnectConnectData, }, }) if err != nil { @@ -12426,7 +13175,7 @@ type ProcessChatFolderNewChatsRequest struct { AddedChatIds []int64 `json:"added_chat_ids"` } -// Process new chats added to a shareable chat folder by its owner +// Processes new chats added to a shareable chat folder by its owner func (client *Client) ProcessChatFolderNewChats(req *ProcessChatFolderNewChatsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12622,7 +13371,7 @@ type SetChatMessageAutoDeleteTimeRequest struct { MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } -// Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels. Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +// Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires can_change_info administrator right in basic groups, supergroups and channels. Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDeleteTimeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12920,7 +13669,7 @@ func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedC type ProcessChatHasProtectedContentDisableRequestRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the message with the request. The message must be incoming and has content of the type messageChatHasProtectedContentDisableRequested + // Identifier of the message with the request. The message must be incoming and have content of the type messageChatHasProtectedContentDisableRequested RequestMessageId int64 `json:"request_message_id"` // Pass true to approve the request; pass false to reject the request Approve bool `json:"approve"` @@ -14264,6 +15013,8 @@ type PostStoryRequest struct { Areas *InputStoryAreas `json:"areas"` // 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") Caption *FormattedText `json:"caption"` + // Music to be attached to the story; pass null if none. The music can be up to 60 seconds long. The bot getOption("audio_search_bot_username") can be used to find the music files + Music *InputAudio `json:"music"` // The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats PrivacySettings StoryPrivacySettings `json:"privacy_settings"` // Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_size_max") stories @@ -14289,6 +15040,7 @@ func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { "content": req.Content, "areas": req.Areas, "caption": req.Caption, + "music": req.Music, "privacy_settings": req.PrivacySettings, "album_ids": req.AlbumIds, "active_period": req.ActivePeriod, @@ -14428,6 +15180,38 @@ func (client *Client) EditStoryCover(req *EditStoryCoverRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type EditStoryMusicRequest struct { + // Identifier of the chat that posted the story + StoryPosterChatId int64 `json:"story_poster_chat_id"` + // Identifier of the story to edit + StoryId int32 `json:"story_id"` + // The new music; pass null to remove music from the story. The music can be up to 60 seconds long + Music *InputAudio `json:"music"` +} + +// Changes music attached to a story. Can be called only if story.can_be_edited == true and the story isn't being edited now +func (client *Client) EditStoryMusic(req *EditStoryMusicRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editStoryMusic", + }, + Data: map[string]interface{}{ + "story_poster_chat_id": req.StoryPosterChatId, + "story_id": req.StoryId, + "music": req.Music, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetStoryPrivacySettingsRequest struct { // Identifier of the story StoryId int32 `json:"story_id"` @@ -14542,7 +15326,7 @@ type LoadActiveStoriesRequest struct { StoryList StoryList `json:"story_list"` } -// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_poster_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.chat_id) in descending order. Returns a 404 error if all active stories have been loaded func (client *Client) LoadActiveStories(req *LoadActiveStoriesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14627,7 +15411,7 @@ type GetChatPostedToChatPageStoriesRequest struct { Limit int32 `json:"limit"` } -// Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +// Returns the list of stories that were posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story.id). For optimal performance, the number of returned stories is chosen by TDLib func (client *Client) GetChatPostedToChatPageStories(req *GetChatPostedToChatPageStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ @@ -14659,7 +15443,7 @@ type GetChatArchivedStoriesRequest struct { Limit int32 `json:"limit"` } -// Returns the list of all stories posted by the given chat; requires can_edit_stories administrator right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +// Returns the list of all stories posted by the given chat; requires can_edit_stories administrator right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story.id). For optimal performance, the number of returned stories is chosen by TDLib func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ @@ -14770,7 +15554,7 @@ func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { } type GetStoryAvailableReactionsRequest struct { - // Number of reaction per row, 5-25 + // Number of reactions per row, 5-25 RowSize int32 `json:"row_size"` } @@ -15204,7 +15988,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_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 + // 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 ones are removed from the album StoryIds []int32 `json:"story_ids"` } @@ -16733,11 +17517,11 @@ func (client *Client) RevokeChatInviteLink(req *RevokeChatInviteLinkRequest) (*C type DeleteRevokedChatInviteLinkRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Invite link to revoke + // Invite link to delete InviteLink string `json:"invite_link"` } -// Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +// Deletes a revoked chat invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links func (client *Client) DeleteRevokedChatInviteLink(req *DeleteRevokedChatInviteLinkRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18580,7 +19364,7 @@ type ToggleGroupCallParticipantIsHandRaisedRequest struct { IsHandRaised bool `json:"is_hand_raised"` } -// Toggles whether a group call participant hand is rased; for video chats only +// Toggles whether a group call participant hand is raised; for video chats only func (client *Client) ToggleGroupCallParticipantIsHandRaised(req *ToggleGroupCallParticipantIsHandRaisedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -21450,7 +22234,7 @@ type ResendPhoneNumberCodeRequest struct { Reason ResendCodeReason `json:"reason"` } -// Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +// Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo.next_type was not null and the server-specified timeout has passed func (client *Client) ResendPhoneNumberCode(req *ResendPhoneNumberCodeRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -21775,13 +22559,26 @@ func (client *Client) GetBusinessChatLinkInfo(req *GetBusinessChatLinkInfoReques return UnmarshalBusinessChatLinkInfo(result.Data) } +type GetUserLinkRequest struct { + // Pass true to get a link, which allows other users to send unpaid messages to the current user. By default, a temporary link is returned in this case + RemoveMessagesFee bool `json:"remove_messages_fee"` + // Pass true to get a permanent link; ignored if remove_messages_fee is false. Can be used only if can_get_permanent_link is true in a previously received userLink + ReturnPermanentLink bool `json:"return_permanent_link"` + // Pass true to revoke previously created links, which allow other users to send unpaid messages to the current user; ignored if remove_messages_fee is false. If return_permanent_link is true, then the permanent link is revoked too; otherwise, only temporary links are revoked + RevokePreviousLinks bool `json:"revoke_previous_links"` +} + // Returns an HTTPS link, which can be used to get information about the current user -func (client *Client) GetUserLink() (*UserLink, error) { +func (client *Client) GetUserLink(req *GetUserLinkRequest) (*UserLink, error) { result, err := client.Send(Request{ meta: meta{ Type: "getUserLink", }, - Data: map[string]interface{}{}, + Data: map[string]interface{}{ + "remove_messages_fee": req.RemoveMessagesFee, + "return_permanent_link": req.ReturnPermanentLink, + "revoke_previous_links": req.RevokePreviousLinks, + }, }) if err != nil { return nil, err @@ -21820,6 +22617,35 @@ func (client *Client) SearchUserByToken(req *SearchUserByTokenRequest) (*User, e return UnmarshalUser(result.Data) } +type ApplyUnpaidMessagesTokenRequest struct { + // Identifier of the user + UserId int64 `json:"user_id"` + // Token from the link + Token string `json:"token"` +} + +// Allows the current user to send unpaid messages to the given user, which requires payment for incoming messages, using a token from an internal link of the type internalLinkTypePublicChat, internalLinkTypeUserPhoneNumber, or internalLinkTypeUserToken. The first message sent to the user will be preceded by a messageUnpaidMessagesAllowedByLink message. Repeated calls and calls for the current user have no effect +func (client *Client) ApplyUnpaidMessagesToken(req *ApplyUnpaidMessagesTokenRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "applyUnpaidMessagesToken", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetCommandsRequest struct { // The scope to which the commands are relevant; pass null to change commands in the default bot command scope Scope BotCommandScope `json:"scope"` @@ -22290,9 +23116,11 @@ func (client *Client) DeleteBotMediaPreviews(req *DeleteBotMediaPreviewsRequest) type CheckBotUsernameRequest struct { // Username to be checked Username string `json:"username"` + // Pass true to check whether the username is suitable as a secondary username for an existing bot; pass false to check whether the username is suitable for createBot + IsSecondary bool `json:"is_secondary"` } -// Checks whether a username can be set for a new bot. Use checkChatUsername to check username for other chat types +// Checks whether a username can be set for a new bot or assigned as a secondary username to an existing bot. Use checkChatUsername to check username for other chat types func (client *Client) CheckBotUsername(req *CheckBotUsernameRequest) (CheckChatUsernameResult, error) { result, err := client.Send(Request{ meta: meta{ @@ -22300,6 +23128,7 @@ func (client *Client) CheckBotUsername(req *CheckBotUsernameRequest) (CheckChatU }, Data: map[string]interface{}{ "username": req.Username, + "is_secondary": req.IsSecondary, }, }) if err != nil { @@ -22339,7 +23168,7 @@ type CreateBotRequest struct { ManagerBotUserId int64 `json:"manager_bot_user_id"` // Name of the bot; 1-64 characters Name string `json:"name"` - // Username of the bot. The username must end with "bot". Use checkBotUsername to find whether the name is suitable + // Username of the bot. The username must end with "bot" or a string from updateAllowedBotUsernamePremiumSuffixes case-insensitive. Use checkBotUsername to find whether the name is suitable. If the username doesn't end with "bot", then the current user must have Telegram Premium subscription, the chosen username will be assigned as secondary and an additional regular username ending with "bot" will be automatically assigned to the created bot Username string `json:"username"` // Pass true if the bot is created from an internalLinkTypeRequestManagedBot link ViaLink bool `json:"via_link"` @@ -22543,6 +23372,61 @@ func (client *Client) SetBotProfilePhoto(req *SetBotProfilePhotoRequest) (*Ok, e return UnmarshalOk(result.Data) } +type AddBotSecondaryUsernameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The new secondary username; must be non-empty. Use checkBotUsername to check username validness + Username string `json:"username"` +} + +// Adds a secondary username to a bot. Can be called only if userTypeBot.can_be_edited, the bot has no secondary username and the current user has Telegram Premium subscription. May return an error with a message "OWNER_USERNAMES_LIMIT_EXCEEDED" if the current user already owns at least getOption("secondary_bot_username_count_max") bots with a secondary username +func (client *Client) AddBotSecondaryUsername(req *AddBotSecondaryUsernameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addBotSecondaryUsername", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "username": req.Username, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteBotSecondaryUsernameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` +} + +// Removes a secondary username from a bot. Can be called only if userTypeBot.can_be_edited == true and the bot has a secondary username +func (client *Client) DeleteBotSecondaryUsername(req *DeleteBotSecondaryUsernameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteBotSecondaryUsername", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleBotUsernameIsActiveRequest struct { // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` @@ -22731,8 +23615,8 @@ type SetMessageSenderBotVerificationRequest struct { BotUserId int64 `json:"bot_user_id"` // Identifier of the user or the supergroup or channel chat, which will be verified by the bot VerifiedId MessageSender `json:"verified_id"` - // Custom description of verification reason; 0-getOption("bot_verification_custom_description_length_max"). If empty, then "was verified by organization "organization_name"" will be used as description. Can be specified only if the bot is allowed to provide custom description - CustomDescription string `json:"custom_description"` + // Custom description of verification reason; 0-getOption("bot_verification_custom_description_length_max") characters. Only TextUrl entities are supported. If empty, then "was verified by organization "organization_name"" will be used as description. Can be specified only if the bot is allowed to provide custom description + CustomDescription *FormattedText `json:"custom_description"` } // Changes the verification status of a user or a chat by an owned bot @@ -22961,7 +23845,7 @@ func (client *Client) SetInactiveSessionTtl(req *SetInactiveSessionTtlRequest) ( return UnmarshalOk(result.Data) } -// Returns all website where the current user used Telegram to log in +// Returns all websites where the current user used Telegram to log in func (client *Client) GetConnectedWebsites() (*ConnectedWebsites, error) { result, err := client.Send(Request{ meta: meta{ @@ -23177,7 +24061,7 @@ type SetSupergroupCustomEmojiStickerSetRequest struct { CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` } -// Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color +// Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to set a custom emoji sticker set func (client *Client) SetSupergroupCustomEmojiStickerSet(req *SetSupergroupCustomEmojiStickerSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -23505,6 +24389,8 @@ type ToggleSupergroupIsForumRequest struct { IsForum bool `json:"is_forum"` // New value of has_forum_tabs; ignored if is_forum is false HasForumTabs bool `json:"has_forum_tabs"` + // New value of has_forum_sidebar; ignored if is_forum is false. Must be false if has_forum_tabs is true + HasForumSidebar bool `json:"has_forum_sidebar"` } // Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums @@ -23517,6 +24403,7 @@ func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumReques "supergroup_id": req.SupergroupId, "is_forum": req.IsForum, "has_forum_tabs": req.HasForumTabs, + "has_forum_sidebar": req.HasForumSidebar, }, }) if err != nil { @@ -23690,7 +24577,7 @@ type GetChatEventLogRequest struct { UserIds []int64 `json:"user_ids"` } -// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) +// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing chatEvent.id) func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, error) { result, err := client.Send(Request{ meta: meta{ @@ -24241,6 +25128,35 @@ func (client *Client) SellGift(req *SellGiftRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type DeleteGiftRequest struct { + // Unique identifier of business connection on behalf of which to send the request; for bots only + BusinessConnectionId string `json:"business_connection_id"` + // Identifier of the gift + ReceivedGiftId string `json:"received_gift_id"` +} + +// Deletes a gift without receiving Telegram Stars for it. Use receivedGift.can_be_deleted or messageGift.can_be_deleted to check whether the gift can be deleted +func (client *Client) DeleteGift(req *DeleteGiftRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGift", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "received_gift_id": req.ReceivedGiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleGiftIsSavedRequest struct { // Identifier of the gift ReceivedGiftId string `json:"received_gift_id"` @@ -24454,7 +25370,7 @@ func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) { } type CraftGiftRequest struct { - // Identifier of the gifts to use for crafting. In the case of a successful craft, the resulting gift will have the number of the first gift. Consequently, the first gift must not have been withdrawn to the TON blockchain as an NFT and must have an empty gift_address + // Identifier of the gifts to use for crafting. In the case of a successful craft, the resulting gift will have the number of the first gift. Consequently, unless getOption("can_craft_from_withdrawn_first_gift") is true, the first gift must not have been withdrawn to the TON blockchain as an NFT and must have an empty gift_address ReceivedGiftIds []string `json:"received_gift_ids"` } @@ -24772,7 +25688,7 @@ type GetGiftsForCraftingRequest struct { Limit int32 `json:"limit"` } -// Returns upgraded gifts of the current user who can be used to craft another gifts +// Returns upgraded gifts of the current user, which can be used to craft other gifts func (client *Client) GetGiftsForCrafting(req *GetGiftsForCraftingRequest) (*GiftsForCrafting, error) { result, err := client.Send(Request{ meta: meta{ @@ -24850,11 +25766,9 @@ func (client *Client) GetUpgradedGiftValueInfo(req *GetUpgradedGiftValueInfoRequ type GetUpgradedGiftWithdrawalUrlRequest struct { // Identifier of the gift ReceivedGiftId string `json:"received_gift_id"` - // The 2-step verification password of the current user - Password string `json:"password"` } -// Returns a URL for upgraded gift withdrawal in the TON blockchain as an NFT; requires owner privileges for gifts owned by a chat +// Returns a URL for upgraded gift withdrawal in the TON blockchain as an NFT; requires owner privileges for gifts owned by a chat. The user must have a valid temporary password; see createTemporaryPassword func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawalUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -24862,7 +25776,6 @@ func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawa }, Data: map[string]interface{}{ "received_gift_id": req.ReceivedGiftId, - "password": req.Password, }, }) if err != nil { @@ -24876,6 +25789,96 @@ func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawa return UnmarshalHttpUrl(result.Data) } +type WithdrawUpgradedGiftRequest struct { + // Identifier of the gift + ReceivedGiftId string `json:"received_gift_id"` + // Pass true to keep the gift displayed on the user's or the chat's profile page after withdrawal + KeepOnProfile bool `json:"keep_on_profile"` +} + +// Withdraws an upgraded gift to the TON blockchain as an NFT directly to the TON wallet of the current user, which is created automatically if the user has no wallet yet; requires owner privileges for gifts owned by a chat. The user must have a valid temporary password; see createTemporaryPassword. The gift will be received by the wallet in a few seconds after the request succeeds +func (client *Client) WithdrawUpgradedGift(req *WithdrawUpgradedGiftRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "withdrawUpgradedGift", + }, + Data: map[string]interface{}{ + "received_gift_id": req.ReceivedGiftId, + "keep_on_profile": req.KeepOnProfile, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetUpgradedGiftDepositInfoRequest struct { + // Identifier of the user or the channel chat that will receive the gift + OwnerId MessageSender `json:"owner_id"` + // Unique name of the upgraded gift + Name string `json:"name"` + // Pass true to hide the sender of the gift in the message received by the new owner + HideSender bool `json:"hide_sender"` +} + +// Returns information needed to deposit an upgraded gift from the TON wallet of the current user to a Telegram account. Use sendTonWalletTransfer to complete transfer of the gift. The gift will be received by the new owner with a message about the gift after the transfer is confirmed in the blockchain +func (client *Client) GetUpgradedGiftDepositInfo(req *GetUpgradedGiftDepositInfoRequest) (*UpgradedGiftDepositInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUpgradedGiftDepositInfo", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "name": req.Name, + "hide_sender": req.HideSender, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUpgradedGiftDepositInfo(result.Data) +} + +type DisplayUpgradedGiftRequest struct { + // Identifier of the current user or a channel chat owned by the current user on whose profile page the gift will be shown; pass null to hide the gift from all profile pages + OwnerId MessageSender `json:"owner_id"` + // Unique name of the upgraded gift + Name string `json:"name"` +} + +// Shows an upgraded gift from the TON wallet of the current user on a profile page or hides it from all profile pages; the gift remains in the wallet +func (client *Client) DisplayUpgradedGift(req *DisplayUpgradedGiftRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "displayUpgradedGift", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns promotional animation for upgraded gifts func (client *Client) GetUpgradedGiftsPromotionalAnimation() (*Animation, error) { result, err := client.Send(Request{ @@ -25121,7 +26124,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_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 + // 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 ones are removed from the collection ReceivedGiftIds []string `json:"received_gift_ids"` } @@ -25473,6 +26476,54 @@ func (client *Client) ResetInstalledBackgrounds() (*Ok, error) { return UnmarshalOk(result.Data) } +// Returns the list of backdrops, which can be used as a background of a theme of the screen for sharing a link to a user or a chat +func (client *Client) GetProfileShareThemeBackdrops() (*ProfileShareThemeBackdrops, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getProfileShareThemeBackdrops", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalProfileShareThemeBackdrops(result.Data) +} + +type SetProfileShareThemeRequest struct { + // Identifier of the chat with the current user, or identifier of a supergroup or a channel chat + ChatId int64 `json:"chat_id"` + // The new theme; pass null to use the default theme + Theme InputProfileShareTheme `json:"theme"` +} + +// Changes the theme of the screen for sharing a link to the current user or a chat. The chat must have a username. Requires can_change_info administrator right in supergroups and channels +func (client *Client) SetProfileShareTheme(req *SetProfileShareThemeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setProfileShareTheme", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "theme": req.Theme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetLocalizationTargetInfoRequest struct { // Pass true to get only locally available information without sending network requests OnlyLocal bool `json:"only_local"` @@ -25668,7 +26719,7 @@ type SetCustomLanguagePackStringRequest struct { NewString *LanguagePackString `json:"new_string"` } -// Adds, edits or deletes a string in a custom local language pack. Can be called before authorization +// Adds, edits, or deletes a string in a custom local language pack. Can be called before authorization func (client *Client) SetCustomLanguagePackString(req *SetCustomLanguagePackStringRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -26326,13 +27377,13 @@ type ReportChatRequest struct { ChatId int64 `json:"chat_id"` // Option identifier chosen by the user; leave empty for the initial request OptionId []byte `json:"option_id"` - // Identifiers of reported messages. Use messageProperties.can_report_chat to check whether the message can be reported + // Identifiers of reported messages. Use messageProperties.can_report_chat to check whether the message can be reported. Ephemeral messages must be reported separately MessageIds []int64 `json:"message_ids"` // Additional report details if asked by the server; 0-1024 characters; leave empty for the initial request Text string `json:"text"` } -// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported +// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, if chat.can_be_reported, or if messageProperties.can_report_chat func (client *Client) ReportChat(req *ReportChatRequest) (ReportChatResult, error) { result, err := client.Send(Request{ meta: meta{ @@ -26537,7 +27588,7 @@ type GetTonTransactionsRequest struct { Limit int32 `json:"limit"` } -// Returns the list of TON blockchain transactions of the current user +// Returns the list of TON Gram transactions of the current user func (client *Client) GetTonTransactions(req *GetTonTransactionsRequest) (*TonTransactions, error) { result, err := client.Send(Request{ meta: meta{ @@ -26560,6 +27611,1111 @@ func (client *Client) GetTonTransactions(req *GetTonTransactionsRequest) (*TonTr return UnmarshalTonTransactions(result.Data) } +type GetTonWalletTransactionsRequest struct { + // Direction of the transactions to receive; pass null to get all transactions + Direction TransactionDirection `json:"direction"` + // Offset of the first transaction 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 transactions to return + Limit int32 `json:"limit"` +} + +// Returns the list of TON wallet transactions of the current user; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetTonWalletTransactions(req *GetTonWalletTransactionsRequest) (*TonWalletTransactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletTransactions", + }, + Data: map[string]interface{}{ + "direction": req.Direction, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletTransactions(result.Data) +} + +type GetTonWalletTransactionRequest struct { + // Identifier of the transaction + TransactionId string `json:"transaction_id"` +} + +// Returns a TON wallet transaction by its identifier +func (client *Client) GetTonWalletTransaction(req *GetTonWalletTransactionRequest) (*TonWalletTransaction, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletTransaction", + }, + Data: map[string]interface{}{ + "transaction_id": req.TransactionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletTransaction(result.Data) +} + +type GetTonWalletTransactionByMsgHashRequest struct { + // Value of msg_hash of the transaction + MsgHash string `json:"msg_hash"` +} + +// Returns a TON wallet transaction by its msg_hash; returns an error if the transaction isn't finalized yet +func (client *Client) GetTonWalletTransactionByMsgHash(req *GetTonWalletTransactionByMsgHashRequest) (*TonWalletTransaction, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletTransactionByMsgHash", + }, + Data: map[string]interface{}{ + "msg_hash": req.MsgHash, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletTransaction(result.Data) +} + +// Loads state of the TON wallet of the current user; can be used only if getOption("can_use_ton_wallet") +func (client *Client) LoadTonWalletState() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadTonWalletState", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Loads or reloads the current state of gasless transfers for the current user; can be used only if getOption("can_use_ton_wallet") +func (client *Client) LoadTonWalletGaslessTransfersInfo() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadTonWalletGaslessTransfersInfo", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns information about balance of the current user in the bot https://t.me/walt; can be used only if getOption("can_use_ton_wallet") +func (client *Client) CheckWalletBotBalance() (*WalletBotBalance, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkWalletBotBalance", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWalletBotBalance(result.Data) +} + +type GetUserTonWalletAddressesRequest struct { + // Identifiers of the users whose wallet addresses have to be returned. If a user has no TON wallet, it will be skipped in the result + UserIds []int64 `json:"user_ids"` +} + +// Returns TON wallet addresses of the specified users; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetUserTonWalletAddresses(req *GetUserTonWalletAddressesRequest) (*UserTonWalletAddresses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserTonWalletAddresses", + }, + Data: map[string]interface{}{ + "user_ids": req.UserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserTonWalletAddresses(result.Data) +} + +type CreateUserTonWalletRequest struct { + // Identifier of the user + UserId int64 `json:"user_id"` +} + +// Creates a TON wallet for the specified regular user; can be used only if getOption("can_use_ton_wallet"). The current user must have positive TON wallet balance +func (client *Client) CreateUserTonWallet(req *CreateUserTonWalletRequest) (*UserTonWalletAddress, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createUserTonWallet", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserTonWalletAddress(result.Data) +} + +type GetAddressTonWalletRequest struct { + // Address in the TON blockchain + Address string `json:"address"` +} + +// Returns information about a TON wallet with the given address; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetAddressTonWallet(req *GetAddressTonWalletRequest) (*UserTonWalletAddress, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAddressTonWallet", + }, + Data: map[string]interface{}{ + "address": req.Address, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserTonWalletAddress(result.Data) +} + +type GetTonWalletSecretPhraseRequest struct { + // Password of the current user; pass an empty string unless receive an error with a message "PASSWORD_MISSING" for a passwordless request + Password string `json:"password"` +} + +// Returns the secret phrase of the user's TON wallet. Works only if tonWalletState.can_export_phrase is true +func (client *Client) GetTonWalletSecretPhrase(req *GetTonWalletSecretPhraseRequest) (*TonWalletSecretPhrase, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletSecretPhrase", + }, + Data: map[string]interface{}{ + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletSecretPhrase(result.Data) +} + +// Returns a challenge which may be used to prove ownership of a TON wallet; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetTonWalletOwnershipProofChallenge() (*TonWalletOwnershipProofChallenge, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletOwnershipProofChallenge", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletOwnershipProofChallenge(result.Data) +} + +type EnableTonWalletBackupRequest struct { + // The secret phrase of the user's TON wallet as a space separated list of words + SecretPhrase string `json:"secret_phrase"` + // Proof of the TON wallet ownership; use getTonWalletOwnershipProofChallenge to get a challenge for the proof + Proof *TonWalletOwnershipProof `json:"proof"` +} + +// Enables backup of the TON wallet of the user. Works only if tonWalletState.can_enable_backup is true +func (client *Client) EnableTonWalletBackup(req *EnableTonWalletBackupRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "enableTonWalletBackup", + }, + Data: map[string]interface{}{ + "secret_phrase": req.SecretPhrase, + "proof": req.Proof, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DisableTonWalletBackupRequest struct { + // Password of the current user; pass an empty string unless receive an error with a message "PASSWORD_MISSING" for a passwordless request + Password string `json:"password"` +} + +// Disables backup of the TON wallet of the user. Works only if tonWalletState.is_backup_enabled is true +func (client *Client) DisableTonWalletBackup(req *DisableTonWalletBackupRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "disableTonWalletBackup", + }, + Data: map[string]interface{}{ + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DisableTonWalletBackupWithProofRequest struct { + // Proof of the TON wallet ownership; use getTonWalletOwnershipProofChallenge to get a challenge for the proof + Proof *TonWalletOwnershipProof `json:"proof"` +} + +// Disables backup of the TON wallet of the user using proof of wallet ownership instead of the password. Works only if tonWalletState.is_backup_enabled is true +func (client *Client) DisableTonWalletBackupWithProof(req *DisableTonWalletBackupWithProofRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "disableTonWalletBackupWithProof", + }, + Data: map[string]interface{}{ + "proof": req.Proof, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SendTonWalletTransferRequest struct { + // Identifier of the user who will receive the transfer; pass 0 if unknown + UserId int64 `json:"user_id"` + // Address in the TON blockchain of the transaction peer + Address string `json:"address"` + // The amount of the sent cryptocurrency, in the smallest units of the cryptocurrency + Amount JsonInt64 `json:"amount"` + // Comment added to the transaction + Comment string `json:"comment"` + // Pass true if the comment is encrypted and must be decrypted using the receiver's or sender's private key + IsCommentEncrypted bool `json:"is_comment_encrypted"` + // 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"` + // Serialized data for regular cryptocurrency transfer request. The minimum allowed transfer amount is getOption("ton_wallet_transfer_amount_min") + RegularTransferData []byte `json:"regular_transfer_data"` + // Serialized data for gasless cryptocurrency transfer request; pass an empty string to force a regular request. The minimum allowed transfer amount for a gasless transfer is getOption("ton_wallet_gasless_transfer_amount_min") + GaslessTransferData []byte `json:"gasless_transfer_data"` +} + +// Sends a cryptocurrency from the user's TON wallet; can be used only if getOption("can_use_ton_wallet") +func (client *Client) SendTonWalletTransfer(req *SendTonWalletTransferRequest) (*TonWalletTransferResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendTonWalletTransfer", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "address": req.Address, + "amount": req.Amount, + "comment": req.Comment, + "is_comment_encrypted": req.IsCommentEncrypted, + "sending_id": req.SendingId, + "regular_transfer_data": req.RegularTransferData, + "gasless_transfer_data": req.GaslessTransferData, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletTransferResult(result.Data) +} + +type DeleteTonWalletRequest struct { + // Password of the current user; pass an empty string unless receive an error with a message "PASSWORD_MISSING" for a passwordless request + Password string `json:"password"` +} + +// Deletes the current TON wallet of the user and creates a new one; can be used only if getOption("can_use_ton_wallet") +func (client *Client) DeleteTonWallet(req *DeleteTonWalletRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteTonWallet", + }, + Data: map[string]interface{}{ + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReplaceTonWalletRequest struct { + // Password of the current user; pass an empty string unless receive an error with a message "PASSWORD_MISSING" for a passwordless request + Password string `json:"password"` + // Original public key of the new TON wallet + AnchorPublicKey []byte `json:"anchor_public_key"` + // Proof of ownership of the new private key of the TON wallet; use getTonWalletOwnershipProofChallenge to get a challenge for the proof + Proof *TonWalletOwnershipProof `json:"proof"` +} + +// Replaces the current TON wallet with another existing v6r2 wallet or changes private key of the current TON wallet; can be used only if getOption("can_use_ton_wallet") +func (client *Client) ReplaceTonWallet(req *ReplaceTonWalletRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceTonWallet", + }, + Data: map[string]interface{}{ + "password": req.Password, + "anchor_public_key": req.AnchorPublicKey, + "proof": req.Proof, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns exchange rates of currencies to USD +func (client *Client) GetCurrencyExchangeRates() (*CurrencyExchangeRates, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCurrencyExchangeRates", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCurrencyExchangeRates(result.Data) +} + +type GetTonWalletNftsRequest struct { + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of NFTs to be returned; must be positive and can't be greater than 20 + Limit int32 `json:"limit"` +} + +// Returns NFTs stored on the TON wallet of the user; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetTonWalletNfts(req *GetTonWalletNftsRequest) (*TonNfts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletNfts", + }, + Data: map[string]interface{}{ + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonNfts(result.Data) +} + +// Returns names of upgraded gift collections whose NFTs can be used as background_nft_address in setTonWalletCardStickers; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetTonWalletCardBackgroundGiftCollectionNames() (*UpgradedGiftCollectionNames, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonWalletCardBackgroundGiftCollectionNames", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUpgradedGiftCollectionNames(result.Data) +} + +type SetTonWalletCardStickersRequest struct { + // The new list of stickers; pass an empty list to remove all stickers. Up to 10 stickers can be added. Each NFT can be used only once + Stickers []*InputTonWalletCardSticker `json:"stickers"` + // Address of the NFT from the new list of stickers, whose colors will be used for the card background; pass an empty string to use the default background. The NFT must correspond to an upgraded gift with can_be_ton_wallet_card_background == true + BackgroundNftAddress string `json:"background_nft_address"` +} + +// Changes the list of stickers on the TON wallet card of the current user; can be used only if getOption("can_use_ton_wallet"). The whole list of stickers is replaced. The request can take up to 20 seconds to complete, so it must be called only on explicit user action. Stickers are removed automatically if the corresponding NFT leaves the wallet or the wallet is replaced. Returns the updated card +func (client *Client) SetTonWalletCardStickers(req *SetTonWalletCardStickersRequest) (*TonWalletCard, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setTonWalletCardStickers", + }, + Data: map[string]interface{}{ + "stickers": req.Stickers, + "background_nft_address": req.BackgroundNftAddress, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonWalletCard(result.Data) +} + +// Returns active TON Connect sessions; can be used only if getOption("can_use_ton_wallet") +func (client *Client) GetTonConnectSessions() (*TonConnectSessions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonConnectSessions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectSessions(result.Data) +} + +type CreateTonConnectSessionRequest struct { + // Hex-encoded public X25519 key of the dApp + DappClientId string `json:"dapp_client_id"` + // URL of the manifest of the dApp + ManifestUrl string `json:"manifest_url"` +} + +// Creates a TON Connect session; can be used only if getOption("can_use_ton_wallet") +func (client *Client) CreateTonConnectSession(req *CreateTonConnectSessionRequest) (*TonConnectSession, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createTonConnectSession", + }, + Data: map[string]interface{}{ + "dapp_client_id": req.DappClientId, + "manifest_url": req.ManifestUrl, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectSession(result.Data) +} + +type SetTonConnectSessionWalletClientIdRequest struct { + // Unique identifier of the session + SessionId JsonInt64 `json:"session_id"` + // Hex-encoded public X25519 key of the current user's application calculated from the TON wallet private key and session parameters + WalletClientId string `json:"wallet_client_id"` +} + +// Sets wallet_client_id for a pending TON Connect session. Then, sendTonConnectSessionConnectResult must be used to accept or reject the session. If the session was created for an OAuth request, then acceptOauthRequest must be used instead +func (client *Client) SetTonConnectSessionWalletClientId(req *SetTonConnectSessionWalletClientIdRequest) (*TonConnectChallenge, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setTonConnectSessionWalletClientId", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "wallet_client_id": req.WalletClientId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectChallenge(result.Data) +} + +type SendTonConnectSessionConnectResultRequest struct { + // Unique identifier of the session + SessionId JsonInt64 `json:"session_id"` + // Answer to the challenge received from setTonConnectSessionWalletClientId + ChallengeAnswer []byte `json:"challenge_answer"` + // Pass true to reject the request; pass false to accept it + IsError bool `json:"is_error"` + // Body of the result + Body []byte `json:"body"` + // Identifier to trace the connection request + TraceId string `json:"trace_id"` +} + +// Accepts or rejects a TON Connect session +func (client *Client) SendTonConnectSessionConnectResult(req *SendTonConnectSessionConnectResultRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendTonConnectSessionConnectResult", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "challenge_answer": req.ChallengeAnswer, + "is_error": req.IsError, + "body": req.Body, + "trace_id": req.TraceId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetTonConnectSessionPendingRequestsRequest struct { + // Unique identifier of the session + SessionId JsonInt64 `json:"session_id"` +} + +// Returns pending requests in a TON Connect session +func (client *Client) GetTonConnectSessionPendingRequests(req *GetTonConnectSessionPendingRequestsRequest) (*TonConnectRequests, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonConnectSessionPendingRequests", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectRequests(result.Data) +} + +type GetTonConnectDAppPendingRequestsRequest struct { + // Hex-encoded public X25519 key of the dApp + DappClientId string `json:"dapp_client_id"` +} + +// Returns pending requests with a dApp through TON Connect +func (client *Client) GetTonConnectDAppPendingRequests(req *GetTonConnectDAppPendingRequestsRequest) (*TonConnectRequests, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonConnectDAppPendingRequests", + }, + Data: map[string]interface{}{ + "dapp_client_id": req.DappClientId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectRequests(result.Data) +} + +type ClaimTonConnectRequestRequest struct { + // Unique identifier of the TON Connect session + SessionId JsonInt64 `json:"session_id"` + // Identifier of the message with the request + MessageId int64 `json:"message_id"` + // Identifier of the request assigned by the dApp + DappRequestId string `json:"dapp_request_id"` + // Pass true to reject the request + IsRejected bool `json:"is_rejected"` +} + +// Claims a request received through TON Connect for processing on this device +func (client *Client) ClaimTonConnectRequest(req *ClaimTonConnectRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "claimTonConnectRequest", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "message_id": req.MessageId, + "dapp_request_id": req.DappRequestId, + "is_rejected": req.IsRejected, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AnswerTonConnectRequestRequest struct { + // Unique identifier of the TON Connect session + SessionId JsonInt64 `json:"session_id"` + // Identifier of the message with the request + MessageId int64 `json:"message_id"` + // Identifier to trace the request + TraceId string `json:"trace_id"` + // Body of the response + Body []byte `json:"body"` +} + +// Sends an answer for a request received through TON Connect +func (client *Client) AnswerTonConnectRequest(req *AnswerTonConnectRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerTonConnectRequest", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "message_id": req.MessageId, + "trace_id": req.TraceId, + "body": req.Body, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetTonConnectSessionNextEventIdRequest struct { + // Unique identifier of the TON Connect session + SessionId JsonInt64 `json:"session_id"` +} + +// Returns the next event identifier for the given TON Connect session +func (client *Client) GetTonConnectSessionNextEventId(req *GetTonConnectSessionNextEventIdRequest) (*TonConnectSessionEventId, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonConnectSessionNextEventId", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonConnectSessionEventId(result.Data) +} + +type DisconnectTonConnectSessionRequest struct { + // Unique identifier of the TON Connect session to close + SessionId JsonInt64 `json:"session_id"` + // Encrypted body of the disconnect event; may be empty if the session has already been closed. Use getTonConnectSessionNextEventId to get event identifier for the event + Body []byte `json:"body"` +} + +// Closes a TON Connect session +func (client *Client) DisconnectTonConnectSession(req *DisconnectTonConnectSessionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "disconnectTonConnectSession", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "body": req.Body, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetOnRampProvidersRequest struct { + // Pass a cryptocurrency to receive only providers that support it; pass an empty string to receive all providers + Cryptocurrency string `json:"cryptocurrency"` +} + +// Returns available on-ramp providers +func (client *Client) GetOnRampProviders(req *GetOnRampProvidersRequest) (*OnRampProviders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOnRampProviders", + }, + Data: map[string]interface{}{ + "cryptocurrency": req.Cryptocurrency, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOnRampProviders(result.Data) +} + +type GetOnRampProviderBaseCurrenciesRequest struct { + // Unique identifier of the on-ramp provider; only for providers that support base currencies + ProviderId string `json:"provider_id"` + // The cryptocurrency that will be bought + Cryptocurrency string `json:"cryptocurrency"` +} + +// Returns the list of fiat currencies supported by an on-ramp provider for the given cryptocurrency +func (client *Client) GetOnRampProviderBaseCurrencies(req *GetOnRampProviderBaseCurrenciesRequest) (*Currencies, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOnRampProviderBaseCurrencies", + }, + Data: map[string]interface{}{ + "provider_id": req.ProviderId, + "cryptocurrency": req.Cryptocurrency, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCurrencies(result.Data) +} + +type GetOnRampPaymentAvailabilityRequest struct { + // Unique identifier of the on-ramp provider + ProviderId string `json:"provider_id"` + // The cryptocurrency that will be bought + Cryptocurrency string `json:"cryptocurrency"` + // ISO 4217 currency code of the currency that will be used for the purchase; pass an empty string if unknown + BaseCurrency string `json:"base_currency"` +} + +// Returns the available on-ramp payment methods based on the current user location +func (client *Client) GetOnRampPaymentAvailability(req *GetOnRampPaymentAvailabilityRequest) (*OnRampPaymentAvailability, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOnRampPaymentAvailability", + }, + Data: map[string]interface{}{ + "provider_id": req.ProviderId, + "cryptocurrency": req.Cryptocurrency, + "base_currency": req.BaseCurrency, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOnRampPaymentAvailability(result.Data) +} + +type GetOnRampPaymentLimitsRequest struct { + // Unique identifier of the on-ramp provider + ProviderId string `json:"provider_id"` + // The cryptocurrency that will be bought + Cryptocurrency string `json:"cryptocurrency"` + // ISO 4217 currency code of the currency that will be used for the purchase + BaseCurrency string `json:"base_currency"` + // Name of the chosen payment method; pass an empty string if none + PaymentMethodName string `json:"payment_method_name"` +} + +// Returns the limits for an on-ramp payment; only for providers that support limits retrieval +func (client *Client) GetOnRampPaymentLimits(req *GetOnRampPaymentLimitsRequest) (*OnRampPaymentLimits, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOnRampPaymentLimits", + }, + Data: map[string]interface{}{ + "provider_id": req.ProviderId, + "cryptocurrency": req.Cryptocurrency, + "base_currency": req.BaseCurrency, + "payment_method_name": req.PaymentMethodName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOnRampPaymentLimits(result.Data) +} + +type GetOnRampPaymentQuoteRequest struct { + // Unique identifier of the on-ramp provider + ProviderId string `json:"provider_id"` + // The cryptocurrency that will be bought + Cryptocurrency string `json:"cryptocurrency"` + // ISO 4217 currency code of the currency that will be used for the purchase + BaseCurrency string `json:"base_currency"` + // The amount of the cryptocurrency to buy; pass an empty string if the user selected base_currency_amount + CryptocurrencyAmount string `json:"cryptocurrency_amount"` + // The amount of the base currency to spend; pass an empty string if the user selected cryptocurrency_amount + BaseCurrencyAmount string `json:"base_currency_amount"` + // Name of the chosen payment method; pass an empty string if none + PaymentMethodName string `json:"payment_method_name"` +} + +// Returns a quote for an on-ramp payment; only for providers that support quote retrieval +func (client *Client) GetOnRampPaymentQuote(req *GetOnRampPaymentQuoteRequest) (*OnRampPaymentQuote, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOnRampPaymentQuote", + }, + Data: map[string]interface{}{ + "provider_id": req.ProviderId, + "cryptocurrency": req.Cryptocurrency, + "base_currency": req.BaseCurrency, + "cryptocurrency_amount": req.CryptocurrencyAmount, + "base_currency_amount": req.BaseCurrencyAmount, + "payment_method_name": req.PaymentMethodName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOnRampPaymentQuote(result.Data) +} + +type CreateOnRampPaymentSessionRequest struct { + // Unique identifier of the on-ramp provider + ProviderId string `json:"provider_id"` + // The cryptocurrency that will be bought + Cryptocurrency string `json:"cryptocurrency"` + // Address to which the cryptocurrency will be sent + Address string `json:"address"` + // Name of the chosen payment method; pass an empty string if none + PaymentMethodName string `json:"payment_method_name"` + // ISO 4217 currency code of the currency that will be used for the purchase; pass an empty string if unknown + BaseCurrency string `json:"base_currency"` + // The amount of the cryptocurrency to buy; pass an empty string if the user selected base_currency_amount + CryptocurrencyAmount string `json:"cryptocurrency_amount"` + // The amount of the base currency to spend; pass an empty string if the user selected cryptocurrency_amount + BaseCurrencyAmount string `json:"base_currency_amount"` + // Memo for the query; pass an empty string if none + Memo string `json:"memo"` + // Preferred theme for the WebView; pass "light" for a light theme, "dark" for a dark theme, or leave empty for a default theme + Theme string `json:"theme"` + // The URL opened on successful payment; pass an empty string if none + SuccessReturnUrl string `json:"success_return_url"` + // The URL opened on failed payment; pass an empty string if none + FailReturnUrl string `json:"fail_return_url"` +} + +// Creates a session for an on-ramp payment +func (client *Client) CreateOnRampPaymentSession(req *CreateOnRampPaymentSessionRequest) (*OnRampPaymentSession, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createOnRampPaymentSession", + }, + Data: map[string]interface{}{ + "provider_id": req.ProviderId, + "cryptocurrency": req.Cryptocurrency, + "address": req.Address, + "payment_method_name": req.PaymentMethodName, + "base_currency": req.BaseCurrency, + "cryptocurrency_amount": req.CryptocurrencyAmount, + "base_currency_amount": req.BaseCurrencyAmount, + "memo": req.Memo, + "theme": req.Theme, + "success_return_url": req.SuccessReturnUrl, + "fail_return_url": req.FailReturnUrl, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOnRampPaymentSession(result.Data) +} + +type SendTonCenterApiRequestRequest struct { + // The path of the requested endpoint. See https://toncenter.com/api/v3/index.html for the list of supported endpoints + Endpoint string `json:"endpoint"` + // Type of the request + Type TonCenterApiRequestType `json:"type"` +} + +// Sends a request to TON Center API and returns its response in JSON format +func (client *Client) SendTonCenterApiRequest(req *SendTonCenterApiRequestRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendTonCenterApiRequest", + }, + Data: map[string]interface{}{ + "endpoint": req.Endpoint, + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +// Returns a URL for TON Center Streaming API +func (client *Client) GetTonCenterStreamingApiUrl() (*TonCenterStreamingApiUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTonCenterStreamingApiUrl", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTonCenterStreamingApiUrl(result.Data) +} + type GetStarRevenueStatisticsRequest struct { // Identifier of the owner of the Telegram Stars; can be identifier of the current user, an owned bot, or a supergroup or a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true OwnerId MessageSender `json:"owner_id"` @@ -29106,7 +31262,7 @@ func (client *Client) DisconnectAffiliateProgram(req *DisconnectAffiliateProgram } type GetConnectedAffiliateProgramRequest struct { - // The affiliate to which the affiliate program will be connected + // The affiliate to which the affiliate program is connected Affiliate AffiliateType `json:"affiliate"` // Identifier of the bot that created the program BotUserId int64 `json:"bot_user_id"` @@ -29518,6 +31674,32 @@ func (client *Client) GetDeepLinkInfo(req *GetDeepLinkInfoRequest) (*DeepLinkInf return UnmarshalDeepLinkInfo(result.Data) } +type DismissWebTokenRequest struct { + // The token to dismiss + Token string `json:"token"` +} + +// Dismisses a received web token without consumption; for official Telegram apps only +func (client *Client) DismissWebToken(req *DismissWebTokenRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "dismissWebToken", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns application config, provided by the server. Can be called before authorization func (client *Client) GetApplicationConfig() (JsonValue, error) { result, err := client.Send(Request{ @@ -29792,6 +31974,64 @@ func (client *Client) PingProxy(req *PingProxyRequest) (*Seconds, error) { return UnmarshalSeconds(result.Data) } +type ProcessWebProxyCarrierMessageRequest struct { + // Identifier of the carrier + CarrierId int32 `json:"carrier_id"` + // The received message + Message WebProxyCarrierMessage `json:"message"` +} + +// Passes a message, which the page of a web proxy carrier passed to postMessage of the bridge object, to TDLib. Must be called in the order in which the messages were passed. Can be called before authorization +func (client *Client) ProcessWebProxyCarrierMessage(req *ProcessWebProxyCarrierMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processWebProxyCarrierMessage", + }, + Data: map[string]interface{}{ + "carrier_id": req.CarrierId, + "message": req.Message, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReportWebProxyCarrierErrorRequest struct { + // Identifier of the carrier + CarrierId int32 `json:"carrier_id"` + // The error + Error WebProxyCarrierError `json:"error"` +} + +// Reports that a web proxy carrier failed. TDLib closes the carrier and decides whether and when to request a new one. Can be called before authorization +func (client *Client) ReportWebProxyCarrierError(req *ReportWebProxyCarrierErrorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportWebProxyCarrierError", + }, + Data: map[string]interface{}{ + "carrier_id": req.CarrierId, + "error": req.Error, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetLogStreamRequest struct { // New log stream LogStream LogStream `json:"log_stream"` @@ -30762,6 +33002,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateAllowedBotUsernamePremiumSuffixes: + return UnmarshalUpdateAllowedBotUsernamePremiumSuffixes(result.Data) + case TypeUpdateTrustedMiniAppBots: return UnmarshalUpdateTrustedMiniAppBots(result.Data) @@ -30810,6 +33053,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateConnectionState: return UnmarshalUpdateConnectionState(result.Data) + case TypeUpdateWebProxyCarrierOpened: + return UnmarshalUpdateWebProxyCarrierOpened(result.Data) + + case TypeUpdateWebProxyCarrierData: + return UnmarshalUpdateWebProxyCarrierData(result.Data) + + case TypeUpdateWebProxyCarrierClosed: + return UnmarshalUpdateWebProxyCarrierClosed(result.Data) + case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(result.Data) @@ -30852,6 +33104,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateOwnedGramCount: return UnmarshalUpdateOwnedGramCount(result.Data) + case TypeUpdateTonWalletState: + return UnmarshalUpdateTonWalletState(result.Data) + + case TypeUpdateTonWalletGaslessTransfersInfo: + return UnmarshalUpdateTonWalletGaslessTransfersInfo(result.Data) + + case TypeUpdateTonWalletTonConnectSession: + return UnmarshalUpdateTonWalletTonConnectSession(result.Data) + + case TypeUpdateTonWalletTonConnectSessionDisconnectRequired: + return UnmarshalUpdateTonWalletTonConnectSessionDisconnectRequired(result.Data) + case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(result.Data) @@ -30864,6 +33128,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(result.Data) + case TypeUpdateSpeechRecognitionInFile: + return UnmarshalUpdateSpeechRecognitionInFile(result.Data) + case TypeUpdateGroupCallMessageLevels: return UnmarshalUpdateGroupCallMessageLevels(result.Data) @@ -30924,6 +33191,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewBusinessCallbackQuery: return UnmarshalUpdateNewBusinessCallbackQuery(result.Data) + case TypeUpdateNewWidgetQuery: + return UnmarshalUpdateNewWidgetQuery(result.Data) + + case TypeUpdateNewInlineWidgetQuery: + return UnmarshalUpdateNewInlineWidgetQuery(result.Data) + + case TypeUpdateNewWidgetCopyQuery: + return UnmarshalUpdateNewWidgetCopyQuery(result.Data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(result.Data) diff --git a/client/type.go b/client/type.go index d1d4293..a295291 100755 --- a/client/type.go +++ b/client/type.go @@ -48,10 +48,20 @@ const ( ClassTransactionDirection = "TransactionDirection" ClassStarTransactionType = "StarTransactionType" ClassTonTransactionType = "TonTransactionType" + ClassTonCenterApiRequestType = "TonCenterApiRequestType" + ClassTonWalletTransferReceiver = "TonWalletTransferReceiver" + ClassTonWalletTransactionState = "TonWalletTransactionState" + ClassTonWalletTransactionType = "TonWalletTransactionType" + ClassTonConnectRequestState = "TonConnectRequestState" + ClassTonConnectManifest = "TonConnectManifest" + ClassTonConnectSessionState = "TonConnectSessionState" + ClassTonConnectConnectItem = "TonConnectConnectItem" ClassActiveStoryState = "ActiveStoryState" ClassGiveawayParticipantStatus = "GiveawayParticipantStatus" ClassGiveawayInfo = "GiveawayInfo" ClassGiveawayPrize = "GiveawayPrize" + ClassNotificationSettingsScope = "NotificationSettingsScope" + ClassReactionNotificationSource = "ReactionNotificationSource" ClassCommunityMemberStatus = "CommunityMemberStatus" ClassEmojiStatusType = "EmojiStatusType" ClassChatMemberStatus = "ChatMemberStatus" @@ -73,8 +83,6 @@ const ( ClassInputMessageReplyTo = "InputMessageReplyTo" ClassMessageSource = "MessageSource" ClassReportSponsoredResult = "ReportSponsoredResult" - ClassNotificationSettingsScope = "NotificationSettingsScope" - ClassReactionNotificationSource = "ReactionNotificationSource" ClassDraftMessageContent = "DraftMessageContent" ClassChatType = "ChatType" ClassChatList = "ChatList" @@ -90,6 +98,9 @@ const ( ClassLoginUrlInfo = "LoginUrlInfo" ClassSavedMessagesTopicType = "SavedMessagesTopicType" ClassBuiltInTheme = "BuiltInTheme" + ClassEmojiType = "EmojiType" + ClassProfileShareTheme = "ProfileShareTheme" + ClassInputProfileShareTheme = "InputProfileShareTheme" ClassRichText = "RichText" ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" @@ -157,6 +168,7 @@ const ( ClassInlineQueryResult = "InlineQueryResult" ClassInlineQueryResultsButtonType = "InlineQueryResultsButtonType" ClassCallbackQueryPayload = "CallbackQueryPayload" + ClassWidgetQueryType = "WidgetQueryType" ClassChatEventAction = "ChatEventAction" ClassLanguagePackStringValue = "LanguagePackStringValue" ClassPremiumLimitType = "PremiumLimitType" @@ -208,6 +220,8 @@ const ( ClassSuggestedAction = "SuggestedAction" ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" + ClassWebProxyCarrierMessage = "WebProxyCarrierMessage" + ClassWebProxyCarrierError = "WebProxyCarrierError" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatisticsObjectType = "ChatStatisticsObjectType" ClassChatStatistics = "ChatStatistics" @@ -224,6 +238,8 @@ const ( ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo" ClassTextEntity = "TextEntity" ClassTextEntities = "TextEntities" + ClassTextRange = "TextRange" + ClassTextRanges = "TextRanges" ClassFormattedText = "FormattedText" ClassRichMessage = "RichMessage" ClassInputRichMessageMedia = "InputRichMessageMedia" @@ -317,6 +333,7 @@ const ( ClassWebAppInfo = "WebAppInfo" ClassMainWebApp = "MainWebApp" ClassWebAppOpenParameters = "WebAppOpenParameters" + ClassAreaPosition = "AreaPosition" ClassSuggestedPostInfo = "SuggestedPostInfo" ClassInputSuggestedPostInfo = "InputSuggestedPostInfo" ClassStarAmount = "StarAmount" @@ -360,6 +377,7 @@ const ( ClassGift = "Gift" ClassUpgradedGift = "UpgradedGift" ClassUpgradedGiftValueInfo = "UpgradedGiftValueInfo" + ClassUpgradedGiftDepositInfo = "UpgradedGiftDepositInfo" ClassUpgradeGiftResult = "UpgradeGiftResult" ClassAvailableGift = "AvailableGift" ClassAvailableGifts = "AvailableGifts" @@ -385,16 +403,60 @@ const ( ClassStarTransactions = "StarTransactions" ClassTonTransaction = "TonTransaction" ClassTonTransactions = "TonTransactions" + ClassTonCenterStreamingApiUrl = "TonCenterStreamingApiUrl" + ClassWalletBotBalance = "WalletBotBalance" + ClassUserTonWalletAddress = "UserTonWalletAddress" + ClassUserTonWalletAddresses = "UserTonWalletAddresses" + ClassTonWalletOwnershipProofChallenge = "TonWalletOwnershipProofChallenge" + ClassTonWalletOwnershipProof = "TonWalletOwnershipProof" + ClassTonWalletSecretPhrase = "TonWalletSecretPhrase" + ClassTonWalletGaslessTransfersInfo = "TonWalletGaslessTransfersInfo" + ClassCurrencyExchangeRate = "CurrencyExchangeRate" + ClassCurrencyExchangeRates = "CurrencyExchangeRates" + ClassOnRampProvider = "OnRampProvider" + ClassOnRampProviders = "OnRampProviders" + ClassCurrencies = "Currencies" + ClassOnRampPaymentMethod = "OnRampPaymentMethod" + ClassOnRampPaymentAvailability = "OnRampPaymentAvailability" + ClassOnRampPaymentLimits = "OnRampPaymentLimits" + ClassOnRampPaymentQuote = "OnRampPaymentQuote" + ClassOnRampPaymentSession = "OnRampPaymentSession" + ClassTonWalletState = "TonWalletState" + ClassTonNftAttribute = "TonNftAttribute" + ClassTonNft = "TonNft" + ClassTonNfts = "TonNfts" + ClassTonWalletCardSticker = "TonWalletCardSticker" + ClassTonWalletCard = "TonWalletCard" + ClassInputTonWalletCardSticker = "InputTonWalletCardSticker" + ClassUpgradedGiftCollectionNames = "UpgradedGiftCollectionNames" + ClassTonWalletTransaction = "TonWalletTransaction" + ClassTonWalletTransactions = "TonWalletTransactions" + ClassTonConnectConnectRequest = "TonConnectConnectRequest" + ClassTonConnectConnectData = "TonConnectConnectData" + ClassTonConnectSession = "TonConnectSession" + ClassTonConnectSessions = "TonConnectSessions" + ClassTonConnectRequest = "TonConnectRequest" + ClassTonConnectRequests = "TonConnectRequests" + ClassTonConnectChallenge = "TonConnectChallenge" + ClassTonConnectSessionEventId = "TonConnectSessionEventId" + ClassTonWalletTransferResult = "TonWalletTransferResult" ClassLinkPreviewOptions = "LinkPreviewOptions" ClassAccentColor = "AccentColor" ClassProfileAccentColors = "ProfileAccentColors" ClassProfileAccentColor = "ProfileAccentColor" + ClassChatNotificationSettings = "ChatNotificationSettings" + ClassScopeNotificationSettings = "ScopeNotificationSettings" + ClassReactionNotificationSettings = "ReactionNotificationSettings" ClassCommunityId = "CommunityId" ClassCommunityPermissions = "CommunityPermissions" ClassCommunityAdministratorRights = "CommunityAdministratorRights" ClassCommunity = "Community" ClassCommunityChat = "CommunityChat" ClassCommunityFullInfo = "CommunityFullInfo" + ClassCommunities = "Communities" + ClassCommunityAddChatRequest = "CommunityAddChatRequest" + ClassCommunityAddChatRequests = "CommunityAddChatRequests" + ClassCommunityMemberChats = "CommunityMemberChats" ClassUserRating = "UserRating" ClassRestrictionInfo = "RestrictionInfo" ClassEmojiStatus = "EmojiStatus" @@ -471,9 +533,6 @@ const ( ClassFileDownload = "FileDownload" ClassDownloadedFileCounts = "DownloadedFileCounts" ClassFoundFileDownloads = "FoundFileDownloads" - ClassChatNotificationSettings = "ChatNotificationSettings" - ClassScopeNotificationSettings = "ScopeNotificationSettings" - ClassReactionNotificationSettings = "ReactionNotificationSettings" ClassDraftMessage = "DraftMessage" ClassChatFolderIcon = "ChatFolderIcon" ClassChatFolderName = "ChatFolderName" @@ -510,6 +569,8 @@ const ( ClassSharedUser = "SharedUser" ClassSharedChat = "SharedChat" ClassThemeSettings = "ThemeSettings" + ClassProfileShareThemeBackdrop = "ProfileShareThemeBackdrop" + ClassProfileShareThemeBackdrops = "ProfileShareThemeBackdrops" ClassInlineButton = "InlineButton" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" @@ -578,7 +639,6 @@ const ( ClassEmojiCategory = "EmojiCategory" ClassEmojiCategories = "EmojiCategories" ClassCurrentWeather = "CurrentWeather" - ClassStoryAreaPosition = "StoryAreaPosition" ClassStoryArea = "StoryArea" ClassInputStoryArea = "InputStoryArea" ClassInputStoryAreas = "InputStoryAreas" @@ -638,6 +698,7 @@ const ( ClassAnimations = "Animations" ClassImportedContact = "ImportedContact" ClassImportedContacts = "ImportedContacts" + ClassSpeechRecognitionLanguages = "SpeechRecognitionLanguages" ClassBusinessConnection = "BusinessConnection" ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" ClassAttachmentMenuBot = "AttachmentMenuBot" @@ -650,6 +711,9 @@ const ( ClassPreparedInlineMessageId = "PreparedInlineMessageId" ClassPreparedInlineMessage = "PreparedInlineMessage" ClassCallbackQueryAnswer = "CallbackQueryAnswer" + ClassWidgetQueryWallet = "WidgetQueryWallet" + ClassWidgetQueryAnswer = "WidgetQueryAnswer" + ClassWidgetPublicData = "WidgetPublicData" ClassCustomRequestResult = "CustomRequestResult" ClassGameHighScore = "GameHighScore" ClassGameHighScores = "GameHighScores" @@ -720,6 +784,7 @@ const ( ClassDeepLinkInfo = "DeepLinkInfo" ClassAddedProxy = "AddedProxy" ClassAddedProxies = "AddedProxies" + ClassWebProxyCarrier = "WebProxyCarrier" ClassNewSticker = "NewSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" @@ -774,6 +839,8 @@ const ( TypeEmailAddressResetStatePending = "emailAddressResetStatePending" TypeTextEntity = "textEntity" TypeTextEntities = "textEntities" + TypeTextRange = "textRange" + TypeTextRanges = "textRanges" TypeFormattedText = "formattedText" TypeRichMessage = "richMessage" TypeInputRichMessageMedia = "inputRichMessageMedia" @@ -943,6 +1010,7 @@ const ( TypeWebAppInfo = "webAppInfo" TypeMainWebApp = "mainWebApp" TypeWebAppOpenParameters = "webAppOpenParameters" + TypeAreaPosition = "areaPosition" TypeGiftResalePriceStar = "giftResalePriceStar" TypeGiftResalePriceGram = "giftResalePriceGram" TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" @@ -1020,6 +1088,7 @@ const ( TypeGift = "gift" TypeUpgradedGift = "upgradedGift" TypeUpgradedGiftValueInfo = "upgradedGiftValueInfo" + TypeUpgradedGiftDepositInfo = "upgradedGiftDepositInfo" TypeUpgradeGiftResult = "upgradeGiftResult" TypeCraftGiftResultSuccess = "craftGiftResultSuccess" TypeCraftGiftResultTooEarly = "craftGiftResultTooEarly" @@ -1117,6 +1186,67 @@ const ( TypeTonTransactionTypeUnsupported = "tonTransactionTypeUnsupported" TypeTonTransaction = "tonTransaction" TypeTonTransactions = "tonTransactions" + TypeTonCenterApiRequestTypeGet = "tonCenterApiRequestTypeGet" + TypeTonCenterApiRequestTypePost = "tonCenterApiRequestTypePost" + TypeTonWalletTransferReceiverUser = "tonWalletTransferReceiverUser" + TypeTonWalletTransferReceiverAddress = "tonWalletTransferReceiverAddress" + TypeTonCenterStreamingApiUrl = "tonCenterStreamingApiUrl" + TypeWalletBotBalance = "walletBotBalance" + TypeUserTonWalletAddress = "userTonWalletAddress" + TypeUserTonWalletAddresses = "userTonWalletAddresses" + TypeTonWalletOwnershipProofChallenge = "tonWalletOwnershipProofChallenge" + TypeTonWalletOwnershipProof = "tonWalletOwnershipProof" + TypeTonWalletSecretPhrase = "tonWalletSecretPhrase" + TypeTonWalletGaslessTransfersInfo = "tonWalletGaslessTransfersInfo" + TypeCurrencyExchangeRate = "currencyExchangeRate" + TypeCurrencyExchangeRates = "currencyExchangeRates" + TypeOnRampProvider = "onRampProvider" + TypeOnRampProviders = "onRampProviders" + TypeCurrencies = "currencies" + TypeOnRampPaymentMethod = "onRampPaymentMethod" + TypeOnRampPaymentAvailability = "onRampPaymentAvailability" + TypeOnRampPaymentLimits = "onRampPaymentLimits" + TypeOnRampPaymentQuote = "onRampPaymentQuote" + TypeOnRampPaymentSession = "onRampPaymentSession" + TypeTonWalletState = "tonWalletState" + TypeTonNftAttribute = "tonNftAttribute" + TypeTonNft = "tonNft" + TypeTonNfts = "tonNfts" + TypeTonWalletCardSticker = "tonWalletCardSticker" + TypeTonWalletCard = "tonWalletCard" + TypeInputTonWalletCardSticker = "inputTonWalletCardSticker" + TypeUpgradedGiftCollectionNames = "upgradedGiftCollectionNames" + TypeTonWalletTransactionStateSucceeded = "tonWalletTransactionStateSucceeded" + TypeTonWalletTransactionStateFailed = "tonWalletTransactionStateFailed" + TypeTonWalletTransactionTypeOnRampDeposit = "tonWalletTransactionTypeOnRampDeposit" + TypeTonWalletTransactionTypeTransfer = "tonWalletTransactionTypeTransfer" + TypeTonWalletTransactionTypeNftTransfer = "tonWalletTransactionTypeNftTransfer" + TypeTonWalletTransactionTypeTelegramGiftTransfer = "tonWalletTransactionTypeTelegramGiftTransfer" + TypeTonWalletTransactionTypeKeyChange = "tonWalletTransactionTypeKeyChange" + TypeTonWalletTransaction = "tonWalletTransaction" + TypeTonWalletTransactions = "tonWalletTransactions" + TypeTonConnectRequestStatePending = "tonConnectRequestStatePending" + TypeTonConnectRequestStateAccepted = "tonConnectRequestStateAccepted" + TypeTonConnectRequestStateRejected = "tonConnectRequestStateRejected" + TypeTonConnectManifestPending = "tonConnectManifestPending" + TypeTonConnectManifestInfo = "tonConnectManifestInfo" + TypeTonConnectManifestFailed = "tonConnectManifestFailed" + TypeTonConnectManifestInvalid = "tonConnectManifestInvalid" + TypeTonConnectSessionStatePending = "tonConnectSessionStatePending" + TypeTonConnectSessionStateReady = "tonConnectSessionStateReady" + TypeTonConnectSessionStateClosing = "tonConnectSessionStateClosing" + TypeTonConnectSessionStateClosed = "tonConnectSessionStateClosed" + TypeTonConnectConnectItemAddress = "tonConnectConnectItemAddress" + TypeTonConnectConnectItemProof = "tonConnectConnectItemProof" + TypeTonConnectConnectRequest = "tonConnectConnectRequest" + TypeTonConnectConnectData = "tonConnectConnectData" + TypeTonConnectSession = "tonConnectSession" + TypeTonConnectSessions = "tonConnectSessions" + TypeTonConnectRequest = "tonConnectRequest" + TypeTonConnectRequests = "tonConnectRequests" + TypeTonConnectChallenge = "tonConnectChallenge" + TypeTonConnectSessionEventId = "tonConnectSessionEventId" + TypeTonWalletTransferResult = "tonWalletTransferResult" TypeActiveStoryStateLive = "activeStoryStateLive" TypeActiveStoryStateUnread = "activeStoryStateUnread" TypeActiveStoryStateRead = "activeStoryStateRead" @@ -1133,6 +1263,15 @@ const ( TypeAccentColor = "accentColor" TypeProfileAccentColors = "profileAccentColors" TypeProfileAccentColor = "profileAccentColor" + TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" + TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" + TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" + TypeChatNotificationSettings = "chatNotificationSettings" + TypeScopeNotificationSettings = "scopeNotificationSettings" + TypeReactionNotificationSourceNone = "reactionNotificationSourceNone" + TypeReactionNotificationSourceContacts = "reactionNotificationSourceContacts" + TypeReactionNotificationSourceAll = "reactionNotificationSourceAll" + TypeReactionNotificationSettings = "reactionNotificationSettings" TypeCommunityId = "communityId" TypeCommunityPermissions = "communityPermissions" TypeCommunityAdministratorRights = "communityAdministratorRights" @@ -1144,6 +1283,10 @@ const ( TypeCommunity = "community" TypeCommunityChat = "communityChat" TypeCommunityFullInfo = "communityFullInfo" + TypeCommunities = "communities" + TypeCommunityAddChatRequest = "communityAddChatRequest" + TypeCommunityAddChatRequests = "communityAddChatRequests" + TypeCommunityMemberChats = "communityMemberChats" TypeUserRating = "userRating" TypeRestrictionInfo = "restrictionInfo" TypeEmojiStatusTypeCustomEmoji = "emojiStatusTypeCustomEmoji" @@ -1303,15 +1446,6 @@ const ( TypeFileDownload = "fileDownload" TypeDownloadedFileCounts = "downloadedFileCounts" TypeFoundFileDownloads = "foundFileDownloads" - TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" - TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" - TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" - TypeChatNotificationSettings = "chatNotificationSettings" - TypeScopeNotificationSettings = "scopeNotificationSettings" - TypeReactionNotificationSourceNone = "reactionNotificationSourceNone" - TypeReactionNotificationSourceContacts = "reactionNotificationSourceContacts" - TypeReactionNotificationSourceAll = "reactionNotificationSourceAll" - TypeReactionNotificationSettings = "reactionNotificationSettings" TypeDraftMessageContentText = "draftMessageContentText" TypeDraftMessageContentRichMessage = "draftMessageContentRichMessage" TypeDraftMessageContentInputRichMessage = "draftMessageContentInputRichMessage" @@ -1412,6 +1546,14 @@ const ( TypeBuiltInThemeTinted = "builtInThemeTinted" TypeBuiltInThemeArctic = "builtInThemeArctic" TypeThemeSettings = "themeSettings" + TypeProfileShareThemeBackdrop = "profileShareThemeBackdrop" + TypeProfileShareThemeBackdrops = "profileShareThemeBackdrops" + TypeEmojiTypeRegular = "emojiTypeRegular" + TypeEmojiTypeCustomEmoji = "emojiTypeCustomEmoji" + TypeProfileShareThemeEmoji = "profileShareThemeEmoji" + TypeProfileShareThemeUpgradedGift = "profileShareThemeUpgradedGift" + TypeInputProfileShareThemeEmoji = "inputProfileShareThemeEmoji" + TypeInputProfileShareThemeUpgradedGift = "inputProfileShareThemeUpgradedGift" TypeInlineButton = "inlineButton" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" @@ -1427,6 +1569,7 @@ const ( TypeRichTextHashtag = "richTextHashtag" TypeRichTextCashtag = "richTextCashtag" TypeRichTextBankCardNumber = "richTextBankCardNumber" + TypeRichTextTonAddress = "richTextTonAddress" TypeRichTextBotCommand = "richTextBotCommand" TypeRichTextFixed = "richTextFixed" TypeRichTextMentionName = "richTextMentionName" @@ -1681,6 +1824,7 @@ const ( TypeMessagePoll = "messagePoll" TypeMessageStakeDice = "messageStakeDice" TypeMessageStory = "messageStory" + TypeMessageWidget = "messageWidget" TypeMessageChecklist = "messageChecklist" TypeMessageInvoice = "messageInvoice" TypeMessageCall = "messageCall" @@ -1736,6 +1880,8 @@ const ( TypeMessageGiftedStars = "messageGiftedStars" TypeMessageGiftedGrams = "messageGiftedGrams" TypeMessageGiveawayPrizeStars = "messageGiveawayPrizeStars" + TypeMessageTonWalletTransfer = "messageTonWalletTransfer" + TypeMessageTonConnectRequest = "messageTonConnectRequest" TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" @@ -1744,6 +1890,7 @@ const ( TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded" TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged" TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged" + TypeMessageUnpaidMessagesAllowedByLink = "messageUnpaidMessagesAllowedByLink" TypeMessageChecklistTasksDone = "messageChecklistTasksDone" TypeMessageChecklistTasksAdded = "messageChecklistTasksAdded" TypeMessageSuggestedPostApprovalFailed = "messageSuggestedPostApprovalFailed" @@ -1774,6 +1921,7 @@ const ( TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" + TypeTextEntityTypeTonAddress = "textEntityTypeTonAddress" TypeTextEntityTypeBold = "textEntityTypeBold" TypeTextEntityTypeItalic = "textEntityTypeItalic" TypeTextEntityTypeUnderline = "textEntityTypeUnderline" @@ -1866,6 +2014,8 @@ const ( TypeInputMessageStakeDice = "inputMessageStakeDice" TypeInputMessageStory = "inputMessageStory" TypeInputMessageChecklist = "inputMessageChecklist" + TypeInputMessageWidget = "inputMessageWidget" + TypeInputMessageSharedWidget = "inputMessageSharedWidget" TypeInputMessageForwarded = "inputMessageForwarded" TypeMessageProperties = "messageProperties" TypePollOptionProperties = "pollOptionProperties" @@ -1932,7 +2082,6 @@ const ( TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus" TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto" TypeCurrentWeather = "currentWeather" - TypeStoryAreaPosition = "storyAreaPosition" TypeStoryAreaTypeLocation = "storyAreaTypeLocation" TypeStoryAreaTypeVenue = "storyAreaTypeVenue" TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" @@ -1942,7 +2091,6 @@ const ( TypeStoryAreaTypeUpgradedGift = "storyAreaTypeUpgradedGift" TypeStoryArea = "storyArea" TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" - TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage" @@ -2077,6 +2225,7 @@ const ( TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" TypeSpeechRecognitionResultText = "speechRecognitionResultText" TypeSpeechRecognitionResultError = "speechRecognitionResultError" + TypeSpeechRecognitionLanguages = "speechRecognitionLanguages" TypeBusinessConnection = "businessConnection" TypeAttachmentMenuBotColor = "attachmentMenuBotColor" TypeAttachmentMenuBot = "attachmentMenuBot" @@ -2125,6 +2274,12 @@ const ( TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" TypeCallbackQueryAnswer = "callbackQueryAnswer" + TypeWidgetQueryWallet = "widgetQueryWallet" + TypeWidgetQueryTypeData = "widgetQueryTypeData" + TypeWidgetQueryTypeSignData = "widgetQueryTypeSignData" + TypeWidgetQueryTypeSentTransaction = "widgetQueryTypeSentTransaction" + TypeWidgetQueryAnswer = "widgetQueryAnswer" + TypeWidgetPublicData = "widgetPublicData" TypeCustomRequestResult = "customRequestResult" TypeGameHighScore = "gameHighScore" TypeGameHighScores = "gameHighScores" @@ -2364,6 +2519,8 @@ const ( TypePushMessageContentPoll = "pushMessageContentPoll" TypePushMessageContentPremiumGiftCode = "pushMessageContentPremiumGiftCode" TypePushMessageContentGiveaway = "pushMessageContentGiveaway" + TypePushMessageContentTonWalletTransfer = "pushMessageContentTonWalletTransfer" + TypePushMessageContentTonConnectRequest = "pushMessageContentTonConnectRequest" TypePushMessageContentGift = "pushMessageContentGift" TypePushMessageContentUpgradedGift = "pushMessageContentUpgradedGift" TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" @@ -2570,6 +2727,8 @@ const ( TypeInternalLinkTypeStoryAlbum = "internalLinkTypeStoryAlbum" TypeInternalLinkTypeTextCompositionStyle = "internalLinkTypeTextCompositionStyle" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeTonConnect = "internalLinkTypeTonConnect" + TypeInternalLinkTypeTonWalletTransfer = "internalLinkTypeTonWalletTransfer" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" TypeInternalLinkTypeUpgradedGift = "internalLinkTypeUpgradedGift" TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" @@ -2660,6 +2819,7 @@ const ( TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" + TypeSuggestedActionViewFirstTonWalletTransferHint = "suggestedActionViewFirstTonWalletTransferHint" TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" TypeSuggestedActionSetPassword = "suggestedActionSetPassword" TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium" @@ -2685,8 +2845,17 @@ const ( TypeProxyTypeSocks5 = "proxyTypeSocks5" TypeProxyTypeHttp = "proxyTypeHttp" TypeProxyTypeMtproto = "proxyTypeMtproto" + TypeProxyTypeWeb = "proxyTypeWeb" TypeAddedProxy = "addedProxy" TypeAddedProxies = "addedProxies" + TypeWebProxyCarrier = "webProxyCarrier" + TypeWebProxyCarrierMessageText = "webProxyCarrierMessageText" + TypeWebProxyCarrierMessageBinary = "webProxyCarrierMessageBinary" + TypeWebProxyCarrierErrorUnsupported = "webProxyCarrierErrorUnsupported" + TypeWebProxyCarrierErrorPaused = "webProxyCarrierErrorPaused" + TypeWebProxyCarrierErrorLoadFailed = "webProxyCarrierErrorLoadFailed" + TypeWebProxyCarrierErrorTerminated = "webProxyCarrierErrorTerminated" + TypeWebProxyCarrierErrorRefused = "webProxyCarrierErrorRefused" TypeNewSticker = "newSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" @@ -2854,6 +3023,7 @@ const ( TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateAllowedBotUsernamePremiumSuffixes = "updateAllowedBotUsernamePremiumSuffixes" TypeUpdateTrustedMiniAppBots = "updateTrustedMiniAppBots" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" @@ -2870,6 +3040,9 @@ const ( TypeUpdateWebBrowserSettings = "updateWebBrowserSettings" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" + TypeUpdateWebProxyCarrierOpened = "updateWebProxyCarrierOpened" + TypeUpdateWebProxyCarrierData = "updateWebProxyCarrierData" + TypeUpdateWebProxyCarrierClosed = "updateWebProxyCarrierClosed" TypeUpdateFreezeState = "updateFreezeState" TypeUpdateAgeVerificationParameters = "updateAgeVerificationParameters" TypeUpdateTermsOfService = "updateTermsOfService" @@ -2884,10 +3057,15 @@ const ( TypeUpdateActiveLiveLocationMessages = "updateActiveLiveLocationMessages" TypeUpdateOwnedStarCount = "updateOwnedStarCount" TypeUpdateOwnedGramCount = "updateOwnedGramCount" + TypeUpdateTonWalletState = "updateTonWalletState" + TypeUpdateTonWalletGaslessTransfersInfo = "updateTonWalletGaslessTransfersInfo" + TypeUpdateTonWalletTonConnectSession = "updateTonWalletTonConnectSession" + TypeUpdateTonWalletTonConnectSessionDisconnectRequired = "updateTonWalletTonConnectSessionDisconnectRequired" TypeUpdateChatRevenueAmount = "updateChatRevenueAmount" TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" TypeUpdateGramRevenueStatus = "updateGramRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" + TypeUpdateSpeechRecognitionInFile = "updateSpeechRecognitionInFile" TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateStakeDiceState = "updateStakeDiceState" @@ -2908,6 +3086,9 @@ const ( TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" TypeUpdateNewBusinessCallbackQuery = "updateNewBusinessCallbackQuery" + TypeUpdateNewWidgetQuery = "updateNewWidgetQuery" + TypeUpdateNewInlineWidgetQuery = "updateNewInlineWidgetQuery" + TypeUpdateNewWidgetCopyQuery = "updateNewWidgetCopyQuery" TypeUpdateNewShippingQuery = "updateNewShippingQuery" TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" TypeUpdateNewCustomEvent = "updateNewCustomEvent" @@ -3143,6 +3324,46 @@ type TonTransactionType interface { TonTransactionTypeType() string } +// Describes a type of request to the TON Center API +type TonCenterApiRequestType interface { + TonCenterApiRequestTypeType() string +} + +// Represents expected receiver of a TON wallet transfer +type TonWalletTransferReceiver interface { + TonWalletTransferReceiverType() string +} + +// Describes state of a transaction with a TON wallet +type TonWalletTransactionState interface { + TonWalletTransactionStateType() string +} + +// Describes type of transaction with a TON wallet +type TonWalletTransactionType interface { + TonWalletTransactionTypeType() string +} + +// Describes state of a request received from a dApp through TON Connect +type TonConnectRequestState interface { + TonConnectRequestStateType() string +} + +// Describes manifest of the dApp that is being connected using TON Connect +type TonConnectManifest interface { + TonConnectManifestType() string +} + +// Describes state of a TON Connect session +type TonConnectSessionState interface { + TonConnectSessionStateType() string +} + +// Represents a data item to share with a dApp +type TonConnectConnectItem interface { + TonConnectConnectItemType() string +} + // Describes state of active stories posted by a chat type ActiveStoryState interface { ActiveStoryStateType() string @@ -3163,6 +3384,16 @@ type GiveawayPrize interface { GiveawayPrizeType() string } +// Describes the types of chats to which notification settings are relevant +type NotificationSettingsScope interface { + NotificationSettingsScopeType() string +} + +// Describes sources of reactions for which notifications will be shown +type ReactionNotificationSource interface { + ReactionNotificationSourceType() string +} + // Provides information about the status of a member in a community type CommunityMemberStatus interface { CommunityMemberStatusType() string @@ -3268,16 +3499,6 @@ type ReportSponsoredResult interface { ReportSponsoredResultType() string } -// Describes the types of chats to which notification settings are relevant -type NotificationSettingsScope interface { - NotificationSettingsScopeType() string -} - -// Describes sources of reactions for which notifications will be shown -type ReactionNotificationSource interface { - ReactionNotificationSourceType() string -} - // Content of the message draft type DraftMessageContent interface { DraftMessageContentType() string @@ -3353,6 +3574,21 @@ type BuiltInTheme interface { BuiltInThemeType() string } +// Describes an emoji +type EmojiType interface { + EmojiTypeType() string +} + +// Describes a theme of the screen for sharing a link to a user or a chat +type ProfileShareTheme interface { + ProfileShareThemeType() string +} + +// Describes a theme of the screen for sharing a link to a user or a chat to be set +type InputProfileShareTheme interface { + InputProfileShareThemeType() string +} + // Describes a formatted text object type RichText interface { RichTextType() string @@ -3363,7 +3599,7 @@ type PageBlockHorizontalAlignment interface { PageBlockHorizontalAlignmentType() string } -// Describes a Vertical alignment of a table cell content +// Describes a vertical alignment of a table cell content type PageBlockVerticalAlignment interface { PageBlockVerticalAlignmentType() string } @@ -3688,6 +3924,11 @@ type CallbackQueryPayload interface { CallbackQueryPayloadType() string } +// Describes type of a widget query +type WidgetQueryType interface { + WidgetQueryTypeType() string +} + // Represents a chat event type ChatEventAction interface { ChatEventActionType() string @@ -3943,6 +4184,16 @@ type ProxyType interface { ProxyTypeType() string } +// Describes a message passed by the page of a web proxy carrier to postMessage of the bridge object +type WebProxyCarrierMessage interface { + WebProxyCarrierMessageType() string +} + +// Describes the reason why a web proxy carrier failed +type WebProxyCarrierError interface { + WebProxyCarrierErrorType() string +} + // Describes a statistical graph type StatisticalGraph interface { StatisticalGraphType() string @@ -4623,6 +4874,54 @@ func (*TextEntities) GetType() string { return TypeTextEntities } +// Describes a part of a text +type TextRange struct { + meta + // Offset of the part, in UTF-16 code units + Offset int32 `json:"offset"` + // Length of the part, in UTF-16 code units + Length int32 `json:"length"` +} + +func (entity *TextRange) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextRange + + return json.Marshal((*stub)(entity)) +} + +func (*TextRange) GetClass() string { + return ClassTextRange +} + +func (*TextRange) GetType() string { + return TypeTextRange +} + +// Contains a list of text parts +type TextRanges struct { + meta + // List of text parts + Ranges []*TextRange `json:"ranges"` +} + +func (entity *TextRanges) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextRanges + + return json.Marshal((*stub)(entity)) +} + +func (*TextRanges) GetClass() string { + return ClassTextRanges +} + +func (*TextRanges) GetType() string { + return TypeTextRanges +} + // A text with some entities type FormattedText struct { meta @@ -5628,7 +5927,7 @@ func (*RecoveryEmailAddress) GetType() string { return TypeRecoveryEmailAddress } -// Returns information about the availability of a temporary password, which can be used for payments +// Contains information about the availability of a temporary password, which can be used for payments and withdrawal of upgraded gifts type TemporaryPasswordState struct { meta // True, if a temporary password is available @@ -7580,6 +7879,8 @@ type AnimatedEmoji struct { FitzpatrickType int32 `json:"fitzpatrick_type"` // 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 Sound *File `json:"sound"` + // True, if the emoji is a regular emoji + IsRegularEmoji bool `json:"is_regular_emoji"` } func (entity *AnimatedEmoji) MarshalJSON() ([]byte, error) { @@ -7844,7 +8145,7 @@ type Poll struct { MembersOnly bool `json:"members_only"` // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll CountryCodes []string `json:"country_codes"` - // The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed + // The list of 0-based poll option identifiers in which the options of the poll must be shown; empty if the order of options must not be changed OptionOrder []int32 `json:"option_order"` // Type of the poll Type PollType `json:"type"` @@ -8426,6 +8727,8 @@ type UserTypeBot struct { HasMainWebApp bool `json:"has_main_web_app"` // True, if the bot has topics HasTopics bool `json:"has_topics"` + // True, if the bot has topics, which are shown in a sidebar + HasTopicSidebar bool `json:"has_topic_sidebar"` // 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 can manage other bots @@ -8631,7 +8934,7 @@ type BotVerification struct { BotUserId int64 `json:"bot_user_id"` // Identifier of the custom emoji that is used as the verification sign IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` - // Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities + // Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, TonAddress, Url, and EmailAddress entities CustomDescription *FormattedText `json:"custom_description"` } @@ -8996,7 +9299,7 @@ type BusinessBotRights struct { CanEditUsername bool `json:"can_edit_username"` // 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 + // True, if the bot can sell or delete regular gifts received by the business account CanSellGifts bool `json:"can_sell_gifts"` // True, if the bot can change gift receiving settings of the business account CanChangeGiftSettings bool `json:"can_change_gift_settings"` @@ -9481,7 +9784,7 @@ type ChatPhoto struct { AddedDate int32 `json:"added_date"` // Photo minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` - // Available variants of the photo in JPEG format, in different size + // Available variants of the photo in JPEG format, in different sizes Sizes []*PhotoSize `json:"sizes"` // A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null Animation *AnimatedChatPhoto `json:"animation"` @@ -10088,6 +10391,39 @@ func (webAppOpenParameters *WebAppOpenParameters) UnmarshalJSON(data []byte) err return nil } +// Describes position of a rectangle area on a story media or a TON wallet card +type AreaPosition struct { + meta + // The abscissa of the rectangle's center, as a percentage of the media or the card width + XPercentage float64 `json:"x_percentage"` + // The ordinate of the rectangle's center, as a percentage of the media or the card height + YPercentage float64 `json:"y_percentage"` + // The width of the rectangle, as a percentage of the media or the card width + WidthPercentage float64 `json:"width_percentage"` + // The height of the rectangle, as a percentage of the media or the card height + HeightPercentage float64 `json:"height_percentage"` + // Clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 `json:"rotation_angle"` + // The radius of the rectangle corner rounding, as a percentage of the media or the card width + CornerRadiusPercentage float64 `json:"corner_radius_percentage"` +} + +func (entity *AreaPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AreaPosition + + return json.Marshal((*stub)(entity)) +} + +func (*AreaPosition) GetClass() string { + return ClassAreaPosition +} + +func (*AreaPosition) GetType() string { + return TypeAreaPosition +} + // Describes price of a resold gift in Telegram Stars type GiftResalePriceStar struct { meta @@ -10939,7 +11275,7 @@ func (*AffiliateInfo) GetType() string { // Describes a found affiliate program type FoundAffiliateProgram struct { meta - // User identifier of the bot created the program + // User identifier of the bot that created the program BotUserId int64 `json:"bot_user_id"` // Information about the affiliate program Info *AffiliateProgramInfo `json:"info"` @@ -10993,7 +11329,7 @@ type ConnectedAffiliateProgram struct { meta // The link that can be used to refer users if the program is still active Url string `json:"url"` - // User identifier of the bot created the program + // User identifier of the bot that created the program BotUserId int64 `json:"bot_user_id"` // The parameters of the affiliate program Parameters *AffiliateProgramParameters `json:"parameters"` @@ -11850,7 +12186,7 @@ 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 +// 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 } @@ -12396,7 +12732,7 @@ type Gift struct { UserLimits *GiftPurchaseLimits `json:"user_limits"` // Number of times the gift can be purchased by all users; may be null if not limited OverallLimits *GiftPurchaseLimits `json:"overall_limits"` - // Background of the gift + // Background of the gift; may be null if the gift has no background Background *GiftBackground `json:"background"` // Point in time (Unix timestamp) when the gift was sent for the first time; for sold out gifts only FirstSendDate int32 `json:"first_send_date"` @@ -12459,6 +12795,8 @@ type UpgradedGift struct { OwnerName string `json:"owner_name"` // Address of the gift NFT 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 GiftAddress string `json:"gift_address"` + // True, if the gift NFT can be used as background_nft_address in setTonWalletCardStickers + CanBeTonWalletCardBackground bool `json:"can_be_ton_wallet_card_background"` // Model of the upgraded gift Model *UpgradedGiftModel `json:"model"` // Symbol of the upgraded gift @@ -12519,6 +12857,7 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { OwnerAddress string `json:"owner_address"` OwnerName string `json:"owner_name"` GiftAddress string `json:"gift_address"` + CanBeTonWalletCardBackground bool `json:"can_be_ton_wallet_card_background"` Model *UpgradedGiftModel `json:"model"` Symbol *UpgradedGiftSymbol `json:"symbol"` Backdrop *UpgradedGiftBackdrop `json:"backdrop"` @@ -12553,6 +12892,7 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.OwnerAddress = tmp.OwnerAddress upgradedGift.OwnerName = tmp.OwnerName upgradedGift.GiftAddress = tmp.GiftAddress + upgradedGift.CanBeTonWalletCardBackground = tmp.CanBeTonWalletCardBackground upgradedGift.Model = tmp.Model upgradedGift.Symbol = tmp.Symbol upgradedGift.Backdrop = tmp.Backdrop @@ -12623,6 +12963,33 @@ func (*UpgradedGiftValueInfo) GetType() string { return TypeUpgradedGiftValueInfo } +// Contains information needed to deposit an upgraded gift from the TON wallet of the current user to a Telegram account. The gift must be transferred by an internal message from the wallet to nft_address with gram_amount attached and with payload as the message body +type UpgradedGiftDepositInfo struct { + meta + // Address in TON blockchain to which the message must be sent + NftAddress string `json:"nft_address"` + // Body of the NFT transfer message + Payload []byte `json:"payload"` + // The amount of TON Grams that must be attached to the message to cover fees, in the smallest units of the cryptocurrency; excess amount will be returned to the wallet + GramAmount JsonInt64 `json:"gram_amount"` +} + +func (entity *UpgradedGiftDepositInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftDepositInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftDepositInfo) GetClass() string { + return ClassUpgradedGiftDepositInfo +} + +func (*UpgradedGiftDepositInfo) GetType() string { + return TypeUpgradedGiftDepositInfo +} + // Contains result of gift upgrading type UpgradeGiftResult struct { meta @@ -12981,7 +13348,7 @@ type UpgradedGiftBackdropCount struct { meta // The backdrop Backdrop *UpgradedGiftBackdrop `json:"backdrop"` - // Total number of gifts with the symbol + // Total number of gifts with the backdrop TotalCount int32 `json:"total_count"` } @@ -13269,7 +13636,7 @@ type ReceivedGift struct { 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 + // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone is 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 IsSaved bool `json:"is_saved"` @@ -13279,6 +13646,8 @@ type ReceivedGift struct { CanBeUpgraded bool `json:"can_be_upgraded"` // True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift CanBeTransferred bool `json:"can_be_transferred"` + // True, if the gift is a regular gift that can be deleted using deleteGift; only for the receiver of the gift + CanBeDeleted bool `json:"can_be_deleted"` // True, if the gift was refunded and isn't available anymore WasRefunded bool `json:"was_refunded"` // Point in time (Unix timestamp) when the gift was sent @@ -13336,6 +13705,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { IsPinned bool `json:"is_pinned"` CanBeUpgraded bool `json:"can_be_upgraded"` CanBeTransferred bool `json:"can_be_transferred"` + CanBeDeleted bool `json:"can_be_deleted"` WasRefunded bool `json:"was_refunded"` Date int32 `json:"date"` Gift json.RawMessage `json:"gift"` @@ -13365,6 +13735,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.IsPinned = tmp.IsPinned receivedGift.CanBeUpgraded = tmp.CanBeUpgraded receivedGift.CanBeTransferred = tmp.CanBeTransferred + receivedGift.CanBeDeleted = tmp.CanBeDeleted receivedGift.WasRefunded = tmp.WasRefunded receivedGift.Date = tmp.Date receivedGift.CollectionIds = tmp.CollectionIds @@ -13420,7 +13791,7 @@ func (*ReceivedGifts) GetType() string { // 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 + // 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 crafts PersistenceChancePerMille []int32 `json:"persistence_chance_per_mille"` } @@ -13447,7 +13818,7 @@ type GiftsForCrafting struct { 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 + // 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-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"` @@ -13729,7 +14100,7 @@ func (*AuctionStateFinished) AuctionStateType() string { return TypeAuctionStateFinished } -// Represent auction state of a gift +// Represents auction state of a gift type GiftAuctionState struct { meta // The gift @@ -14444,7 +14815,7 @@ type StarTransactionTypeBotSubscriptionPurchase struct { UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` - // Information about the bought subscription + // Information about the bought subscription; may be null if no information about the subscription is available ProductInfo *ProductInfo `json:"product_info"` } @@ -14475,7 +14846,7 @@ type StarTransactionTypeBotSubscriptionSale struct { UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` - // Information about the bought subscription + // Information about the bought subscription; may be null if no information about the subscription is available ProductInfo *ProductInfo `json:"product_info"` // Invoice payload InvoicePayload []byte `json:"invoice_payload"` @@ -15201,7 +15572,7 @@ func (starTransactionTypePaidGroupCallMessageReceive *StarTransactionTypePaidGro return nil } -// The transaction is a sending of a paid group reaction; relevant for regular users only +// The transaction is a sending of a paid group call reaction; relevant for regular users only type StarTransactionTypePaidGroupCallReactionSend struct { meta // Identifier of the chat that received the payment @@ -15900,6 +16271,1803 @@ func (*TonTransactions) GetType() string { return TypeTonTransactions } +// A GET request +type TonCenterApiRequestTypeGet struct { + meta + // URL-encoded query of the request + Query string `json:"query"` +} + +func (entity *TonCenterApiRequestTypeGet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonCenterApiRequestTypeGet + + return json.Marshal((*stub)(entity)) +} + +func (*TonCenterApiRequestTypeGet) GetClass() string { + return ClassTonCenterApiRequestType +} + +func (*TonCenterApiRequestTypeGet) GetType() string { + return TypeTonCenterApiRequestTypeGet +} + +func (*TonCenterApiRequestTypeGet) TonCenterApiRequestTypeType() string { + return TypeTonCenterApiRequestTypeGet +} + +// A POST request +type TonCenterApiRequestTypePost struct { + meta + // Payload of the request + Payload string `json:"payload"` +} + +func (entity *TonCenterApiRequestTypePost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonCenterApiRequestTypePost + + return json.Marshal((*stub)(entity)) +} + +func (*TonCenterApiRequestTypePost) GetClass() string { + return ClassTonCenterApiRequestType +} + +func (*TonCenterApiRequestTypePost) GetType() string { + return TypeTonCenterApiRequestTypePost +} + +func (*TonCenterApiRequestTypePost) TonCenterApiRequestTypeType() string { + return TypeTonCenterApiRequestTypePost +} + +// The receiver is specified by its username +type TonWalletTransferReceiverUser struct { + meta + // Username of the user. Use searchPublicChat to find the user, check that it is a regular user, and then use createUserTonWallet to get information about the user's TON wallet + Username string `json:"username"` +} + +func (entity *TonWalletTransferReceiverUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransferReceiverUser + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransferReceiverUser) GetClass() string { + return ClassTonWalletTransferReceiver +} + +func (*TonWalletTransferReceiverUser) GetType() string { + return TypeTonWalletTransferReceiverUser +} + +func (*TonWalletTransferReceiverUser) TonWalletTransferReceiverType() string { + return TypeTonWalletTransferReceiverUser +} + +// The receiver is specified by its address +type TonWalletTransferReceiverAddress struct { + meta + // Address of the receiver. Use getAddressTonWallet to get information about the user's TON wallet + Address string `json:"address"` +} + +func (entity *TonWalletTransferReceiverAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransferReceiverAddress + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransferReceiverAddress) GetClass() string { + return ClassTonWalletTransferReceiver +} + +func (*TonWalletTransferReceiverAddress) GetType() string { + return TypeTonWalletTransferReceiverAddress +} + +func (*TonWalletTransferReceiverAddress) TonWalletTransferReceiverType() string { + return TypeTonWalletTransferReceiverAddress +} + +// Contains an HTTP URL for TON Center Streaming API +type TonCenterStreamingApiUrl struct { + meta + // The URL + Url string `json:"url"` + // Time after which the URL expires + ExpiresIn int32 `json:"expires_in"` +} + +func (entity *TonCenterStreamingApiUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonCenterStreamingApiUrl + + return json.Marshal((*stub)(entity)) +} + +func (*TonCenterStreamingApiUrl) GetClass() string { + return ClassTonCenterStreamingApiUrl +} + +func (*TonCenterStreamingApiUrl) GetType() string { + return TypeTonCenterStreamingApiUrl +} + +// Describes balance of the current user in the bot https://t.me/walt +type WalletBotBalance struct { + meta + // True, if the user has positive TON Gram balance + HasBalance bool `json:"has_balance"` + // The URL to open to launch the bot; may be empty if none + Url string `json:"url"` +} + +func (entity *WalletBotBalance) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WalletBotBalance + + return json.Marshal((*stub)(entity)) +} + +func (*WalletBotBalance) GetClass() string { + return ClassWalletBotBalance +} + +func (*WalletBotBalance) GetType() string { + return TypeWalletBotBalance +} + +// Contains TON wallet address of a user +type UserTonWalletAddress struct { + meta + // Identifier of the user; 0 if unknown + UserId int64 `json:"user_id"` + // Address of the user's wallet in the TON blockchain + WalletAddress string `json:"wallet_address"` + // Public key of the user + PublicKey []byte `json:"public_key"` +} + +func (entity *UserTonWalletAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTonWalletAddress + + return json.Marshal((*stub)(entity)) +} + +func (*UserTonWalletAddress) GetClass() string { + return ClassUserTonWalletAddress +} + +func (*UserTonWalletAddress) GetType() string { + return TypeUserTonWalletAddress +} + +// Represents a list of TON wallet addresses of users +type UserTonWalletAddresses struct { + meta + // A list of TON wallet addresses + Addresses []*UserTonWalletAddress `json:"addresses"` +} + +func (entity *UserTonWalletAddresses) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTonWalletAddresses + + return json.Marshal((*stub)(entity)) +} + +func (*UserTonWalletAddresses) GetClass() string { + return ClassUserTonWalletAddresses +} + +func (*UserTonWalletAddresses) GetType() string { + return TypeUserTonWalletAddresses +} + +// Represents a challenge for TON wallet ownership proof +type TonWalletOwnershipProofChallenge struct { + meta + // Payload of the challenge + Payload string `json:"payload"` + // Domain of the proof requester + Domain string `json:"domain"` +} + +func (entity *TonWalletOwnershipProofChallenge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletOwnershipProofChallenge + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletOwnershipProofChallenge) GetClass() string { + return ClassTonWalletOwnershipProofChallenge +} + +func (*TonWalletOwnershipProofChallenge) GetType() string { + return TypeTonWalletOwnershipProofChallenge +} + +// Represents a proof of TON wallet ownership +type TonWalletOwnershipProof struct { + meta + // Public key of the wallet + PublicKey []byte `json:"public_key"` + // The current UNIX timestamp which was used to create the proof + Timestamp int32 `json:"timestamp"` + // The signature proving the ownership + Signature []byte `json:"signature"` +} + +func (entity *TonWalletOwnershipProof) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletOwnershipProof + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletOwnershipProof) GetClass() string { + return ClassTonWalletOwnershipProof +} + +func (*TonWalletOwnershipProof) GetType() string { + return TypeTonWalletOwnershipProof +} + +// Contains the secret phrase of a TON wallet +type TonWalletSecretPhrase struct { + meta + // The secret phrase as a space separated list of words + SecretPhrase string `json:"secret_phrase"` +} + +func (entity *TonWalletSecretPhrase) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletSecretPhrase + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletSecretPhrase) GetClass() string { + return ClassTonWalletSecretPhrase +} + +func (*TonWalletSecretPhrase) GetType() string { + return TypeTonWalletSecretPhrase +} + +// Represents state of gasless transfers for the current user +type TonWalletGaslessTransfersInfo struct { + meta + // Number of left gasless transfers. The daily available number of gasless transfers is available as getOption("ton_wallet_gasless_transfer_daily_count_max") + LeftCount int32 `json:"left_count"` + // Point in time (Unix timestamp) when the number of left transfers will be reset; 0 if never + ResetDate int32 `json:"reset_date"` + // Address of the relayer for gasless transfers; may be empty if unavailable + RelayerAddress string `json:"relayer_address"` +} + +func (entity *TonWalletGaslessTransfersInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletGaslessTransfersInfo + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletGaslessTransfersInfo) GetClass() string { + return ClassTonWalletGaslessTransfersInfo +} + +func (*TonWalletGaslessTransfersInfo) GetType() string { + return TypeTonWalletGaslessTransfersInfo +} + +// Describes exchange rate of a currency to USD +type CurrencyExchangeRate struct { + meta + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Exchange rate of the currency to USD + Rate float64 `json:"rate"` +} + +func (entity *CurrencyExchangeRate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CurrencyExchangeRate + + return json.Marshal((*stub)(entity)) +} + +func (*CurrencyExchangeRate) GetClass() string { + return ClassCurrencyExchangeRate +} + +func (*CurrencyExchangeRate) GetType() string { + return TypeCurrencyExchangeRate +} + +// Represents a list of currency exchange rates +type CurrencyExchangeRates struct { + meta + // A list of currency exchange rates + Rates []*CurrencyExchangeRate `json:"rates"` +} + +func (entity *CurrencyExchangeRates) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CurrencyExchangeRates + + return json.Marshal((*stub)(entity)) +} + +func (*CurrencyExchangeRates) GetClass() string { + return ClassCurrencyExchangeRates +} + +func (*CurrencyExchangeRates) GetType() string { + return TypeCurrencyExchangeRates +} + +// Describes an on-ramp provider +type OnRampProvider struct { + meta + // Unique identifier of the provider + Id string `json:"id"` + // Name of the provider + Name string `json:"name"` + // List of cryptocurrencies supported by the provider + Cryptocurrencies []string `json:"cryptocurrencies"` + // True, if the provider supports base currencies and can be used in the method getOnRampProviderBaseCurrencies + SupportsBaseCurrencies bool `json:"supports_base_currencies"` + // True, if the provider supports limits retrieval using the method getOnRampPaymentLimits + SupportsLimits bool `json:"supports_limits"` + // True, if the provider supports quote retrieval using the method getOnRampPaymentQuote + SupportsQuote bool `json:"supports_quote"` +} + +func (entity *OnRampProvider) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampProvider + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampProvider) GetClass() string { + return ClassOnRampProvider +} + +func (*OnRampProvider) GetType() string { + return TypeOnRampProvider +} + +// Represents a list of on-ramp providers +type OnRampProviders struct { + meta + // A list of providers + Providers []*OnRampProvider `json:"providers"` +} + +func (entity *OnRampProviders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampProviders + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampProviders) GetClass() string { + return ClassOnRampProviders +} + +func (*OnRampProviders) GetType() string { + return TypeOnRampProviders +} + +// Represents a list of currencies +type Currencies struct { + meta + // A list of ISO 4217 currency codes + Currencies []string `json:"currencies"` +} + +func (entity *Currencies) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Currencies + + return json.Marshal((*stub)(entity)) +} + +func (*Currencies) GetClass() string { + return ClassCurrencies +} + +func (*Currencies) GetType() string { + return TypeCurrencies +} + +// Describes a payment method of an on-ramp provider +type OnRampPaymentMethod struct { + meta + // Name of the method + Name string `json:"name"` + // True, if the method is available to the user + IsAvailable bool `json:"is_available"` +} + +func (entity *OnRampPaymentMethod) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampPaymentMethod + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampPaymentMethod) GetClass() string { + return ClassOnRampPaymentMethod +} + +func (*OnRampPaymentMethod) GetType() string { + return TypeOnRampPaymentMethod +} + +// Describes availability of cryptocurrency purchase through an on-ramp provider +type OnRampPaymentAvailability struct { + meta + // True, if the current user can use the provider + IsAllowed bool `json:"is_allowed"` + // True, if the current user can purchase through the provider + IsPurchaseAllowed bool `json:"is_purchase_allowed"` + // The list of available payment methods + Methods []*OnRampPaymentMethod `json:"methods"` + // A two-letter ISO 3166-1 alpha-2 country code of the current user's country + CountryCode string `json:"country_code"` + // Code of the state of the current user; may be empty if unknown + State string `json:"state"` +} + +func (entity *OnRampPaymentAvailability) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampPaymentAvailability + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampPaymentAvailability) GetClass() string { + return ClassOnRampPaymentAvailability +} + +func (*OnRampPaymentAvailability) GetType() string { + return TypeOnRampPaymentAvailability +} + +// Describes limits for an on-ramp purchase +type OnRampPaymentLimits struct { + meta + // The payment method to be used + PaymentMethod string `json:"payment_method"` + // The minimum allowed amount of the base currency + BaseCurrencyMinAmount string `json:"base_currency_min_amount"` + // The maximum allowed amount of the base currency + BaseCurrencyMaxAmount string `json:"base_currency_max_amount"` + // The minimum allowed amount of the bought cryptocurrency + CryptocurrencyMinAmount string `json:"cryptocurrency_min_amount"` + // The maximum allowed amount of the bought cryptocurrency + CryptocurrencyMaxAmount string `json:"cryptocurrency_max_amount"` +} + +func (entity *OnRampPaymentLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampPaymentLimits + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampPaymentLimits) GetClass() string { + return ClassOnRampPaymentLimits +} + +func (*OnRampPaymentLimits) GetType() string { + return TypeOnRampPaymentLimits +} + +// Describes a quote for an on-ramp purchase +type OnRampPaymentQuote struct { + meta + // The payment method to be used + PaymentMethod string `json:"payment_method"` + // Point in time (Unix timestamp) when the quote will expire + ExpirationDate int32 `json:"expiration_date"` + // Paid amount of the base currency + BaseCurrencyAmount string `json:"base_currency_amount"` + // Purchased amount of the cryptocurrency + CryptocurrencyAmount string `json:"cryptocurrency_amount"` + // The price of the cryptocurrency + CryptocurrencyPrice string `json:"cryptocurrency_price"` + // Fee amount + FeeAmount string `json:"fee_amount"` + // Extra fee amount + ExtraFeeAmount string `json:"extra_fee_amount"` + // Network fee amount + NetworkFeeAmount string `json:"network_fee_amount"` + // Total paid amount + TotalAmount string `json:"total_amount"` +} + +func (entity *OnRampPaymentQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampPaymentQuote + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampPaymentQuote) GetClass() string { + return ClassOnRampPaymentQuote +} + +func (*OnRampPaymentQuote) GetType() string { + return TypeOnRampPaymentQuote +} + +// Describes a session for an on-ramp purchase +type OnRampPaymentSession struct { + meta + // Identifier of the session + SessionId string `json:"session_id"` + // Point in time (Unix timestamp) when the session will expire + ExpirationDate int32 `json:"expiration_date"` + // HTTPS URL to be opened in a WebView to complete the purchase + Url string `json:"url"` +} + +func (entity *OnRampPaymentSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OnRampPaymentSession + + return json.Marshal((*stub)(entity)) +} + +func (*OnRampPaymentSession) GetClass() string { + return ClassOnRampPaymentSession +} + +func (*OnRampPaymentSession) GetType() string { + return TypeOnRampPaymentSession +} + +// Describes state of the wallet of the current user in the TON blockchain +type TonWalletState struct { + meta + // Address of the wallet; may be empty if none + Address string `json:"address"` + // Public key of the wallet; may be empty if none + PublicKey []byte `json:"public_key"` + // The total amount of owned TON Grams, in the smallest units of the cryptocurrency + GramAmount JsonInt64 `json:"gram_amount"` + // True, if the wallet is being created + IsBeingCreated bool `json:"is_being_created"` + // True, if backup for the wallet key is enabled + IsBackupEnabled bool `json:"is_backup_enabled"` + // True, if the user can enable backup for the wallet key + CanEnableBackup bool `json:"can_enable_backup"` + // True, if the wallet key can be exported using getTonWalletSecretPhrase + CanExportPhrase bool `json:"can_export_phrase"` +} + +func (entity *TonWalletState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletState + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletState) GetClass() string { + return ClassTonWalletState +} + +func (*TonWalletState) GetType() string { + return TypeTonWalletState +} + +// Represents an attribute of an NFT in the TON blockchain +type TonNftAttribute struct { + meta + // Trait type + TraitType string `json:"trait_type"` + // Value of the attribute + Value string `json:"value"` +} + +func (entity *TonNftAttribute) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonNftAttribute + + return json.Marshal((*stub)(entity)) +} + +func (*TonNftAttribute) GetClass() string { + return ClassTonNftAttribute +} + +func (*TonNftAttribute) GetType() string { + return TypeTonNftAttribute +} + +// Represents an NFT in the TON blockchain +type TonNft struct { + meta + // Address of the collection to which the NFT belongs; may be empty if unknown + CollectionAddress string `json:"collection_address"` + // Address of the NFT + Address string `json:"address"` + // Address of the owner of the NFT + OwnerAddress string `json:"owner_address"` + // Index of the NFT among all NFTs from the collection as a decimal number + Index string `json:"index"` + // Name of the NFT + Name string `json:"name"` + // Description of the NFT + Description string `json:"description"` + // Image of the NFT; may be null if none + Image *PhotoSize `json:"image"` + // Thumbnail of the NFT; may be null if none + Thumbnail *PhotoSize `json:"thumbnail"` + // Content of the NFT; may be null if none + Content *Document `json:"content"` + // Sticker of the NFT; may be null if none + Sticker *Sticker `json:"sticker"` + // Attributes of the NFT + Attributes []*TonNftAttribute `json:"attributes"` + // Additional data about the NFT; may be null if none + Extra JsonValue `json:"extra"` + // The upgraded gift corresponding to the NFT; may be null if none. Information about the owner of the gift isn't available. Original details of the gift are available only to the sender and the receiver of the original gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *TonNft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonNft + + return json.Marshal((*stub)(entity)) +} + +func (*TonNft) GetClass() string { + return ClassTonNft +} + +func (*TonNft) GetType() string { + return TypeTonNft +} + +func (tonNft *TonNft) UnmarshalJSON(data []byte) error { + var tmp struct { + CollectionAddress string `json:"collection_address"` + Address string `json:"address"` + OwnerAddress string `json:"owner_address"` + Index string `json:"index"` + Name string `json:"name"` + Description string `json:"description"` + Image *PhotoSize `json:"image"` + Thumbnail *PhotoSize `json:"thumbnail"` + Content *Document `json:"content"` + Sticker *Sticker `json:"sticker"` + Attributes []*TonNftAttribute `json:"attributes"` + Extra json.RawMessage `json:"extra"` + Gift *UpgradedGift `json:"gift"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + tonNft.CollectionAddress = tmp.CollectionAddress + tonNft.Address = tmp.Address + tonNft.OwnerAddress = tmp.OwnerAddress + tonNft.Index = tmp.Index + tonNft.Name = tmp.Name + tonNft.Description = tmp.Description + tonNft.Image = tmp.Image + tonNft.Thumbnail = tmp.Thumbnail + tonNft.Content = tmp.Content + tonNft.Sticker = tmp.Sticker + tonNft.Attributes = tmp.Attributes + tonNft.Gift = tmp.Gift + + fieldExtra, _ := UnmarshalJsonValue(tmp.Extra) + tonNft.Extra = fieldExtra + + return nil +} + +// Represents a list of TON NFTs +type TonNfts struct { + meta + // List of NFTs + Nfts []*TonNft `json:"nfts"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *TonNfts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonNfts + + return json.Marshal((*stub)(entity)) +} + +func (*TonNfts) GetClass() string { + return ClassTonNfts +} + +func (*TonNfts) GetType() string { + return TypeTonNfts +} + +// Describes a sticker on a TON wallet card +type TonWalletCardSticker struct { + meta + // Position of the sticker on the card + Position *AreaPosition `json:"position"` + // The NFT shown as the sticker. If nft.gift is non-null, then it is enough to draw the sticker and there is no need to download the media of the NFT + Nft *TonNft `json:"nft"` +} + +func (entity *TonWalletCardSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletCardSticker + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletCardSticker) GetClass() string { + return ClassTonWalletCardSticker +} + +func (*TonWalletCardSticker) GetType() string { + return TypeTonWalletCardSticker +} + +// Describes a TON wallet card, which is shown on the profile page of a user to everyone +type TonWalletCard struct { + meta + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency; may be slightly outdated + GramAmount JsonInt64 `json:"gram_amount"` + // Stickers placed on the card + Stickers []*TonWalletCardSticker `json:"stickers"` + // Address of the NFT of one of the stickers, whose colors must be used for the card background; may be empty if the default background must be used + BackgroundNftAddress string `json:"background_nft_address"` +} + +func (entity *TonWalletCard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletCard + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletCard) GetClass() string { + return ClassTonWalletCard +} + +func (*TonWalletCard) GetType() string { + return TypeTonWalletCard +} + +// Describes a sticker to be placed on the TON wallet card of the current user +type InputTonWalletCardSticker struct { + meta + // Position of the sticker on the card + Position *AreaPosition `json:"position"` + // Address of an NFT owned by the wallet, which is an upgraded gift; use getTonWalletNfts to get the list of owned NFTs + NftAddress string `json:"nft_address"` +} + +func (entity *InputTonWalletCardSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputTonWalletCardSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputTonWalletCardSticker) GetClass() string { + return ClassInputTonWalletCardSticker +} + +func (*InputTonWalletCardSticker) GetType() string { + return TypeInputTonWalletCardSticker +} + +// Contains a list of names of upgraded gift collections. The name of the collection of an upgraded gift is the part of upgradedGift.name before the last "-" +type UpgradedGiftCollectionNames struct { + meta + // The names + Names []string `json:"names"` +} + +func (entity *UpgradedGiftCollectionNames) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftCollectionNames + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftCollectionNames) GetClass() string { + return ClassUpgradedGiftCollectionNames +} + +func (*UpgradedGiftCollectionNames) GetType() string { + return TypeUpgradedGiftCollectionNames +} + +// The transaction succeeded +type TonWalletTransactionStateSucceeded struct { + meta + // Hash of the transaction + TxHash string `json:"tx_hash"` +} + +func (entity *TonWalletTransactionStateSucceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionStateSucceeded + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionStateSucceeded) GetClass() string { + return ClassTonWalletTransactionState +} + +func (*TonWalletTransactionStateSucceeded) GetType() string { + return TypeTonWalletTransactionStateSucceeded +} + +func (*TonWalletTransactionStateSucceeded) TonWalletTransactionStateType() string { + return TypeTonWalletTransactionStateSucceeded +} + +// The transaction failed +type TonWalletTransactionStateFailed struct{ + meta +} + +func (entity *TonWalletTransactionStateFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionStateFailed + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionStateFailed) GetClass() string { + return ClassTonWalletTransactionState +} + +func (*TonWalletTransactionStateFailed) GetType() string { + return TypeTonWalletTransactionStateFailed +} + +func (*TonWalletTransactionStateFailed) TonWalletTransactionStateType() string { + return TypeTonWalletTransactionStateFailed +} + +// The transaction is a deposit from an on-ramp provider +type TonWalletTransactionTypeOnRampDeposit struct { + meta + // The amount of received cryptocurrency, in the smallest units of the cryptocurrency + Amount JsonInt64 `json:"amount"` + // Name of the on-ramp provider + ProviderName string `json:"provider_name"` +} + +func (entity *TonWalletTransactionTypeOnRampDeposit) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionTypeOnRampDeposit + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionTypeOnRampDeposit) GetClass() string { + return ClassTonWalletTransactionType +} + +func (*TonWalletTransactionTypeOnRampDeposit) GetType() string { + return TypeTonWalletTransactionTypeOnRampDeposit +} + +func (*TonWalletTransactionTypeOnRampDeposit) TonWalletTransactionTypeType() string { + return TypeTonWalletTransactionTypeOnRampDeposit +} + +// A transfer of TON Grams to or from the wallet +type TonWalletTransactionTypeTransfer struct { + meta + // The amount of received cryptocurrency, in the smallest units of the cryptocurrency; negative for outgoing transactions + Amount JsonInt64 `json:"amount"` + // True, if the fee was paid by Telegram + IsGasless bool `json:"is_gasless"` + // Comment added to the transaction + Comment string `json:"comment"` + // True, if the comment is encrypted and must be decrypted using the user's private key + IsCommentEncrypted bool `json:"is_comment_encrypted"` +} + +func (entity *TonWalletTransactionTypeTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionTypeTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionTypeTransfer) GetClass() string { + return ClassTonWalletTransactionType +} + +func (*TonWalletTransactionTypeTransfer) GetType() string { + return TypeTonWalletTransactionTypeTransfer +} + +func (*TonWalletTransactionTypeTransfer) TonWalletTransactionTypeType() string { + return TypeTonWalletTransactionTypeTransfer +} + +// A transfer of a TON NFT to or from the wallet +type TonWalletTransactionTypeNftTransfer struct { + meta + // The transferred NFT + Nft *TonNft `json:"nft"` + // True, if the transfer is outgoing + IsOutgoing bool `json:"is_outgoing"` + // Comment added to the transaction + Comment string `json:"comment"` + // True, if the comment is encrypted and must be decrypted using the user's private key + IsCommentEncrypted bool `json:"is_comment_encrypted"` +} + +func (entity *TonWalletTransactionTypeNftTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionTypeNftTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionTypeNftTransfer) GetClass() string { + return ClassTonWalletTransactionType +} + +func (*TonWalletTransactionTypeNftTransfer) GetType() string { + return TypeTonWalletTransactionTypeNftTransfer +} + +func (*TonWalletTransactionTypeNftTransfer) TonWalletTransactionTypeType() string { + return TypeTonWalletTransactionTypeNftTransfer +} + +// A Telegram gift was minted as a TON NFT or was transferred from Telegram to the wallet or back; peer details aren't available for the transaction +type TonWalletTransactionTypeTelegramGiftTransfer struct { + meta + // The minted or transferred NFT + Nft *TonNft `json:"nft"` + // True, if the transfer is from the wallet to Telegram + IsOutgoing bool `json:"is_outgoing"` + // True, if the gift was displayed on the current user's profile page before or after the transfer + IsSaved bool `json:"is_saved"` +} + +func (entity *TonWalletTransactionTypeTelegramGiftTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionTypeTelegramGiftTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionTypeTelegramGiftTransfer) GetClass() string { + return ClassTonWalletTransactionType +} + +func (*TonWalletTransactionTypeTelegramGiftTransfer) GetType() string { + return TypeTonWalletTransactionTypeTelegramGiftTransfer +} + +func (*TonWalletTransactionTypeTelegramGiftTransfer) TonWalletTransactionTypeType() string { + return TypeTonWalletTransactionTypeTelegramGiftTransfer +} + +// Change of the wallet key +type TonWalletTransactionTypeKeyChange struct{ + meta +} + +func (entity *TonWalletTransactionTypeKeyChange) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactionTypeKeyChange + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactionTypeKeyChange) GetClass() string { + return ClassTonWalletTransactionType +} + +func (*TonWalletTransactionTypeKeyChange) GetType() string { + return TypeTonWalletTransactionTypeKeyChange +} + +func (*TonWalletTransactionTypeKeyChange) TonWalletTransactionTypeType() string { + return TypeTonWalletTransactionTypeKeyChange +} + +// Represents a transaction with the TON wallet of the current user +type TonWalletTransaction struct { + meta + // Unique identifier of the transaction + Id string `json:"id"` + // Address in the TON blockchain of the transaction peer; may be empty if the transaction isn't a wallet transfer + PeerAddress string `json:"peer_address"` + // Identifier of the other user who participated in the transaction; 0 if unknown + PeerUserId int64 `json:"peer_user_id"` + // Identifier of the domain assigned to the peer address; may be empty if none + PeerDomain string `json:"peer_domain"` + // Point in time (Unix timestamp) when the transaction was completed + Date int32 `json:"date"` + // The fee amount paid for the transaction in TON Grams, in the smallest units of the cryptocurrency + FeeAmount JsonInt64 `json:"fee_amount"` + // State of the transaction + State TonWalletTransactionState `json:"state"` + // Type of the transaction + Type TonWalletTransactionType `json:"type"` +} + +func (entity *TonWalletTransaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransaction + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransaction) GetClass() string { + return ClassTonWalletTransaction +} + +func (*TonWalletTransaction) GetType() string { + return TypeTonWalletTransaction +} + +func (tonWalletTransaction *TonWalletTransaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + PeerAddress string `json:"peer_address"` + PeerUserId int64 `json:"peer_user_id"` + PeerDomain string `json:"peer_domain"` + Date int32 `json:"date"` + FeeAmount JsonInt64 `json:"fee_amount"` + State json.RawMessage `json:"state"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + tonWalletTransaction.Id = tmp.Id + tonWalletTransaction.PeerAddress = tmp.PeerAddress + tonWalletTransaction.PeerUserId = tmp.PeerUserId + tonWalletTransaction.PeerDomain = tmp.PeerDomain + tonWalletTransaction.Date = tmp.Date + tonWalletTransaction.FeeAmount = tmp.FeeAmount + + fieldState, _ := UnmarshalTonWalletTransactionState(tmp.State) + tonWalletTransaction.State = fieldState + + fieldType, _ := UnmarshalTonWalletTransactionType(tmp.Type) + tonWalletTransaction.Type = fieldType + + return nil +} + +// Represents a list of TON Gram transactions +type TonWalletTransactions struct { + meta + // The total amount of owned TON Grams, in the smallest units of the cryptocurrency + GramAmount JsonInt64 `json:"gram_amount"` + // List of transactions + Transactions []*TonWalletTransaction `json:"transactions"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *TonWalletTransactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransactions + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransactions) GetClass() string { + return ClassTonWalletTransactions +} + +func (*TonWalletTransactions) GetType() string { + return TypeTonWalletTransactions +} + +// The request must be accepted or rejected if it isn't expired yet +type TonConnectRequestStatePending struct { + meta + // Point in time (Unix timestamp) when the request will expire or has expired + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *TonConnectRequestStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectRequestStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectRequestStatePending) GetClass() string { + return ClassTonConnectRequestState +} + +func (*TonConnectRequestStatePending) GetType() string { + return TypeTonConnectRequestStatePending +} + +func (*TonConnectRequestStatePending) TonConnectRequestStateType() string { + return TypeTonConnectRequestStatePending +} + +// The request was accepted +type TonConnectRequestStateAccepted struct{ + meta +} + +func (entity *TonConnectRequestStateAccepted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectRequestStateAccepted + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectRequestStateAccepted) GetClass() string { + return ClassTonConnectRequestState +} + +func (*TonConnectRequestStateAccepted) GetType() string { + return TypeTonConnectRequestStateAccepted +} + +func (*TonConnectRequestStateAccepted) TonConnectRequestStateType() string { + return TypeTonConnectRequestStateAccepted +} + +// The request was rejected +type TonConnectRequestStateRejected struct{ + meta +} + +func (entity *TonConnectRequestStateRejected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectRequestStateRejected + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectRequestStateRejected) GetClass() string { + return ClassTonConnectRequestState +} + +func (*TonConnectRequestStateRejected) GetType() string { + return TypeTonConnectRequestStateRejected +} + +func (*TonConnectRequestStateRejected) TonConnectRequestStateType() string { + return TypeTonConnectRequestStateRejected +} + +// The manifest is being downloaded +type TonConnectManifestPending struct{ + meta +} + +func (entity *TonConnectManifestPending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectManifestPending + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectManifestPending) GetClass() string { + return ClassTonConnectManifest +} + +func (*TonConnectManifestPending) GetType() string { + return TypeTonConnectManifestPending +} + +func (*TonConnectManifestPending) TonConnectManifestType() string { + return TypeTonConnectManifestPending +} + +// The manifest is available +type TonConnectManifestInfo struct { + meta + // URL of the dApp + Url string `json:"url"` + // Name of the dApp + Name string `json:"name"` + // App icon in PNG or ICO format + Icon *Document `json:"icon"` +} + +func (entity *TonConnectManifestInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectManifestInfo + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectManifestInfo) GetClass() string { + return ClassTonConnectManifest +} + +func (*TonConnectManifestInfo) GetType() string { + return TypeTonConnectManifestInfo +} + +func (*TonConnectManifestInfo) TonConnectManifestType() string { + return TypeTonConnectManifestInfo +} + +// The manifest has failed to download +type TonConnectManifestFailed struct{ + meta +} + +func (entity *TonConnectManifestFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectManifestFailed + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectManifestFailed) GetClass() string { + return ClassTonConnectManifest +} + +func (*TonConnectManifestFailed) GetType() string { + return TypeTonConnectManifestFailed +} + +func (*TonConnectManifestFailed) TonConnectManifestType() string { + return TypeTonConnectManifestFailed +} + +// The manifest is invalid +type TonConnectManifestInvalid struct{ + meta +} + +func (entity *TonConnectManifestInvalid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectManifestInvalid + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectManifestInvalid) GetClass() string { + return ClassTonConnectManifest +} + +func (*TonConnectManifestInvalid) GetType() string { + return TypeTonConnectManifestInvalid +} + +func (*TonConnectManifestInvalid) TonConnectManifestType() string { + return TypeTonConnectManifestInvalid +} + +// The session is pending +type TonConnectSessionStatePending struct{ + meta +} + +func (entity *TonConnectSessionStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessionStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessionStatePending) GetClass() string { + return ClassTonConnectSessionState +} + +func (*TonConnectSessionStatePending) GetType() string { + return TypeTonConnectSessionStatePending +} + +func (*TonConnectSessionStatePending) TonConnectSessionStateType() string { + return TypeTonConnectSessionStatePending +} + +// The session is ready +type TonConnectSessionStateReady struct{ + meta +} + +func (entity *TonConnectSessionStateReady) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessionStateReady + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessionStateReady) GetClass() string { + return ClassTonConnectSessionState +} + +func (*TonConnectSessionStateReady) GetType() string { + return TypeTonConnectSessionStateReady +} + +func (*TonConnectSessionStateReady) TonConnectSessionStateType() string { + return TypeTonConnectSessionStateReady +} + +// The session is being closed +type TonConnectSessionStateClosing struct{ + meta +} + +func (entity *TonConnectSessionStateClosing) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessionStateClosing + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessionStateClosing) GetClass() string { + return ClassTonConnectSessionState +} + +func (*TonConnectSessionStateClosing) GetType() string { + return TypeTonConnectSessionStateClosing +} + +func (*TonConnectSessionStateClosing) TonConnectSessionStateType() string { + return TypeTonConnectSessionStateClosing +} + +// The session is closed +type TonConnectSessionStateClosed struct{ + meta +} + +func (entity *TonConnectSessionStateClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessionStateClosed + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessionStateClosed) GetClass() string { + return ClassTonConnectSessionState +} + +func (*TonConnectSessionStateClosed) GetType() string { + return TypeTonConnectSessionStateClosed +} + +func (*TonConnectSessionStateClosed) TonConnectSessionStateType() string { + return TypeTonConnectSessionStateClosed +} + +// Address of the wallet +type TonConnectConnectItemAddress struct { + meta + // Stringified TON network global_id (e.g. "-239" for mainnet); may be empty + Network string `json:"network"` +} + +func (entity *TonConnectConnectItemAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectConnectItemAddress + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectConnectItemAddress) GetClass() string { + return ClassTonConnectConnectItem +} + +func (*TonConnectConnectItemAddress) GetType() string { + return TypeTonConnectConnectItemAddress +} + +func (*TonConnectConnectItemAddress) TonConnectConnectItemType() string { + return TypeTonConnectConnectItemAddress +} + +// Proof of the wallet ownership +type TonConnectConnectItemProof struct { + meta + // Payload to be used for the proof (e.g. nonce + expiration timestamp) + Payload string `json:"payload"` +} + +func (entity *TonConnectConnectItemProof) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectConnectItemProof + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectConnectItemProof) GetClass() string { + return ClassTonConnectConnectItem +} + +func (*TonConnectConnectItemProof) GetType() string { + return TypeTonConnectConnectItemProof +} + +func (*TonConnectConnectItemProof) TonConnectConnectItemType() string { + return TypeTonConnectConnectItemProof +} + +// Contains information about a request to connect the user's TON wallet to a dApp using TON Connect +type TonConnectConnectRequest struct { + meta + // URL of the manifest of the dApp + ManifestUrl string `json:"manifest_url"` + // Items requested from the wallet + Items []TonConnectConnectItem `json:"items"` +} + +func (entity *TonConnectConnectRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectConnectRequest + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectConnectRequest) GetClass() string { + return ClassTonConnectConnectRequest +} + +func (*TonConnectConnectRequest) GetType() string { + return TypeTonConnectConnectRequest +} + +func (tonConnectConnectRequest *TonConnectConnectRequest) UnmarshalJSON(data []byte) error { + var tmp struct { + ManifestUrl string `json:"manifest_url"` + Items []json.RawMessage `json:"items"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + tonConnectConnectRequest.ManifestUrl = tmp.ManifestUrl + + fieldItems, _ := UnmarshalListOfTonConnectConnectItem(tmp.Items) + tonConnectConnectRequest.Items = fieldItems + + return nil +} + +// Contains data required to give access to the TON wallet of the current user in acceptOauthRequest +type TonConnectConnectData struct { + meta + // Unique identifier of the session + SessionId JsonInt64 `json:"session_id"` + // Answer to the challenge received from setTonConnectSessionWalletClientId + ChallengeAnswer []byte `json:"challenge_answer"` + // Body of the result of the connection request as in sendTonConnectSessionConnectResult + Body []byte `json:"body"` + // Proof of the TON wallet ownership for the payload oauthLinkInfo.ton_proof_payload + Proof *TonWalletOwnershipProof `json:"proof"` +} + +func (entity *TonConnectConnectData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectConnectData + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectConnectData) GetClass() string { + return ClassTonConnectConnectData +} + +func (*TonConnectConnectData) GetType() string { + return TypeTonConnectConnectData +} + +// Represents a TON Connect session. See https://github.com/ton-blockchain/ton-connect/tree/main/spec for full TON Connect protocol documentation +type TonConnectSession struct { + meta + // Unique identifier of the session + Id JsonInt64 `json:"id"` + // Hex-encoded public X25519 key of the dApp + DappClientId string `json:"dapp_client_id"` + // Hex-encoded public X25519 key of the current user's application; may be empty if none + WalletClientId string `json:"wallet_client_id"` + // Point in time (Unix timestamp) when the session was created + CreationDate int32 `json:"creation_date"` + // Manifest of the dApp + Manifest TonConnectManifest `json:"manifest"` + // Nonce used for the session + Nonce []byte `json:"nonce"` + // Session state + State TonConnectSessionState `json:"state"` +} + +func (entity *TonConnectSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSession + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSession) GetClass() string { + return ClassTonConnectSession +} + +func (*TonConnectSession) GetType() string { + return TypeTonConnectSession +} + +func (tonConnectSession *TonConnectSession) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + DappClientId string `json:"dapp_client_id"` + WalletClientId string `json:"wallet_client_id"` + CreationDate int32 `json:"creation_date"` + Manifest json.RawMessage `json:"manifest"` + Nonce []byte `json:"nonce"` + State json.RawMessage `json:"state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + tonConnectSession.Id = tmp.Id + tonConnectSession.DappClientId = tmp.DappClientId + tonConnectSession.WalletClientId = tmp.WalletClientId + tonConnectSession.CreationDate = tmp.CreationDate + tonConnectSession.Nonce = tmp.Nonce + + fieldManifest, _ := UnmarshalTonConnectManifest(tmp.Manifest) + tonConnectSession.Manifest = fieldManifest + + fieldState, _ := UnmarshalTonConnectSessionState(tmp.State) + tonConnectSession.State = fieldState + + return nil +} + +// Contains a list of TON Connect sessions +type TonConnectSessions struct { + meta + // The list of sessions + Sessions []*TonConnectSession `json:"sessions"` +} + +func (entity *TonConnectSessions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessions + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessions) GetClass() string { + return ClassTonConnectSessions +} + +func (*TonConnectSessions) GetType() string { + return TypeTonConnectSessions +} + +// Represents a pending TON Connect request +type TonConnectRequest struct { + meta + // Unique identifier of the session + SessionId JsonInt64 `json:"session_id"` + // Unique identifier of the service message in the chat 777000 with the request + MessageId int64 `json:"message_id"` + // Body of the request + Body []byte `json:"body"` + // Point in time (Unix timestamp) when the request will expire; 0 if never + ExpirationDate int32 `json:"expiration_date"` + // Topic of the request; may be empty if none + Topic string `json:"topic"` + // Identifier to trace the request; may be empty if none + TraceId string `json:"trace_id"` +} + +func (entity *TonConnectRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectRequest + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectRequest) GetClass() string { + return ClassTonConnectRequest +} + +func (*TonConnectRequest) GetType() string { + return TypeTonConnectRequest +} + +// Represents a session with its pending TON Connect requests +type TonConnectRequests struct { + meta + // The session + Session *TonConnectSession `json:"session"` + // The requests + Requests []*TonConnectRequest `json:"requests"` +} + +func (entity *TonConnectRequests) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectRequests + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectRequests) GetClass() string { + return ClassTonConnectRequests +} + +func (*TonConnectRequests) GetType() string { + return TypeTonConnectRequests +} + +// Represents a TON Connect challenge +type TonConnectChallenge struct { + meta + // 104-byte challenge + Challenge []byte `json:"challenge"` + // Unique identifier of the first outgoing event + EventId JsonInt64 `json:"event_id"` +} + +func (entity *TonConnectChallenge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectChallenge + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectChallenge) GetClass() string { + return ClassTonConnectChallenge +} + +func (*TonConnectChallenge) GetType() string { + return TypeTonConnectChallenge +} + +// Represents identifier of an event in a TON Connect session +type TonConnectSessionEventId struct { + meta + // The event identifier + EventId JsonInt64 `json:"event_id"` +} + +func (entity *TonConnectSessionEventId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonConnectSessionEventId + + return json.Marshal((*stub)(entity)) +} + +func (*TonConnectSessionEventId) GetClass() string { + return ClassTonConnectSessionEventId +} + +func (*TonConnectSessionEventId) GetType() string { + return TypeTonConnectSessionEventId +} + +// Represents result of cryptocurrency transfer from the current user's TON wallet +type TonWalletTransferResult struct { + meta + // True, if the transfer is gasless + IsGasless bool `json:"is_gasless"` + // Unique identifier of the sent message; use getTonWalletTransactionByMsgHash to poll information about the transaction + MsgHash []byte `json:"msg_hash"` + // The completed transaction; may be null if the transaction is still pending + Transaction *TonWalletTransaction `json:"transaction"` +} + +func (entity *TonWalletTransferResult) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonWalletTransferResult + + return json.Marshal((*stub)(entity)) +} + +func (*TonWalletTransferResult) GetClass() string { + return ClassTonWalletTransferResult +} + +func (*TonWalletTransferResult) GetType() string { + return TypeTonWalletTransferResult +} + // The chat has an active live story type ActiveStoryStateLive struct { meta @@ -16375,6 +18543,308 @@ func (*ProfileAccentColor) GetType() string { return TypeProfileAccentColor } +// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value +type NotificationSettingsScopePrivateChats struct{ + meta +} + +func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopePrivateChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopePrivateChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopePrivateChats) GetType() string { + return TypeNotificationSettingsScopePrivateChats +} + +func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopePrivateChats +} + +// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value +type NotificationSettingsScopeGroupChats struct{ + meta +} + +func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopeGroupChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopeGroupChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopeGroupChats) GetType() string { + return TypeNotificationSettingsScopeGroupChats +} + +func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopeGroupChats +} + +// Notification settings applied to all channel chats when the corresponding chat setting has a default value +type NotificationSettingsScopeChannelChats struct{ + meta +} + +func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopeChannelChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopeChannelChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopeChannelChats) GetType() string { + return TypeNotificationSettingsScopeChannelChats +} + +func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopeChannelChats +} + +// Contains information about notification settings for a chat or a forum topic +type ChatNotificationSettings struct { + meta + // If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of mute_for + UseDefaultMuteFor bool `json:"use_default_mute_for"` + // Time left before notifications will be unmuted, in seconds + MuteFor int32 `json:"mute_for"` + // If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of sound_id + UseDefaultSound bool `json:"use_default_sound"` + // Identifier of the notification sound to be played for messages; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` + // If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of show_preview + UseDefaultShowPreview bool `json:"use_default_show_preview"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` + // If true, the value for the chat's community or the relevant type of chat is used instead of mute_stories + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled for the chat + MuteStories bool `json:"mute_stories"` + // If true, the value for the chat's community or the relevant type of chat is used instead of story_sound_id + UseDefaultStorySound bool `json:"use_default_story_sound"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled + StorySoundId JsonInt64 `json:"story_sound_id"` + // If true, the value for the chat's community or the relevant type of chat is used instead of show_story_poster + UseDefaultShowStoryPoster bool `json:"use_default_show_story_poster"` + // True, if the chat that posted a story must be displayed in notifications + ShowStoryPoster bool `json:"show_story_poster"` + // If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of disable_pinned_message_notifications + UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` + // If true, notifications for incoming pinned messages will be created as for an ordinary unread message + DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` + // If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of disable_mention_notifications + UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"` + // If true, notifications for messages with mentions will be created as for an ordinary unread message + DisableMentionNotifications bool `json:"disable_mention_notifications"` +} + +func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ChatNotificationSettings) GetClass() string { + return ClassChatNotificationSettings +} + +func (*ChatNotificationSettings) GetType() string { + return TypeChatNotificationSettings +} + +// Contains information about notification settings for several chats +type ScopeNotificationSettings struct { + meta + // Time left before notifications will be unmuted, in seconds + MuteFor int32 `json:"mute_for"` + // Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound + SoundId JsonInt64 `json:"sound_id"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` + // If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled + MuteStories bool `json:"mute_stories"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled; pass -1 to use the app-dependent default sound + StorySoundId JsonInt64 `json:"story_sound_id"` + // True, if the chat that posted a story must be displayed in notifications + ShowStoryPoster bool `json:"show_story_poster"` + // True, if notifications for incoming pinned messages will be created as for an ordinary unread message + DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` + // True, if notifications for messages with mentions will be created as for an ordinary unread message + DisableMentionNotifications bool `json:"disable_mention_notifications"` +} + +func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ScopeNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ScopeNotificationSettings) GetClass() string { + return ClassScopeNotificationSettings +} + +func (*ScopeNotificationSettings) GetType() string { + return TypeScopeNotificationSettings +} + +// Notifications for reactions are disabled +type ReactionNotificationSourceNone struct{ + meta +} + +func (entity *ReactionNotificationSourceNone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionNotificationSourceNone + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionNotificationSourceNone) GetClass() string { + return ClassReactionNotificationSource +} + +func (*ReactionNotificationSourceNone) GetType() string { + return TypeReactionNotificationSourceNone +} + +func (*ReactionNotificationSourceNone) ReactionNotificationSourceType() string { + return TypeReactionNotificationSourceNone +} + +// Notifications for reactions are shown only for reactions from contacts +type ReactionNotificationSourceContacts struct{ + meta +} + +func (entity *ReactionNotificationSourceContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionNotificationSourceContacts + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionNotificationSourceContacts) GetClass() string { + return ClassReactionNotificationSource +} + +func (*ReactionNotificationSourceContacts) GetType() string { + return TypeReactionNotificationSourceContacts +} + +func (*ReactionNotificationSourceContacts) ReactionNotificationSourceType() string { + return TypeReactionNotificationSourceContacts +} + +// Notifications for reactions are shown for all reactions +type ReactionNotificationSourceAll struct{ + meta +} + +func (entity *ReactionNotificationSourceAll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionNotificationSourceAll + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionNotificationSourceAll) GetClass() string { + return ClassReactionNotificationSource +} + +func (*ReactionNotificationSourceAll) GetType() string { + return TypeReactionNotificationSourceAll +} + +func (*ReactionNotificationSourceAll) ReactionNotificationSourceType() string { + return TypeReactionNotificationSourceAll +} + +// Contains information about notification settings for reactions and poll votes +type ReactionNotificationSettings struct { + meta + // Source of message reactions for which notifications are shown + MessageReactionSource ReactionNotificationSource `json:"message_reaction_source"` + // Source of story reactions for which notifications are shown + StoryReactionSource ReactionNotificationSource `json:"story_reaction_source"` + // Source of poll votes for which notifications are shown + PollVoteSource ReactionNotificationSource `json:"poll_vote_source"` + // Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound + SoundId JsonInt64 `json:"sound_id"` + // True, if reaction sender and emoji must be displayed in notifications + ShowPreview bool `json:"show_preview"` +} + +func (entity *ReactionNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionNotificationSettings) GetClass() string { + return ClassReactionNotificationSettings +} + +func (*ReactionNotificationSettings) GetType() string { + return TypeReactionNotificationSettings +} + +func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageReactionSource json.RawMessage `json:"message_reaction_source"` + StoryReactionSource json.RawMessage `json:"story_reaction_source"` + PollVoteSource json.RawMessage `json:"poll_vote_source"` + SoundId JsonInt64 `json:"sound_id"` + ShowPreview bool `json:"show_preview"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + reactionNotificationSettings.SoundId = tmp.SoundId + reactionNotificationSettings.ShowPreview = tmp.ShowPreview + + fieldMessageReactionSource, _ := UnmarshalReactionNotificationSource(tmp.MessageReactionSource) + reactionNotificationSettings.MessageReactionSource = fieldMessageReactionSource + + fieldStoryReactionSource, _ := UnmarshalReactionNotificationSource(tmp.StoryReactionSource) + reactionNotificationSettings.StoryReactionSource = fieldStoryReactionSource + + fieldPollVoteSource, _ := UnmarshalReactionNotificationSource(tmp.PollVoteSource) + reactionNotificationSettings.PollVoteSource = fieldPollVoteSource + + return nil +} + // Contains identifier of a community type CommunityId struct { meta @@ -16598,6 +19068,8 @@ type Community struct { Status CommunityMemberStatus `json:"status"` // Actions that non-administrator community members are allowed to take in the community Permissions *CommunityPermissions `json:"permissions"` + // True, if all chats of the community are collapsed into one entry in the chat list + AreChatsCollapsed bool `json:"are_chats_collapsed"` } func (entity *Community) MarshalJSON() ([]byte, error) { @@ -16625,6 +19097,7 @@ func (community *Community) UnmarshalJSON(data []byte) error { Date int32 `json:"date"` Status json.RawMessage `json:"status"` Permissions *CommunityPermissions `json:"permissions"` + AreChatsCollapsed bool `json:"are_chats_collapsed"` } err := json.Unmarshal(data, &tmp) @@ -16638,6 +19111,7 @@ func (community *Community) UnmarshalJSON(data []byte) error { community.Photo = tmp.Photo community.Date = tmp.Date community.Permissions = tmp.Permissions + community.AreChatsCollapsed = tmp.AreChatsCollapsed fieldStatus, _ := UnmarshalCommunityMemberStatus(tmp.Status) community.Status = fieldStatus @@ -16685,6 +19159,8 @@ type CommunityFullInfo struct { BannedCount int32 `json:"banned_count"` // Number of pending requests for addition of chats to the community; 0 if the current user isn't an administrator of the community AddChatRequestCount int32 `json:"add_chat_request_count"` + // Notification settings for the community. Default notification settings are chosen based on the type of a chat in the community + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } func (entity *CommunityFullInfo) MarshalJSON() ([]byte, error) { @@ -16703,6 +19179,110 @@ func (*CommunityFullInfo) GetType() string { return TypeCommunityFullInfo } +// Represents a list of communities +type Communities struct { + meta + // List of community identifiers + CommunityIds []int64 `json:"community_ids"` +} + +func (entity *Communities) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Communities + + return json.Marshal((*stub)(entity)) +} + +func (*Communities) GetClass() string { + return ClassCommunities +} + +func (*Communities) GetType() string { + return TypeCommunities +} + +// Describes a request to add a chat to a community +type CommunityAddChatRequest struct { + meta + // Identifier of the chat to be added + ChatId int64 `json:"chat_id"` + // True, if the chat will be visible only to administrators of the community + IsHidden bool `json:"is_hidden"` + // Identifier of the user who sent the request + SenderUserId int64 `json:"sender_user_id"` + // Point in time (Unix timestamp) when the request was sent + Date int32 `json:"date"` +} + +func (entity *CommunityAddChatRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityAddChatRequest + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityAddChatRequest) GetClass() string { + return ClassCommunityAddChatRequest +} + +func (*CommunityAddChatRequest) GetType() string { + return TypeCommunityAddChatRequest +} + +// Contains a list of requests to add chats to a community +type CommunityAddChatRequests struct { + meta + // Approximate total number of requests found + TotalCount int32 `json:"total_count"` + // List of the requests + Requests []*CommunityAddChatRequest `json:"requests"` + // The offset for the next getCommunityAddChatRequests request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *CommunityAddChatRequests) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityAddChatRequests + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityAddChatRequests) GetClass() string { + return ClassCommunityAddChatRequests +} + +func (*CommunityAddChatRequests) GetType() string { + return TypeCommunityAddChatRequests +} + +// Contains information about chats in a community, which are joined or owned by a member of the community +type CommunityMemberChats struct { + meta + // Identifiers of the chats owned by the member. The chats will be removed from the community if the member is banned in the community + OwnedChatIds []int64 `json:"owned_chat_ids"` + // Identifiers of the non-owned chats joined by the member + JoinedChatIds []int64 `json:"joined_chat_ids"` +} + +func (entity *CommunityMemberChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberChats + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberChats) GetClass() string { + return ClassCommunityMemberChats +} + +func (*CommunityMemberChats) GetType() string { + return TypeCommunityMemberChats +} + // Contains description of user rating type UserRating struct { meta @@ -16916,7 +19496,7 @@ func (*EmojiStatusCustomEmojis) GetType() string { // Describes usernames assigned to a user, a supergroup, or a channel type Usernames struct { meta - // 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 + // 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 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"` @@ -16924,6 +19504,8 @@ type Usernames struct { 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"` + // Secondary non-collectible username. Currently, must be non-empty only for bot accounts. Can't be used in toggleBotUsernameIsActive; use addBotSecondaryUsername or deleteBotSecondaryUsername to edit it. If the username is disabled, then Telegram Premium subscription is required to re-enable it + SecondaryUsername string `json:"secondary_username"` } func (entity *Usernames) MarshalJSON() ([]byte, error) { @@ -17291,6 +19873,10 @@ type UserFullInfo struct { PendingRatingDate int32 `json:"pending_rating_date"` // Note added to the user's contact; may be null if none Note *FormattedText `json:"note"` + // TON wallet card of the user; may be null if none + TonWalletCard *TonWalletCard `json:"ton_wallet_card"` + // Theme of the screen for sharing a link to the user; may be null if the default theme is used + ShareTheme ProfileShareTheme `json:"share_theme"` // 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 @@ -17345,6 +19931,8 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { PendingRating *UserRating `json:"pending_rating"` PendingRatingDate int32 `json:"pending_rating_date"` Note *FormattedText `json:"note"` + TonWalletCard *TonWalletCard `json:"ton_wallet_card"` + ShareTheme json.RawMessage `json:"share_theme"` BusinessInfo *BusinessInfo `json:"business_info"` BotInfo *BotInfo `json:"bot_info"` } @@ -17382,6 +19970,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.PendingRating = tmp.PendingRating userFullInfo.PendingRatingDate = tmp.PendingRatingDate userFullInfo.Note = tmp.Note + userFullInfo.TonWalletCard = tmp.TonWalletCard userFullInfo.BusinessInfo = tmp.BusinessInfo userFullInfo.BotInfo = tmp.BotInfo @@ -17391,6 +19980,9 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) userFullInfo.MainProfileTab = fieldMainProfileTab + fieldShareTheme, _ := UnmarshalProfileShareTheme(tmp.ShareTheme) + userFullInfo.ShareTheme = fieldShareTheme + return nil } @@ -18198,7 +20790,7 @@ func (*ChatJoinResultSuccess) ChatJoinResultType() string { return TypeChatJoinResultSuccess } -// The join request was sent and have to be approved by administrators of the chat +// The join request was sent and has to be approved by administrators of the chat type ChatJoinResultRequestSent struct{ meta } @@ -18379,7 +20971,7 @@ type ChatInviteLink struct { PendingJoinRequestCount int32 `json:"pending_join_request_count"` // True, if the link only creates join request. If true, total number of joining members will be unlimited CreatesJoinRequest bool `json:"creates_join_request"` - // True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time + // True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. Primary link can create join requests only if this is set up using toggleSupergroupJoinByRequest. There is exactly one primary invite link for each administrator with can_invite_users right at a given time IsPrimary bool `json:"is_primary"` // True, if the link was revoked IsRevoked bool `json:"is_revoked"` @@ -18939,6 +21531,8 @@ type Supergroup struct { HasDirectMessagesGroup bool `json:"has_direct_messages_group"` // True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups HasForumTabs bool `json:"has_forum_tabs"` + // True, if the supergroup is a forum, which topics are shown in a sidebar. If true, then has_forum_tabs is false + HasForumSidebar bool `json:"has_forum_sidebar"` // Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none RestrictionInfo *RestrictionInfo `json:"restriction_info"` // Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message @@ -18988,6 +21582,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { VerificationStatus *VerificationStatus `json:"verification_status"` HasDirectMessagesGroup bool `json:"has_direct_messages_group"` HasForumTabs bool `json:"has_forum_tabs"` + HasForumSidebar bool `json:"has_forum_sidebar"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` PaidMessageStarCount int64 `json:"paid_message_star_count"` ActiveStoryState json.RawMessage `json:"active_story_state"` @@ -19020,6 +21615,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.VerificationStatus = tmp.VerificationStatus supergroup.HasDirectMessagesGroup = tmp.HasDirectMessagesGroup supergroup.HasForumTabs = tmp.HasForumTabs + supergroup.HasForumSidebar = tmp.HasForumSidebar supergroup.RestrictionInfo = tmp.RestrictionInfo supergroup.PaidMessageStarCount = tmp.PaidMessageStarCount @@ -19081,7 +21677,7 @@ type SupergroupFullInfo struct { CanSendGift bool `json:"can_send_gift"` // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` - // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators + // True, if new chat members will have access to old messages. In public, discussion, or forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators IsAllHistoryAvailable bool `json:"is_all_history_available"` // True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat CanHaveSponsoredMessages bool `json:"can_have_sponsored_messages"` @@ -19115,6 +21711,8 @@ type SupergroupFullInfo struct { BotVerification *BotVerification `json:"bot_verification"` // The main tab chosen by the administrators of the channel; may be null if not chosen manually MainProfileTab ProfileTab `json:"main_profile_tab"` + // Theme of the screen for sharing a link to the supergroup or the channel; may be null if the default theme is used + ShareTheme ProfileShareTheme `json:"share_theme"` // Identifier of the basic group from which supergroup was upgraded; 0 if none UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` // Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none @@ -19179,6 +21777,7 @@ func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { BotCommands []*BotCommands `json:"bot_commands"` BotVerification *BotVerification `json:"bot_verification"` MainProfileTab json.RawMessage `json:"main_profile_tab"` + ShareTheme json.RawMessage `json:"share_theme"` UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"` } @@ -19233,6 +21832,9 @@ func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) supergroupFullInfo.MainProfileTab = fieldMainProfileTab + fieldShareTheme, _ := UnmarshalProfileShareTheme(tmp.ShareTheme) + supergroupFullInfo.ShareTheme = fieldShareTheme + return nil } @@ -20200,7 +22802,7 @@ func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { // 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 + // Total amount of spent Telegram Stars TotalStarCount int64 `json:"total_star_count"` // List of top donors in the live story TopDonors []*PaidReactor `json:"top_donors"` @@ -20812,9 +23414,11 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { // Describes manually or automatically chosen quote from another message type TextQuote struct { meta - // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text + // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text. May be empty if the quote was chosen from a rich message Text *FormattedText `json:"text"` - // Approximate quote position in the original message in UTF-16 code units as specified by the message sender + // Rich text of the quote if it was chosen from a rich message; empty if the quote wasn't chosen from a rich message. Only richTextPlain, richTextBold, richTextItalic, richTextUnderline, richTextStrikethrough, richTextSpoiler, richTextSubscript, richTextSuperscript, richTextDateTime, richTextCustomEmoji, richTextMathematicalExpression, and richTexts can be present in the texts + RichTexts []RichText `json:"rich_texts"` + // Approximate quote position in the original message in UTF-16 code units as specified by the message sender. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds Position int32 `json:"position"` // True, if the quote was manually chosen by the message sender IsManual bool `json:"is_manual"` @@ -20836,12 +23440,37 @@ func (*TextQuote) GetType() string { return TypeTextQuote } +func (textQuote *TextQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text *FormattedText `json:"text"` + RichTexts []json.RawMessage `json:"rich_texts"` + Position int32 `json:"position"` + IsManual bool `json:"is_manual"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + textQuote.Text = tmp.Text + textQuote.Position = tmp.Position + textQuote.IsManual = tmp.IsManual + + fieldRichTexts, _ := UnmarshalListOfRichText(tmp.RichTexts) + textQuote.RichTexts = fieldRichTexts + + return nil +} + // Describes manually chosen quote from another message type InputTextQuote struct { meta - // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote + // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote. Ignored if rich_texts are non-empty Text *FormattedText `json:"text"` - // Quote position in the original message in UTF-16 code units + // Quote from a rich message; pass an empty array if the quote isn't chosen from a rich message. Must contain one element for each quoted text of the message in the order of their appearance. The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept. Mathematical expressions must be quoted entirely. Buttons in pageBlockButtonRow, anchors and dividers can't be quoted. There can be up to 32 quoted texts with total length up to getOption("message_reply_quote_length_max") characters + RichTexts []RichText `json:"rich_texts"` + // Quote position in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds Position int32 `json:"position"` } @@ -20861,6 +23490,27 @@ func (*InputTextQuote) GetType() string { return TypeInputTextQuote } +func (inputTextQuote *InputTextQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text *FormattedText `json:"text"` + RichTexts []json.RawMessage `json:"rich_texts"` + Position int32 `json:"position"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputTextQuote.Text = tmp.Text + inputTextQuote.Position = tmp.Position + + fieldRichTexts, _ := UnmarshalListOfRichText(tmp.RichTexts) + inputTextQuote.RichTexts = fieldRichTexts + + return nil +} + // Describes a message replied by a given message type MessageReplyToMessage struct { meta @@ -20878,7 +23528,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, messageStakeDice, 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, messageVoiceNote, or messageWidget Content MessageContent `json:"content"` } @@ -21236,7 +23886,7 @@ type Message struct { SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"` // Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead SenderBoostCount int32 `json:"sender_boost_count"` - // Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or supergroup administrators, the current custom title or tag must be used instead + // Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or by supergroup administrators, the current custom title or tag must be used instead SenderTag string `json:"sender_tag"` // The number of Telegram Stars the sender paid to send the message PaidMessageStarCount int64 `json:"paid_message_star_count"` @@ -22417,308 +25067,6 @@ func (*FoundFileDownloads) GetType() string { return TypeFoundFileDownloads } -// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value -type NotificationSettingsScopePrivateChats struct{ - meta -} - -func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopePrivateChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopePrivateChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopePrivateChats) GetType() string { - return TypeNotificationSettingsScopePrivateChats -} - -func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopePrivateChats -} - -// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value -type NotificationSettingsScopeGroupChats struct{ - meta -} - -func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopeGroupChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopeGroupChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopeGroupChats) GetType() string { - return TypeNotificationSettingsScopeGroupChats -} - -func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopeGroupChats -} - -// Notification settings applied to all channel chats when the corresponding chat setting has a default value -type NotificationSettingsScopeChannelChats struct{ - meta -} - -func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopeChannelChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopeChannelChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopeChannelChats) GetType() string { - return TypeNotificationSettingsScopeChannelChats -} - -func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopeChannelChats -} - -// Contains information about notification settings for a chat or a forum topic -type ChatNotificationSettings struct { - meta - // If true, the value for the relevant type of chat or the forum chat is used instead of mute_for - UseDefaultMuteFor bool `json:"use_default_mute_for"` - // Time left before notifications will be unmuted, in seconds - MuteFor int32 `json:"mute_for"` - // If true, the value for the relevant type of chat or the forum chat is used instead of sound_id - UseDefaultSound bool `json:"use_default_sound"` - // Identifier of the notification sound to be played for messages; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` - // If true, the value for the relevant type of chat or the forum chat is used instead of show_preview - UseDefaultShowPreview bool `json:"use_default_show_preview"` - // True, if message content must be displayed in notifications - ShowPreview bool `json:"show_preview"` - // If true, the value for the relevant type of chat is used instead of mute_stories - UseDefaultMuteStories bool `json:"use_default_mute_stories"` - // True, if story notifications are disabled for the chat - MuteStories bool `json:"mute_stories"` - // If true, the value for the relevant type of chat is used instead of story_sound_id - UseDefaultStorySound bool `json:"use_default_story_sound"` - // Identifier of the notification sound to be played for stories; 0 if sound is disabled - StorySoundId JsonInt64 `json:"story_sound_id"` - // If true, the value for the relevant type of chat is used instead of show_story_poster - UseDefaultShowStoryPoster bool `json:"use_default_show_story_poster"` - // True, if the chat that posted a story must be displayed in notifications - ShowStoryPoster bool `json:"show_story_poster"` - // If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications - UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` - // If true, notifications for incoming pinned messages will be created as for an ordinary unread message - DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` - // If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications - UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"` - // If true, notifications for messages with mentions will be created as for an ordinary unread message - DisableMentionNotifications bool `json:"disable_mention_notifications"` -} - -func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ChatNotificationSettings) GetClass() string { - return ClassChatNotificationSettings -} - -func (*ChatNotificationSettings) GetType() string { - return TypeChatNotificationSettings -} - -// Contains information about notification settings for several chats -type ScopeNotificationSettings struct { - meta - // Time left before notifications will be unmuted, in seconds - MuteFor int32 `json:"mute_for"` - // Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound - SoundId JsonInt64 `json:"sound_id"` - // True, if message content must be displayed in notifications - ShowPreview bool `json:"show_preview"` - // If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories - UseDefaultMuteStories bool `json:"use_default_mute_stories"` - // True, if story notifications are disabled - MuteStories bool `json:"mute_stories"` - // Identifier of the notification sound to be played for stories; 0 if sound is disabled; pass -1 to use the app-dependent default sound - StorySoundId JsonInt64 `json:"story_sound_id"` - // True, if the chat that posted a story must be displayed in notifications - ShowStoryPoster bool `json:"show_story_poster"` - // True, if notifications for incoming pinned messages will be created as for an ordinary unread message - DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` - // True, if notifications for messages with mentions will be created as for an ordinary unread message - DisableMentionNotifications bool `json:"disable_mention_notifications"` -} - -func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ScopeNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ScopeNotificationSettings) GetClass() string { - return ClassScopeNotificationSettings -} - -func (*ScopeNotificationSettings) GetType() string { - return TypeScopeNotificationSettings -} - -// Notifications for reactions are disabled -type ReactionNotificationSourceNone struct{ - meta -} - -func (entity *ReactionNotificationSourceNone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionNotificationSourceNone - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionNotificationSourceNone) GetClass() string { - return ClassReactionNotificationSource -} - -func (*ReactionNotificationSourceNone) GetType() string { - return TypeReactionNotificationSourceNone -} - -func (*ReactionNotificationSourceNone) ReactionNotificationSourceType() string { - return TypeReactionNotificationSourceNone -} - -// Notifications for reactions are shown only for reactions from contacts -type ReactionNotificationSourceContacts struct{ - meta -} - -func (entity *ReactionNotificationSourceContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionNotificationSourceContacts - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionNotificationSourceContacts) GetClass() string { - return ClassReactionNotificationSource -} - -func (*ReactionNotificationSourceContacts) GetType() string { - return TypeReactionNotificationSourceContacts -} - -func (*ReactionNotificationSourceContacts) ReactionNotificationSourceType() string { - return TypeReactionNotificationSourceContacts -} - -// Notifications for reactions are shown for all reactions -type ReactionNotificationSourceAll struct{ - meta -} - -func (entity *ReactionNotificationSourceAll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionNotificationSourceAll - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionNotificationSourceAll) GetClass() string { - return ClassReactionNotificationSource -} - -func (*ReactionNotificationSourceAll) GetType() string { - return TypeReactionNotificationSourceAll -} - -func (*ReactionNotificationSourceAll) ReactionNotificationSourceType() string { - return TypeReactionNotificationSourceAll -} - -// Contains information about notification settings for reactions and poll votes -type ReactionNotificationSettings struct { - meta - // Source of message reactions for which notifications are shown - MessageReactionSource ReactionNotificationSource `json:"message_reaction_source"` - // Source of story reactions for which notifications are shown - StoryReactionSource ReactionNotificationSource `json:"story_reaction_source"` - // Source of poll votes for which notifications are shown - PollVoteSource ReactionNotificationSource `json:"poll_vote_source"` - // Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound - SoundId JsonInt64 `json:"sound_id"` - // True, if reaction sender and emoji must be displayed in notifications - ShowPreview bool `json:"show_preview"` -} - -func (entity *ReactionNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionNotificationSettings) GetClass() string { - return ClassReactionNotificationSettings -} - -func (*ReactionNotificationSettings) GetType() string { - return TypeReactionNotificationSettings -} - -func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - MessageReactionSource json.RawMessage `json:"message_reaction_source"` - StoryReactionSource json.RawMessage `json:"story_reaction_source"` - PollVoteSource json.RawMessage `json:"poll_vote_source"` - SoundId JsonInt64 `json:"sound_id"` - ShowPreview bool `json:"show_preview"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - reactionNotificationSettings.SoundId = tmp.SoundId - reactionNotificationSettings.ShowPreview = tmp.ShowPreview - - fieldMessageReactionSource, _ := UnmarshalReactionNotificationSource(tmp.MessageReactionSource) - reactionNotificationSettings.MessageReactionSource = fieldMessageReactionSource - - fieldStoryReactionSource, _ := UnmarshalReactionNotificationSource(tmp.StoryReactionSource) - reactionNotificationSettings.StoryReactionSource = fieldStoryReactionSource - - fieldPollVoteSource, _ := UnmarshalReactionNotificationSource(tmp.PollVoteSource) - reactionNotificationSettings.PollVoteSource = fieldPollVoteSource - - return nil -} - // A text message draft type DraftMessageContentText struct { meta @@ -25450,6 +27798,14 @@ type OauthLinkInfo struct { 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"` + // True, if access to the user's TON wallet is requested by the app. If true and the user agrees to give access, then use createTonConnectSession with dapp_client_id and ton_connect_manifest_url to create the TON Connect session, then setTonConnectSessionWalletClientId, then create a tonWalletOwnershipProof for the given domain with the payload ton_proof_payload, and then pass all data to acceptOauthRequest in the parameter ton_connect_connect_data + RequestTonWalletAccess bool `json:"request_ton_wallet_access"` + // Hex-encoded public X25519 key of the dApp; may be empty if TON wallet access wasn't requested + DappClientId string `json:"dapp_client_id"` + // URL of the TON Connect manifest of the dApp; may be empty if TON wallet access wasn't requested + TonConnectManifestUrl string `json:"ton_connect_manifest_url"` + // Payload for TON wallet ownership proof; may be empty if TON wallet access wasn't requested + TonProofPayload string `json:"ton_proof_payload"` // The version of a browser used for the authorization Browser string `json:"browser"` // Operating system the browser is running on @@ -25491,7 +27847,7 @@ type MessageThreadInfo struct { ReplyInfo *MessageReplyInfo `json:"reply_info"` // Approximate number of unread messages in the message thread UnreadMessageCount int32 `json:"unread_message_count"` - // The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) + // The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message.id) Messages []*Message `json:"messages"` // A draft of a message in the message thread; may be null if none DraftMessage *DraftMessage `json:"draft_message"` @@ -25513,7 +27869,7 @@ func (*MessageThreadInfo) GetType() string { return TypeMessageThreadInfo } -// Topic containing messages sent by the current user of forwarded from an unknown chat +// Topic containing messages sent by the current user or forwarded from an unknown chat type SavedMessagesTopicTypeMyNotes struct{ meta } @@ -26113,7 +28469,9 @@ type ThemeSettings struct { OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` // If true, the freeform gradient fill needs to be animated on every sent message AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` - // Accent color of outgoing messages in ARGB format + // True, if there is chosen accent color for outgoing messages; otherwise, the color must be deduced from other theme settings + HasOutgoingMessageAccentColor bool `json:"has_outgoing_message_accent_color"` + // Accent color of outgoing messages in ARGB format; must be ignored if has_outgoing_message_accent_color is false OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` } @@ -26140,6 +28498,7 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { Background *Background `json:"background"` OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` + HasOutgoingMessageAccentColor bool `json:"has_outgoing_message_accent_color"` OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` } @@ -26151,6 +28510,7 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { themeSettings.AccentColor = tmp.AccentColor themeSettings.Background = tmp.Background themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill + themeSettings.HasOutgoingMessageAccentColor = tmp.HasOutgoingMessageAccentColor themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor fieldBaseTheme, _ := UnmarshalBuiltInTheme(tmp.BaseTheme) @@ -26162,6 +28522,268 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { return nil } +// Describes a backdrop, which can be used as a background of a theme of the screen for sharing a link to a user or a chat +type ProfileShareThemeBackdrop struct { + meta + // Unique identifier of the backdrop + Id int32 `json:"id"` + // Name of the backdrop + Name string `json:"name"` + // Colors of the backdrop + Colors *UpgradedGiftBackdropColors `json:"colors"` +} + +func (entity *ProfileShareThemeBackdrop) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileShareThemeBackdrop + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileShareThemeBackdrop) GetClass() string { + return ClassProfileShareThemeBackdrop +} + +func (*ProfileShareThemeBackdrop) GetType() string { + return TypeProfileShareThemeBackdrop +} + +// Contains a list of backdrops, which can be used as a background of a theme of the screen for sharing a link to a user or a chat +type ProfileShareThemeBackdrops struct { + meta + // The list of backdrops + Backdrops []*ProfileShareThemeBackdrop `json:"backdrops"` +} + +func (entity *ProfileShareThemeBackdrops) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileShareThemeBackdrops + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileShareThemeBackdrops) GetClass() string { + return ClassProfileShareThemeBackdrops +} + +func (*ProfileShareThemeBackdrops) GetType() string { + return TypeProfileShareThemeBackdrops +} + +// A regular emoji +type EmojiTypeRegular struct { + meta + // Text representation of the emoji + Emoji string `json:"emoji"` +} + +func (entity *EmojiTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiTypeRegular) GetClass() string { + return ClassEmojiType +} + +func (*EmojiTypeRegular) GetType() string { + return TypeEmojiTypeRegular +} + +func (*EmojiTypeRegular) EmojiTypeType() string { + return TypeEmojiTypeRegular +} + +// A custom emoji +type EmojiTypeCustomEmoji struct { + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *EmojiTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiTypeCustomEmoji) GetClass() string { + return ClassEmojiType +} + +func (*EmojiTypeCustomEmoji) GetType() string { + return TypeEmojiTypeCustomEmoji +} + +func (*EmojiTypeCustomEmoji) EmojiTypeType() string { + return TypeEmojiTypeCustomEmoji +} + +// A theme with emoji placed on a background +type ProfileShareThemeEmoji struct { + meta + // The emoji; 0-6 regular or custom emoji. If empty, then use_default_background is false + Emojis []EmojiType `json:"emojis"` + // True, if the default background is used; otherwise, the backdrop with identifier background_backdrop_id is used as background + UseDefaultBackground bool `json:"use_default_background"` + // Identifier of the backdrop used as background; must be ignored if use_default_background is true. Use getProfileShareThemeBackdrops to get details about the backdrop + BackgroundBackdropId int32 `json:"background_backdrop_id"` +} + +func (entity *ProfileShareThemeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileShareThemeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileShareThemeEmoji) GetClass() string { + return ClassProfileShareTheme +} + +func (*ProfileShareThemeEmoji) GetType() string { + return TypeProfileShareThemeEmoji +} + +func (*ProfileShareThemeEmoji) ProfileShareThemeType() string { + return TypeProfileShareThemeEmoji +} + +func (profileShareThemeEmoji *ProfileShareThemeEmoji) UnmarshalJSON(data []byte) error { + var tmp struct { + Emojis []json.RawMessage `json:"emojis"` + UseDefaultBackground bool `json:"use_default_background"` + BackgroundBackdropId int32 `json:"background_backdrop_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + profileShareThemeEmoji.UseDefaultBackground = tmp.UseDefaultBackground + profileShareThemeEmoji.BackgroundBackdropId = tmp.BackgroundBackdropId + + fieldEmojis, _ := UnmarshalListOfEmojiType(tmp.Emojis) + profileShareThemeEmoji.Emojis = fieldEmojis + + return nil +} + +// A theme based on an upgraded gift owned by the user or the chat +type ProfileShareThemeUpgradedGift struct { + meta + // The upgraded gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *ProfileShareThemeUpgradedGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileShareThemeUpgradedGift + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileShareThemeUpgradedGift) GetClass() string { + return ClassProfileShareTheme +} + +func (*ProfileShareThemeUpgradedGift) GetType() string { + return TypeProfileShareThemeUpgradedGift +} + +func (*ProfileShareThemeUpgradedGift) ProfileShareThemeType() string { + return TypeProfileShareThemeUpgradedGift +} + +// A theme with emoji placed on a background +type InputProfileShareThemeEmoji struct { + meta + // The emoji; 0-6 regular or custom emoji. If empty, then use_default_background must be false + Emojis []EmojiType `json:"emojis"` + // Pass true to use the default background; otherwise, the backdrop with identifier background_backdrop_id will be used as background + UseDefaultBackground bool `json:"use_default_background"` + // Identifier of the backdrop to be used as background; ignored if use_default_background is true. Use getProfileShareThemeBackdrops to get the list of available backdrops + BackgroundBackdropId int32 `json:"background_backdrop_id"` +} + +func (entity *InputProfileShareThemeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputProfileShareThemeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*InputProfileShareThemeEmoji) GetClass() string { + return ClassInputProfileShareTheme +} + +func (*InputProfileShareThemeEmoji) GetType() string { + return TypeInputProfileShareThemeEmoji +} + +func (*InputProfileShareThemeEmoji) InputProfileShareThemeType() string { + return TypeInputProfileShareThemeEmoji +} + +func (inputProfileShareThemeEmoji *InputProfileShareThemeEmoji) UnmarshalJSON(data []byte) error { + var tmp struct { + Emojis []json.RawMessage `json:"emojis"` + UseDefaultBackground bool `json:"use_default_background"` + BackgroundBackdropId int32 `json:"background_backdrop_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputProfileShareThemeEmoji.UseDefaultBackground = tmp.UseDefaultBackground + inputProfileShareThemeEmoji.BackgroundBackdropId = tmp.BackgroundBackdropId + + fieldEmojis, _ := UnmarshalListOfEmojiType(tmp.Emojis) + inputProfileShareThemeEmoji.Emojis = fieldEmojis + + return nil +} + +// A theme based on an upgraded gift +type InputProfileShareThemeUpgradedGift struct { + meta + // Identifier of the upgraded gift, which is owned by the user or the chat, for which the theme is set + ReceivedGiftId string `json:"received_gift_id"` +} + +func (entity *InputProfileShareThemeUpgradedGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputProfileShareThemeUpgradedGift + + return json.Marshal((*stub)(entity)) +} + +func (*InputProfileShareThemeUpgradedGift) GetClass() string { + return ClassInputProfileShareTheme +} + +func (*InputProfileShareThemeUpgradedGift) GetType() string { + return TypeInputProfileShareThemeUpgradedGift +} + +func (*InputProfileShareThemeUpgradedGift) InputProfileShareThemeType() string { + return TypeInputProfileShareThemeUpgradedGift +} + // Represents a button inside a rich message type InlineButton struct { meta @@ -26830,6 +29452,54 @@ func (richTextBankCardNumber *RichTextBankCardNumber) UnmarshalJSON(data []byte) return nil } +// An address in the TON blockchain +type RichTextTonAddress struct { + meta + // Text + Text RichText `json:"text"` + // The address + Address string `json:"address"` +} + +func (entity *RichTextTonAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextTonAddress + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextTonAddress) GetClass() string { + return ClassRichText +} + +func (*RichTextTonAddress) GetType() string { + return TypeRichTextTonAddress +} + +func (*RichTextTonAddress) RichTextType() string { + return TypeRichTextTonAddress +} + +func (richTextTonAddress *RichTextTonAddress) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Address string `json:"address"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextTonAddress.Address = tmp.Address + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextTonAddress.Text = fieldText + + return nil +} + // A bot command type RichTextBotCommand struct { meta @@ -27149,7 +29819,7 @@ func (*RichTextCustomEmoji) RichTextType() string { // A small image inside the text; instant view only type RichTextIcon struct { meta - // The image represented as a document. The image can be in GIF, JPEG or PNG format + // The image represented as a document. The image can be in GIF, JPEG, or PNG format Document *Document `json:"document"` // Width of a bounding box in which the image must be shown; 0 if unknown Width int32 `json:"width"` @@ -27560,7 +30230,7 @@ type PageBlockListItem struct { IsChecked bool `json:"is_checked"` // Value of the item; 0 for unordered lists Value int32 `json:"value"` - // Type of the item numbering type; must be one of "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, "1" for decimal numbers, or empty for unordered lists + // Type of item numbering; must be one of "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, "1" for decimal numbers, or an empty string for unordered lists Type string `json:"type"` } @@ -27618,7 +30288,7 @@ type InputPageBlockListItem struct { IsChecked bool `json:"is_checked"` // Value of the item; pass 0 for unordered lists Value int32 `json:"value"` - // Type of the item numbering type; must be one of "a" for a lowercase letter, "A" for an uppercase letter, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, "1" for decimal numbers, or empty for unordered lists + // Type of item numbering; pass "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, "1" for decimal numbers, or an empty string for unordered lists Type string `json:"type"` } @@ -30228,7 +32898,7 @@ func (*LinkPreviewTypePremiumGiftCode) LinkPreviewTypeType() string { return TypeLinkPreviewTypePremiumGiftCode } -// The link is a link to a dialog for creating of a managed bot +// The link is a link to a dialog for creating a managed bot type LinkPreviewTypeRequestManagedBot struct{ meta } @@ -33759,7 +36429,7 @@ func (*PassportAuthorizationForm) GetType() string { return TypePassportAuthorizationForm } -// Contains information about a Telegram Passport elements and corresponding errors +// Contains information about Telegram Passport elements and corresponding errors type PassportElementsWithErrors struct { meta // Telegram Passport elements @@ -33837,7 +36507,7 @@ type EncryptedPassportElement struct { Type PassportElementType `json:"type"` // Encrypted JSON-encoded data about the user Data []byte `json:"data"` - // The front side of an identity document + // The front side of an identity document; may be null if the element isn't an identity document FrontSide *DatedFile `json:"front_side"` // The reverse side of an identity document; may be null ReverseSide *DatedFile `json:"reverse_side"` @@ -35307,6 +37977,53 @@ func (*MessageStory) MessageContentType() string { return TypeMessageStory } +// A message with an HTML widget +type MessageWidget struct { + meta + // Width of the widget; 0 if the widget must occupy the whole width of the message bubble + Width int32 `json:"width"` + // Height of the widget; 0 if the height of the widget isn't fixed + Height int32 `json:"height"` + // HTML code of the widget + Html string `json:"html"` + // Public data of the widget + PublicData string `json:"public_data"` + // Data of the widget, which is specific to the chat + ChatData string `json:"chat_data"` + // Identifier of the shared widget; 0 if the widget isn't shared + WidgetId JsonInt64 `json:"widget_id"` + // Widget caption + Caption *FormattedText `json:"caption"` + // True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget + ShowCaptionAboveMedia bool `json:"show_caption_above_media"` + // True, if the message is a copy of the widget + IsCopy bool `json:"is_copy"` + // True, if the widget can send queries to the bot + CanSendQueries bool `json:"can_send_queries"` + // True, if the widget can send queries to the bot in the background + CanSendBackgroundQueries bool `json:"can_send_background_queries"` +} + +func (entity *MessageWidget) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWidget + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWidget) GetClass() string { + return ClassMessageContent +} + +func (*MessageWidget) GetType() string { + return TypeMessageWidget +} + +func (*MessageWidget) MessageContentType() string { + return TypeMessageWidget +} + // A message with a checklist type MessageChecklist struct { meta @@ -35466,7 +38183,7 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { return nil } -// 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 +// 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 becomes active or missed, then the call screen must be hidden type MessageGroupCall struct { meta // Persistent unique group call identifier @@ -35842,7 +38559,7 @@ func (*MessageChatDeletePhoto) MessageContentType() string { // 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 + // Identifier of the user who will become the new owner of the chat if the previous owner doesn't return; 0 if none NewOwnerUserId int64 `json:"new_owner_user_id"` } @@ -37227,6 +39944,103 @@ func (*MessageGiveawayPrizeStars) MessageContentType() string { return TypeMessageGiveawayPrizeStars } +// Represents a transfer with the TON wallet of the current user +type MessageTonWalletTransfer struct { + meta + // Sender of the transfer; 0 if unknown + SenderUserId int64 `json:"sender_user_id"` + // Unique identifier of the transaction; may be empty if the transfer isn't sent yet. Use getTonWalletTransaction to get additional information about the transaction + TransactionId string `json:"transaction_id"` + // Address in the TON blockchain of the transaction peer + PeerAddress string `json:"peer_address"` + // The amount of received cryptocurrency, in the smallest units of the cryptocurrency; negative for outgoing transactions + Amount JsonInt64 `json:"amount"` + // Comment added to the transaction + Comment string `json:"comment"` + // True, if the comment is encrypted and must be decrypted using the receiver's or sender's private key + IsCommentEncrypted bool `json:"is_comment_encrypted"` +} + +func (entity *MessageTonWalletTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageTonWalletTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageTonWalletTransfer) GetClass() string { + return ClassMessageContent +} + +func (*MessageTonWalletTransfer) GetType() string { + return TypeMessageTonWalletTransfer +} + +func (*MessageTonWalletTransfer) MessageContentType() string { + return TypeMessageTonWalletTransfer +} + +// A request from a dApp was received through TON Connect +type MessageTonConnectRequest struct { + meta + // Unique identifier of the TON Connect session + SessionId JsonInt64 `json:"session_id"` + // State of the request + State TonConnectRequestState `json:"state"` + // Name of the dApp; may be empty if unknown + DappName string `json:"dapp_name"` + // Topic of the request; may be empty if none + Topic string `json:"topic"` + // Identifier to trace the request; may be empty if none + TraceId string `json:"trace_id"` +} + +func (entity *MessageTonConnectRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageTonConnectRequest + + return json.Marshal((*stub)(entity)) +} + +func (*MessageTonConnectRequest) GetClass() string { + return ClassMessageContent +} + +func (*MessageTonConnectRequest) GetType() string { + return TypeMessageTonConnectRequest +} + +func (*MessageTonConnectRequest) MessageContentType() string { + return TypeMessageTonConnectRequest +} + +func (messageTonConnectRequest *MessageTonConnectRequest) UnmarshalJSON(data []byte) error { + var tmp struct { + SessionId JsonInt64 `json:"session_id"` + State json.RawMessage `json:"state"` + DappName string `json:"dapp_name"` + Topic string `json:"topic"` + TraceId string `json:"trace_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageTonConnectRequest.SessionId = tmp.SessionId + messageTonConnectRequest.DappName = tmp.DappName + messageTonConnectRequest.Topic = tmp.Topic + messageTonConnectRequest.TraceId = tmp.TraceId + + fieldState, _ := UnmarshalTonConnectRequestState(tmp.State) + messageTonConnectRequest.State = fieldState + + return nil +} + // A regular gift was received or sent by the current user, or the current user was notified about a channel gift type MessageGift struct { meta @@ -37258,6 +40072,8 @@ type MessageGift struct { IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` // True, if the gift can be upgraded to a unique gift; only for the receiver of the gift CanBeUpgraded bool `json:"can_be_upgraded"` + // True, if the gift can be deleted using deleteGift; only for the receiver of the gift + CanBeDeleted bool `json:"can_be_deleted"` // True, if the gift was converted to Telegram Stars; only for the receiver of the gift WasConverted bool `json:"was_converted"` // True, if the gift was upgraded to a unique gift @@ -37306,6 +40122,7 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { IsSaved bool `json:"is_saved"` IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` CanBeUpgraded bool `json:"can_be_upgraded"` + CanBeDeleted bool `json:"can_be_deleted"` WasConverted bool `json:"was_converted"` WasUpgraded bool `json:"was_upgraded"` WasRefunded bool `json:"was_refunded"` @@ -37330,6 +40147,7 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { messageGift.IsSaved = tmp.IsSaved messageGift.IsPrepaidUpgrade = tmp.IsPrepaidUpgrade messageGift.CanBeUpgraded = tmp.CanBeUpgraded + messageGift.CanBeDeleted = tmp.CanBeDeleted messageGift.WasConverted = tmp.WasConverted messageGift.WasUpgraded = tmp.WasUpgraded messageGift.WasRefunded = tmp.WasRefunded @@ -37453,7 +40271,7 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error return nil } -// A gift which purchase, upgrade or transfer were refunded +// A gift which purchase, upgrade, or transfer were refunded type MessageRefundedUpgradedGift struct { meta // The gift @@ -37712,6 +40530,31 @@ func (*MessageDirectMessagePriceChanged) MessageContentType() string { return TypeMessageDirectMessagePriceChanged } +// The sender of the message used a link of the other user, which allows sending unpaid messages to the user +type MessageUnpaidMessagesAllowedByLink struct{ + meta +} + +func (entity *MessageUnpaidMessagesAllowedByLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUnpaidMessagesAllowedByLink + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUnpaidMessagesAllowedByLink) GetClass() string { + return ClassMessageContent +} + +func (*MessageUnpaidMessagesAllowedByLink) GetType() string { + return TypeMessageUnpaidMessagesAllowedByLink +} + +func (*MessageUnpaidMessagesAllowedByLink) MessageContentType() string { + return TypeMessageUnpaidMessagesAllowedByLink +} + // Some tasks from a checklist were marked as done or not done type MessageChecklistTasksDone struct { meta @@ -38667,6 +41510,31 @@ func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string { return TypeTextEntityTypeBankCardNumber } +// An address in the TON blockchain +type TextEntityTypeTonAddress struct{ + meta +} + +func (entity *TextEntityTypeTonAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeTonAddress + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeTonAddress) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeTonAddress) GetType() string { + return TypeTextEntityTypeTonAddress +} + +func (*TextEntityTypeTonAddress) TextEntityTypeType() string { + return TypeTextEntityTypeTonAddress +} + // A bold text type TextEntityTypeBold struct{ meta @@ -38946,7 +41814,7 @@ func (*TextEntityTypeTextUrl) TextEntityTypeType() string { return TypeTextEntityTypeTextUrl } -// A text shows instead of a raw mention of the user (e.g., when the user has no username) +// A text shown instead of a raw mention of the user (e.g., when the user has no username) type TextEntityTypeMentionName struct { meta // Identifier of the mentioned user @@ -39155,7 +42023,7 @@ func (*DiffEntityTypeDelete) DiffEntityTypeType() string { // A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size type InputThumbnail struct { meta - // Thumbnail file to send. Sending thumbnails by file_id is currently not supported + // Thumbnail file to send. Sending thumbnails by inputFileId or inputFileRemote is currently not supported Thumbnail InputFile `json:"thumbnail"` // Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown Width int32 `json:"width"` @@ -39604,7 +42472,7 @@ func (inputVideoNote *InputVideoNote) UnmarshalJSON(data []byte) error { return nil } -// A video note to be sent +// A voice note to be sent type InputVoiceNote struct { meta // Voice note file to be sent. The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio channel, or be in MP3 or M4A format as regular audio @@ -39961,7 +42829,7 @@ type MessageSendOptions struct { AllowPaidBroadcast bool `json:"allow_paid_broadcast"` // The number of Telegram Stars the user agreed to pay to send the messages PaidMessageStarCount int64 `json:"paid_message_star_count"` - // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum + // Pass true if the user has explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum 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"` @@ -42090,6 +44958,82 @@ func (*InputMessageChecklist) InputMessageContentType() string { return TypeInputMessageChecklist } +// A message with an HTML widget; for bots only +type InputMessageWidget struct { + meta + // Width of the widget; 0 if the widget must occupy the whole width of the message bubble + Width int32 `json:"width"` + // Height of the widget; 0 if the height of the widget isn't fixed + Height int32 `json:"height"` + // HTML code of the widget; 1-32768 bytes; must not exceed 4096 bytes when compressed by zlib with the maximal compression level + Html string `json:"html"` + // Public data of the widget, which will be available in copies and forwards of the message + PublicData string `json:"public_data"` + // Data of the widget, which is specific to the chat + ChatData string `json:"chat_data"` + // Widget caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget + ShowCaptionAboveMedia bool `json:"show_caption_above_media"` + // Pass true to allow the widget to send queries to the bot + AllowQueries bool `json:"allow_queries"` + // Pass true to create a shared widget, which can be sent again by its identifier + IsShared bool `json:"is_shared"` +} + +func (entity *InputMessageWidget) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageWidget + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageWidget) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageWidget) GetType() string { + return TypeInputMessageWidget +} + +func (*InputMessageWidget) InputMessageContentType() string { + return TypeInputMessageWidget +} + +// A message with an existing shared widget; for bots only +type InputMessageSharedWidget struct { + meta + // Identifier of the shared widget + WidgetId JsonInt64 `json:"widget_id"` + // Data of the widget, which is specific to the chat + ChatData string `json:"chat_data"` + // Widget caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget + ShowCaptionAboveMedia bool `json:"show_caption_above_media"` +} + +func (entity *InputMessageSharedWidget) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageSharedWidget + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageSharedWidget) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageSharedWidget) GetType() string { + return TypeInputMessageSharedWidget +} + +func (*InputMessageSharedWidget) InputMessageContentType() string { + return TypeInputMessageSharedWidget +} + // A forwarded message type InputMessageForwarded struct { meta @@ -42146,7 +45090,7 @@ type MessageProperties struct { CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users using the method deleteMessages with revoke == true CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location, poll, and checklist messages this fields shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message + // True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location, poll, and checklist messages this field shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options CanBeForwarded bool `json:"can_be_forwarded"` @@ -42176,7 +45120,7 @@ type MessageProperties struct { CanGetEmbeddingCode bool `json:"can_get_embedding_code"` // True, if a link can be generated for the message using getMessageLink CanGetLink bool `json:"can_get_link"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption, or link preview description using getMessageLink CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` // True, if information about the message thread is available through getMessageThread and getMessageThreadHistory CanGetMessageThread bool `json:"can_get_message_thread"` @@ -42202,6 +45146,8 @@ type MessageProperties struct { CanReportSupergroupSpam bool `json:"can_report_supergroup_spam"` // True, if fact check for the message can be changed through setMessageFactCheck CanSetFactCheck bool `json:"can_set_fact_check"` + // Identifiers of custom emoji used in the message + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` // True, if content of the message can't be saved locally, because it is protected by the current user; if true, then can_be_saved is false HasProtectedContentByCurrentUser bool `json:"has_protected_content_by_current_user"` // True, if content of the message can't be saved locally, because it is protected by the other user; if true, then can_be_saved is false @@ -44019,39 +46965,6 @@ func (*CurrentWeather) GetType() string { return TypeCurrentWeather } -// Describes position of a clickable rectangle area on a story media -type StoryAreaPosition struct { - meta - // The abscissa of the rectangle's center, as a percentage of the media width - XPercentage float64 `json:"x_percentage"` - // The ordinate of the rectangle's center, as a percentage of the media height - YPercentage float64 `json:"y_percentage"` - // The width of the rectangle, as a percentage of the media width - WidthPercentage float64 `json:"width_percentage"` - // The height of the rectangle, as a percentage of the media height - HeightPercentage float64 `json:"height_percentage"` - // Clockwise rotation angle of the rectangle, in degrees; 0-360 - RotationAngle float64 `json:"rotation_angle"` - // The radius of the rectangle corner rounding, as a percentage of the media width - CornerRadiusPercentage float64 `json:"corner_radius_percentage"` -} - -func (entity *StoryAreaPosition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryAreaPosition - - return json.Marshal((*stub)(entity)) -} - -func (*StoryAreaPosition) GetClass() string { - return ClassStoryAreaPosition -} - -func (*StoryAreaPosition) GetType() string { - return TypeStoryAreaPosition -} - // An area pointing to a location type StoryAreaTypeLocation struct { meta @@ -44193,7 +47106,7 @@ func (*StoryAreaTypeMessage) StoryAreaTypeType() string { return TypeStoryAreaTypeMessage } -// An area pointing to a HTTP or tg:// link +// An area pointing to an HTTP or tg:// link type StoryAreaTypeLink struct { meta // HTTP or tg:// URL to be opened when the area is clicked @@ -44282,7 +47195,7 @@ func (*StoryAreaTypeUpgradedGift) StoryAreaTypeType() string { type StoryArea struct { meta // Position of the area - Position *StoryAreaPosition `json:"position"` + Position *AreaPosition `json:"position"` // Type of the area Type StoryAreaType `json:"type"` } @@ -44305,7 +47218,7 @@ func (*StoryArea) GetType() string { func (storyArea *StoryArea) UnmarshalJSON(data []byte) error { var tmp struct { - Position *StoryAreaPosition `json:"position"` + Position *AreaPosition `json:"position"` Type json.RawMessage `json:"type"` } @@ -44351,35 +47264,6 @@ func (*InputStoryAreaTypeLocation) InputStoryAreaTypeType() string { return TypeInputStoryAreaTypeLocation } -// An area pointing to a venue found by the bot getOption("venue_search_bot_username") -type InputStoryAreaTypeFoundVenue struct { - meta - // Identifier of the inline query, used to found the venue - QueryId JsonInt64 `json:"query_id"` - // Identifier of the inline query result - ResultId string `json:"result_id"` -} - -func (entity *InputStoryAreaTypeFoundVenue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputStoryAreaTypeFoundVenue - - return json.Marshal((*stub)(entity)) -} - -func (*InputStoryAreaTypeFoundVenue) GetClass() string { - return ClassInputStoryAreaType -} - -func (*InputStoryAreaTypeFoundVenue) GetType() string { - return TypeInputStoryAreaTypeFoundVenue -} - -func (*InputStoryAreaTypeFoundVenue) InputStoryAreaTypeType() string { - return TypeInputStoryAreaTypeFoundVenue -} - // An area pointing to a venue already added to the story type InputStoryAreaTypePreviousVenue struct { meta @@ -44490,7 +47374,7 @@ func (*InputStoryAreaTypeMessage) InputStoryAreaTypeType() string { return TypeInputStoryAreaTypeMessage } -// An area pointing to a HTTP or tg:// link +// An area pointing to an HTTP or tg:// link type InputStoryAreaTypeLink struct { meta // HTTP or tg:// URL to be opened when the area is clicked @@ -44579,7 +47463,7 @@ func (*InputStoryAreaTypeUpgradedGift) InputStoryAreaTypeType() string { type InputStoryArea struct { meta // Position of the area - Position *StoryAreaPosition `json:"position"` + Position *AreaPosition `json:"position"` // Type of the area Type InputStoryAreaType `json:"type"` } @@ -44602,7 +47486,7 @@ func (*InputStoryArea) GetType() string { func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { var tmp struct { - Position *StoryAreaPosition `json:"position"` + Position *AreaPosition `json:"position"` Type json.RawMessage `json:"type"` } @@ -44622,7 +47506,7 @@ func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { // Contains a list of story areas to be added type InputStoryAreas struct { meta - // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, up to 3 inputStoryAreaTypeWeather areas, and up to 1 inputStoryAreaTypeUpgradedGift area + // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, up to 3 inputStoryAreaTypeWeather areas, and up to 1 inputStoryAreaTypeUpgradedGift area Areas []*InputStoryArea `json:"areas"` } @@ -45235,6 +48119,8 @@ type Story struct { Areas []*StoryArea `json:"areas"` // Caption of the story Caption *FormattedText `json:"caption"` + // Music attached to the story; may be null if none + Music *Audio `json:"music"` // Identifiers of story albums to which the story is added; only for manageable stories AlbumIds []int32 `json:"album_ids"` } @@ -45283,6 +48169,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { Content json.RawMessage `json:"content"` Areas []*StoryArea `json:"areas"` Caption *FormattedText `json:"caption"` + Music *Audio `json:"music"` AlbumIds []int32 `json:"album_ids"` } @@ -45313,6 +48200,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.InteractionInfo = tmp.InteractionInfo story.Areas = tmp.Areas story.Caption = tmp.Caption + story.Music = tmp.Music story.AlbumIds = tmp.AlbumIds fieldPosterId, _ := UnmarshalMessageSender(tmp.PosterId) @@ -45497,7 +48385,7 @@ type ChatActiveStories struct { ChatId int64 `json:"chat_id"` // Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list List StoryList `json:"list"` - // A parameter used to determine order of the stories in the story list; 0 if the stories don't need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order + // A parameter used to determine order of the stories in the story list; 0 if the stories don't need to be shown in the story list. Stories must be sorted by the pair (order, chat_id) in descending order Order int64 `json:"order"` // True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can't be archived nor hidden using removeTopChat CanBeArchived bool `json:"can_be_archived"` @@ -46222,7 +49110,7 @@ type ChatBoostSourceGiveaway struct { meta // 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 + // 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 giveaways only GiftCode string `json:"gift_code"` // Number of Telegram Stars distributed among winners of the giveaway StarCount int64 `json:"star_count"` @@ -47355,7 +50243,7 @@ type GroupCallRecentSpeaker struct { meta // Group call participant identifier ParticipantId MessageSender `json:"participant_id"` - // True, is the user has spoken recently + // True, if the user has spoken recently IsSpeaking bool `json:"is_speaking"` } @@ -47866,7 +50754,7 @@ type GroupCallMessageLevel struct { 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 + // Background color for the message in the RGB format BackgroundColor int32 `json:"background_color"` } @@ -49020,6 +51908,29 @@ func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { return TypeSpeechRecognitionResultError } +// Contains a list of probable languages of speech +type SpeechRecognitionLanguages struct { + meta + // IETF language tags of the languages in descending order of their probability; for example, "en-US" + LanguageCodes []string `json:"language_codes"` +} + +func (entity *SpeechRecognitionLanguages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionLanguages + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionLanguages) GetClass() string { + return ClassSpeechRecognitionLanguages +} + +func (*SpeechRecognitionLanguages) GetType() string { + return TypeSpeechRecognitionLanguages +} + // Describes a connection of the bot with a business account type BusinessConnection struct { meta @@ -49277,8 +52188,10 @@ type UserLink struct { meta // The URL Url string `json:"url"` - // Left time for which the link is valid, in seconds; 0 if the link is a public username link + // Left time for which the link is valid, in seconds; 0 if the link is permanent ExpiresIn int32 `json:"expires_in"` + // True, if a permanent link to the current user can be received; false if all links to the current user expire + CanGetPermanentLink bool `json:"can_get_permanent_link"` } func (entity *UserLink) MarshalJSON() ([]byte, error) { @@ -49444,7 +52357,7 @@ type InputInlineQueryResultAnimation struct { VideoHeight int32 `json:"video_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAnimation, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAnimation, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49526,7 +52439,7 @@ type InputInlineQueryResultArticle struct { ThumbnailHeight int32 `json:"thumbnail_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49600,7 +52513,7 @@ type InputInlineQueryResultAudio struct { AudioDuration int32 `json:"audio_duration"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAudio, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAudio, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49670,7 +52583,7 @@ type InputInlineQueryResultContact struct { ThumbnailHeight int32 `json:"thumbnail_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49746,7 +52659,7 @@ type InputInlineQueryResultDocument struct { ThumbnailHeight int32 `json:"thumbnail_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageDocument, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageDocument, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49878,7 +52791,7 @@ type InputInlineQueryResultLocation struct { ThumbnailHeight int32 `json:"thumbnail_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -49956,7 +52869,7 @@ type InputInlineQueryResultPhoto struct { PhotoHeight int32 `json:"photo_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessagePhoto, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessagePhoto, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -50030,7 +52943,7 @@ type InputInlineQueryResultSticker struct { StickerHeight int32 `json:"sticker_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageSticker, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageSticker, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -50100,7 +53013,7 @@ type InputInlineQueryResultVenue struct { ThumbnailHeight int32 `json:"thumbnail_height"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -50178,7 +53091,7 @@ type InputInlineQueryResultVideo struct { VideoDuration int32 `json:"video_duration"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVideo, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVideo, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -50254,7 +53167,7 @@ type InputInlineQueryResultVoiceNote struct { VoiceNoteDuration int32 `json:"voice_note_duration"` // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVoiceNote, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVoiceNote, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -51041,6 +53954,168 @@ func (*CallbackQueryAnswer) GetType() string { return TypeCallbackQueryAnswer } +// Describes a TON wallet of the user, who is used in a widget query +type WidgetQueryWallet struct { + meta + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency + GramAmount JsonInt64 `json:"gram_amount"` + // Public key of the wallet; may be empty if unknown + PublicKey []byte `json:"public_key"` + // Serialized StateInit of the wallet contract; must be empty if and only if public_key is empty + StateInit []byte `json:"state_init"` +} + +func (entity *WidgetQueryWallet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetQueryWallet + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetQueryWallet) GetClass() string { + return ClassWidgetQueryWallet +} + +func (*WidgetQueryWallet) GetType() string { + return TypeWidgetQueryWallet +} + +// The query contains data for the bot +type WidgetQueryTypeData struct { + meta + // True, if the TON wallet card of the user who sends the query is sent to the bot along with the query + WithWallet bool `json:"with_wallet"` +} + +func (entity *WidgetQueryTypeData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetQueryTypeData + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetQueryTypeData) GetClass() string { + return ClassWidgetQueryType +} + +func (*WidgetQueryTypeData) GetType() string { + return TypeWidgetQueryTypeData +} + +func (*WidgetQueryTypeData) WidgetQueryTypeType() string { + return TypeWidgetQueryTypeData +} + +// The query contains data signed by a TON wallet of the user who sends the query +type WidgetQueryTypeSignData struct { + meta + // The wallet that signed the data + Wallet *WidgetQueryWallet `json:"wallet"` + // JSON-serialized signed data + SignData string `json:"sign_data"` +} + +func (entity *WidgetQueryTypeSignData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetQueryTypeSignData + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetQueryTypeSignData) GetClass() string { + return ClassWidgetQueryType +} + +func (*WidgetQueryTypeSignData) GetType() string { + return TypeWidgetQueryTypeSignData +} + +func (*WidgetQueryTypeSignData) WidgetQueryTypeType() string { + return TypeWidgetQueryTypeSignData +} + +// The query notifies the bot about a transaction sent from a TON wallet of the user who sends the query +type WidgetQueryTypeSentTransaction struct { + meta + // The wallet from which the transaction was sent + Wallet *WidgetQueryWallet `json:"wallet"` + // Value of msg_hash of the transaction + MsgHash string `json:"msg_hash"` +} + +func (entity *WidgetQueryTypeSentTransaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetQueryTypeSentTransaction + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetQueryTypeSentTransaction) GetClass() string { + return ClassWidgetQueryType +} + +func (*WidgetQueryTypeSentTransaction) GetType() string { + return TypeWidgetQueryTypeSentTransaction +} + +func (*WidgetQueryTypeSentTransaction) WidgetQueryTypeType() string { + return TypeWidgetQueryTypeSentTransaction +} + +// Contains an answer to a widget query +type WidgetQueryAnswer struct { + meta + // Data returned by the bot + Data string `json:"data"` +} + +func (entity *WidgetQueryAnswer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetQueryAnswer + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetQueryAnswer) GetClass() string { + return ClassWidgetQueryAnswer +} + +func (*WidgetQueryAnswer) GetType() string { + return TypeWidgetQueryAnswer +} + +// Contains public data of a widget +type WidgetPublicData struct { + meta + // Public data of the widget + Data string `json:"data"` + // The number of seconds after which the public data can be polled again + PollPeriod int32 `json:"poll_period"` +} + +func (entity *WidgetPublicData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WidgetPublicData + + return json.Marshal((*stub)(entity)) +} + +func (*WidgetPublicData) GetClass() string { + return ClassWidgetPublicData +} + +func (*WidgetPublicData) GetType() string { + return TypeWidgetPublicData +} + // Contains the result of a custom request type CustomRequestResult struct { meta @@ -52124,7 +55199,7 @@ func (*ChatEventProfileAccentColorChanged) ChatEventActionType() string { return TypeChatEventProfileAccentColorChanged } -// The has_protected_content setting of a channel was toggled +// The has_protected_content setting of a chat was toggled type ChatEventHasProtectedContentToggled struct { meta // New value of has_protected_content @@ -52573,7 +55648,7 @@ func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatPartici return nil } -// The is_forum setting of a channel was toggled +// The is_forum setting of a supergroup was toggled type ChatEventIsForumToggled struct { meta // New value of is_forum @@ -53995,7 +57070,7 @@ func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { return TypePremiumFeatureForumTopicIcon } -// Allowed to set a premium application icons +// Allowed to set premium application icons type PremiumFeatureAppIcons struct{ meta } @@ -54695,7 +57770,7 @@ func (*PremiumStoryFeaturePriorityOrder) PremiumStoryFeatureType() string { return TypePremiumStoryFeaturePriorityOrder } -// The ability to hide the fact that the user viewed other's stories +// The ability to hide the fact that the user viewed others' stories type PremiumStoryFeatureStealthMode struct{ meta } @@ -54770,7 +57845,7 @@ func (*PremiumStoryFeatureCustomExpirationDuration) PremiumStoryFeatureType() st return TypePremiumStoryFeatureCustomExpirationDuration } -// The ability to save other's unprotected stories +// The ability to save others' unprotected stories type PremiumStoryFeatureSaveStories struct{ meta } @@ -55071,7 +58146,7 @@ func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) err // A user tried to use a Business feature type PremiumSourceBusinessFeature struct { meta - // The used feature; pass null if none specific feature was used + // The used feature; pass null if no specific feature was used Feature BusinessFeature `json:"feature"` } @@ -55726,7 +58801,7 @@ type TelegramPaymentPurposeStars struct { Amount int64 `json:"amount"` // Number of bought Telegram Stars StarCount int64 `json:"star_count"` - // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none + // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none. If non-zero and getOption("star_top_up_disabled"), then the payment isn't allowed and the user can't buy Telegram Stars in this place ChatId int64 `json:"chat_id"` } @@ -56706,7 +59781,7 @@ func (*InputChatThemeEmoji) InputChatThemeType() string { // A theme based on an upgraded gift type InputChatThemeGift struct { meta - // Name of the upgraded gift. A gift can be used only in one chat in a time. When the same gift is used in another chat, theme in the previous chat is reset to default + // Name of the upgraded gift. A gift can be used only in one chat at a time. When the same gift is used in another chat, theme in the previous chat is reset to default Name string `json:"name"` } @@ -58005,6 +61080,64 @@ func (pushMessageContentGiveaway *PushMessageContentGiveaway) UnmarshalJSON(data return nil } +// A message with a TON wallet transfer +type PushMessageContentTonWalletTransfer struct { + meta + // Sender of the transfer; 0 if unknown + SenderUserId int64 `json:"sender_user_id"` + // String representation of the received amount + Amount string `json:"amount"` + // Comment added to the transaction if it is public + Comment string `json:"comment"` +} + +func (entity *PushMessageContentTonWalletTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentTonWalletTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentTonWalletTransfer) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentTonWalletTransfer) GetType() string { + return TypePushMessageContentTonWalletTransfer +} + +func (*PushMessageContentTonWalletTransfer) PushMessageContentType() string { + return TypePushMessageContentTonWalletTransfer +} + +// A message with a request from a dApp was received through TON Connect +type PushMessageContentTonConnectRequest struct { + meta + // Name of the dApp; may be empty if unknown + DappName string `json:"dapp_name"` +} + +func (entity *PushMessageContentTonConnectRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentTonConnectRequest + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentTonConnectRequest) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentTonConnectRequest) GetType() string { + return TypePushMessageContentTonConnectRequest +} + +func (*PushMessageContentTonConnectRequest) PushMessageContentType() string { + return TypePushMessageContentTonConnectRequest +} + // A message with a gift type PushMessageContentGift struct { meta @@ -58802,7 +61935,7 @@ func (*PushMessageContentPollOptionAdded) PushMessageContentType() string { return TypePushMessageContentPollOptionAdded } -// A forwarded messages +// Forwarded messages type PushMessageContentMessageForwards struct { meta // Number of forwarded messages @@ -59878,7 +63011,7 @@ func (*UserPrivacySettingRuleAllowUsers) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleAllowUsers } -// A rule to allow all members of certain specified basic groups and supergroups to doing something +// A rule to allow all members of certain specified basic groups and supergroups to do something type UserPrivacySettingRuleAllowChatMembers struct { meta // The chat identifiers, total number of chats in all rules must not exceed 20 @@ -60426,7 +63559,7 @@ func (*UserPrivacySettingAllowUnpaidMessages) UserPrivacySettingType() string { // Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting type ReadDatePrivacySettings struct { meta - // True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date + // True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see others' message read date ShowReadDate bool `json:"show_read_date"` } @@ -62339,7 +65472,7 @@ 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 +// 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 accepts 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 type InternalLinkTypeAttachmentMenuBot struct { meta // Target chat to be opened @@ -63254,7 +66387,7 @@ func (internalLinkTypeNewStory *InternalLinkTypeNewStory) UnmarshalJSON(data []b return nil } -// The link is an OAuth link. Call getOauthLinkInfo with the given URL to process the link if the link was received from outside of the application; otherwise, ignore it. After getOauthLinkInfo, show the user confirmation dialog and process it with checkOauthRequestMatchCode, acceptOauthRequest or declineOauthRequest +// The link is an OAuth link. Call getOauthLinkInfo with the given URL to process the link if the link was received from outside of the application; otherwise, ignore it. After getOauthLinkInfo, show the user confirmation dialog and process it with checkOauthRequestMatchCode, acceptOauthRequest, or declineOauthRequest type InternalLinkTypeOauth struct { meta // URL to be passed to getOauthLinkInfo @@ -63462,6 +66595,8 @@ type InternalLinkTypePublicChat struct { DraftText string `json:"draft_text"` // True, if chat profile information screen must be opened; otherwise, the chat itself must be opened OpenProfile bool `json:"open_profile"` + // Token, which allows the current user to send unpaid messages; may be empty if none. If the token isn't empty and the chat is a private chat with a regular user, then call applyUnpaidMessagesToken with the user and the token + UnpaidMessagesToken string `json:"unpaid_messages_token"` } func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) { @@ -63514,7 +66649,7 @@ type InternalLinkTypeRequestManagedBot struct { meta // Username of the bot which will manage the new bot ManagerBotUsername string `json:"manager_bot_username"` - // Suggested username for the bot; always ends with "bot" case-insensitive + // Suggested username for the bot; always ends with "bot" or a string from updateAllowedBotUsernamePremiumSuffixes case-insensitive SuggestedBotUsername string `json:"suggested_bot_username"` // Suggested name for the bot; may be empty if not specified SuggestedBotName string `json:"suggested_bot_name"` @@ -63828,6 +66963,91 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } +// The link is a universal TON Connect link +type InternalLinkTypeTonConnect struct { + meta + // TON Connect version + Version int32 `json:"version"` + // Hex-encoded public X25519 key of the dApp + DappClientId string `json:"dapp_client_id"` + // TON Connect connect request + ConnectRequest *TonConnectConnectRequest `json:"connect_request"` + // Request return strategy; one of "back", "none", or a URL to open + ReturnStrategy string `json:"return_strategy"` + // Embedded RPC request represented as base64url-encoded JSON + RpcRequest string `json:"rpc_request"` + // Identifier to trace the connection request + TraceId string `json:"trace_id"` +} + +func (entity *InternalLinkTypeTonConnect) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeTonConnect + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeTonConnect) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeTonConnect) GetType() string { + return TypeInternalLinkTypeTonConnect +} + +func (*InternalLinkTypeTonConnect) InternalLinkTypeType() string { + return TypeInternalLinkTypeTonConnect +} + +// The link is a link for sending Grams from the user's TON wallet +type InternalLinkTypeTonWalletTransfer struct { + meta + // Chosen receiver of the transfer; may be null if none + Receiver TonWalletTransferReceiver `json:"receiver"` + // The pre-filled amount of TON Grams to send; in the smallest units of the cryptocurrency + GramAmount JsonInt64 `json:"gram_amount"` +} + +func (entity *InternalLinkTypeTonWalletTransfer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeTonWalletTransfer + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeTonWalletTransfer) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeTonWalletTransfer) GetType() string { + return TypeInternalLinkTypeTonWalletTransfer +} + +func (*InternalLinkTypeTonWalletTransfer) InternalLinkTypeType() string { + return TypeInternalLinkTypeTonWalletTransfer +} + +func (internalLinkTypeTonWalletTransfer *InternalLinkTypeTonWalletTransfer) UnmarshalJSON(data []byte) error { + var tmp struct { + Receiver json.RawMessage `json:"receiver"` + GramAmount JsonInt64 `json:"gram_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeTonWalletTransfer.GramAmount = tmp.GramAmount + + fieldReceiver, _ := UnmarshalTonWalletTransferReceiver(tmp.Receiver) + internalLinkTypeTonWalletTransfer.Receiver = fieldReceiver + + return nil +} + // The link is an unknown tg: link. Call getDeepLinkInfo to process the link type InternalLinkTypeUnknownDeepLink struct { meta @@ -63891,6 +67111,8 @@ type InternalLinkTypeUserPhoneNumber struct { DraftText string `json:"draft_text"` // True, if user's profile information screen must be opened; otherwise, the chat itself must be opened OpenProfile bool `json:"open_profile"` + // Token, which allows the current user to send unpaid messages to the user; may be empty if none. If the token isn't empty and the user is found, then call applyUnpaidMessagesToken with the user and the token + UnpaidMessagesToken string `json:"unpaid_messages_token"` } func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { @@ -63918,6 +67140,8 @@ type InternalLinkTypeUserToken struct { meta // The token Token string `json:"token"` + // Token, which allows the current user to send unpaid messages to the user; may be empty if none. If the token isn't empty and the user is found, then call applyUnpaidMessagesToken with the user and the token + UnpaidMessagesToken string `json:"unpaid_messages_token"` } func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) { @@ -63971,7 +67195,7 @@ func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { return TypeInternalLinkTypeVideoChat } -// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot. If the bot is restricted for the current user, then show an error message. Otherwise, call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party applications instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App +// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot. If the bot is restricted for the current user, then show an error message. Otherwise, call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party applications instead of the dialog and ask the user to accept their Terms of service. If the user accepts the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App type InternalLinkTypeWebApp struct { meta // Username of the bot that owns the Web App @@ -66343,6 +69567,31 @@ func (*SuggestedActionViewChecksHint) SuggestedActionType() string { return TypeSuggestedActionViewChecksHint } +// Suggests the user to view a hint about receiving of the first TON wallet transfer +type SuggestedActionViewFirstTonWalletTransferHint struct{ + meta +} + +func (entity *SuggestedActionViewFirstTonWalletTransferHint) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionViewFirstTonWalletTransferHint + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionViewFirstTonWalletTransferHint) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionViewFirstTonWalletTransferHint) GetType() string { + return TypeSuggestedActionViewFirstTonWalletTransferHint +} + +func (*SuggestedActionViewFirstTonWalletTransferHint) SuggestedActionType() string { + return TypeSuggestedActionViewFirstTonWalletTransferHint +} + // Suggests the user to convert specified supergroup to a broadcast group type SuggestedActionConvertToBroadcastGroup struct { meta @@ -66986,6 +70235,35 @@ func (*ProxyTypeMtproto) ProxyTypeType() string { return TypeProxyTypeMtproto } +// A web proxy server. MTProto traffic goes through an HTTPS relay page hosted by the application in a hidden web view; see updateWebProxyCarrierOpened. The proxy server must be a domain name and the port must be 443 +type ProxyTypeWeb struct { + meta + // Base path of the relay on the server, without leading and trailing slashes; may be empty. Consists of 0-128 characters; each "/"-separated segment must match [A-Za-z0-9][A-Za-z0-9_-]* + Path string `json:"path"` + // The MTProto proxy secret in hexadecimal encoding; must be 16 bytes long, optionally prefixed with the byte 0xdd + Secret string `json:"secret"` +} + +func (entity *ProxyTypeWeb) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProxyTypeWeb + + return json.Marshal((*stub)(entity)) +} + +func (*ProxyTypeWeb) GetClass() string { + return ClassProxyType +} + +func (*ProxyTypeWeb) GetType() string { + return TypeProxyTypeWeb +} + +func (*ProxyTypeWeb) ProxyTypeType() string { + return TypeProxyTypeWeb +} + // Contains information about a proxy server added to the list of proxies type AddedProxy struct { meta @@ -67040,6 +70318,222 @@ func (*AddedProxies) GetType() string { return TypeAddedProxies } +// Describes a web proxy carrier: an HTTPS relay page, which carries traffic of a web proxy and must be loaded by the application as the top-level document of a hidden web view. Before loading the page, the application must arrange for an object named carrier.bridge_object_name to be defined in the top-level document whenever its origin is exactly carrier.origin, and in no other document or frame. The object must be read-only and must have two members: a method postMessage(value), which passes an ArrayBuffer or a typed array to processWebProxyCarrierMessage as webProxyCarrierMessageBinary, passes a string as webProxyCarrierMessageText, and rejects any other value; and a property onmessage, which the page sets to a function. The application delivers data to the page by calling that function with an object {data: value}, where value is an ArrayBuffer for binary data and a string for text. Each carrier needs its own web view +type WebProxyCarrier struct { + meta + // Unique identifier of the carrier + Id int32 `json:"id"` + // Identifier of the added proxy that uses the carrier; 0 if the carrier is used by pingProxy or testProxy + ProxyId int32 `json:"proxy_id"` + // The HTTPS URL to load. The URL contains the capability for the proxy and a fragment, which must be kept; the URL must never be logged or shown to the user + Url string `json:"url"` + // Origin of the relay page, for example, "https://proxy.example.com". The web view must not be allowed to navigate to another origin + Origin string `json:"origin"` + // The only path prefix on carrier.origin from which the page may load resources or to which it may send requests, for example, "/" or "/relay/" + PathPrefix string `json:"path_prefix"` + // Name of the object to define in the top-level document; currently, always "TelegramWebProxy" + BridgeObjectName string `json:"bridge_object_name"` + // True, if the carrier is needed only to test the proxy and will be closed after the test. The application may refuse to open such carriers, for example, to avoid creating a web view for every saved proxy + IsTemporary bool `json:"is_temporary"` +} + +func (entity *WebProxyCarrier) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrier + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrier) GetClass() string { + return ClassWebProxyCarrier +} + +func (*WebProxyCarrier) GetType() string { + return TypeWebProxyCarrier +} + +// A string message +type WebProxyCarrierMessageText struct { + meta + // The string + Text string `json:"text"` +} + +func (entity *WebProxyCarrierMessageText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierMessageText + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierMessageText) GetClass() string { + return ClassWebProxyCarrierMessage +} + +func (*WebProxyCarrierMessageText) GetType() string { + return TypeWebProxyCarrierMessageText +} + +func (*WebProxyCarrierMessageText) WebProxyCarrierMessageType() string { + return TypeWebProxyCarrierMessageText +} + +// A binary message, passed as an ArrayBuffer or a typed array +type WebProxyCarrierMessageBinary struct { + meta + // Data of the message + Data []byte `json:"data"` +} + +func (entity *WebProxyCarrierMessageBinary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierMessageBinary + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierMessageBinary) GetClass() string { + return ClassWebProxyCarrierMessage +} + +func (*WebProxyCarrierMessageBinary) GetType() string { + return TypeWebProxyCarrierMessageBinary +} + +func (*WebProxyCarrierMessageBinary) WebProxyCarrierMessageType() string { + return TypeWebProxyCarrierMessageBinary +} + +// The application can't open the carrier, because the platform can't create hidden web views or define the bridge object; TDLib will not retry until the proxy is enabled again +type WebProxyCarrierErrorUnsupported struct{ + meta +} + +func (entity *WebProxyCarrierErrorUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierErrorUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierErrorUnsupported) GetClass() string { + return ClassWebProxyCarrierError +} + +func (*WebProxyCarrierErrorUnsupported) GetType() string { + return TypeWebProxyCarrierErrorUnsupported +} + +func (*WebProxyCarrierErrorUnsupported) WebProxyCarrierErrorType() string { + return TypeWebProxyCarrierErrorUnsupported +} + +// The application can't open the carrier now, for example, because it is in the background; TDLib will request it again after the next call to setNetworkType or after a delay +type WebProxyCarrierErrorPaused struct{ + meta +} + +func (entity *WebProxyCarrierErrorPaused) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierErrorPaused + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierErrorPaused) GetClass() string { + return ClassWebProxyCarrierError +} + +func (*WebProxyCarrierErrorPaused) GetType() string { + return TypeWebProxyCarrierErrorPaused +} + +func (*WebProxyCarrierErrorPaused) WebProxyCarrierErrorType() string { + return TypeWebProxyCarrierErrorPaused +} + +// The page failed to load: a network, TLS, or HTTP error, or a forbidden navigation +type WebProxyCarrierErrorLoadFailed struct { + meta + // The error to be logged; must not contain the URL + Message string `json:"message"` +} + +func (entity *WebProxyCarrierErrorLoadFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierErrorLoadFailed + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierErrorLoadFailed) GetClass() string { + return ClassWebProxyCarrierError +} + +func (*WebProxyCarrierErrorLoadFailed) GetType() string { + return TypeWebProxyCarrierErrorLoadFailed +} + +func (*WebProxyCarrierErrorLoadFailed) WebProxyCarrierErrorType() string { + return TypeWebProxyCarrierErrorLoadFailed +} + +// The web view or its renderer process was terminated, or passing data between the application and the page failed +type WebProxyCarrierErrorTerminated struct{ + meta +} + +func (entity *WebProxyCarrierErrorTerminated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierErrorTerminated + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierErrorTerminated) GetClass() string { + return ClassWebProxyCarrierError +} + +func (*WebProxyCarrierErrorTerminated) GetType() string { + return TypeWebProxyCarrierErrorTerminated +} + +func (*WebProxyCarrierErrorTerminated) WebProxyCarrierErrorType() string { + return TypeWebProxyCarrierErrorTerminated +} + +// The application refused to open a temporary carrier +type WebProxyCarrierErrorRefused struct{ + meta +} + +func (entity *WebProxyCarrierErrorRefused) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebProxyCarrierErrorRefused + + return json.Marshal((*stub)(entity)) +} + +func (*WebProxyCarrierErrorRefused) GetClass() string { + return ClassWebProxyCarrierError +} + +func (*WebProxyCarrierErrorRefused) GetType() string { + return TypeWebProxyCarrierErrorRefused +} + +func (*WebProxyCarrierErrorRefused) WebProxyCarrierErrorType() string { + return TypeWebProxyCarrierErrorRefused +} + // A sticker to be added to a sticker set type NewSticker struct { meta @@ -67699,7 +71193,7 @@ type ChatRevenueAmount struct { BalanceAmount JsonInt64 `json:"balance_amount"` // Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency AvailableAmount JsonInt64 `json:"available_amount"` - // True, if Telegram Stars can be withdrawn now or later + // True, if the cryptocurrency can be withdrawn now or later WithdrawalEnabled bool `json:"withdrawal_enabled"` } @@ -67728,7 +71222,7 @@ type ChatRevenueStatistics struct { RevenueGraph StatisticalGraph `json:"revenue_graph"` // Amount of earned revenue RevenueAmount *ChatRevenueAmount `json:"revenue_amount"` - // Current conversion rate of the cryptocurrency in which revenue is calculated to USD + // Current exchange rate of the cryptocurrency in which revenue is calculated to USD UsdRate float64 `json:"usd_rate"` } @@ -68137,7 +71631,7 @@ func (*ChatRevenueTransactionTypeFragmentRefund) ChatRevenueTransactionTypeType( return TypeChatRevenueTransactionTypeFragmentRefund } -// Contains a chat revenue transactions +// Contains a chat revenue transaction type ChatRevenueTransaction struct { meta // Cryptocurrency in which revenue is calculated @@ -68250,7 +71744,7 @@ type StarRevenueStatistics struct { RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` // Telegram Star revenue status Status *StarRevenueStatus `json:"status"` - // Current conversion rate of a Telegram Star to USD + // Current exchange rate of a Telegram Star to USD UsdRate float64 `json:"usd_rate"` } @@ -68327,7 +71821,7 @@ type GramRevenueStatistics struct { RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` // Amount of earned revenue Status *GramRevenueStatus `json:"status"` - // Current conversion rate of nanogram to USD cents + // Current exchange rate of nanogram to USD cents UsdRate float64 `json:"usd_rate"` } @@ -72803,6 +76297,33 @@ func (*UpdateStoryStealthMode) UpdateType() string { return TypeUpdateStoryStealthMode } +// Lists of suffixes allowed in secondary bot usernames, which can be added additionally to the main username if the bot's owner has a Telegram Premium subscription +type UpdateAllowedBotUsernamePremiumSuffixes struct { + meta + // The list of allowed suffixes + Suffixes []string `json:"suffixes"` +} + +func (entity *UpdateAllowedBotUsernamePremiumSuffixes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAllowedBotUsernamePremiumSuffixes + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAllowedBotUsernamePremiumSuffixes) GetClass() string { + return ClassUpdate +} + +func (*UpdateAllowedBotUsernamePremiumSuffixes) GetType() string { + return TypeUpdateAllowedBotUsernamePremiumSuffixes +} + +func (*UpdateAllowedBotUsernamePremiumSuffixes) UpdateType() string { + return TypeUpdateAllowedBotUsernamePremiumSuffixes +} + // 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 @@ -73326,6 +76847,89 @@ func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) e return nil } +// A web proxy carrier must be opened as described in webProxyCarrier. Messages passed by the page to the bridge object must be passed to processWebProxyCarrierMessage. Failures of the carrier must be reported with reportWebProxyCarrierError +type UpdateWebProxyCarrierOpened struct { + meta + // The carrier + Carrier *WebProxyCarrier `json:"carrier"` +} + +func (entity *UpdateWebProxyCarrierOpened) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebProxyCarrierOpened + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebProxyCarrierOpened) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebProxyCarrierOpened) GetType() string { + return TypeUpdateWebProxyCarrierOpened +} + +func (*UpdateWebProxyCarrierOpened) UpdateType() string { + return TypeUpdateWebProxyCarrierOpened +} + +// Data must be delivered as an ArrayBuffer to the page of a web proxy carrier through the onmessage function of the bridge object, in the order of the updates +type UpdateWebProxyCarrierData struct { + meta + // Identifier of the carrier + CarrierId int32 `json:"carrier_id"` + // The data to deliver + Data []byte `json:"data"` +} + +func (entity *UpdateWebProxyCarrierData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebProxyCarrierData + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebProxyCarrierData) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebProxyCarrierData) GetType() string { + return TypeUpdateWebProxyCarrierData +} + +func (*UpdateWebProxyCarrierData) UpdateType() string { + return TypeUpdateWebProxyCarrierData +} + +// A web proxy carrier must be closed. If the page has passed any message to the bridge object, then the application must deliver the string {"t":"close"} to the page, so that it can end its relay session, and destroy the web view shortly after, for example, in 200 milliseconds; otherwise, the web view must be destroyed immediately. Messages from the carrier received after this update must be ignored +type UpdateWebProxyCarrierClosed struct { + meta + // Identifier of the carrier + CarrierId int32 `json:"carrier_id"` +} + +func (entity *UpdateWebProxyCarrierClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebProxyCarrierClosed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebProxyCarrierClosed) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebProxyCarrierClosed) GetType() string { + return TypeUpdateWebProxyCarrierClosed +} + +func (*UpdateWebProxyCarrierClosed) UpdateType() string { + return TypeUpdateWebProxyCarrierClosed +} + // The freeze state of the current user's account has changed type UpdateFreezeState struct { meta @@ -73643,7 +77247,7 @@ func (updateDefaultPaidReactionType *UpdateDefaultPaidReactionType) UnmarshalJSO // Tags used in Saved Messages or a Saved Messages topic have changed type UpdateSavedMessagesTags struct { meta - // Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed + // Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat have changed SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` // The new tags Tags *SavedMessagesTags `json:"tags"` @@ -73750,6 +77354,114 @@ func (*UpdateOwnedGramCount) UpdateType() string { return TypeUpdateOwnedGramCount } +// The state of the TON wallet of the current user has changed +type UpdateTonWalletState struct { + meta + // The new state of the wallet + State *TonWalletState `json:"state"` +} + +func (entity *UpdateTonWalletState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTonWalletState + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTonWalletState) GetClass() string { + return ClassUpdate +} + +func (*UpdateTonWalletState) GetType() string { + return TypeUpdateTonWalletState +} + +func (*UpdateTonWalletState) UpdateType() string { + return TypeUpdateTonWalletState +} + +// The information about gasless transfers has changed +type UpdateTonWalletGaslessTransfersInfo struct { + meta + // The new information about gasless transfers + Info *TonWalletGaslessTransfersInfo `json:"info"` +} + +func (entity *UpdateTonWalletGaslessTransfersInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTonWalletGaslessTransfersInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTonWalletGaslessTransfersInfo) GetClass() string { + return ClassUpdate +} + +func (*UpdateTonWalletGaslessTransfersInfo) GetType() string { + return TypeUpdateTonWalletGaslessTransfersInfo +} + +func (*UpdateTonWalletGaslessTransfersInfo) UpdateType() string { + return TypeUpdateTonWalletGaslessTransfersInfo +} + +// A session of a TON Connect has changed +type UpdateTonWalletTonConnectSession struct { + meta + // The new state of the session + Session *TonConnectSession `json:"session"` +} + +func (entity *UpdateTonWalletTonConnectSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTonWalletTonConnectSession + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTonWalletTonConnectSession) GetClass() string { + return ClassUpdate +} + +func (*UpdateTonWalletTonConnectSession) GetType() string { + return TypeUpdateTonWalletTonConnectSession +} + +func (*UpdateTonWalletTonConnectSession) UpdateType() string { + return TypeUpdateTonWalletTonConnectSession +} + +// TON Connect sessions must be disconnected in a regular way +type UpdateTonWalletTonConnectSessionDisconnectRequired struct { + meta + // Identifiers of the sessions + SessionIds []JsonInt64 `json:"session_ids"` +} + +func (entity *UpdateTonWalletTonConnectSessionDisconnectRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTonWalletTonConnectSessionDisconnectRequired + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTonWalletTonConnectSessionDisconnectRequired) GetClass() string { + return ClassUpdate +} + +func (*UpdateTonWalletTonConnectSessionDisconnectRequired) GetType() string { + return TypeUpdateTonWalletTonConnectSessionDisconnectRequired +} + +func (*UpdateTonWalletTonConnectSessionDisconnectRequired) UpdateType() string { + return TypeUpdateTonWalletTonConnectSessionDisconnectRequired +} + // The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions type UpdateChatRevenueAmount struct { meta @@ -73887,6 +77599,35 @@ func (*UpdateSpeechRecognitionTrial) UpdateType() string { return TypeUpdateSpeechRecognitionTrial } +// Speech in an audio file was partially recognized. The final result will be returned by the corresponding recognizeSpeechInFile request +type UpdateSpeechRecognitionInFile struct { + meta + // Identifier of the speech recognition as specified in recognizeSpeechInFile + RecognitionId JsonInt64 `json:"recognition_id"` + // Partially recognized text + PartialText string `json:"partial_text"` +} + +func (entity *UpdateSpeechRecognitionInFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSpeechRecognitionInFile + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSpeechRecognitionInFile) GetClass() string { + return ClassUpdate +} + +func (*UpdateSpeechRecognitionInFile) GetType() string { + return TypeUpdateSpeechRecognitionInFile +} + +func (*UpdateSpeechRecognitionInFile) UpdateType() string { + return TypeUpdateSpeechRecognitionInFile +} + // The levels of live story group call messages have changed type UpdateGroupCallMessageLevels struct { meta @@ -74640,6 +78381,226 @@ func (updateNewBusinessCallbackQuery *UpdateNewBusinessCallbackQuery) UnmarshalJ return nil } +// A new incoming widget query; for bots only +type UpdateNewWidgetQuery struct { + meta + // Unique query identifier + Id JsonInt64 `json:"id"` + // Identifier of the user who sent the query + SenderUserId int64 `json:"sender_user_id"` + // Identifier of the chat where the query was sent + ChatId int64 `json:"chat_id"` + // Identifier of the message from which the query originated + MessageId int64 `json:"message_id"` + // Identifier that uniquely corresponds to the chat to which the message was sent + ChatInstance JsonInt64 `json:"chat_instance"` + // Type of the chat to which the message was sent + ChatType string `json:"chat_type"` + // Type of the query + QueryType WidgetQueryType `json:"query_type"` + // Data of the query + Data []byte `json:"data"` + // Identifier of the shared widget from which the query originated; 0 if the widget isn't shared + WidgetId JsonInt64 `json:"widget_id"` + // TON wallet card of the user who sent the query; may be null if none + WalletCard *TonWalletCard `json:"wallet_card"` +} + +func (entity *UpdateNewWidgetQuery) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewWidgetQuery + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewWidgetQuery) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewWidgetQuery) GetType() string { + return TypeUpdateNewWidgetQuery +} + +func (*UpdateNewWidgetQuery) UpdateType() string { + return TypeUpdateNewWidgetQuery +} + +func (updateNewWidgetQuery *UpdateNewWidgetQuery) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SenderUserId int64 `json:"sender_user_id"` + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + ChatInstance JsonInt64 `json:"chat_instance"` + ChatType string `json:"chat_type"` + QueryType json.RawMessage `json:"query_type"` + Data []byte `json:"data"` + WidgetId JsonInt64 `json:"widget_id"` + WalletCard *TonWalletCard `json:"wallet_card"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewWidgetQuery.Id = tmp.Id + updateNewWidgetQuery.SenderUserId = tmp.SenderUserId + updateNewWidgetQuery.ChatId = tmp.ChatId + updateNewWidgetQuery.MessageId = tmp.MessageId + updateNewWidgetQuery.ChatInstance = tmp.ChatInstance + updateNewWidgetQuery.ChatType = tmp.ChatType + updateNewWidgetQuery.Data = tmp.Data + updateNewWidgetQuery.WidgetId = tmp.WidgetId + updateNewWidgetQuery.WalletCard = tmp.WalletCard + + fieldQueryType, _ := UnmarshalWidgetQueryType(tmp.QueryType) + updateNewWidgetQuery.QueryType = fieldQueryType + + return nil +} + +// A new incoming widget query from a message sent via a bot; for bots only +type UpdateNewInlineWidgetQuery struct { + meta + // Unique query identifier + Id JsonInt64 `json:"id"` + // Identifier of the user who sent the query + SenderUserId int64 `json:"sender_user_id"` + // Identifier of the inline message from which the query originated + InlineMessageId string `json:"inline_message_id"` + // Identifier that uniquely corresponds to the chat to which the message was sent + ChatInstance JsonInt64 `json:"chat_instance"` + // Type of the chat to which the message was sent + ChatType string `json:"chat_type"` + // Type of the query + QueryType WidgetQueryType `json:"query_type"` + // Data of the query + Data []byte `json:"data"` + // Identifier of the shared widget from which the query originated; 0 if the widget isn't shared + WidgetId JsonInt64 `json:"widget_id"` + // TON wallet card of the user who sent the query; may be null if none + WalletCard *TonWalletCard `json:"wallet_card"` +} + +func (entity *UpdateNewInlineWidgetQuery) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewInlineWidgetQuery + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewInlineWidgetQuery) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewInlineWidgetQuery) GetType() string { + return TypeUpdateNewInlineWidgetQuery +} + +func (*UpdateNewInlineWidgetQuery) UpdateType() string { + return TypeUpdateNewInlineWidgetQuery +} + +func (updateNewInlineWidgetQuery *UpdateNewInlineWidgetQuery) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SenderUserId int64 `json:"sender_user_id"` + InlineMessageId string `json:"inline_message_id"` + ChatInstance JsonInt64 `json:"chat_instance"` + ChatType string `json:"chat_type"` + QueryType json.RawMessage `json:"query_type"` + Data []byte `json:"data"` + WidgetId JsonInt64 `json:"widget_id"` + WalletCard *TonWalletCard `json:"wallet_card"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewInlineWidgetQuery.Id = tmp.Id + updateNewInlineWidgetQuery.SenderUserId = tmp.SenderUserId + updateNewInlineWidgetQuery.InlineMessageId = tmp.InlineMessageId + updateNewInlineWidgetQuery.ChatInstance = tmp.ChatInstance + updateNewInlineWidgetQuery.ChatType = tmp.ChatType + updateNewInlineWidgetQuery.Data = tmp.Data + updateNewInlineWidgetQuery.WidgetId = tmp.WidgetId + updateNewInlineWidgetQuery.WalletCard = tmp.WalletCard + + fieldQueryType, _ := UnmarshalWidgetQueryType(tmp.QueryType) + updateNewInlineWidgetQuery.QueryType = fieldQueryType + + return nil +} + +// A new incoming widget query from a copy of a shared widget; for bots only +type UpdateNewWidgetCopyQuery struct { + meta + // Unique query identifier + Id JsonInt64 `json:"id"` + // Identifier of the user who sent the query + SenderUserId int64 `json:"sender_user_id"` + // Type of the query + QueryType WidgetQueryType `json:"query_type"` + // Data of the query + Data []byte `json:"data"` + // Identifier of the shared widget from which the query originated + WidgetId JsonInt64 `json:"widget_id"` + // TON wallet card of the user who sent the query; may be null if none + WalletCard *TonWalletCard `json:"wallet_card"` +} + +func (entity *UpdateNewWidgetCopyQuery) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewWidgetCopyQuery + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewWidgetCopyQuery) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewWidgetCopyQuery) GetType() string { + return TypeUpdateNewWidgetCopyQuery +} + +func (*UpdateNewWidgetCopyQuery) UpdateType() string { + return TypeUpdateNewWidgetCopyQuery +} + +func (updateNewWidgetCopyQuery *UpdateNewWidgetCopyQuery) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SenderUserId int64 `json:"sender_user_id"` + QueryType json.RawMessage `json:"query_type"` + Data []byte `json:"data"` + WidgetId JsonInt64 `json:"widget_id"` + WalletCard *TonWalletCard `json:"wallet_card"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewWidgetCopyQuery.Id = tmp.Id + updateNewWidgetCopyQuery.SenderUserId = tmp.SenderUserId + updateNewWidgetCopyQuery.Data = tmp.Data + updateNewWidgetCopyQuery.WidgetId = tmp.WidgetId + updateNewWidgetCopyQuery.WalletCard = tmp.WalletCard + + fieldQueryType, _ := UnmarshalWidgetQueryType(tmp.QueryType) + updateNewWidgetCopyQuery.QueryType = fieldQueryType + + return nil +} + // A new incoming shipping query; for bots only. Only for invoices with flexible price type UpdateNewShippingQuery struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 868d1cb..7d7e415 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -1746,6 +1746,302 @@ func UnmarshalListOfTonTransactionType(dataList []json.RawMessage) ([]TonTransac return list, nil } +func UnmarshalTonCenterApiRequestType(data json.RawMessage) (TonCenterApiRequestType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonCenterApiRequestTypeGet: + return UnmarshalTonCenterApiRequestTypeGet(data) + + case TypeTonCenterApiRequestTypePost: + return UnmarshalTonCenterApiRequestTypePost(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonCenterApiRequestType(dataList []json.RawMessage) ([]TonCenterApiRequestType, error) { + list := []TonCenterApiRequestType{} + + for _, data := range dataList { + entity, err := UnmarshalTonCenterApiRequestType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonWalletTransferReceiver(data json.RawMessage) (TonWalletTransferReceiver, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonWalletTransferReceiverUser: + return UnmarshalTonWalletTransferReceiverUser(data) + + case TypeTonWalletTransferReceiverAddress: + return UnmarshalTonWalletTransferReceiverAddress(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonWalletTransferReceiver(dataList []json.RawMessage) ([]TonWalletTransferReceiver, error) { + list := []TonWalletTransferReceiver{} + + for _, data := range dataList { + entity, err := UnmarshalTonWalletTransferReceiver(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonWalletTransactionState(data json.RawMessage) (TonWalletTransactionState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonWalletTransactionStateSucceeded: + return UnmarshalTonWalletTransactionStateSucceeded(data) + + case TypeTonWalletTransactionStateFailed: + return UnmarshalTonWalletTransactionStateFailed(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonWalletTransactionState(dataList []json.RawMessage) ([]TonWalletTransactionState, error) { + list := []TonWalletTransactionState{} + + for _, data := range dataList { + entity, err := UnmarshalTonWalletTransactionState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonWalletTransactionType(data json.RawMessage) (TonWalletTransactionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonWalletTransactionTypeOnRampDeposit: + return UnmarshalTonWalletTransactionTypeOnRampDeposit(data) + + case TypeTonWalletTransactionTypeTransfer: + return UnmarshalTonWalletTransactionTypeTransfer(data) + + case TypeTonWalletTransactionTypeNftTransfer: + return UnmarshalTonWalletTransactionTypeNftTransfer(data) + + case TypeTonWalletTransactionTypeTelegramGiftTransfer: + return UnmarshalTonWalletTransactionTypeTelegramGiftTransfer(data) + + case TypeTonWalletTransactionTypeKeyChange: + return UnmarshalTonWalletTransactionTypeKeyChange(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonWalletTransactionType(dataList []json.RawMessage) ([]TonWalletTransactionType, error) { + list := []TonWalletTransactionType{} + + for _, data := range dataList { + entity, err := UnmarshalTonWalletTransactionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonConnectRequestState(data json.RawMessage) (TonConnectRequestState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonConnectRequestStatePending: + return UnmarshalTonConnectRequestStatePending(data) + + case TypeTonConnectRequestStateAccepted: + return UnmarshalTonConnectRequestStateAccepted(data) + + case TypeTonConnectRequestStateRejected: + return UnmarshalTonConnectRequestStateRejected(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonConnectRequestState(dataList []json.RawMessage) ([]TonConnectRequestState, error) { + list := []TonConnectRequestState{} + + for _, data := range dataList { + entity, err := UnmarshalTonConnectRequestState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonConnectManifest(data json.RawMessage) (TonConnectManifest, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonConnectManifestPending: + return UnmarshalTonConnectManifestPending(data) + + case TypeTonConnectManifestInfo: + return UnmarshalTonConnectManifestInfo(data) + + case TypeTonConnectManifestFailed: + return UnmarshalTonConnectManifestFailed(data) + + case TypeTonConnectManifestInvalid: + return UnmarshalTonConnectManifestInvalid(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonConnectManifest(dataList []json.RawMessage) ([]TonConnectManifest, error) { + list := []TonConnectManifest{} + + for _, data := range dataList { + entity, err := UnmarshalTonConnectManifest(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonConnectSessionState(data json.RawMessage) (TonConnectSessionState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonConnectSessionStatePending: + return UnmarshalTonConnectSessionStatePending(data) + + case TypeTonConnectSessionStateReady: + return UnmarshalTonConnectSessionStateReady(data) + + case TypeTonConnectSessionStateClosing: + return UnmarshalTonConnectSessionStateClosing(data) + + case TypeTonConnectSessionStateClosed: + return UnmarshalTonConnectSessionStateClosed(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonConnectSessionState(dataList []json.RawMessage) ([]TonConnectSessionState, error) { + list := []TonConnectSessionState{} + + for _, data := range dataList { + entity, err := UnmarshalTonConnectSessionState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTonConnectConnectItem(data json.RawMessage) (TonConnectConnectItem, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTonConnectConnectItemAddress: + return UnmarshalTonConnectConnectItemAddress(data) + + case TypeTonConnectConnectItemProof: + return UnmarshalTonConnectConnectItemProof(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTonConnectConnectItem(dataList []json.RawMessage) ([]TonConnectConnectItem, error) { + list := []TonConnectConnectItem{} + + for _, data := range dataList { + entity, err := UnmarshalTonConnectConnectItem(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalActiveStoryState(data json.RawMessage) (ActiveStoryState, error) { var meta meta @@ -1894,6 +2190,80 @@ func UnmarshalListOfGiveawayPrize(dataList []json.RawMessage) ([]GiveawayPrize, return list, nil } +func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeNotificationSettingsScopePrivateChats: + return UnmarshalNotificationSettingsScopePrivateChats(data) + + case TypeNotificationSettingsScopeGroupChats: + return UnmarshalNotificationSettingsScopeGroupChats(data) + + case TypeNotificationSettingsScopeChannelChats: + return UnmarshalNotificationSettingsScopeChannelChats(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfNotificationSettingsScope(dataList []json.RawMessage) ([]NotificationSettingsScope, error) { + list := []NotificationSettingsScope{} + + for _, data := range dataList { + entity, err := UnmarshalNotificationSettingsScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalReactionNotificationSource(data json.RawMessage) (ReactionNotificationSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReactionNotificationSourceNone: + return UnmarshalReactionNotificationSourceNone(data) + + case TypeReactionNotificationSourceContacts: + return UnmarshalReactionNotificationSourceContacts(data) + + case TypeReactionNotificationSourceAll: + return UnmarshalReactionNotificationSourceAll(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReactionNotificationSource(dataList []json.RawMessage) ([]ReactionNotificationSource, error) { + list := []ReactionNotificationSource{} + + for _, data := range dataList { + entity, err := UnmarshalReactionNotificationSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCommunityMemberStatus(data json.RawMessage) (CommunityMemberStatus, error) { var meta meta @@ -2746,80 +3116,6 @@ func UnmarshalListOfReportSponsoredResult(dataList []json.RawMessage) ([]ReportS return list, nil } -func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeNotificationSettingsScopePrivateChats: - return UnmarshalNotificationSettingsScopePrivateChats(data) - - case TypeNotificationSettingsScopeGroupChats: - return UnmarshalNotificationSettingsScopeGroupChats(data) - - case TypeNotificationSettingsScopeChannelChats: - return UnmarshalNotificationSettingsScopeChannelChats(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfNotificationSettingsScope(dataList []json.RawMessage) ([]NotificationSettingsScope, error) { - list := []NotificationSettingsScope{} - - for _, data := range dataList { - entity, err := UnmarshalNotificationSettingsScope(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalReactionNotificationSource(data json.RawMessage) (ReactionNotificationSource, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeReactionNotificationSourceNone: - return UnmarshalReactionNotificationSourceNone(data) - - case TypeReactionNotificationSourceContacts: - return UnmarshalReactionNotificationSourceContacts(data) - - case TypeReactionNotificationSourceAll: - return UnmarshalReactionNotificationSourceAll(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfReactionNotificationSource(dataList []json.RawMessage) ([]ReactionNotificationSource, error) { - list := []ReactionNotificationSource{} - - for _, data := range dataList { - entity, err := UnmarshalReactionNotificationSource(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalDraftMessageContent(data json.RawMessage) (DraftMessageContent, error) { var meta meta @@ -3432,6 +3728,108 @@ func UnmarshalListOfBuiltInTheme(dataList []json.RawMessage) ([]BuiltInTheme, er return list, nil } +func UnmarshalEmojiType(data json.RawMessage) (EmojiType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmojiTypeRegular: + return UnmarshalEmojiTypeRegular(data) + + case TypeEmojiTypeCustomEmoji: + return UnmarshalEmojiTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmojiType(dataList []json.RawMessage) ([]EmojiType, error) { + list := []EmojiType{} + + for _, data := range dataList { + entity, err := UnmarshalEmojiType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalProfileShareTheme(data json.RawMessage) (ProfileShareTheme, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeProfileShareThemeEmoji: + return UnmarshalProfileShareThemeEmoji(data) + + case TypeProfileShareThemeUpgradedGift: + return UnmarshalProfileShareThemeUpgradedGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfProfileShareTheme(dataList []json.RawMessage) ([]ProfileShareTheme, error) { + list := []ProfileShareTheme{} + + for _, data := range dataList { + entity, err := UnmarshalProfileShareTheme(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputProfileShareTheme(data json.RawMessage) (InputProfileShareTheme, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputProfileShareThemeEmoji: + return UnmarshalInputProfileShareThemeEmoji(data) + + case TypeInputProfileShareThemeUpgradedGift: + return UnmarshalInputProfileShareThemeUpgradedGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputProfileShareTheme(dataList []json.RawMessage) ([]InputProfileShareTheme, error) { + list := []InputProfileShareTheme{} + + for _, data := range dataList { + entity, err := UnmarshalInputProfileShareTheme(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalRichText(data json.RawMessage) (RichText, error) { var meta meta @@ -3483,6 +3881,9 @@ func UnmarshalRichText(data json.RawMessage) (RichText, error) { case TypeRichTextBankCardNumber: return UnmarshalRichTextBankCardNumber(data) + case TypeRichTextTonAddress: + return UnmarshalRichTextTonAddress(data) + case TypeRichTextBotCommand: return UnmarshalRichTextBotCommand(data) @@ -4651,6 +5052,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageStory: return UnmarshalMessageStory(data) + case TypeMessageWidget: + return UnmarshalMessageWidget(data) + case TypeMessageChecklist: return UnmarshalMessageChecklist(data) @@ -4816,6 +5220,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) + case TypeMessageTonWalletTransfer: + return UnmarshalMessageTonWalletTransfer(data) + + case TypeMessageTonConnectRequest: + return UnmarshalMessageTonConnectRequest(data) + case TypeMessageGift: return UnmarshalMessageGift(data) @@ -4840,6 +5250,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageDirectMessagePriceChanged: return UnmarshalMessageDirectMessagePriceChanged(data) + case TypeMessageUnpaidMessagesAllowedByLink: + return UnmarshalMessageUnpaidMessagesAllowedByLink(data) + case TypeMessageChecklistTasksDone: return UnmarshalMessageChecklistTasksDone(data) @@ -5014,6 +5427,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeBankCardNumber: return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeTextEntityTypeTonAddress: + return UnmarshalTextEntityTypeTonAddress(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) @@ -5450,6 +5866,12 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessageChecklist: return UnmarshalInputMessageChecklist(data) + case TypeInputMessageWidget: + return UnmarshalInputMessageWidget(data) + + case TypeInputMessageSharedWidget: + return UnmarshalInputMessageSharedWidget(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -5885,9 +6307,6 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro case TypeInputStoryAreaTypeLocation: return UnmarshalInputStoryAreaTypeLocation(data) - case TypeInputStoryAreaTypeFoundVenue: - return UnmarshalInputStoryAreaTypeFoundVenue(data) - case TypeInputStoryAreaTypePreviousVenue: return UnmarshalInputStoryAreaTypePreviousVenue(data) @@ -7027,6 +7446,43 @@ func UnmarshalListOfCallbackQueryPayload(dataList []json.RawMessage) ([]Callback return list, nil } +func UnmarshalWidgetQueryType(data json.RawMessage) (WidgetQueryType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeWidgetQueryTypeData: + return UnmarshalWidgetQueryTypeData(data) + + case TypeWidgetQueryTypeSignData: + return UnmarshalWidgetQueryTypeSignData(data) + + case TypeWidgetQueryTypeSentTransaction: + return UnmarshalWidgetQueryTypeSentTransaction(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfWidgetQueryType(dataList []json.RawMessage) ([]WidgetQueryType, error) { + list := []WidgetQueryType{} + + for _, data := range dataList { + entity, err := UnmarshalWidgetQueryType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { var meta meta @@ -8328,6 +8784,12 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentGiveaway: return UnmarshalPushMessageContentGiveaway(data) + case TypePushMessageContentTonWalletTransfer: + return UnmarshalPushMessageContentTonWalletTransfer(data) + + case TypePushMessageContentTonConnectRequest: + return UnmarshalPushMessageContentTonConnectRequest(data) + case TypePushMessageContentGift: return UnmarshalPushMessageContentGift(data) @@ -9318,6 +9780,12 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) + case TypeInternalLinkTypeTonConnect: + return UnmarshalInternalLinkTypeTonConnect(data) + + case TypeInternalLinkTypeTonWalletTransfer: + return UnmarshalInternalLinkTypeTonWalletTransfer(data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) @@ -9802,6 +10270,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionViewChecksHint: return UnmarshalSuggestedActionViewChecksHint(data) + case TypeSuggestedActionViewFirstTonWalletTransferHint: + return UnmarshalSuggestedActionViewFirstTonWalletTransferHint(data) + case TypeSuggestedActionConvertToBroadcastGroup: return UnmarshalSuggestedActionConvertToBroadcastGroup(data) @@ -9912,6 +10383,9 @@ func UnmarshalProxyType(data json.RawMessage) (ProxyType, error) { case TypeProxyTypeMtproto: return UnmarshalProxyTypeMtproto(data) + case TypeProxyTypeWeb: + return UnmarshalProxyTypeWeb(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -9931,6 +10405,83 @@ func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { return list, nil } +func UnmarshalWebProxyCarrierMessage(data json.RawMessage) (WebProxyCarrierMessage, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeWebProxyCarrierMessageText: + return UnmarshalWebProxyCarrierMessageText(data) + + case TypeWebProxyCarrierMessageBinary: + return UnmarshalWebProxyCarrierMessageBinary(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfWebProxyCarrierMessage(dataList []json.RawMessage) ([]WebProxyCarrierMessage, error) { + list := []WebProxyCarrierMessage{} + + for _, data := range dataList { + entity, err := UnmarshalWebProxyCarrierMessage(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalWebProxyCarrierError(data json.RawMessage) (WebProxyCarrierError, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeWebProxyCarrierErrorUnsupported: + return UnmarshalWebProxyCarrierErrorUnsupported(data) + + case TypeWebProxyCarrierErrorPaused: + return UnmarshalWebProxyCarrierErrorPaused(data) + + case TypeWebProxyCarrierErrorLoadFailed: + return UnmarshalWebProxyCarrierErrorLoadFailed(data) + + case TypeWebProxyCarrierErrorTerminated: + return UnmarshalWebProxyCarrierErrorTerminated(data) + + case TypeWebProxyCarrierErrorRefused: + return UnmarshalWebProxyCarrierErrorRefused(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfWebProxyCarrierError(dataList []json.RawMessage) ([]WebProxyCarrierError, error) { + list := []WebProxyCarrierError{} + + for _, data := range dataList { + entity, err := UnmarshalWebProxyCarrierError(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { var meta meta @@ -10608,6 +11159,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateAllowedBotUsernamePremiumSuffixes: + return UnmarshalUpdateAllowedBotUsernamePremiumSuffixes(data) + case TypeUpdateTrustedMiniAppBots: return UnmarshalUpdateTrustedMiniAppBots(data) @@ -10656,6 +11210,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateConnectionState: return UnmarshalUpdateConnectionState(data) + case TypeUpdateWebProxyCarrierOpened: + return UnmarshalUpdateWebProxyCarrierOpened(data) + + case TypeUpdateWebProxyCarrierData: + return UnmarshalUpdateWebProxyCarrierData(data) + + case TypeUpdateWebProxyCarrierClosed: + return UnmarshalUpdateWebProxyCarrierClosed(data) + case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) @@ -10698,6 +11261,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateOwnedGramCount: return UnmarshalUpdateOwnedGramCount(data) + case TypeUpdateTonWalletState: + return UnmarshalUpdateTonWalletState(data) + + case TypeUpdateTonWalletGaslessTransfersInfo: + return UnmarshalUpdateTonWalletGaslessTransfersInfo(data) + + case TypeUpdateTonWalletTonConnectSession: + return UnmarshalUpdateTonWalletTonConnectSession(data) + + case TypeUpdateTonWalletTonConnectSessionDisconnectRequired: + return UnmarshalUpdateTonWalletTonConnectSessionDisconnectRequired(data) + case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) @@ -10710,6 +11285,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateSpeechRecognitionInFile: + return UnmarshalUpdateSpeechRecognitionInFile(data) + case TypeUpdateGroupCallMessageLevels: return UnmarshalUpdateGroupCallMessageLevels(data) @@ -10770,6 +11348,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewBusinessCallbackQuery: return UnmarshalUpdateNewBusinessCallbackQuery(data) + case TypeUpdateNewWidgetQuery: + return UnmarshalUpdateNewWidgetQuery(data) + + case TypeUpdateNewInlineWidgetQuery: + return UnmarshalUpdateNewInlineWidgetQuery(data) + + case TypeUpdateNewWidgetCopyQuery: + return UnmarshalUpdateNewWidgetCopyQuery(data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(data) @@ -11036,6 +11623,22 @@ func UnmarshalTextEntities(data json.RawMessage) (*TextEntities, error) { return &resp, err } +func UnmarshalTextRange(data json.RawMessage) (*TextRange, error) { + var resp TextRange + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextRanges(data json.RawMessage) (*TextRanges, error) { + var resp TextRanges + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFormattedText(data json.RawMessage) (*FormattedText, error) { var resp FormattedText @@ -12388,6 +12991,14 @@ func UnmarshalWebAppOpenParameters(data json.RawMessage) (*WebAppOpenParameters, return &resp, err } +func UnmarshalAreaPosition(data json.RawMessage) (*AreaPosition, error) { + var resp AreaPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiftResalePriceStar(data json.RawMessage) (*GiftResalePriceStar, error) { var resp GiftResalePriceStar @@ -13004,6 +13615,14 @@ func UnmarshalUpgradedGiftValueInfo(data json.RawMessage) (*UpgradedGiftValueInf return &resp, err } +func UnmarshalUpgradedGiftDepositInfo(data json.RawMessage) (*UpgradedGiftDepositInfo, error) { + var resp UpgradedGiftDepositInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error) { var resp UpgradeGiftResult @@ -13780,6 +14399,494 @@ func UnmarshalTonTransactions(data json.RawMessage) (*TonTransactions, error) { return &resp, err } +func UnmarshalTonCenterApiRequestTypeGet(data json.RawMessage) (*TonCenterApiRequestTypeGet, error) { + var resp TonCenterApiRequestTypeGet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonCenterApiRequestTypePost(data json.RawMessage) (*TonCenterApiRequestTypePost, error) { + var resp TonCenterApiRequestTypePost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransferReceiverUser(data json.RawMessage) (*TonWalletTransferReceiverUser, error) { + var resp TonWalletTransferReceiverUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransferReceiverAddress(data json.RawMessage) (*TonWalletTransferReceiverAddress, error) { + var resp TonWalletTransferReceiverAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonCenterStreamingApiUrl(data json.RawMessage) (*TonCenterStreamingApiUrl, error) { + var resp TonCenterStreamingApiUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWalletBotBalance(data json.RawMessage) (*WalletBotBalance, error) { + var resp WalletBotBalance + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTonWalletAddress(data json.RawMessage) (*UserTonWalletAddress, error) { + var resp UserTonWalletAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTonWalletAddresses(data json.RawMessage) (*UserTonWalletAddresses, error) { + var resp UserTonWalletAddresses + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletOwnershipProofChallenge(data json.RawMessage) (*TonWalletOwnershipProofChallenge, error) { + var resp TonWalletOwnershipProofChallenge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletOwnershipProof(data json.RawMessage) (*TonWalletOwnershipProof, error) { + var resp TonWalletOwnershipProof + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletSecretPhrase(data json.RawMessage) (*TonWalletSecretPhrase, error) { + var resp TonWalletSecretPhrase + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletGaslessTransfersInfo(data json.RawMessage) (*TonWalletGaslessTransfersInfo, error) { + var resp TonWalletGaslessTransfersInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCurrencyExchangeRate(data json.RawMessage) (*CurrencyExchangeRate, error) { + var resp CurrencyExchangeRate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCurrencyExchangeRates(data json.RawMessage) (*CurrencyExchangeRates, error) { + var resp CurrencyExchangeRates + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampProvider(data json.RawMessage) (*OnRampProvider, error) { + var resp OnRampProvider + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampProviders(data json.RawMessage) (*OnRampProviders, error) { + var resp OnRampProviders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCurrencies(data json.RawMessage) (*Currencies, error) { + var resp Currencies + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampPaymentMethod(data json.RawMessage) (*OnRampPaymentMethod, error) { + var resp OnRampPaymentMethod + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampPaymentAvailability(data json.RawMessage) (*OnRampPaymentAvailability, error) { + var resp OnRampPaymentAvailability + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampPaymentLimits(data json.RawMessage) (*OnRampPaymentLimits, error) { + var resp OnRampPaymentLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampPaymentQuote(data json.RawMessage) (*OnRampPaymentQuote, error) { + var resp OnRampPaymentQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOnRampPaymentSession(data json.RawMessage) (*OnRampPaymentSession, error) { + var resp OnRampPaymentSession + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletState(data json.RawMessage) (*TonWalletState, error) { + var resp TonWalletState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonNftAttribute(data json.RawMessage) (*TonNftAttribute, error) { + var resp TonNftAttribute + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonNft(data json.RawMessage) (*TonNft, error) { + var resp TonNft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonNfts(data json.RawMessage) (*TonNfts, error) { + var resp TonNfts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletCardSticker(data json.RawMessage) (*TonWalletCardSticker, error) { + var resp TonWalletCardSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletCard(data json.RawMessage) (*TonWalletCard, error) { + var resp TonWalletCard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputTonWalletCardSticker(data json.RawMessage) (*InputTonWalletCardSticker, error) { + var resp InputTonWalletCardSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftCollectionNames(data json.RawMessage) (*UpgradedGiftCollectionNames, error) { + var resp UpgradedGiftCollectionNames + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionStateSucceeded(data json.RawMessage) (*TonWalletTransactionStateSucceeded, error) { + var resp TonWalletTransactionStateSucceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionStateFailed(data json.RawMessage) (*TonWalletTransactionStateFailed, error) { + var resp TonWalletTransactionStateFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionTypeOnRampDeposit(data json.RawMessage) (*TonWalletTransactionTypeOnRampDeposit, error) { + var resp TonWalletTransactionTypeOnRampDeposit + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionTypeTransfer(data json.RawMessage) (*TonWalletTransactionTypeTransfer, error) { + var resp TonWalletTransactionTypeTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionTypeNftTransfer(data json.RawMessage) (*TonWalletTransactionTypeNftTransfer, error) { + var resp TonWalletTransactionTypeNftTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionTypeTelegramGiftTransfer(data json.RawMessage) (*TonWalletTransactionTypeTelegramGiftTransfer, error) { + var resp TonWalletTransactionTypeTelegramGiftTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactionTypeKeyChange(data json.RawMessage) (*TonWalletTransactionTypeKeyChange, error) { + var resp TonWalletTransactionTypeKeyChange + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransaction(data json.RawMessage) (*TonWalletTransaction, error) { + var resp TonWalletTransaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransactions(data json.RawMessage) (*TonWalletTransactions, error) { + var resp TonWalletTransactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectRequestStatePending(data json.RawMessage) (*TonConnectRequestStatePending, error) { + var resp TonConnectRequestStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectRequestStateAccepted(data json.RawMessage) (*TonConnectRequestStateAccepted, error) { + var resp TonConnectRequestStateAccepted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectRequestStateRejected(data json.RawMessage) (*TonConnectRequestStateRejected, error) { + var resp TonConnectRequestStateRejected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectManifestPending(data json.RawMessage) (*TonConnectManifestPending, error) { + var resp TonConnectManifestPending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectManifestInfo(data json.RawMessage) (*TonConnectManifestInfo, error) { + var resp TonConnectManifestInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectManifestFailed(data json.RawMessage) (*TonConnectManifestFailed, error) { + var resp TonConnectManifestFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectManifestInvalid(data json.RawMessage) (*TonConnectManifestInvalid, error) { + var resp TonConnectManifestInvalid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessionStatePending(data json.RawMessage) (*TonConnectSessionStatePending, error) { + var resp TonConnectSessionStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessionStateReady(data json.RawMessage) (*TonConnectSessionStateReady, error) { + var resp TonConnectSessionStateReady + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessionStateClosing(data json.RawMessage) (*TonConnectSessionStateClosing, error) { + var resp TonConnectSessionStateClosing + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessionStateClosed(data json.RawMessage) (*TonConnectSessionStateClosed, error) { + var resp TonConnectSessionStateClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectConnectItemAddress(data json.RawMessage) (*TonConnectConnectItemAddress, error) { + var resp TonConnectConnectItemAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectConnectItemProof(data json.RawMessage) (*TonConnectConnectItemProof, error) { + var resp TonConnectConnectItemProof + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectConnectRequest(data json.RawMessage) (*TonConnectConnectRequest, error) { + var resp TonConnectConnectRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectConnectData(data json.RawMessage) (*TonConnectConnectData, error) { + var resp TonConnectConnectData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSession(data json.RawMessage) (*TonConnectSession, error) { + var resp TonConnectSession + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessions(data json.RawMessage) (*TonConnectSessions, error) { + var resp TonConnectSessions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectRequest(data json.RawMessage) (*TonConnectRequest, error) { + var resp TonConnectRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectRequests(data json.RawMessage) (*TonConnectRequests, error) { + var resp TonConnectRequests + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectChallenge(data json.RawMessage) (*TonConnectChallenge, error) { + var resp TonConnectChallenge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonConnectSessionEventId(data json.RawMessage) (*TonConnectSessionEventId, error) { + var resp TonConnectSessionEventId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonWalletTransferResult(data json.RawMessage) (*TonWalletTransferResult, error) { + var resp TonWalletTransferResult + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalActiveStoryStateLive(data json.RawMessage) (*ActiveStoryStateLive, error) { var resp ActiveStoryStateLive @@ -13908,6 +15015,78 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err return &resp, err } +func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { + var resp NotificationSettingsScopePrivateChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSettingsScopeGroupChats(data json.RawMessage) (*NotificationSettingsScopeGroupChats, error) { + var resp NotificationSettingsScopeGroupChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSettingsScopeChannelChats(data json.RawMessage) (*NotificationSettingsScopeChannelChats, error) { + var resp NotificationSettingsScopeChannelChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatNotificationSettings(data json.RawMessage) (*ChatNotificationSettings, error) { + var resp ChatNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalScopeNotificationSettings(data json.RawMessage) (*ScopeNotificationSettings, error) { + var resp ScopeNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionNotificationSourceNone(data json.RawMessage) (*ReactionNotificationSourceNone, error) { + var resp ReactionNotificationSourceNone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionNotificationSourceContacts(data json.RawMessage) (*ReactionNotificationSourceContacts, error) { + var resp ReactionNotificationSourceContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionNotificationSourceAll(data json.RawMessage) (*ReactionNotificationSourceAll, error) { + var resp ReactionNotificationSourceAll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionNotificationSettings(data json.RawMessage) (*ReactionNotificationSettings, error) { + var resp ReactionNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCommunityId(data json.RawMessage) (*CommunityId, error) { var resp CommunityId @@ -13996,6 +15175,38 @@ func UnmarshalCommunityFullInfo(data json.RawMessage) (*CommunityFullInfo, error return &resp, err } +func UnmarshalCommunities(data json.RawMessage) (*Communities, error) { + var resp Communities + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityAddChatRequest(data json.RawMessage) (*CommunityAddChatRequest, error) { + var resp CommunityAddChatRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityAddChatRequests(data json.RawMessage) (*CommunityAddChatRequests, error) { + var resp CommunityAddChatRequests + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberChats(data json.RawMessage) (*CommunityMemberChats, error) { + var resp CommunityMemberChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserRating(data json.RawMessage) (*UserRating, error) { var resp UserRating @@ -15268,78 +16479,6 @@ func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, err return &resp, err } -func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { - var resp NotificationSettingsScopePrivateChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSettingsScopeGroupChats(data json.RawMessage) (*NotificationSettingsScopeGroupChats, error) { - var resp NotificationSettingsScopeGroupChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSettingsScopeChannelChats(data json.RawMessage) (*NotificationSettingsScopeChannelChats, error) { - var resp NotificationSettingsScopeChannelChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatNotificationSettings(data json.RawMessage) (*ChatNotificationSettings, error) { - var resp ChatNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalScopeNotificationSettings(data json.RawMessage) (*ScopeNotificationSettings, error) { - var resp ScopeNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionNotificationSourceNone(data json.RawMessage) (*ReactionNotificationSourceNone, error) { - var resp ReactionNotificationSourceNone - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionNotificationSourceContacts(data json.RawMessage) (*ReactionNotificationSourceContacts, error) { - var resp ReactionNotificationSourceContacts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionNotificationSourceAll(data json.RawMessage) (*ReactionNotificationSourceAll, error) { - var resp ReactionNotificationSourceAll - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionNotificationSettings(data json.RawMessage) (*ReactionNotificationSettings, error) { - var resp ReactionNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalDraftMessageContentText(data json.RawMessage) (*DraftMessageContentText, error) { var resp DraftMessageContentText @@ -16140,6 +17279,70 @@ func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { return &resp, err } +func UnmarshalProfileShareThemeBackdrop(data json.RawMessage) (*ProfileShareThemeBackdrop, error) { + var resp ProfileShareThemeBackdrop + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileShareThemeBackdrops(data json.RawMessage) (*ProfileShareThemeBackdrops, error) { + var resp ProfileShareThemeBackdrops + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiTypeRegular(data json.RawMessage) (*EmojiTypeRegular, error) { + var resp EmojiTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiTypeCustomEmoji(data json.RawMessage) (*EmojiTypeCustomEmoji, error) { + var resp EmojiTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileShareThemeEmoji(data json.RawMessage) (*ProfileShareThemeEmoji, error) { + var resp ProfileShareThemeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileShareThemeUpgradedGift(data json.RawMessage) (*ProfileShareThemeUpgradedGift, error) { + var resp ProfileShareThemeUpgradedGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputProfileShareThemeEmoji(data json.RawMessage) (*InputProfileShareThemeEmoji, error) { + var resp InputProfileShareThemeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputProfileShareThemeUpgradedGift(data json.RawMessage) (*InputProfileShareThemeUpgradedGift, error) { + var resp InputProfileShareThemeUpgradedGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineButton(data json.RawMessage) (*InlineButton, error) { var resp InlineButton @@ -16260,6 +17463,14 @@ func UnmarshalRichTextBankCardNumber(data json.RawMessage) (*RichTextBankCardNum return &resp, err } +func UnmarshalRichTextTonAddress(data json.RawMessage) (*RichTextTonAddress, error) { + var resp RichTextTonAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextBotCommand(data json.RawMessage) (*RichTextBotCommand, error) { var resp RichTextBotCommand @@ -18292,6 +19503,14 @@ func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { return &resp, err } +func UnmarshalMessageWidget(data json.RawMessage) (*MessageWidget, error) { + var resp MessageWidget + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChecklist(data json.RawMessage) (*MessageChecklist, error) { var resp MessageChecklist @@ -18732,6 +19951,22 @@ func UnmarshalMessageGiveawayPrizeStars(data json.RawMessage) (*MessageGiveawayP return &resp, err } +func UnmarshalMessageTonWalletTransfer(data json.RawMessage) (*MessageTonWalletTransfer, error) { + var resp MessageTonWalletTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageTonConnectRequest(data json.RawMessage) (*MessageTonConnectRequest, error) { + var resp MessageTonConnectRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageGift(data json.RawMessage) (*MessageGift, error) { var resp MessageGift @@ -18796,6 +20031,14 @@ func UnmarshalMessageDirectMessagePriceChanged(data json.RawMessage) (*MessageDi return &resp, err } +func UnmarshalMessageUnpaidMessagesAllowedByLink(data json.RawMessage) (*MessageUnpaidMessagesAllowedByLink, error) { + var resp MessageUnpaidMessagesAllowedByLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChecklistTasksDone(data json.RawMessage) (*MessageChecklistTasksDone, error) { var resp MessageChecklistTasksDone @@ -19036,6 +20279,14 @@ func UnmarshalTextEntityTypeBankCardNumber(data json.RawMessage) (*TextEntityTyp return &resp, err } +func UnmarshalTextEntityTypeTonAddress(data json.RawMessage) (*TextEntityTypeTonAddress, error) { + var resp TextEntityTypeTonAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeBold(data json.RawMessage) (*TextEntityTypeBold, error) { var resp TextEntityTypeBold @@ -19772,6 +21023,22 @@ func UnmarshalInputMessageChecklist(data json.RawMessage) (*InputMessageChecklis return &resp, err } +func UnmarshalInputMessageWidget(data json.RawMessage) (*InputMessageWidget, error) { + var resp InputMessageWidget + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageSharedWidget(data json.RawMessage) (*InputMessageSharedWidget, error) { + var resp InputMessageSharedWidget + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { var resp InputMessageForwarded @@ -20300,14 +21567,6 @@ func UnmarshalCurrentWeather(data json.RawMessage) (*CurrentWeather, error) { return &resp, err } -func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { - var resp StoryAreaPosition - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) { var resp StoryAreaTypeLocation @@ -20380,14 +21639,6 @@ func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaT return &resp, err } -func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) { - var resp InputStoryAreaTypeFoundVenue - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) { var resp InputStoryAreaTypePreviousVenue @@ -21460,6 +22711,14 @@ func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecogni return &resp, err } +func UnmarshalSpeechRecognitionLanguages(data json.RawMessage) (*SpeechRecognitionLanguages, error) { + var resp SpeechRecognitionLanguages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessConnection(data json.RawMessage) (*BusinessConnection, error) { var resp BusinessConnection @@ -21844,6 +23103,54 @@ func UnmarshalCallbackQueryAnswer(data json.RawMessage) (*CallbackQueryAnswer, e return &resp, err } +func UnmarshalWidgetQueryWallet(data json.RawMessage) (*WidgetQueryWallet, error) { + var resp WidgetQueryWallet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWidgetQueryTypeData(data json.RawMessage) (*WidgetQueryTypeData, error) { + var resp WidgetQueryTypeData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWidgetQueryTypeSignData(data json.RawMessage) (*WidgetQueryTypeSignData, error) { + var resp WidgetQueryTypeSignData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWidgetQueryTypeSentTransaction(data json.RawMessage) (*WidgetQueryTypeSentTransaction, error) { + var resp WidgetQueryTypeSentTransaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWidgetQueryAnswer(data json.RawMessage) (*WidgetQueryAnswer, error) { + var resp WidgetQueryAnswer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWidgetPublicData(data json.RawMessage) (*WidgetPublicData, error) { + var resp WidgetPublicData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCustomRequestResult(data json.RawMessage) (*CustomRequestResult, error) { var resp CustomRequestResult @@ -23756,6 +25063,22 @@ func UnmarshalPushMessageContentGiveaway(data json.RawMessage) (*PushMessageCont return &resp, err } +func UnmarshalPushMessageContentTonWalletTransfer(data json.RawMessage) (*PushMessageContentTonWalletTransfer, error) { + var resp PushMessageContentTonWalletTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentTonConnectRequest(data json.RawMessage) (*PushMessageContentTonConnectRequest, error) { + var resp PushMessageContentTonConnectRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentGift(data json.RawMessage) (*PushMessageContentGift, error) { var resp PushMessageContentGift @@ -25404,6 +26727,22 @@ func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeThem return &resp, err } +func UnmarshalInternalLinkTypeTonConnect(data json.RawMessage) (*InternalLinkTypeTonConnect, error) { + var resp InternalLinkTypeTonConnect + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeTonWalletTransfer(data json.RawMessage) (*InternalLinkTypeTonWalletTransfer, error) { + var resp InternalLinkTypeTonWalletTransfer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { var resp InternalLinkTypeUnknownDeepLink @@ -26124,6 +27463,14 @@ func UnmarshalSuggestedActionViewChecksHint(data json.RawMessage) (*SuggestedAct return &resp, err } +func UnmarshalSuggestedActionViewFirstTonWalletTransferHint(data json.RawMessage) (*SuggestedActionViewFirstTonWalletTransferHint, error) { + var resp SuggestedActionViewFirstTonWalletTransferHint + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSuggestedActionConvertToBroadcastGroup(data json.RawMessage) (*SuggestedActionConvertToBroadcastGroup, error) { var resp SuggestedActionConvertToBroadcastGroup @@ -26324,6 +27671,14 @@ func UnmarshalProxyTypeMtproto(data json.RawMessage) (*ProxyTypeMtproto, error) return &resp, err } +func UnmarshalProxyTypeWeb(data json.RawMessage) (*ProxyTypeWeb, error) { + var resp ProxyTypeWeb + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAddedProxy(data json.RawMessage) (*AddedProxy, error) { var resp AddedProxy @@ -26340,6 +27695,70 @@ func UnmarshalAddedProxies(data json.RawMessage) (*AddedProxies, error) { return &resp, err } +func UnmarshalWebProxyCarrier(data json.RawMessage) (*WebProxyCarrier, error) { + var resp WebProxyCarrier + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierMessageText(data json.RawMessage) (*WebProxyCarrierMessageText, error) { + var resp WebProxyCarrierMessageText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierMessageBinary(data json.RawMessage) (*WebProxyCarrierMessageBinary, error) { + var resp WebProxyCarrierMessageBinary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierErrorUnsupported(data json.RawMessage) (*WebProxyCarrierErrorUnsupported, error) { + var resp WebProxyCarrierErrorUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierErrorPaused(data json.RawMessage) (*WebProxyCarrierErrorPaused, error) { + var resp WebProxyCarrierErrorPaused + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierErrorLoadFailed(data json.RawMessage) (*WebProxyCarrierErrorLoadFailed, error) { + var resp WebProxyCarrierErrorLoadFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierErrorTerminated(data json.RawMessage) (*WebProxyCarrierErrorTerminated, error) { + var resp WebProxyCarrierErrorTerminated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebProxyCarrierErrorRefused(data json.RawMessage) (*WebProxyCarrierErrorRefused, error) { + var resp WebProxyCarrierErrorRefused + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNewSticker(data json.RawMessage) (*NewSticker, error) { var resp NewSticker @@ -27676,6 +29095,14 @@ func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthM return &resp, err } +func UnmarshalUpdateAllowedBotUsernamePremiumSuffixes(data json.RawMessage) (*UpdateAllowedBotUsernamePremiumSuffixes, error) { + var resp UpdateAllowedBotUsernamePremiumSuffixes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateTrustedMiniAppBots(data json.RawMessage) (*UpdateTrustedMiniAppBots, error) { var resp UpdateTrustedMiniAppBots @@ -27804,6 +29231,30 @@ func UnmarshalUpdateConnectionState(data json.RawMessage) (*UpdateConnectionStat return &resp, err } +func UnmarshalUpdateWebProxyCarrierOpened(data json.RawMessage) (*UpdateWebProxyCarrierOpened, error) { + var resp UpdateWebProxyCarrierOpened + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateWebProxyCarrierData(data json.RawMessage) (*UpdateWebProxyCarrierData, error) { + var resp UpdateWebProxyCarrierData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateWebProxyCarrierClosed(data json.RawMessage) (*UpdateWebProxyCarrierClosed, error) { + var resp UpdateWebProxyCarrierClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateFreezeState(data json.RawMessage) (*UpdateFreezeState, error) { var resp UpdateFreezeState @@ -27916,6 +29367,38 @@ func UnmarshalUpdateOwnedGramCount(data json.RawMessage) (*UpdateOwnedGramCount, return &resp, err } +func UnmarshalUpdateTonWalletState(data json.RawMessage) (*UpdateTonWalletState, error) { + var resp UpdateTonWalletState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateTonWalletGaslessTransfersInfo(data json.RawMessage) (*UpdateTonWalletGaslessTransfersInfo, error) { + var resp UpdateTonWalletGaslessTransfersInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateTonWalletTonConnectSession(data json.RawMessage) (*UpdateTonWalletTonConnectSession, error) { + var resp UpdateTonWalletTonConnectSession + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateTonWalletTonConnectSessionDisconnectRequired(data json.RawMessage) (*UpdateTonWalletTonConnectSessionDisconnectRequired, error) { + var resp UpdateTonWalletTonConnectSessionDisconnectRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatRevenueAmount(data json.RawMessage) (*UpdateChatRevenueAmount, error) { var resp UpdateChatRevenueAmount @@ -27948,6 +29431,14 @@ func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechR return &resp, err } +func UnmarshalUpdateSpeechRecognitionInFile(data json.RawMessage) (*UpdateSpeechRecognitionInFile, error) { + var resp UpdateSpeechRecognitionInFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateGroupCallMessageLevels(data json.RawMessage) (*UpdateGroupCallMessageLevels, error) { var resp UpdateGroupCallMessageLevels @@ -28108,6 +29599,30 @@ func UnmarshalUpdateNewBusinessCallbackQuery(data json.RawMessage) (*UpdateNewBu return &resp, err } +func UnmarshalUpdateNewWidgetQuery(data json.RawMessage) (*UpdateNewWidgetQuery, error) { + var resp UpdateNewWidgetQuery + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewInlineWidgetQuery(data json.RawMessage) (*UpdateNewInlineWidgetQuery, error) { + var resp UpdateNewInlineWidgetQuery + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewWidgetCopyQuery(data json.RawMessage) (*UpdateNewWidgetCopyQuery, error) { + var resp UpdateNewWidgetCopyQuery + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewShippingQuery(data json.RawMessage) (*UpdateNewShippingQuery, error) { var resp UpdateNewShippingQuery @@ -28404,6 +29919,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntities: return UnmarshalTextEntities(data) + case TypeTextRange: + return UnmarshalTextRange(data) + + case TypeTextRanges: + return UnmarshalTextRanges(data) + case TypeFormattedText: return UnmarshalFormattedText(data) @@ -28911,6 +30432,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeWebAppOpenParameters: return UnmarshalWebAppOpenParameters(data) + case TypeAreaPosition: + return UnmarshalAreaPosition(data) + case TypeGiftResalePriceStar: return UnmarshalGiftResalePriceStar(data) @@ -29142,6 +30666,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftValueInfo: return UnmarshalUpgradedGiftValueInfo(data) + case TypeUpgradedGiftDepositInfo: + return UnmarshalUpgradedGiftDepositInfo(data) + case TypeUpgradeGiftResult: return UnmarshalUpgradeGiftResult(data) @@ -29433,6 +30960,189 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactions: return UnmarshalTonTransactions(data) + case TypeTonCenterApiRequestTypeGet: + return UnmarshalTonCenterApiRequestTypeGet(data) + + case TypeTonCenterApiRequestTypePost: + return UnmarshalTonCenterApiRequestTypePost(data) + + case TypeTonWalletTransferReceiverUser: + return UnmarshalTonWalletTransferReceiverUser(data) + + case TypeTonWalletTransferReceiverAddress: + return UnmarshalTonWalletTransferReceiverAddress(data) + + case TypeTonCenterStreamingApiUrl: + return UnmarshalTonCenterStreamingApiUrl(data) + + case TypeWalletBotBalance: + return UnmarshalWalletBotBalance(data) + + case TypeUserTonWalletAddress: + return UnmarshalUserTonWalletAddress(data) + + case TypeUserTonWalletAddresses: + return UnmarshalUserTonWalletAddresses(data) + + case TypeTonWalletOwnershipProofChallenge: + return UnmarshalTonWalletOwnershipProofChallenge(data) + + case TypeTonWalletOwnershipProof: + return UnmarshalTonWalletOwnershipProof(data) + + case TypeTonWalletSecretPhrase: + return UnmarshalTonWalletSecretPhrase(data) + + case TypeTonWalletGaslessTransfersInfo: + return UnmarshalTonWalletGaslessTransfersInfo(data) + + case TypeCurrencyExchangeRate: + return UnmarshalCurrencyExchangeRate(data) + + case TypeCurrencyExchangeRates: + return UnmarshalCurrencyExchangeRates(data) + + case TypeOnRampProvider: + return UnmarshalOnRampProvider(data) + + case TypeOnRampProviders: + return UnmarshalOnRampProviders(data) + + case TypeCurrencies: + return UnmarshalCurrencies(data) + + case TypeOnRampPaymentMethod: + return UnmarshalOnRampPaymentMethod(data) + + case TypeOnRampPaymentAvailability: + return UnmarshalOnRampPaymentAvailability(data) + + case TypeOnRampPaymentLimits: + return UnmarshalOnRampPaymentLimits(data) + + case TypeOnRampPaymentQuote: + return UnmarshalOnRampPaymentQuote(data) + + case TypeOnRampPaymentSession: + return UnmarshalOnRampPaymentSession(data) + + case TypeTonWalletState: + return UnmarshalTonWalletState(data) + + case TypeTonNftAttribute: + return UnmarshalTonNftAttribute(data) + + case TypeTonNft: + return UnmarshalTonNft(data) + + case TypeTonNfts: + return UnmarshalTonNfts(data) + + case TypeTonWalletCardSticker: + return UnmarshalTonWalletCardSticker(data) + + case TypeTonWalletCard: + return UnmarshalTonWalletCard(data) + + case TypeInputTonWalletCardSticker: + return UnmarshalInputTonWalletCardSticker(data) + + case TypeUpgradedGiftCollectionNames: + return UnmarshalUpgradedGiftCollectionNames(data) + + case TypeTonWalletTransactionStateSucceeded: + return UnmarshalTonWalletTransactionStateSucceeded(data) + + case TypeTonWalletTransactionStateFailed: + return UnmarshalTonWalletTransactionStateFailed(data) + + case TypeTonWalletTransactionTypeOnRampDeposit: + return UnmarshalTonWalletTransactionTypeOnRampDeposit(data) + + case TypeTonWalletTransactionTypeTransfer: + return UnmarshalTonWalletTransactionTypeTransfer(data) + + case TypeTonWalletTransactionTypeNftTransfer: + return UnmarshalTonWalletTransactionTypeNftTransfer(data) + + case TypeTonWalletTransactionTypeTelegramGiftTransfer: + return UnmarshalTonWalletTransactionTypeTelegramGiftTransfer(data) + + case TypeTonWalletTransactionTypeKeyChange: + return UnmarshalTonWalletTransactionTypeKeyChange(data) + + case TypeTonWalletTransaction: + return UnmarshalTonWalletTransaction(data) + + case TypeTonWalletTransactions: + return UnmarshalTonWalletTransactions(data) + + case TypeTonConnectRequestStatePending: + return UnmarshalTonConnectRequestStatePending(data) + + case TypeTonConnectRequestStateAccepted: + return UnmarshalTonConnectRequestStateAccepted(data) + + case TypeTonConnectRequestStateRejected: + return UnmarshalTonConnectRequestStateRejected(data) + + case TypeTonConnectManifestPending: + return UnmarshalTonConnectManifestPending(data) + + case TypeTonConnectManifestInfo: + return UnmarshalTonConnectManifestInfo(data) + + case TypeTonConnectManifestFailed: + return UnmarshalTonConnectManifestFailed(data) + + case TypeTonConnectManifestInvalid: + return UnmarshalTonConnectManifestInvalid(data) + + case TypeTonConnectSessionStatePending: + return UnmarshalTonConnectSessionStatePending(data) + + case TypeTonConnectSessionStateReady: + return UnmarshalTonConnectSessionStateReady(data) + + case TypeTonConnectSessionStateClosing: + return UnmarshalTonConnectSessionStateClosing(data) + + case TypeTonConnectSessionStateClosed: + return UnmarshalTonConnectSessionStateClosed(data) + + case TypeTonConnectConnectItemAddress: + return UnmarshalTonConnectConnectItemAddress(data) + + case TypeTonConnectConnectItemProof: + return UnmarshalTonConnectConnectItemProof(data) + + case TypeTonConnectConnectRequest: + return UnmarshalTonConnectConnectRequest(data) + + case TypeTonConnectConnectData: + return UnmarshalTonConnectConnectData(data) + + case TypeTonConnectSession: + return UnmarshalTonConnectSession(data) + + case TypeTonConnectSessions: + return UnmarshalTonConnectSessions(data) + + case TypeTonConnectRequest: + return UnmarshalTonConnectRequest(data) + + case TypeTonConnectRequests: + return UnmarshalTonConnectRequests(data) + + case TypeTonConnectChallenge: + return UnmarshalTonConnectChallenge(data) + + case TypeTonConnectSessionEventId: + return UnmarshalTonConnectSessionEventId(data) + + case TypeTonWalletTransferResult: + return UnmarshalTonWalletTransferResult(data) + case TypeActiveStoryStateLive: return UnmarshalActiveStoryStateLive(data) @@ -29481,6 +31191,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfileAccentColor: return UnmarshalProfileAccentColor(data) + case TypeNotificationSettingsScopePrivateChats: + return UnmarshalNotificationSettingsScopePrivateChats(data) + + case TypeNotificationSettingsScopeGroupChats: + return UnmarshalNotificationSettingsScopeGroupChats(data) + + case TypeNotificationSettingsScopeChannelChats: + return UnmarshalNotificationSettingsScopeChannelChats(data) + + case TypeChatNotificationSettings: + return UnmarshalChatNotificationSettings(data) + + case TypeScopeNotificationSettings: + return UnmarshalScopeNotificationSettings(data) + + case TypeReactionNotificationSourceNone: + return UnmarshalReactionNotificationSourceNone(data) + + case TypeReactionNotificationSourceContacts: + return UnmarshalReactionNotificationSourceContacts(data) + + case TypeReactionNotificationSourceAll: + return UnmarshalReactionNotificationSourceAll(data) + + case TypeReactionNotificationSettings: + return UnmarshalReactionNotificationSettings(data) + case TypeCommunityId: return UnmarshalCommunityId(data) @@ -29514,6 +31251,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCommunityFullInfo: return UnmarshalCommunityFullInfo(data) + case TypeCommunities: + return UnmarshalCommunities(data) + + case TypeCommunityAddChatRequest: + return UnmarshalCommunityAddChatRequest(data) + + case TypeCommunityAddChatRequests: + return UnmarshalCommunityAddChatRequests(data) + + case TypeCommunityMemberChats: + return UnmarshalCommunityMemberChats(data) + case TypeUserRating: return UnmarshalUserRating(data) @@ -29991,33 +31740,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundFileDownloads: return UnmarshalFoundFileDownloads(data) - case TypeNotificationSettingsScopePrivateChats: - return UnmarshalNotificationSettingsScopePrivateChats(data) - - case TypeNotificationSettingsScopeGroupChats: - return UnmarshalNotificationSettingsScopeGroupChats(data) - - case TypeNotificationSettingsScopeChannelChats: - return UnmarshalNotificationSettingsScopeChannelChats(data) - - case TypeChatNotificationSettings: - return UnmarshalChatNotificationSettings(data) - - case TypeScopeNotificationSettings: - return UnmarshalScopeNotificationSettings(data) - - case TypeReactionNotificationSourceNone: - return UnmarshalReactionNotificationSourceNone(data) - - case TypeReactionNotificationSourceContacts: - return UnmarshalReactionNotificationSourceContacts(data) - - case TypeReactionNotificationSourceAll: - return UnmarshalReactionNotificationSourceAll(data) - - case TypeReactionNotificationSettings: - return UnmarshalReactionNotificationSettings(data) - case TypeDraftMessageContentText: return UnmarshalDraftMessageContentText(data) @@ -30318,6 +32040,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThemeSettings: return UnmarshalThemeSettings(data) + case TypeProfileShareThemeBackdrop: + return UnmarshalProfileShareThemeBackdrop(data) + + case TypeProfileShareThemeBackdrops: + return UnmarshalProfileShareThemeBackdrops(data) + + case TypeEmojiTypeRegular: + return UnmarshalEmojiTypeRegular(data) + + case TypeEmojiTypeCustomEmoji: + return UnmarshalEmojiTypeCustomEmoji(data) + + case TypeProfileShareThemeEmoji: + return UnmarshalProfileShareThemeEmoji(data) + + case TypeProfileShareThemeUpgradedGift: + return UnmarshalProfileShareThemeUpgradedGift(data) + + case TypeInputProfileShareThemeEmoji: + return UnmarshalInputProfileShareThemeEmoji(data) + + case TypeInputProfileShareThemeUpgradedGift: + return UnmarshalInputProfileShareThemeUpgradedGift(data) + case TypeInlineButton: return UnmarshalInlineButton(data) @@ -30363,6 +32109,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRichTextBankCardNumber: return UnmarshalRichTextBankCardNumber(data) + case TypeRichTextTonAddress: + return UnmarshalRichTextTonAddress(data) + case TypeRichTextBotCommand: return UnmarshalRichTextBotCommand(data) @@ -31125,6 +32874,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageStory: return UnmarshalMessageStory(data) + case TypeMessageWidget: + return UnmarshalMessageWidget(data) + case TypeMessageChecklist: return UnmarshalMessageChecklist(data) @@ -31290,6 +33042,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) + case TypeMessageTonWalletTransfer: + return UnmarshalMessageTonWalletTransfer(data) + + case TypeMessageTonConnectRequest: + return UnmarshalMessageTonConnectRequest(data) + case TypeMessageGift: return UnmarshalMessageGift(data) @@ -31314,6 +33072,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageDirectMessagePriceChanged: return UnmarshalMessageDirectMessagePriceChanged(data) + case TypeMessageUnpaidMessagesAllowedByLink: + return UnmarshalMessageUnpaidMessagesAllowedByLink(data) + case TypeMessageChecklistTasksDone: return UnmarshalMessageChecklistTasksDone(data) @@ -31404,6 +33165,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeBankCardNumber: return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeTextEntityTypeTonAddress: + return UnmarshalTextEntityTypeTonAddress(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) @@ -31680,6 +33444,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageChecklist: return UnmarshalInputMessageChecklist(data) + case TypeInputMessageWidget: + return UnmarshalInputMessageWidget(data) + + case TypeInputMessageSharedWidget: + return UnmarshalInputMessageSharedWidget(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -31878,9 +33648,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCurrentWeather: return UnmarshalCurrentWeather(data) - case TypeStoryAreaPosition: - return UnmarshalStoryAreaPosition(data) - case TypeStoryAreaTypeLocation: return UnmarshalStoryAreaTypeLocation(data) @@ -31908,9 +33675,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputStoryAreaTypeLocation: return UnmarshalInputStoryAreaTypeLocation(data) - case TypeInputStoryAreaTypeFoundVenue: - return UnmarshalInputStoryAreaTypeFoundVenue(data) - case TypeInputStoryAreaTypePreviousVenue: return UnmarshalInputStoryAreaTypePreviousVenue(data) @@ -32313,6 +34077,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSpeechRecognitionResultError: return UnmarshalSpeechRecognitionResultError(data) + case TypeSpeechRecognitionLanguages: + return UnmarshalSpeechRecognitionLanguages(data) + case TypeBusinessConnection: return UnmarshalBusinessConnection(data) @@ -32457,6 +34224,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallbackQueryAnswer: return UnmarshalCallbackQueryAnswer(data) + case TypeWidgetQueryWallet: + return UnmarshalWidgetQueryWallet(data) + + case TypeWidgetQueryTypeData: + return UnmarshalWidgetQueryTypeData(data) + + case TypeWidgetQueryTypeSignData: + return UnmarshalWidgetQueryTypeSignData(data) + + case TypeWidgetQueryTypeSentTransaction: + return UnmarshalWidgetQueryTypeSentTransaction(data) + + case TypeWidgetQueryAnswer: + return UnmarshalWidgetQueryAnswer(data) + + case TypeWidgetPublicData: + return UnmarshalWidgetPublicData(data) + case TypeCustomRequestResult: return UnmarshalCustomRequestResult(data) @@ -33174,6 +34959,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentGiveaway: return UnmarshalPushMessageContentGiveaway(data) + case TypePushMessageContentTonWalletTransfer: + return UnmarshalPushMessageContentTonWalletTransfer(data) + + case TypePushMessageContentTonConnectRequest: + return UnmarshalPushMessageContentTonConnectRequest(data) + case TypePushMessageContentGift: return UnmarshalPushMessageContentGift(data) @@ -33792,6 +35583,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) + case TypeInternalLinkTypeTonConnect: + return UnmarshalInternalLinkTypeTonConnect(data) + + case TypeInternalLinkTypeTonWalletTransfer: + return UnmarshalInternalLinkTypeTonWalletTransfer(data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) @@ -34062,6 +35859,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionViewChecksHint: return UnmarshalSuggestedActionViewChecksHint(data) + case TypeSuggestedActionViewFirstTonWalletTransferHint: + return UnmarshalSuggestedActionViewFirstTonWalletTransferHint(data) + case TypeSuggestedActionConvertToBroadcastGroup: return UnmarshalSuggestedActionConvertToBroadcastGroup(data) @@ -34137,12 +35937,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxyTypeMtproto: return UnmarshalProxyTypeMtproto(data) + case TypeProxyTypeWeb: + return UnmarshalProxyTypeWeb(data) + case TypeAddedProxy: return UnmarshalAddedProxy(data) case TypeAddedProxies: return UnmarshalAddedProxies(data) + case TypeWebProxyCarrier: + return UnmarshalWebProxyCarrier(data) + + case TypeWebProxyCarrierMessageText: + return UnmarshalWebProxyCarrierMessageText(data) + + case TypeWebProxyCarrierMessageBinary: + return UnmarshalWebProxyCarrierMessageBinary(data) + + case TypeWebProxyCarrierErrorUnsupported: + return UnmarshalWebProxyCarrierErrorUnsupported(data) + + case TypeWebProxyCarrierErrorPaused: + return UnmarshalWebProxyCarrierErrorPaused(data) + + case TypeWebProxyCarrierErrorLoadFailed: + return UnmarshalWebProxyCarrierErrorLoadFailed(data) + + case TypeWebProxyCarrierErrorTerminated: + return UnmarshalWebProxyCarrierErrorTerminated(data) + + case TypeWebProxyCarrierErrorRefused: + return UnmarshalWebProxyCarrierErrorRefused(data) + case TypeNewSticker: return UnmarshalNewSticker(data) @@ -34644,6 +36471,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateAllowedBotUsernamePremiumSuffixes: + return UnmarshalUpdateAllowedBotUsernamePremiumSuffixes(data) + case TypeUpdateTrustedMiniAppBots: return UnmarshalUpdateTrustedMiniAppBots(data) @@ -34692,6 +36522,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateConnectionState: return UnmarshalUpdateConnectionState(data) + case TypeUpdateWebProxyCarrierOpened: + return UnmarshalUpdateWebProxyCarrierOpened(data) + + case TypeUpdateWebProxyCarrierData: + return UnmarshalUpdateWebProxyCarrierData(data) + + case TypeUpdateWebProxyCarrierClosed: + return UnmarshalUpdateWebProxyCarrierClosed(data) + case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) @@ -34734,6 +36573,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateOwnedGramCount: return UnmarshalUpdateOwnedGramCount(data) + case TypeUpdateTonWalletState: + return UnmarshalUpdateTonWalletState(data) + + case TypeUpdateTonWalletGaslessTransfersInfo: + return UnmarshalUpdateTonWalletGaslessTransfersInfo(data) + + case TypeUpdateTonWalletTonConnectSession: + return UnmarshalUpdateTonWalletTonConnectSession(data) + + case TypeUpdateTonWalletTonConnectSessionDisconnectRequired: + return UnmarshalUpdateTonWalletTonConnectSessionDisconnectRequired(data) + case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) @@ -34746,6 +36597,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateSpeechRecognitionInFile: + return UnmarshalUpdateSpeechRecognitionInFile(data) + case TypeUpdateGroupCallMessageLevels: return UnmarshalUpdateGroupCallMessageLevels(data) @@ -34806,6 +36660,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewBusinessCallbackQuery: return UnmarshalUpdateNewBusinessCallbackQuery(data) + case TypeUpdateNewWidgetQuery: + return UnmarshalUpdateNewWidgetQuery(data) + + case TypeUpdateNewInlineWidgetQuery: + return UnmarshalUpdateNewInlineWidgetQuery(data) + + case TypeUpdateNewWidgetCopyQuery: + return UnmarshalUpdateNewWidgetCopyQuery(data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(data) diff --git a/data/td_api.tl b/data/td_api.tl index 16b229d..442ef0e 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -106,14 +106,27 @@ emailAddressResetStateAvailable wait_period:int32 = EmailAddressResetState; emailAddressResetStatePending reset_in:int32 = EmailAddressResetState; -//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity +//@description Represents a part of the text that needs to be formatted in some unusual way +//@offset Offset of the entity, in UTF-16 code units +//@length Length of the entity, in UTF-16 code units +//@type Type of the entity textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; //@description Contains a list of text entities @entities List of text entities textEntities entities:vector = TextEntities; +//@description Describes a part of a text +//@offset Offset of the part, in UTF-16 code units +//@length Length of the part, in UTF-16 code units +textRange offset:int32 length:int32 = TextRange; + +//@description Contains a list of text parts @ranges List of text parts +textRanges ranges:vector = TextRanges; + //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code, PreCode, and DateTime entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other +//-Pre, Code, PreCode, and DateTime entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. +//-Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. +//-All other entities can't contain each other formattedText text:string entities:vector = FormattedText; //@description Describes a message with rich formatting @@ -176,7 +189,10 @@ textCompositionStyleExample source_text:formattedText result_text:formattedText textCompositionStyle name:string custom_emoji_id:int64 title:string is_custom:Bool is_creator:Bool install_count:int32 prompt:string creator_user_id:int53 english_example:textCompositionStyleExample = TextCompositionStyle; -//@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 +//@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; @@ -220,13 +236,17 @@ authorizationStateWaitEmailAddress allow_apple_id:Bool allow_google_id:Bool = Au //@email_address_reset_state Reset state of the email address; may be null if the email address can't be reset authorizationStateWaitEmailCode allow_apple_id:Bool allow_google_id:Bool code_info:emailAddressAuthenticationCodeInfo email_address_reset_state:EmailAddressResetState = AuthorizationState; -//@description TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code @code_info Information about the authorization code that was sent +//@description TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code +//@code_info Information about the authorization code that was sent authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState; -//@description The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link @link A tg:// URL for the QR code. The link will be updated frequently +//@description The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link +//@link A tg:// URL for the QR code. The link will be updated frequently authorizationStateWaitOtherDeviceConfirmation link:string = AuthorizationState; -//@description The user is unregistered and needs to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data @terms_of_service Telegram terms of service +//@description The user is unregistered and needs to accept terms of service and enter their first name and last name to finish registration. +//-Call registerUser to accept the terms of service and provide the data +//@terms_of_service Telegram terms of service authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState; //@description The user has been authorized, but needs to enter a 2-step verification password to start using the application. @@ -276,7 +296,9 @@ passwordState has_password:Bool password_hint:string has_recovery_email_address: recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress; -//@description Returns information about the availability of a temporary password, which can be used for payments @has_password True, if a temporary password is available @valid_for Time left before the temporary password expires, in seconds +//@description Contains information about the availability of a temporary password, which can be used for payments and withdrawal of upgraded gifts +//@has_password True, if a temporary password is available +//@valid_for Time left before the temporary password expires, in seconds temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordState; @@ -294,7 +316,8 @@ localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_ //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. //-If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. +//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation +//-process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. //-Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) @@ -340,7 +363,10 @@ inputFileGenerated original_path:string conversion:string expected_size:int53 = //@progressive_sizes Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector = PhotoSize; -//@description Thumbnail image of a very poor quality and low resolution @width Thumbnail width, usually doesn't exceed 40 @height Thumbnail height, usually doesn't exceed 40 @data The thumbnail in JPEG format +//@description Thumbnail image of a very poor quality and low resolution +//@width Thumbnail width, usually doesn't exceed 40 +//@height Thumbnail height, usually doesn't exceed 40 +//@data The thumbnail in JPEG format minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; @@ -436,7 +462,8 @@ stickerFullTypeMask mask_position:maskPosition = StickerFullType; stickerFullTypeCustomEmoji custom_emoji_id:int64 needs_repainting:Bool = StickerFullType; -//@description Represents a closed vector path. The path begins at the end point of the last command. The coordinate system origin is in the upper-left corner @commands List of vector path commands +//@description Represents a closed vector path. The path begins at the end point of the last command. The coordinate system origin is in the upper-left corner +//@commands List of vector path commands closedVectorPath commands:vector = ClosedVectorPath; //@description Represents outline of an image @paths The list of closed vector paths @@ -630,7 +657,8 @@ voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_resu //@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none //@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; +//@is_regular_emoji True, if the emoji is a regular emoji +animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file is_regular_emoji:Bool = AnimatedEmoji; //@description Describes a contact of a user //@phone_number Phone number of the user @@ -703,7 +731,7 @@ webApp short_name:string title:string description:string photo:photo animation:a //@allows_revoting True, if the poll can be answered multiple times //@members_only True, if only the users that are members of the chat for more than a day will be able to vote //@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll -//@option_order The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed +//@option_order The list of 0-based poll option identifiers in which the options of the poll must be shown; empty if the order of options must not be changed //@type Type of the poll //@open_period Amount of time the poll will be active after creation, in seconds //@close_date Point in time (Unix timestamp) when the poll will automatically be closed @@ -741,7 +769,9 @@ background id:int64 is_default:Bool is_dark:Bool name:string document:document t //@description Contains a list of backgrounds @backgrounds A list of backgrounds backgrounds backgrounds:vector = Backgrounds; -//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background +//@description Describes a background set for a specific chat +//@background The background +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background chatBackground background:background dark_theme_dimming:int32 = ChatBackground; @@ -804,6 +834,7 @@ userTypeDeleted = UserType; //@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 +//@has_topic_sidebar True, if the bot has topics, which are shown in a sidebar //@allows_users_to_create_topics True, if users can create and delete topics in the chat with the bot //@can_manage_bots True, if the bot can manage other bots //@is_inline True, if the bot supports inline queries @@ -814,9 +845,10 @@ userTypeDeleted = UserType; //@can_connect_to_business True, if the bot supports connection to user accounts for chat automation //@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 has_topics:Bool allows_users_to_create_topics:Bool can_manage_bots:Bool is_inline:Bool inline_query_placeholder:string supports_guest_queries:Bool is_guard:Bool 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 has_topic_sidebar:Bool allows_users_to_create_topics:Bool can_manage_bots:Bool is_inline:Bool inline_query_placeholder:string supports_guest_queries:Bool is_guard:Bool 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 +//@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; @@ -850,7 +882,7 @@ botVerificationParameters icon_custom_emoji_id:int64 organization_name:string de //@description Describes verification status provided by a bot //@bot_user_id Identifier of the bot that provided the verification //@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign -//@custom_description Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities +//@custom_description Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, TonAddress, Url, and EmailAddress entities botVerification bot_user_id:int53 icon_custom_emoji_id:int64 custom_description:formattedText = BotVerification; //@description Contains information about verification status of a chat or a user @@ -922,7 +954,7 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@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 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_sell_gifts True, if the bot can sell or delete 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 //@can_transfer_stars True, if the bot can transfer Telegram Stars received by the business account to account of the bot, or use them to upgrade and transfer gifts @@ -1024,7 +1056,7 @@ animatedChatPhoto length:int32 file:file main_frame_timestamp:double = AnimatedC //@id Unique photo identifier //@added_date Point in time (Unix timestamp) when the photo has been added //@minithumbnail Photo minithumbnail; may be null -//@sizes Available variants of the photo in JPEG format, in different size +//@sizes Available variants of the photo in JPEG format, in different sizes //@animation A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null //@small_animation A small (160x160) animated variant of the photo in MPEG4 format; may be null even if the big animation is available //@sticker Sticker-based version of the chat photo; may be null @@ -1155,6 +1187,16 @@ mainWebApp url:webAppUrl mode:WebAppOpenMode = MainWebApp; webAppOpenParameters theme:themeParameters application_name:string mode:WebAppOpenMode = WebAppOpenParameters; +//@description Describes position of a rectangle area on a story media or a TON wallet card +//@x_percentage The abscissa of the rectangle's center, as a percentage of the media or the card width +//@y_percentage The ordinate of the rectangle's center, as a percentage of the media or the card height +//@width_percentage The width of the rectangle, as a percentage of the media or the card width +//@height_percentage The height of the rectangle, as a percentage of the media or the card height +//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 +//@corner_radius_percentage The radius of the rectangle corner rounding, as a percentage of the media or the card width +areaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double corner_radius_percentage:double = AreaPosition; + + //@class GiftResalePrice @description Describes price of a resold gift //@description Describes price of a resold gift in Telegram Stars @@ -1317,7 +1359,7 @@ affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_ affiliateInfo commission_per_mille:int32 affiliate_chat_id:int53 star_amount:starAmount = AffiliateInfo; //@description Describes a found affiliate program -//@bot_user_id User identifier of the bot created the program +//@bot_user_id User identifier of the bot that created the program //@info Information about the affiliate program foundAffiliateProgram bot_user_id:int53 info:affiliateProgramInfo = FoundAffiliateProgram; @@ -1329,7 +1371,7 @@ foundAffiliatePrograms total_count:int32 programs:vector //@description Describes an affiliate program that was connected to an affiliate //@url The link that can be used to refer users if the program is still active -//@bot_user_id User identifier of the bot created the program +//@bot_user_id User identifier of the bot that created the program //@parameters The parameters of the affiliate program //@connection_date Point in time (Unix timestamp) when the affiliate program was connected //@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore @@ -1504,7 +1546,7 @@ upgradedGiftOriginTransfer = UpgradedGiftOrigin; //@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 +//@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 upgrade of the gift, which has been completed @@ -1596,7 +1638,7 @@ upgradedGiftColors id:int64 model_custom_emoji_id:int64 symbol_custom_emoji_id:i //-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 by all users; may be null if not limited -//@background Background of the gift +//@background Background of the gift; may be null if the gift has no background //@first_send_date Point in time (Unix timestamp) when the gift was sent for the first time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was sent 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 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; @@ -1620,6 +1662,7 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@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 //@gift_address Address of the gift NFT 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 +//@can_be_ton_wallet_card_background True, if the gift NFT can be used as background_nft_address in setTonWalletCardStickers //@model Model of the upgraded gift //@symbol Symbol of the upgraded gift //@backdrop Backdrop of the upgraded gift @@ -1631,7 +1674,7 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@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 //@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; +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 can_be_ton_wallet_card_background:Bool 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 @@ -1650,6 +1693,13 @@ upgradedGift id:int64 regular_gift_id:int64 publisher_chat_id:int53 title:string //@fragment_url The HTTPS link to the Fragment for the gift; may be empty if there are no such gifts being sold on Fragment upgradedGiftValueInfo currency:string value:int53 is_value_average:Bool initial_sale_date:int32 initial_sale_star_count:int53 initial_sale_price:int53 last_sale_date:int32 last_sale_price:int53 is_last_sale_on_fragment:Bool minimum_price:int53 average_sale_price:int53 telegram_listed_gift_count:int32 fragment_listed_gift_count:int32 fragment_url:string = UpgradedGiftValueInfo; +//@description Contains information needed to deposit an upgraded gift from the TON wallet of the current user to a Telegram account. +//-The gift must be transferred by an internal message from the wallet to nft_address with gram_amount attached and with payload as the message body +//@nft_address Address in TON blockchain to which the message must be sent +//@payload Body of the NFT transfer message +//@gram_amount The amount of TON Grams that must be attached to the message to cover fees, in the smallest units of the cryptocurrency; excess amount will be returned to the wallet +upgradedGiftDepositInfo nft_address:string payload:bytes gram_amount:int64 = UpgradedGiftDepositInfo; + //@description Contains result of gift upgrading //@gift The upgraded gift //@received_gift_id Unique identifier of the received gift for the current user @@ -1715,7 +1765,7 @@ upgradedGiftModelCount model:upgradedGiftModel total_count:int32 = UpgradedGiftM //@description Describes a symbol shown on the pattern of an upgraded gift @symbol The symbol @total_count Total number of gifts with the symbol upgradedGiftSymbolCount symbol:upgradedGiftSymbol total_count:int32 = UpgradedGiftSymbolCount; -//@description Describes a backdrop of an upgraded gift @backdrop The backdrop @total_count Total number of gifts with the symbol +//@description Describes a backdrop of an upgraded gift @backdrop The backdrop @total_count Total number of gifts with the backdrop upgradedGiftBackdropCount backdrop:upgradedGiftBackdrop total_count:int32 = UpgradedGiftBackdropCount; @@ -1770,11 +1820,12 @@ sentGiftUpgraded gift:upgradedGift = SentGift; //@sender_id Identifier of a user or a chat that sent the gift; may be null if unknown //@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 -//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them +//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone is able to see them //@is_saved True, if the gift is displayed on the chat's profile page; only for the receiver of the gift //@is_pinned True, if the gift is pinned to the top of the chat's profile page //@can_be_upgraded True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift //@can_be_transferred True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift +//@can_be_deleted True, if the gift is a regular gift that can be deleted using deleteGift; only for the receiver of the gift //@was_refunded True, if the gift was refunded and isn't available anymore //@date Point in time (Unix timestamp) when the gift was sent //@gift The gift @@ -1789,7 +1840,7 @@ sentGiftUpgraded gift:upgradedGift = SentGift; //@export_date Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift //@prepaid_upgrade_hash If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade //@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; +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 can_be_deleted: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 @@ -1800,14 +1851,14 @@ receivedGifts total_count:int32 gifts:vector are_notifications_ena //@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 +//-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 crafts 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 +//-for the cases when 1-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; @@ -1877,7 +1928,7 @@ auctionStateActive start_date:int32 end_date:int32 min_bid:int53 bid_levels:vect 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 +//@description Represents auction state of a gift //@gift The gift //@state Auction state of the gift giftAuctionState gift:gift state:AuctionState = GiftAuctionState; @@ -1979,13 +2030,13 @@ starTransactionTypeBotInvoiceSale user_id:int53 product_info:productInfo invoice //@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 +//@product_info Information about the bought subscription; may be null if no information about the subscription is available starTransactionTypeBotSubscriptionPurchase user_id:int53 subscription_period:int32 product_info:productInfo = StarTransactionType; //@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 +//@product_info Information about the bought subscription; may be null if no information about the subscription is available //@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; @@ -2003,16 +2054,22 @@ starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int //@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 +//@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 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 +//@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 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 +//@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 @@ -2021,10 +2078,14 @@ starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; //@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; relevant 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; relevant for regular users only @user_id Identifier of the user who 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; relevant for regular users only @@ -2050,7 +2111,9 @@ starTransactionTypeChannelPaidReactionReceive user_id:int53 message_id:int53 = S //@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; relevant 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; relevant for regular users, supergroup and channel chats only @@ -2069,7 +2132,7 @@ starTransactionTypePaidGroupCallMessageSend chat_id:int53 = StarTransactionType; //@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 +//@description The transaction is a sending of a paid group call 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 @@ -2172,6 +2235,351 @@ tonTransaction id:string gram_amount:int53 is_refund:Bool date:int32 type:TonTra tonTransactions gram_amount:int53 transactions:vector next_offset:string = TonTransactions; +//@class TonCenterApiRequestType @description Describes a type of request to the TON Center API + +//@description A GET request @query URL-encoded query of the request +tonCenterApiRequestTypeGet query:string = TonCenterApiRequestType; + +//@description A POST request @payload Payload of the request +tonCenterApiRequestTypePost payload:string = TonCenterApiRequestType; + + +//@class TonWalletTransferReceiver @description Represents expected receiver of a TON wallet transfer + +//@description The receiver is specified by its username @username Username of the user. Use searchPublicChat to find the user, check that it is a regular user, +//-and then use createUserTonWallet to get information about the user's TON wallet +tonWalletTransferReceiverUser username:string = TonWalletTransferReceiver; + +//@description The receiver is specified by its address @address Address of the receiver. Use getAddressTonWallet to get information about the user's TON wallet +tonWalletTransferReceiverAddress address:string = TonWalletTransferReceiver; + + +//@description Contains an HTTP URL for TON Center Streaming API @url The URL @expires_in Time after which the URL expires +tonCenterStreamingApiUrl url:string expires_in:int32 = TonCenterStreamingApiUrl; + +//@description Describes balance of the current user in the bot https://t.me/walt +//@has_balance True, if the user has positive TON Gram balance +//@url The URL to open to launch the bot; may be empty if none +walletBotBalance has_balance:Bool url:string = WalletBotBalance; + +//@description Contains TON wallet address of a user +//@user_id Identifier of the user; 0 if unknown +//@wallet_address Address of the user's wallet in the TON blockchain +//@public_key Public key of the user +userTonWalletAddress user_id:int53 wallet_address:string public_key:bytes = UserTonWalletAddress; + +//@description Represents a list of TON wallet addresses of users @addresses A list of TON wallet addresses +userTonWalletAddresses addresses:vector = UserTonWalletAddresses; + +//@description Represents a challenge for TON wallet ownership proof +//@payload Payload of the challenge +//@domain Domain of the proof requester +tonWalletOwnershipProofChallenge payload:string domain:string = TonWalletOwnershipProofChallenge; + +//@description Represents a proof of TON wallet ownership +//@public_key Public key of the wallet +//@timestamp The current UNIX timestamp which was used to create the proof +//@signature The signature proving the ownership +tonWalletOwnershipProof public_key:bytes timestamp:int32 signature:bytes = TonWalletOwnershipProof; + +//@description Contains the secret phrase of a TON wallet @secret_phrase The secret phrase as a space separated list of words +tonWalletSecretPhrase secret_phrase:string = TonWalletSecretPhrase; + +//@description Represents state of gasless transfers for the current user +//@left_count Number of left gasless transfers. The daily available number of gasless transfers is available as getOption("ton_wallet_gasless_transfer_daily_count_max") +//@reset_date Point in time (Unix timestamp) when the number of left transfers will be reset; 0 if never +//@relayer_address Address of the relayer for gasless transfers; may be empty if unavailable +tonWalletGaslessTransfersInfo left_count:int32 reset_date:int32 relayer_address:string = TonWalletGaslessTransfersInfo; + +//@description Describes exchange rate of a currency to USD +//@currency ISO 4217 currency code of the payment currency +//@rate Exchange rate of the currency to USD +currencyExchangeRate currency:string rate:double = CurrencyExchangeRate; + +//@description Represents a list of currency exchange rates @rates A list of currency exchange rates +currencyExchangeRates rates:vector = CurrencyExchangeRates; + +//@description Describes an on-ramp provider +//@id Unique identifier of the provider +//@name Name of the provider +//@cryptocurrencies List of cryptocurrencies supported by the provider +//@supports_base_currencies True, if the provider supports base currencies and can be used in the method getOnRampProviderBaseCurrencies +//@supports_limits True, if the provider supports limits retrieval using the method getOnRampPaymentLimits +//@supports_quote True, if the provider supports quote retrieval using the method getOnRampPaymentQuote +onRampProvider id:string name:string cryptocurrencies:vector supports_base_currencies:Bool supports_limits:Bool supports_quote:Bool = OnRampProvider; + +//@description Represents a list of on-ramp providers @providers A list of providers +onRampProviders providers:vector = OnRampProviders; + +//@description Represents a list of currencies @currencies A list of ISO 4217 currency codes +currencies currencies:vector = Currencies; + +//@description Describes a payment method of an on-ramp provider +//@name Name of the method +//@is_available True, if the method is available to the user +onRampPaymentMethod name:string is_available:Bool = OnRampPaymentMethod; + +//@description Describes availability of cryptocurrency purchase through an on-ramp provider +//@is_allowed True, if the current user can use the provider +//@is_purchase_allowed True, if the current user can purchase through the provider +//@methods The list of available payment methods +//@country_code A two-letter ISO 3166-1 alpha-2 country code of the current user's country +//@state Code of the state of the current user; may be empty if unknown +onRampPaymentAvailability is_allowed:Bool is_purchase_allowed:Bool methods:vector country_code:string state:string = OnRampPaymentAvailability; + +//@description Describes limits for an on-ramp purchase +//@payment_method The payment method to be used +//@base_currency_min_amount The minimum allowed amount of the base currency +//@base_currency_max_amount The maximum allowed amount of the base currency +//@cryptocurrency_min_amount The minimum allowed amount of the bought cryptocurrency +//@cryptocurrency_max_amount The maximum allowed amount of the bought cryptocurrency +onRampPaymentLimits payment_method:string base_currency_min_amount:string base_currency_max_amount:string cryptocurrency_min_amount:string cryptocurrency_max_amount:string = OnRampPaymentLimits; + +//@description Describes a quote for an on-ramp purchase +//@payment_method The payment method to be used +//@expiration_date Point in time (Unix timestamp) when the quote will expire +//@base_currency_amount Paid amount of the base currency +//@cryptocurrency_amount Purchased amount of the cryptocurrency +//@cryptocurrency_price The price of the cryptocurrency +//@fee_amount Fee amount +//@extra_fee_amount Extra fee amount +//@network_fee_amount Network fee amount +//@total_amount Total paid amount +onRampPaymentQuote payment_method:string expiration_date:int32 base_currency_amount:string cryptocurrency_amount:string cryptocurrency_price:string fee_amount:string extra_fee_amount:string network_fee_amount:string total_amount:string = OnRampPaymentQuote; + +//@description Describes a session for an on-ramp purchase +//@session_id Identifier of the session +//@expiration_date Point in time (Unix timestamp) when the session will expire +//@url HTTPS URL to be opened in a WebView to complete the purchase +onRampPaymentSession session_id:string expiration_date:int32 url:string = OnRampPaymentSession; + +//@description Describes state of the wallet of the current user in the TON blockchain +//@address Address of the wallet; may be empty if none +//@public_key Public key of the wallet; may be empty if none +//@gram_amount The total amount of owned TON Grams, in the smallest units of the cryptocurrency +//@is_being_created True, if the wallet is being created +//@is_backup_enabled True, if backup for the wallet key is enabled +//@can_enable_backup True, if the user can enable backup for the wallet key +//@can_export_phrase True, if the wallet key can be exported using getTonWalletSecretPhrase +tonWalletState address:string public_key:bytes gram_amount:int64 is_being_created:Bool is_backup_enabled:Bool can_enable_backup:Bool can_export_phrase:Bool = TonWalletState; + +//@description Represents an attribute of an NFT in the TON blockchain +//@trait_type Trait type +//@value Value of the attribute +tonNftAttribute trait_type:string value:string = TonNftAttribute; + +//@description Represents an NFT in the TON blockchain +//@collection_address Address of the collection to which the NFT belongs; may be empty if unknown +//@address Address of the NFT +//@owner_address Address of the owner of the NFT +//@index Index of the NFT among all NFTs from the collection as a decimal number +//@name Name of the NFT +//@param_description Description of the NFT +//@image Image of the NFT; may be null if none +//@thumbnail Thumbnail of the NFT; may be null if none +//@content Content of the NFT; may be null if none +//@sticker Sticker of the NFT; may be null if none +//@attributes Attributes of the NFT +//@extra Additional data about the NFT; may be null if none +//@gift The upgraded gift corresponding to the NFT; may be null if none. Information about the owner of the gift isn't available. +//-Original details of the gift are available only to the sender and the receiver of the original gift +tonNft collection_address:string address:string owner_address:string index:string name:string description:string image:photoSize thumbnail:photoSize content:document sticker:sticker attributes:vector extra:JsonValue gift:upgradedGift = TonNft; + +//@description Represents a list of TON NFTs +//@nfts List of NFTs +//@next_offset The offset for the next request. If empty, then there are no more results +tonNfts nfts:vector next_offset:string = TonNfts; + +//@description Describes a sticker on a TON wallet card +//@position Position of the sticker on the card +//@nft The NFT shown as the sticker. If nft.gift is non-null, then it is enough to draw the sticker and there is no need to download the media of the NFT +tonWalletCardSticker position:areaPosition nft:tonNft = TonWalletCardSticker; + +//@description Describes a TON wallet card, which is shown on the profile page of a user to everyone +//@address Address of the wallet +//@gram_amount Balance of the wallet, in the smallest units of the cryptocurrency; may be slightly outdated +//@stickers Stickers placed on the card +//@background_nft_address Address of the NFT of one of the stickers, whose colors must be used for the card background; may be empty if the default background must be used +tonWalletCard address:string gram_amount:int64 stickers:vector background_nft_address:string = TonWalletCard; + +//@description Describes a sticker to be placed on the TON wallet card of the current user +//@position Position of the sticker on the card +//@nft_address Address of an NFT owned by the wallet, which is an upgraded gift; use getTonWalletNfts to get the list of owned NFTs +inputTonWalletCardSticker position:areaPosition nft_address:string = InputTonWalletCardSticker; + +//@description Contains a list of names of upgraded gift collections. The name of the collection of an upgraded gift is the part of upgradedGift.name before the last "-" +//@names The names +upgradedGiftCollectionNames names:vector = UpgradedGiftCollectionNames; + + +//@class TonWalletTransactionState @description Describes state of a transaction with a TON wallet + +//@description The transaction succeeded @tx_hash Hash of the transaction +tonWalletTransactionStateSucceeded tx_hash:string = TonWalletTransactionState; + +//@description The transaction failed +tonWalletTransactionStateFailed = TonWalletTransactionState; + + +//@class TonWalletTransactionType @description Describes type of transaction with a TON wallet + +//@description The transaction is a deposit from an on-ramp provider +//@amount The amount of received cryptocurrency, in the smallest units of the cryptocurrency +//@provider_name Name of the on-ramp provider +tonWalletTransactionTypeOnRampDeposit amount:int64 provider_name:string = TonWalletTransactionType; + +//@description A transfer of TON Grams to or from the wallet +//@amount The amount of received cryptocurrency, in the smallest units of the cryptocurrency; negative for outgoing transactions +//@is_gasless True, if the fee was paid by Telegram +//@comment Comment added to the transaction +//@is_comment_encrypted True, if the comment is encrypted and must be decrypted using the user's private key +tonWalletTransactionTypeTransfer amount:int64 is_gasless:Bool comment:string is_comment_encrypted:Bool = TonWalletTransactionType; + +//@description A transfer of a TON NFT to or from the wallet +//@nft The transferred NFT +//@is_outgoing True, if the transfer is outgoing +//@comment Comment added to the transaction +//@is_comment_encrypted True, if the comment is encrypted and must be decrypted using the user's private key +tonWalletTransactionTypeNftTransfer nft:tonNft is_outgoing:Bool comment:string is_comment_encrypted:Bool = TonWalletTransactionType; + +//@description A Telegram gift was minted as a TON NFT or was transferred from Telegram to the wallet or back; peer details aren't available for the transaction +//@nft The minted or transferred NFT +//@is_outgoing True, if the transfer is from the wallet to Telegram +//@is_saved True, if the gift was displayed on the current user's profile page before or after the transfer +tonWalletTransactionTypeTelegramGiftTransfer nft:tonNft is_outgoing:Bool is_saved:Bool = TonWalletTransactionType; + +//@description Change of the wallet key +tonWalletTransactionTypeKeyChange = TonWalletTransactionType; + + +//@description Represents a transaction with the TON wallet of the current user +//@id Unique identifier of the transaction +//@peer_address Address in the TON blockchain of the transaction peer; may be empty if the transaction isn't a wallet transfer +//@peer_user_id Identifier of the other user who participated in the transaction; 0 if unknown +//@peer_domain Identifier of the domain assigned to the peer address; may be empty if none +//@date Point in time (Unix timestamp) when the transaction was completed +//@fee_amount The fee amount paid for the transaction in TON Grams, in the smallest units of the cryptocurrency +//@state State of the transaction +//@type Type of the transaction +tonWalletTransaction id:string peer_address:string peer_user_id:int53 peer_domain:string date:int32 fee_amount:int64 state:TonWalletTransactionState type:TonWalletTransactionType = TonWalletTransaction; + +//@description Represents a list of TON Gram transactions +//@gram_amount The total amount of owned TON Grams, in the smallest units of the cryptocurrency +//@transactions List of transactions +//@next_offset The offset for the next request. If empty, then there are no more results +tonWalletTransactions gram_amount:int64 transactions:vector next_offset:string = TonWalletTransactions; + + +//@class TonConnectRequestState @description Describes state of a request received from a dApp through TON Connect + +//@description The request must be accepted or rejected if it isn't expired yet +//@expiration_date Point in time (Unix timestamp) when the request will expire or has expired +tonConnectRequestStatePending expiration_date:int32 = TonConnectRequestState; + +//@description The request was accepted +tonConnectRequestStateAccepted = TonConnectRequestState; + +//@description The request was rejected +tonConnectRequestStateRejected = TonConnectRequestState; + + +//@class TonConnectManifest @description Describes manifest of the dApp that is being connected using TON Connect + +//@description The manifest is being downloaded +tonConnectManifestPending = TonConnectManifest; + +//@description The manifest is available +//@url URL of the dApp +//@name Name of the dApp +//@icon App icon in PNG or ICO format +tonConnectManifestInfo url:string name:string icon:document = TonConnectManifest; + +//@description The manifest has failed to download +tonConnectManifestFailed = TonConnectManifest; + +//@description The manifest is invalid +tonConnectManifestInvalid = TonConnectManifest; + + +//@class TonConnectSessionState @description Describes state of a TON Connect session + +//@description The session is pending +tonConnectSessionStatePending = TonConnectSessionState; + +//@description The session is ready +tonConnectSessionStateReady = TonConnectSessionState; + +//@description The session is being closed +tonConnectSessionStateClosing = TonConnectSessionState; + +//@description The session is closed +tonConnectSessionStateClosed = TonConnectSessionState; + + +//@class TonConnectConnectItem @description Represents a data item to share with a dApp + +//@description Address of the wallet @network Stringified TON network global_id (e.g. "-239" for mainnet); may be empty +tonConnectConnectItemAddress network:string = TonConnectConnectItem; + +//@description Proof of the wallet ownership @payload Payload to be used for the proof (e.g. nonce + expiration timestamp) +tonConnectConnectItemProof payload:string = TonConnectConnectItem; + + +//@description Contains information about a request to connect the user's TON wallet to a dApp using TON Connect +//@manifest_url URL of the manifest of the dApp +//@items Items requested from the wallet +tonConnectConnectRequest manifest_url:string items:vector = TonConnectConnectRequest; + +//@description Contains data required to give access to the TON wallet of the current user in acceptOauthRequest +//@session_id Unique identifier of the session +//@challenge_answer Answer to the challenge received from setTonConnectSessionWalletClientId +//@body Body of the result of the connection request as in sendTonConnectSessionConnectResult +//@proof Proof of the TON wallet ownership for the payload oauthLinkInfo.ton_proof_payload +tonConnectConnectData session_id:int64 challenge_answer:bytes body:bytes proof:tonWalletOwnershipProof = TonConnectConnectData; + +//@description Represents a TON Connect session. See https://github.com/ton-blockchain/ton-connect/tree/main/spec for full TON Connect protocol documentation +//@id Unique identifier of the session +//@dapp_client_id Hex-encoded public X25519 key of the dApp +//@wallet_client_id Hex-encoded public X25519 key of the current user's application; may be empty if none +//@creation_date Point in time (Unix timestamp) when the session was created +//@manifest Manifest of the dApp +//@nonce Nonce used for the session +//@state Session state +tonConnectSession id:int64 dapp_client_id:string wallet_client_id:string creation_date:int32 manifest:TonConnectManifest nonce:bytes state:TonConnectSessionState = TonConnectSession; + +//@description Contains a list of TON Connect sessions @sessions The list of sessions +tonConnectSessions sessions:vector = TonConnectSessions; + +//@description Represents a pending TON Connect request +//@session_id Unique identifier of the session +//@message_id Unique identifier of the service message in the chat 777000 with the request +//@body Body of the request +//@expiration_date Point in time (Unix timestamp) when the request will expire; 0 if never +//@topic Topic of the request; may be empty if none +//@trace_id Identifier to trace the request; may be empty if none +tonConnectRequest session_id:int64 message_id:int53 body:bytes expiration_date:int32 topic:string trace_id:string = TonConnectRequest; + +//@description Represents a session with its pending TON Connect requests +//@session The session +//@requests The requests +tonConnectRequests session:tonConnectSession requests:vector = TonConnectRequests; + +//@description Represents a TON Connect challenge +//@challenge 104-byte challenge +//@event_id Unique identifier of the first outgoing event +tonConnectChallenge challenge:bytes event_id:int64 = TonConnectChallenge; + +//@description Represents identifier of an event in a TON Connect session @event_id The event identifier +tonConnectSessionEventId event_id:int64 = TonConnectSessionEventId; + + +//@description Represents result of cryptocurrency transfer from the current user's TON wallet +//@is_gasless True, if the transfer is gasless +//@msg_hash Unique identifier of the sent message; use getTonWalletTransactionByMsgHash to poll information about the transaction +//@transaction The completed transaction; may be null if the transaction is still pending +tonWalletTransferResult is_gasless:Bool msg_hash:bytes transaction:tonWalletTransaction = TonWalletTransferResult; + + //@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 @@ -2196,10 +2604,12 @@ giveawayParticipantStatusParticipating = GiveawayParticipantStatus; //@joined_chat_date Point in time (Unix timestamp) when the user joined the chat giveawayParticipantStatusAlreadyWasMember joined_chat_date:int32 = GiveawayParticipantStatus; -//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway @chat_id Identifier of the chat administered by the user +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway +//@chat_id Identifier of the chat administered by the user giveawayParticipantStatusAdministrator chat_id:int53 = GiveawayParticipantStatus; -//@description The user can't participate in the giveaway, because their phone number is from a disallowed country @user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +//@description The user can't participate in the giveaway, because their phone number is from a disallowed country +//@user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country giveawayParticipantStatusDisallowedCountry user_country_code:string = GiveawayParticipantStatus; @@ -2264,6 +2674,71 @@ profileAccentColors palette_colors:vector background_colors:vector profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_supergroup_chat_boost_level:int32 min_channel_chat_boost_level:int32 = ProfileAccentColor; +//@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant + +//@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value +notificationSettingsScopePrivateChats = NotificationSettingsScope; + +//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value +notificationSettingsScopeGroupChats = NotificationSettingsScope; + +//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value +notificationSettingsScopeChannelChats = NotificationSettingsScope; + + +//@description Contains information about notification settings for a chat or a forum topic +//@use_default_mute_for If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of mute_for +//@mute_for Time left before notifications will be unmuted, in seconds +//@use_default_sound If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of sound_id +//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled +//@use_default_show_preview If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of show_preview +//@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, the value for the chat's community or the relevant type of chat is used instead of mute_stories +//@mute_stories True, if story notifications are disabled for the chat +//@use_default_story_sound If true, the value for the chat's community or the relevant type of chat is used instead of story_sound_id +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@use_default_show_story_poster If true, the value for the chat's community or the relevant type of chat is used instead of show_story_poster +//@show_story_poster True, if the chat that posted a story must be displayed in notifications +//@use_default_disable_pinned_message_notifications If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of disable_pinned_message_notifications +//@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message +//@use_default_disable_mention_notifications If true, the value for the topic's chat, the chat's community, or the relevant type of chat is used instead of disable_mention_notifications +//@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_poster:Bool show_story_poster:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; + +//@description Contains information about notification settings for several chats +//@mute_for Time left before notifications will be unmuted, in seconds +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound +//@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories +//@mute_stories True, if story notifications are disabled +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled; pass -1 to use the app-dependent default sound +//@show_story_poster True, if the chat that posted a story must be displayed in notifications +//@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message +//@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_poster:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; + + +//@class ReactionNotificationSource @description Describes sources of reactions for which notifications will be shown + +//@description Notifications for reactions are disabled +reactionNotificationSourceNone = ReactionNotificationSource; + +//@description Notifications for reactions are shown only for reactions from contacts +reactionNotificationSourceContacts = ReactionNotificationSource; + +//@description Notifications for reactions are shown for all reactions +reactionNotificationSourceAll = ReactionNotificationSource; + + +//@description Contains information about notification settings for reactions and poll votes +//@message_reaction_source Source of message reactions for which notifications are shown +//@story_reaction_source Source of story reactions for which notifications are shown +//@poll_vote_source Source of poll votes for which notifications are shown +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound +//@show_preview True, if reaction sender and emoji must be displayed in notifications +reactionNotificationSettings message_reaction_source:ReactionNotificationSource story_reaction_source:ReactionNotificationSource poll_vote_source:ReactionNotificationSource sound_id:int64 show_preview:Bool = ReactionNotificationSettings; + + //@description Contains identifier of a community @id Community identifier communityId id:int53 = CommunityId; @@ -2306,7 +2781,8 @@ communityMemberStatusBanned = CommunityMemberStatus; //@date Point in time (Unix timestamp) when the community was joined, or the point in time when the community was created, in case the user is not a member of any chat in the community //@status Status of the current user in the community //@permissions Actions that non-administrator community members are allowed to take in the community -community id:int53 have_access:Bool name:string photo:chatPhotoInfo date:int32 status:CommunityMemberStatus permissions:communityPermissions = Community; +//@are_chats_collapsed True, if all chats of the community are collapsed into one entry in the chat list +community id:int53 have_access:Bool name:string photo:chatPhotoInfo date:int32 status:CommunityMemberStatus permissions:communityPermissions are_chats_collapsed:Bool = Community; //@description Describes a chat in a community //@chat_id Identifier of the chat in the community @@ -2320,7 +2796,29 @@ communityChat chat_id:int53 can_view_history:Bool is_hidden:Bool = CommunityChat //@administrator_count Number of privileged users in the community; 0 if the current user isn't an administrator of the community //@banned_count Number of users banned from the community; 0 if the current user isn't an administrator of the community //@add_chat_request_count Number of pending requests for addition of chats to the community; 0 if the current user isn't an administrator of the community -communityFullInfo photo:chatPhoto chats:vector administrator_count:int32 banned_count:int32 add_chat_request_count:int32 = CommunityFullInfo; +//@notification_settings Notification settings for the community. Default notification settings are chosen based on the type of a chat in the community +communityFullInfo photo:chatPhoto chats:vector administrator_count:int32 banned_count:int32 add_chat_request_count:int32 notification_settings:chatNotificationSettings = CommunityFullInfo; + +//@description Represents a list of communities @community_ids List of community identifiers +communities community_ids:vector = Communities; + +//@description Describes a request to add a chat to a community +//@chat_id Identifier of the chat to be added +//@is_hidden True, if the chat will be visible only to administrators of the community +//@sender_user_id Identifier of the user who sent the request +//@date Point in time (Unix timestamp) when the request was sent +communityAddChatRequest chat_id:int53 is_hidden:Bool sender_user_id:int53 date:int32 = CommunityAddChatRequest; + +//@description Contains a list of requests to add chats to a community +//@total_count Approximate total number of requests found +//@requests List of the requests +//@next_offset The offset for the next getCommunityAddChatRequests request. If empty, then there are no more results +communityAddChatRequests total_count:int32 requests:vector next_offset:string = CommunityAddChatRequests; + +//@description Contains information about chats in a community, which are joined or owned by a member of the community +//@owned_chat_ids Identifiers of the chats owned by the member. The chats will be removed from the community if the member is banned in the community +//@joined_chat_ids Identifiers of the non-owned chats joined by the member +communityMemberChats owned_chat_ids:vector joined_chat_ids:vector = CommunityMemberChats; //@description Contains description of user rating @@ -2369,11 +2867,13 @@ 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 +//@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 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; +//@secondary_username Secondary non-collectible username. Currently, must be non-empty only for bot accounts. Can't be used in toggleBotUsernameIsActive; +//-use addBotSecondaryUsername or deleteBotSecondaryUsername to edit it. If the username is disabled, then Telegram Premium subscription is required to re-enable it +usernames active_usernames:vector disabled_usernames:vector editable_username:string collectible_usernames:vector secondary_username:string = Usernames; //@description Represents a user @@ -2468,9 +2968,11 @@ botInfo short_description:string description:string photo:photo animation:animat //@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 +//@ton_wallet_card TON wallet card of the user; may be null if none +//@share_theme Theme of the screen for sharing a link to the user; may be null if the default theme is used //@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 community_id:int53 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 uses_unofficial_app: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; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto community_id:int53 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 uses_unofficial_app: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 ton_wallet_card:tonWalletCard share_theme:ProfileShareTheme 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; @@ -2497,7 +2999,6 @@ chatAdministrators administrators:vector = ChatAdministrators //@is_member True, if the user is a member of the chat chatMemberStatusCreator is_anonymous:Bool is_member:Bool = ChatMemberStatus; - //@description The user is a member of the chat and has some additional privileges. In basic groups, administrators have all applicable rights. //-In supergroups and channels, any subset of the rights can be chosen for an administrator //@can_be_edited True, if the current user can edit the administrator privileges for the called user @@ -2510,7 +3011,8 @@ chatMemberStatusMember member_until_date:int32 = ChatMemberStatus; //@description The user is under certain restrictions in the chat. Not supported in basic groups and channels //@is_member True, if the user is a member of the chat -//@restricted_until_date Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever +//@restricted_until_date Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. +//-If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever //@permissions User permissions in the chat chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permissions:chatPermissions = ChatMemberStatus; @@ -2518,7 +3020,8 @@ chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permission chatMemberStatusLeft = ChatMemberStatus; //@description The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat -//@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. Always 0 in basic groups +//@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. Always 0 in basic groups chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; @@ -2578,7 +3081,9 @@ 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 who 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 +//@description Returns users who 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 @@ -2590,7 +3095,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@description The chat was joined successfully @chat_id Identifier of the chat chatJoinResultSuccess chat_id:int53 = ChatJoinResult; -//@description The join request was sent and have to be approved by administrators of the chat +//@description The join request was sent and has to be approved by administrators of the chat chatJoinResultRequestSent = ChatJoinResult; //@description An approval from a guard bot through a Web App is required to join the chat @@ -2627,7 +3132,8 @@ chatJoinRequestResultQueued = ChatJoinRequestResult; //@expired_member_count Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only //@pending_join_request_count Number of pending join requests created using this link //@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited -//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time +//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. Primary link can create join requests only if this is set up using toggleSupergroupJoinByRequest. +//-There is exactly one primary invite link for each administrator with can_invite_users right at a given time //@is_revoked True, if the link was revoked chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 subscription_pricing:starSubscriptionPricing member_limit:int32 member_count:int32 expired_member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; @@ -2650,7 +3156,9 @@ chatInviteLinkCounts invite_link_counts:vector = ChatInvite //@approver_user_id User identifier of the chat administrator, approved user join request chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite_link:Bool approver_user_id:int53 = ChatInviteLinkMember; -//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link +//@description Contains a list of chat members joined a chat via an invite link +//@total_count Approximate total number of chat members found +//@members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; @@ -2689,13 +3197,18 @@ 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 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 +//@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 chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; -//@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests +//@description Contains information about pending join requests for a chat +//@total_count Total number of pending join requests +//@user_ids Identifiers of at most 3 users sent the newest pending join requests chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequestsInfo; @@ -2746,10 +3259,11 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@verification_status Information about verification status of the supergroup or channel; may be null if none //@has_direct_messages_group True, if the channel has direct messages group //@has_forum_tabs True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups +//@has_forum_sidebar True, if the supergroup is a forum, which topics are shown in a sidebar. If true, then has_forum_tabs is false //@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 //@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; +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 has_forum_sidebar: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 @@ -2775,7 +3289,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available //@can_send_gift True, if the user can send a gift to the supergroup or channel using sendGift or transferGift //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup -//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, +//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, or forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators //@can_have_sponsored_messages True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators @@ -2793,9 +3307,10 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@bot_commands List of commands of bots in the group //@bot_verification Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown //@main_profile_tab The main tab chosen by the administrators of the channel; may be null if not chosen manually +//@share_theme Theme of the screen for sharing a link to the supergroup or the channel; may be null if the default theme is used //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto community_id:int53 description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 direct_messages_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_messages:Bool can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_send_gift:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool gift_count:int32 my_boost_count:int32 unrestrict_boost_count:int32 outgoing_paid_message_star_count:int53 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink guard_bot_user_id:int53 bot_commands:vector bot_verification:botVerification main_profile_tab:ProfileTab upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto community_id:int53 description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 direct_messages_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_messages:Bool can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_send_gift:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool gift_count:int32 my_boost_count:int32 unrestrict_boost_count:int32 outgoing_paid_message_star_count:int53 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink guard_bot_user_id:int53 bot_commands:vector bot_verification:botVerification main_profile_tab:ProfileTab share_theme:ProfileShareTheme upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -2815,7 +3330,8 @@ secretChatStateClosed = SecretChatState; //@user_id Identifier of the chat partner //@state State of the secret chat //@is_outbound True, if the chat was created by the current user; false otherwise -//@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. +//@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, +//-which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. //-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers //@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, //-files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 @@ -2844,7 +3360,9 @@ messageSenderChat chat_id:int53 = MessageSender; messageSenders total_count:int32 senders:vector = MessageSenders; -//@description Represents a message sender, which can be used to send messages in a chat @sender The message sender @needs_premium True, if Telegram Premium is needed to use the message sender +//@description Represents a message sender, which can be used to send messages in a chat +//@sender The message sender +//@needs_premium True, if Telegram Premium is needed to use the message sender chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; //@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders @@ -2948,14 +3466,15 @@ paidReactionTypeChat chat_id:int53 = PaidReactionType; 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 +//@total_star_count Total amount of spent 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 //@date Point in time (Unix timestamp) when the message was originally sent -//@source For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown +//@source For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, +//-information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown //@public_service_announcement_type The type of public service announcement for the forwarded message messageForwardInfo origin:MessageOrigin date:int32 source:forwardSource public_service_announcement_type:string = MessageForwardInfo; @@ -3051,15 +3570,26 @@ messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool ne //@description Describes manually or automatically chosen quote from another message -//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text -//@position Approximate quote position in the original message in UTF-16 code units as specified by the message sender +//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text. +//-May be empty if the quote was chosen from a rich message +//@rich_texts Rich text of the quote if it was chosen from a rich message; empty if the quote wasn't chosen from a rich message. +//-Only richTextPlain, richTextBold, richTextItalic, richTextUnderline, richTextStrikethrough, richTextSpoiler, richTextSubscript, richTextSuperscript, +//-richTextDateTime, richTextCustomEmoji, richTextMathematicalExpression, and richTexts can be present in the texts +//@position Approximate quote position in the original message in UTF-16 code units as specified by the message sender. For quotes from rich messages, +//-it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds //@is_manual True, if the quote was manually chosen by the message sender -textQuote text:formattedText position:int32 is_manual:Bool = TextQuote; +textQuote text:formattedText rich_texts:vector position:int32 is_manual:Bool = TextQuote; //@description Describes manually chosen quote from another message -//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote -//@position Quote position in the original message in UTF-16 code units -inputTextQuote text:formattedText position:int32 = InputTextQuote; +//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote. +//-Ignored if rich_texts are non-empty +//@rich_texts Quote from a rich message; pass an empty array if the quote isn't chosen from a rich message. Must contain one element for each quoted text of the message in the order of their appearance. +//-The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept. +//-Mathematical expressions must be quoted entirely. Buttons in pageBlockButtonRow, anchors and dividers can't be quoted. +//-There can be up to 32 quoted texts with total length up to getOption("message_reply_quote_length_max") characters +//@position Quote position in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts +//-of all quotable texts of the message, separated by line feeds +inputTextQuote text:formattedText rich_texts:vector position:int32 = InputTextQuote; //@class MessageReplyTo @description Contains information about the message or the story a message is replying to @@ -3075,7 +3605,7 @@ inputTextQuote text:formattedText position:int32 = InputTextQuote; //@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, messageStakeDice, -//-messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote +//-messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, messageVoiceNote, or messageWidget messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote checklist_task_id:int32 poll_option_id:string origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; //@description Describes a story replied by a given message @story_poster_chat_id The identifier of the poster of the story @story_id The identifier of the story @@ -3156,7 +3686,8 @@ ephemeralMessageContent can_be_saved:Bool has_timestamped_media:Bool content:Mes //@guest_bot_caller_id The identifier of the user or chat which used a guest bot to send the message; may be null if none //@sender_business_bot_user_id If non-zero, the user identifier of the business bot that sent this message //@sender_boost_count Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead -//@sender_tag Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or supergroup administrators, the current custom title or tag must be used instead +//@sender_tag Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. +//-For messages sent in basic groups or by supergroup administrators, the current custom title or tag must be used instead //@paid_message_star_count The number of Telegram Stars the sender paid to send the message //@author_signature For channel posts and anonymous group messages, optional author signature //@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 @@ -3174,10 +3705,16 @@ message id:int53 sender_id:MessageSender receiver_id:MessageSender chat_id:int53 //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, then there are no more results +//@description Contains a list of messages found by a search +//@total_count Approximate total number of messages found; -1 if unknown +//@messages List of messages +//@next_offset The offset for the next request. If empty, then there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; -//@description Contains a list of messages found by a search in a given chat @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_from_message_id The offset for the next request. If 0, there are no more results +//@description Contains a list of messages found by a search in a given chat +//@total_count Approximate total number of messages found; -1 if unknown +//@messages List of messages +//@next_from_message_id The offset for the next request. If 0, there are no more results foundChatMessages total_count:int32 messages:vector next_from_message_id:int53 = FoundChatMessages; //@description Contains a list of messages found by a public post search @@ -3187,7 +3724,10 @@ foundChatMessages total_count:int32 messages:vector next_from_message_i //@are_limits_exceeded True, if the query has failed because search limits are exceeded. In this case search_limits.daily_free_query_count will be equal to 0 foundPublicPosts messages:vector next_offset:string search_limits:publicPostSearchLimits are_limits_exceeded:Bool = FoundPublicPosts; -//@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent +//@description Contains information about a message in a specific position +//@position 0-based message position in the full list of suitable messages +//@message_id Message identifier +//@date Point in time (Unix timestamp) when the message was sent messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; //@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions @@ -3196,11 +3736,15 @@ messagePositions total_count:int32 positions:vector = MessagePo //@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day messageCalendarDay total_count:int32 message:message = MessageCalendarDay; -//@description Contains information about found messages, split by days according to the option "utc_time_offset" @total_count Total number of found messages @days Information about messages sent +//@description Contains information about found messages, split by days according to the option "utc_time_offset" +//@total_count Total number of found messages +//@days Information about messages sent messageCalendar total_count:int32 days:vector = MessageCalendar; -//@description Describes a message from a business account as received by a bot @message The message @reply_to_message Message that is replied by the message in the same chat; may be null if none +//@description Describes a message from a business account as received by a bot +//@message The message +//@reply_to_message Message that is replied by the message in the same chat; may be null if none businessMessage message:message reply_to_message:message = BusinessMessage; //@description Contains a list of messages from a business account as received by a bot @messages List of business messages @@ -3263,7 +3807,9 @@ advertisementSponsor url:string photo:photo info:string = AdvertisementSponsor; //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message sponsoredMessage message_id:int53 is_recommended:Bool can_be_reported:Bool content:MessageContent sponsor:advertisementSponsor title:string button_text:string accent_color_id:int32 background_custom_emoji_id:int64 additional_info:string = SponsoredMessage; -//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages +//@description Contains a list of sponsored messages +//@messages List of sponsored messages +//@messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; //@description Describes a sponsored chat @@ -3337,71 +3883,6 @@ downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; -//@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant - -//@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value -notificationSettingsScopePrivateChats = NotificationSettingsScope; - -//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value -notificationSettingsScopeGroupChats = NotificationSettingsScope; - -//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value -notificationSettingsScopeChannelChats = NotificationSettingsScope; - - -//@description Contains information about notification settings for a chat or a forum topic -//@use_default_mute_for If true, the value for the relevant type of chat or the forum chat is used instead of mute_for -//@mute_for Time left before notifications will be unmuted, in seconds -//@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id -//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled -//@use_default_show_preview If true, the value for the relevant type of chat or the forum chat is used instead of show_preview -//@show_preview True, if message content must be displayed in notifications -//@use_default_mute_stories If true, the value for the relevant type of chat is used instead of mute_stories -//@mute_stories True, if story notifications are disabled for the chat -//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id -//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled -//@use_default_show_story_poster If true, the value for the relevant type of chat is used instead of show_story_poster -//@show_story_poster True, if the chat that posted a story must be displayed in notifications -//@use_default_disable_pinned_message_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications -//@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message -//@use_default_disable_mention_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications -//@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_poster:Bool show_story_poster:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; - -//@description Contains information about notification settings for several chats -//@mute_for Time left before notifications will be unmuted, in seconds -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound -//@show_preview True, if message content must be displayed in notifications -//@use_default_mute_stories If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories -//@mute_stories True, if story notifications are disabled -//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled; pass -1 to use the app-dependent default sound -//@show_story_poster True, if the chat that posted a story must be displayed in notifications -//@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message -//@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_poster:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; - - -//@class ReactionNotificationSource @description Describes sources of reactions for which notifications will be shown - -//@description Notifications for reactions are disabled -reactionNotificationSourceNone = ReactionNotificationSource; - -//@description Notifications for reactions are shown only for reactions from contacts -reactionNotificationSourceContacts = ReactionNotificationSource; - -//@description Notifications for reactions are shown for all reactions -reactionNotificationSourceAll = ReactionNotificationSource; - - -//@description Contains information about notification settings for reactions and poll votes -//@message_reaction_source Source of message reactions for which notifications are shown -//@story_reaction_source Source of story reactions for which notifications are shown -//@poll_vote_source Source of poll votes for which notifications are shown -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled; pass -1 to use the app-dependent default sound -//@show_preview True, if reaction sender and emoji must be displayed in notifications -reactionNotificationSettings message_reaction_source:ReactionNotificationSource story_reaction_source:ReactionNotificationSource poll_vote_source:ReactionNotificationSource sound_id:int64 show_preview:Bool = ReactionNotificationSettings; - - //@class DraftMessageContent @description Content of the message draft //@description A text message draft @@ -3454,7 +3935,8 @@ chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; -//@description Represents an icon for a chat folder @name The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//@description Represents an icon for a chat folder +//@name The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", //-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" chatFolderIcon name:string = ChatFolderIcon; @@ -3468,9 +3950,12 @@ chatFolderName text:formattedText animate_custom_emoji:Bool = ChatFolderName; //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder //@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@is_shareable True, if at least one link has been created for the folder -//@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@excluded_chat_ids The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned +//-and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned +//-and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@excluded_chat_ids The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats +//-and the same number of secret chats, but the limit can be increased with Telegram Premium //@exclude_muted True, if muted chats need to be excluded //@exclude_read True, if read chats need to be excluded //@exclude_archived True, if archived chats need to be excluded @@ -3619,7 +4104,8 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@unread_poll_vote_count Number of messages with unread poll votes in the chat //@notification_settings Notification settings for the chat //@available_reactions Types of reaction, available in the chat -//@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. +//-Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date //@emoji_status Emoji status to be shown along with chat title; may be null //@background Background set for the chat; may be null if none //@theme Theme set for the chat; may be null if none @@ -3725,7 +4211,9 @@ keyboardButtonTypeRequestPhoneNumber = KeyboardButtonType; //@description A button that sends the user's location when pressed; available only in private chats keyboardButtonTypeRequestLocation = KeyboardButtonType; -//@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create +//@description A button that allows the user to create and send a poll when pressed; available only in private chats +//@force_regular If true, only regular polls must be allowed to create +//@force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; //@description A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request @@ -3776,7 +4264,8 @@ keyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:Key //@class InlineKeyboardButtonType @description Describes the type of inline keyboard button -//@description A button that opens a specified URL @url HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button +//@description A button that opens a specified URL +//@url HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; //@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo; not supported in ephemeral messages @@ -3791,13 +4280,16 @@ inlineKeyboardButtonTypeWebApp url:string = InlineKeyboardButtonType; //@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; -//@description A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot @data Data to be sent to the bot via a callback query +//@description A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot +//@data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonType; //@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType; -//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @target_chat Target chat from which to send the inline query +//@description A button that forces an inline query to the bot to be inserted in the input field +//@query Inline query to be sent to the bot +//@target_chat Target chat from which to send the inline query inlineKeyboardButtonTypeSwitchInline query:string target_chat:TargetChat = InlineKeyboardButtonType; //@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice @@ -3884,13 +4376,19 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 reque //@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 //@request_phone_number_access True, if the user must be asked for the permission to share their phone number +//@request_ton_wallet_access True, if access to the user's TON wallet is requested by the app. If true and the user agrees to give access, then use createTonConnectSession +//-with dapp_client_id and ton_connect_manifest_url to create the TON Connect session, then setTonConnectSessionWalletClientId, then create a tonWalletOwnershipProof +//-for the given domain with the payload ton_proof_payload, and then pass all data to acceptOauthRequest in the parameter ton_connect_connect_data +//@dapp_client_id Hex-encoded public X25519 key of the dApp; may be empty if TON wallet access wasn't requested +//@ton_connect_manifest_url URL of the TON Connect manifest of the dApp; may be empty if TON wallet access wasn't requested +//@ton_proof_payload Payload for TON wallet ownership proof; may be empty if TON wallet access wasn't requested //@browser The version of a browser used for the authorization //@platform Operating system the browser is running on //@ip_address IP address from which the authorization is performed, in human-readable format //@location Human-readable description of a country and a region from which the authorization is performed, based on the IP address //@match_code_first True, if code matching dialog must be shown first and checkOauthRequestMatchCode must be called before acceptOauthRequest. Otherwise, checkOauthRequestMatchCode must not be called //@match_codes The list of codes to match; may be empty if irrelevant -oauthLinkInfo user_id:int53 url:string domain:string from_app:Bool verified_app_name:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool browser:string platform:string ip_address:string location:string match_code_first:Bool match_codes:vector = OauthLinkInfo; +oauthLinkInfo user_id:int53 url:string domain:string from_app:Bool verified_app_name:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool request_ton_wallet_access:Bool dapp_client_id:string ton_connect_manifest_url:string ton_proof_payload:string browser:string platform:string ip_address:string location:string match_code_first:Bool match_codes:vector = OauthLinkInfo; //@description Contains information about a message thread @@ -3898,14 +4396,14 @@ oauthLinkInfo user_id:int53 url:string domain:string from_app:Bool verified_app_ //@message_thread_id Message thread identifier, unique within the chat //@reply_info Information about the message thread; may be null for forum topic threads //@unread_message_count Approximate number of unread messages in the message thread -//@messages The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +//@messages The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message.id) //@draft_message A draft of a message in the message thread; may be null if none messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; //@class SavedMessagesTopicType @description Describes type of Saved Messages topic -//@description Topic containing messages sent by the current user of forwarded from an unknown chat +//@description Topic containing messages sent by the current user or forwarded from an unknown chat savedMessagesTopicTypeMyNotes = SavedMessagesTopicType; //@description Topic containing messages forwarded from a user with hidden privacy @@ -4022,8 +4520,52 @@ builtInThemeArctic = BuiltInTheme; //@background The background to be used in chats; may be null //@outgoing_message_fill The fill to be used as a background for outgoing messages; may be null if the fill from the base theme must be used instead //@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message -//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format -themeSettings base_theme:BuiltInTheme accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; +//@has_outgoing_message_accent_color True, if there is chosen accent color for outgoing messages; otherwise, the color must be deduced from other theme settings +//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format; must be ignored if has_outgoing_message_accent_color is false +themeSettings base_theme:BuiltInTheme accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool has_outgoing_message_accent_color:Bool outgoing_message_accent_color:int32 = ThemeSettings; + + +//@description Describes a backdrop, which can be used as a background of a theme of the screen for sharing a link to a user or a chat +//@id Unique identifier of the backdrop +//@name Name of the backdrop +//@colors Colors of the backdrop +profileShareThemeBackdrop id:int32 name:string colors:upgradedGiftBackdropColors = ProfileShareThemeBackdrop; + +//@description Contains a list of backdrops, which can be used as a background of a theme of the screen for sharing a link to a user or a chat @backdrops The list of backdrops +profileShareThemeBackdrops backdrops:vector = ProfileShareThemeBackdrops; + + +//@class EmojiType @description Describes an emoji + +//@description A regular emoji @emoji Text representation of the emoji +emojiTypeRegular emoji:string = EmojiType; + +//@description A custom emoji @custom_emoji_id Identifier of the custom emoji +emojiTypeCustomEmoji custom_emoji_id:int64 = EmojiType; + + +//@class ProfileShareTheme @description Describes a theme of the screen for sharing a link to a user or a chat + +//@description A theme with emoji placed on a background +//@emojis The emoji; 0-6 regular or custom emoji. If empty, then use_default_background is false +//@use_default_background True, if the default background is used; otherwise, the backdrop with identifier background_backdrop_id is used as background +//@background_backdrop_id Identifier of the backdrop used as background; must be ignored if use_default_background is true. Use getProfileShareThemeBackdrops to get details about the backdrop +profileShareThemeEmoji emojis:vector use_default_background:Bool background_backdrop_id:int32 = ProfileShareTheme; + +//@description A theme based on an upgraded gift owned by the user or the chat @gift The upgraded gift +profileShareThemeUpgradedGift gift:upgradedGift = ProfileShareTheme; + + +//@class InputProfileShareTheme @description Describes a theme of the screen for sharing a link to a user or a chat to be set + +//@description A theme with emoji placed on a background +//@emojis The emoji; 0-6 regular or custom emoji. If empty, then use_default_background must be false +//@use_default_background Pass true to use the default background; otherwise, the backdrop with identifier background_backdrop_id will be used as background +//@background_backdrop_id Identifier of the backdrop to be used as background; ignored if use_default_background is true. Use getProfileShareThemeBackdrops to get the list of available backdrops +inputProfileShareThemeEmoji emojis:vector use_default_background:Bool background_backdrop_id:int32 = InputProfileShareTheme; + +//@description A theme based on an upgraded gift @received_gift_id Identifier of the upgraded gift, which is owned by the user or the chat, for which the theme is set +inputProfileShareThemeUpgradedGift received_gift_id:string = InputProfileShareTheme; //@description Represents a button inside a rich message @@ -4083,6 +4625,9 @@ richTextCashtag text:RichText cashtag:string = RichText; //@description A bank card number @text Text @bank_card_number The number of the bank card richTextBankCardNumber text:RichText bank_card_number:string = RichText; +//@description An address in the TON blockchain @text Text @address The address +richTextTonAddress text:RichText address:string = RichText; + //@description A bot command @text Text @bot_command The bot command richTextBotCommand text:RichText bot_command:string = RichText; @@ -4105,7 +4650,7 @@ richTextPhoneNumber text:RichText phone_number:string = RichText; richTextCustomEmoji custom_emoji_id:int64 alternative_text:string = RichText; //@description A small image inside the text; instant view only -//@document The image represented as a document. The image can be in GIF, JPEG or PNG format +//@document The image represented as a document. The image can be in GIF, JPEG, or PNG format //@width Width of a bounding box in which the image must be shown; 0 if unknown //@height Height of a bounding box in which the image must be shown; 0 if unknown richTextIcon document:document width:int32 height:int32 = RichText; @@ -4128,7 +4673,10 @@ richTextReferenceLink text:RichText reference_name:string url:string = RichText; //@description An anchor @name Anchor name richTextAnchor name:string = RichText; -//@description A link to an anchor on the same page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL that opens the anchor +//@description A link to an anchor on the same page +//@text The link text +//@anchor_name The anchor name. If the name is empty, the link must bring back to top +//@url An HTTP URL that opens the anchor richTextAnchorLink text:RichText anchor_name:string url:string = RichText; //@description A concatenation of rich texts @texts Texts @@ -4144,8 +4692,8 @@ pageBlockCaption text:RichText credit:RichText = PageBlockCaption; //@has_checkbox True, if the item has a checkbox //@is_checked True, if the item is checked //@value Value of the item; 0 for unordered lists -//@type Type of the item numbering type; must be one of "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, -//-"1" for decimal numbers, or empty for unordered lists +//@type Type of item numbering; must be one of "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, +//-"1" for decimal numbers, or an empty string for unordered lists pageBlockListItem label:string blocks:vector has_checkbox:Bool is_checked:Bool value:int32 type:string = PageBlockListItem; //@description Describes an item of a list page block to be sent @@ -4153,8 +4701,8 @@ pageBlockListItem label:string blocks:vector has_checkbox:Bool is_che //@has_checkbox True, if the item has a checkbox //@is_checked True, if the item is checked //@value Value of the item; pass 0 for unordered lists -//@type Type of the item numbering type; must be one of "a" for a lowercase letter, "A" for an uppercase letter, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, -//-"1" for decimal numbers, or empty for unordered lists +//@type Type of item numbering; pass "a" for lowercase letters, "A" for uppercase letters, "i" for lowercase Roman numerals, "I" for uppercase Roman numerals, +//-"1" for decimal numbers, or an empty string for unordered lists inputPageBlockListItem blocks:vector has_checkbox:Bool is_checked:Bool value:int32 type:string = InputPageBlockListItem; //@class PageBlockHorizontalAlignment @description Describes a horizontal alignment of a table cell content @@ -4168,7 +4716,7 @@ pageBlockHorizontalAlignmentCenter = PageBlockHorizontalAlignment; //@description The content must be right-aligned pageBlockHorizontalAlignmentRight = PageBlockHorizontalAlignment; -//@class PageBlockVerticalAlignment @description Describes a Vertical alignment of a table cell content +//@class PageBlockVerticalAlignment @description Describes a vertical alignment of a table cell content //@description The content must be top-aligned pageBlockVerticalAlignmentTop = PageBlockVerticalAlignment; @@ -4499,7 +5047,7 @@ linkPreviewTypePhoto photo:photo = LinkPreviewType; //@description The link is a link to a Telegram Premium gift code linkPreviewTypePremiumGiftCode = LinkPreviewType; -//@description The link is a link to a dialog for creating of a managed bot +//@description The link is a link to a dialog for creating a managed bot linkPreviewTypeRequestManagedBot = LinkPreviewType; //@description The link is a link to a shareable chat folder @@ -4511,7 +5059,9 @@ linkPreviewTypeSticker sticker:sticker = LinkPreviewType; //@description The link is a link to a sticker set @stickers Up to 4 stickers from the sticker set linkPreviewTypeStickerSet stickers:vector = LinkPreviewType; -//@description The link is a link to a story. Link preview description is unavailable @story_poster_chat_id The identifier of the chat that posted the story @story_id Story identifier +//@description The link is a link to a story. Link preview description is unavailable +//@story_poster_chat_id The identifier of the chat that posted the story +//@story_id Story identifier linkPreviewTypeStory story_poster_chat_id:int53 story_id:int32 = LinkPreviewType; //@description The link is a link to an album of stories @@ -4525,7 +5075,9 @@ linkPreviewTypeSupergroupBoost photo:chatPhoto = LinkPreviewType; //@description The link is a link to a text composition style @custom_emoji_id Identifier of the custom emoji corresponding to the style; 0 if none linkPreviewTypeTextCompositionStyle custom_emoji_id:int64 = LinkPreviewType; -//@description The link is a link to a cloud theme. TDLib has no theme support yet @documents The list of files with theme description @settings Settings for the cloud theme; may be null if unknown +//@description The link is a link to a cloud theme. TDLib has no theme support yet +//@documents The list of files with theme description +//@settings Settings for the cloud theme; may be null if unknown linkPreviewTypeTheme documents:vector settings:themeSettings = LinkPreviewType; //@description The link preview type is unsupported yet @@ -4639,7 +5191,9 @@ address country_code:string state:string city:string street_line1:string street_ locationAddress country_code:string state:string city:string street:string = LocationAddress; -//@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency +//@description Portion of the price of a product (e.g., "delivery cost", "tax amount") +//@label Label for this portion of the product price +//@amount Currency amount in the smallest units of the currency labeledPricePart label:string amount:int53 = LabeledPricePart; //@description Product invoice @@ -4679,10 +5233,13 @@ savedCredentials id:string title:string = SavedCredentials; //@class InputCredentials @description Contains information about the payment method chosen by the user -//@description Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password @saved_credentials_id Identifier of the saved credentials +//@description Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password +//@saved_credentials_id Identifier of the saved credentials inputCredentialsSaved saved_credentials_id:string = InputCredentials; -//@description Applies if a user enters new credentials on a payment provider website @data JSON-encoded data with the credential identifier from the payment provider @allow_save True, if the credential identifier can be saved on the server side +//@description Applies if a user enters new credentials on a payment provider website +//@data JSON-encoded data with the credential identifier from the payment provider +//@allow_save True, if the credential identifier can be saved on the server side inputCredentialsNew data:string allow_save:Bool = InputCredentials; //@description Applies if a user enters new credentials using Apple Pay @data JSON-encoded data with the credential identifier @@ -4739,10 +5296,14 @@ paymentFormTypeStarSubscription pricing:starSubscriptionPricing = PaymentFormTyp //@product_info Information about the product paymentForm id:int64 type:PaymentFormType seller_bot_user_id:int53 product_info:productInfo = PaymentForm; -//@description Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options +//@description Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options +//@order_info_id Temporary identifier of the order information +//@shipping_options Available shipping options validatedOrderInfo order_info_id:string shipping_options:vector = ValidatedOrderInfo; -//@description Contains the result of a payment request @success True, if the payment request was successful; otherwise, the verification_url will be non-empty @verification_url URL for additional payment credentials verification +//@description Contains the result of a payment request +//@success True, if the payment request was successful; otherwise, the verification_url will be non-empty +//@verification_url URL for additional payment credentials verification paymentResult success:Bool verification_url:string = PaymentResult; @@ -4902,10 +5463,14 @@ identityDocument number:string expiration_date:date front_side:datedFile reverse //@translation List of files containing a certified English translation of the document inputIdentityDocument number:string expiration_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; -//@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document +//@description A personal document, containing some information about a user +//@files List of files containing the pages of the document +//@translation List of files containing a certified English translation of the document personalDocument files:vector translation:vector = PersonalDocument; -//@description A personal document to be saved to Telegram Passport @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document +//@description A personal document to be saved to Telegram Passport +//@files List of files containing the pages of the document +//@translation List of files containing a certified English translation of the document inputPersonalDocument files:vector translation:vector = InputPersonalDocument; @@ -5014,7 +5579,8 @@ passportElementErrorSourceReverseSide = PassportElementErrorSource; //@description The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes passportElementErrorSourceSelfie = PassportElementErrorSource; -//@description One of files with the translation of the document contains an error. The error will be considered resolved when the file changes @file_index Index of a file with the error +//@description One of files with the translation of the document contains an error. The error will be considered resolved when the file changes +//@file_index Index of a file with the error passportElementErrorSourceTranslationFile file_index:int32 = PassportElementErrorSource; //@description The translation of the document contains an error. The error will be considered resolved when the list of translation files changes @@ -5027,7 +5593,10 @@ passportElementErrorSourceFile file_index:int32 = PassportElementErrorSource; passportElementErrorSourceFiles = PassportElementErrorSource; -//@description Contains the description of an error in a Telegram Passport element @type Type of the Telegram Passport element which has the error @message Error message @source Error source +//@description Contains the description of an error in a Telegram Passport element +//@type Type of the Telegram Passport element which has the error +//@message Error message +//@source Error source passportElementError type:PassportElementType message:string source:PassportElementErrorSource = PassportElementError; @@ -5038,7 +5607,8 @@ passportElementError type:PassportElementType message:string source:PassportElem //@is_native_name_required True, if personal details must include the user's name in the language of their country of residence passportSuitableElement type:PassportElementType is_selfie_required:Bool is_translation_required:Bool is_native_name_required:Bool = PassportSuitableElement; -//@description Contains a description of the required Telegram Passport element that was requested by a service @suitable_elements List of Telegram Passport elements any of which is enough to provide +//@description Contains a description of the required Telegram Passport element that was requested by a service +//@suitable_elements List of Telegram Passport elements any of which is enough to provide passportRequiredElement suitable_elements:vector = PassportRequiredElement; //@description Contains information about a Telegram Passport authorization form that was requested @@ -5047,18 +5617,23 @@ passportRequiredElement suitable_elements:vector = Pass //@privacy_policy_url URL for the privacy policy of the service; may be empty passportAuthorizationForm id:int32 required_elements:vector privacy_policy_url:string = PassportAuthorizationForm; -//@description Contains information about a Telegram Passport elements and corresponding errors @elements Telegram Passport elements @errors Errors in the elements that are already available +//@description Contains information about Telegram Passport elements and corresponding errors +//@elements Telegram Passport elements +//@errors Errors in the elements that are already available passportElementsWithErrors elements:vector errors:vector = PassportElementsWithErrors; -//@description Contains encrypted Telegram Passport data credentials @data The encrypted credentials @hash The decrypted data hash @secret Secret for data decryption, encrypted with the service's public key +//@description Contains encrypted Telegram Passport data credentials +//@data The encrypted credentials +//@hash The decrypted data hash +//@secret Secret for data decryption, encrypted with the service's public key encryptedCredentials data:bytes hash:bytes secret:bytes = EncryptedCredentials; //@description Contains information about an encrypted Telegram Passport element; for bots only //@type Type of Telegram Passport element //@data Encrypted JSON-encoded data about the user -//@front_side The front side of an identity document +//@front_side The front side of an identity document; may be null if the element isn't an identity document //@reverse_side The reverse side of an identity document; may be null //@selfie Selfie with the document; may be null //@translation List of files containing a certified English translation of the document @@ -5076,19 +5651,23 @@ inputPassportElementErrorSourceUnspecified element_hash:bytes = InputPassportEle //@description A data field contains an error. The error is considered resolved when the field's value changes @field_name Field name @data_hash Current data hash inputPassportElementErrorSourceDataField field_name:string data_hash:bytes = InputPassportElementErrorSource; -//@description The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes @file_hash Current hash of the file containing the front side +//@description The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes +//@file_hash Current hash of the file containing the front side inputPassportElementErrorSourceFrontSide file_hash:bytes = InputPassportElementErrorSource; -//@description The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes @file_hash Current hash of the file containing the reverse side +//@description The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes +//@file_hash Current hash of the file containing the reverse side inputPassportElementErrorSourceReverseSide file_hash:bytes = InputPassportElementErrorSource; //@description The selfie contains an error. The error is considered resolved when the file with the selfie changes @file_hash Current hash of the file containing the selfie inputPassportElementErrorSourceSelfie file_hash:bytes = InputPassportElementErrorSource; -//@description One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes @file_hash Current hash of the file containing the translation +//@description One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes +//@file_hash Current hash of the file containing the translation inputPassportElementErrorSourceTranslationFile file_hash:bytes = InputPassportElementErrorSource; -//@description The translation of the document contains an error. The error is considered resolved when the list of files changes @file_hashes Current hashes of all files with the translation +//@description The translation of the document contains an error. The error is considered resolved when the list of files changes +//@file_hashes Current hashes of all files with the translation inputPassportElementErrorSourceTranslationFiles file_hashes:vector = InputPassportElementErrorSource; //@description The file contains an error. The error is considered resolved when the file changes @file_hash Current hash of the file which has the error @@ -5098,7 +5677,10 @@ inputPassportElementErrorSourceFile file_hash:bytes = InputPassportElementErrorS inputPassportElementErrorSourceFiles file_hashes:vector = InputPassportElementErrorSource; -//@description Contains the description of an error in a Telegram Passport element; for bots only @type Type of Telegram Passport element that has the error @message Error message @source Error source +//@description Contains the description of an error in a Telegram Passport element; for bots only +//@type Type of Telegram Passport element that has the error +//@message Error message +//@source Error source inputPassportElementError type:PassportElementType message:string source:InputPassportElementErrorSource = InputPassportElementError; @@ -5193,10 +5775,16 @@ messageSticker sticker:sticker is_premium:Bool = MessageContent; //@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped messageVideo video:video alternative_videos:vector storyboards:vector cover:photo start_timestamp:int32 caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; -//@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped +//@description A video note message +//@video_note The video note description +//@is_viewed True, if at least one of the recipients has viewed the video note +//@is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent; -//@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note +//@description A voice note message +//@voice_note The voice note description +//@caption Voice note caption +//@is_listened True, if at least one of the recipients has listened to the voice note messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent; //@description A self-destructed photo message @@ -5260,6 +5848,20 @@ messageStakeDice initial_state:DiceStickers final_state:DiceStickers value:int32 //@via_mention True, if the story was automatically forwarded because of a mention of the user messageStory story_poster_chat_id:int53 story_id:int32 via_mention:Bool = MessageContent; +//@description A message with an HTML widget +//@width Width of the widget; 0 if the widget must occupy the whole width of the message bubble +//@height Height of the widget; 0 if the height of the widget isn't fixed +//@html HTML code of the widget +//@public_data Public data of the widget +//@chat_data Data of the widget, which is specific to the chat +//@widget_id Identifier of the shared widget; 0 if the widget isn't shared +//@caption Widget caption +//@show_caption_above_media True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget +//@is_copy True, if the message is a copy of the widget +//@can_send_queries True, if the widget can send queries to the bot +//@can_send_background_queries True, if the widget can send queries to the bot in the background +messageWidget width:int32 height:int32 html:string public_data:string chat_data:string widget_id:int64 caption:formattedText show_caption_above_media:Bool is_copy:Bool can_send_queries:Bool can_send_background_queries:Bool = MessageContent; + //@description A message with a checklist @list The checklist description messageChecklist list:checklist = MessageContent; @@ -5284,7 +5886,7 @@ messageCall unique_id:int64 is_video:Bool discard_reason:CallDiscardReason durat //@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 +//-Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call becomes 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 @@ -5293,7 +5895,9 @@ messageCall unique_id:int64 is_video:Bool discard_reason:CallDiscardReason durat //@other_participant_ids Identifiers of some other call participants 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 +//@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; //@description A newly created video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @@ -5302,7 +5906,9 @@ messageVideoChatStarted group_call_id:int32 = MessageContent; //@description A message with information about an ended video chat @duration Call duration, in seconds messageVideoChatEnded duration:int32 = MessageContent; -//@description A message with information about an invitation to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers +//@description A message with information about an invitation to a video chat +//@group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +//@user_ids Invited user identifiers messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector = MessageContent; //@description A message with information about an added poll option @@ -5332,7 +5938,7 @@ 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 +//@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 doesn'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 @@ -5389,7 +5995,9 @@ messageChatSetBackground old_background_message_id:int53 background:chatBackgrou //@description A theme in the chat has been changed @theme New theme for the chat; may be null if chat theme was reset to the default one messageChatSetTheme theme:ChatTheme = MessageContent; -//@description The auto-delete or self-destruct timer for messages in the chat has been changed @message_auto_delete_time New value auto-delete or self-destruct time, in seconds; 0 if disabled @from_user_id If not 0, a user identifier, which default setting was automatically applied +//@description The auto-delete or self-destruct timer for messages in the chat has been changed +//@message_auto_delete_time New value auto-delete or self-destruct time, in seconds; 0 if disabled +//@from_user_id If not 0, a user identifier, which default setting was automatically applied messageChatSetMessageAutoDeleteTime message_auto_delete_time:int32 from_user_id:int53 = MessageContent; //@description The chat was boosted by the sender of the message @boost_count Number of times the chat was boosted @@ -5413,7 +6021,8 @@ messageForumTopicIsClosedToggled is_closed:Bool = MessageContent; //@description A General forum topic has been hidden or unhidden @is_hidden True, if the topic was hidden; otherwise, the topic was unhidden 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 +//@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 @@ -5422,7 +6031,10 @@ 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; -//@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score +//@description A new high score was achieved in a game +//@game_message_id Identifier of the message with the game, can be an identifier of a deleted message +//@game_id Identifier of the game; may be different from the games presented in the message with the game +//@score New score messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent; //@description A bot managed by another bot was created by the user @@ -5552,6 +6164,23 @@ messageGiftedGrams gifter_user_id:int53 receiver_user_id:int53 gram_amount:int53 //@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; +//@description Represents a transfer with the TON wallet of the current user +//@sender_user_id Sender of the transfer; 0 if unknown +//@transaction_id Unique identifier of the transaction; may be empty if the transfer isn't sent yet. Use getTonWalletTransaction to get additional information about the transaction +//@peer_address Address in the TON blockchain of the transaction peer +//@amount The amount of received cryptocurrency, in the smallest units of the cryptocurrency; negative for outgoing transactions +//@comment Comment added to the transaction +//@is_comment_encrypted True, if the comment is encrypted and must be decrypted using the receiver's or sender's private key +messageTonWalletTransfer sender_user_id:int53 transaction_id:string peer_address:string amount:int64 comment:string is_comment_encrypted:Bool = MessageContent; + +//@description A request from a dApp was received through TON Connect +//@session_id Unique identifier of the TON Connect session +//@state State of the request +//@dapp_name Name of the dApp; may be empty if unknown +//@topic Topic of the request; may be empty if none +//@trace_id Identifier to trace the request; may be empty if none +messageTonConnectRequest session_id:int64 state:TonConnectRequestState dapp_name:string topic:string trace_id:string = MessageContent; + //@description A regular gift was received or sent by the current user, or the current user was notified about a channel gift //@gift The gift //@sender_id Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users @@ -5567,12 +6196,13 @@ messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id //@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 //@can_be_upgraded True, if the gift can be upgraded to a unique gift; only for the receiver of the gift +//@can_be_deleted True, if the gift can be deleted using deleteGift; only for the receiver of the gift //@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift //@was_upgraded True, if the gift was upgraded to a unique gift //@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 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; +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 can_be_deleted: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 @@ -5593,7 +6223,7 @@ messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received //@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 text:formattedText is_private:Bool 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 +//@description A gift which purchase, upgrade, or transfer were refunded //@gift The gift //@sender_id Sender of the gift //@receiver_id Receiver of the gift @@ -5617,7 +6247,8 @@ messageUpgradedGiftPurchaseOfferRejected gift:upgradedGift price:GiftResalePrice //@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; -//@description A price for paid messages was changed in the supergroup chat @paid_message_star_count The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message +//@description A price for paid messages was changed in the supergroup chat +//@paid_message_star_count The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message messagePaidMessagePriceChanged paid_message_star_count:int53 = MessageContent; //@description A price for direct messages was changed in the channel chat @@ -5626,6 +6257,9 @@ messagePaidMessagePriceChanged paid_message_star_count:int53 = MessageContent; //-0 if the direct messages group was disabled or the messages are free messageDirectMessagePriceChanged is_enabled:Bool paid_message_star_count:int53 = MessageContent; +//@description The sender of the message used a link of the other user, which allows sending unpaid messages to the user +messageUnpaidMessagesAllowedByLink = MessageContent; + //@description Some tasks from a checklist were marked as done or not done //@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 @@ -5688,7 +6322,10 @@ messagePassportDataSent types:vector = MessageContent; //@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials messagePassportDataReceived elements:vector credentials:encryptedCredentials = MessageContent; -//@description A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users +//@description A user in the chat came within proximity alert range +//@traveler_id The identifier of a user or chat that triggered the proximity alert +//@watcher_id The identifier of a user or chat that subscribed for the proximity alert +//@distance The distance between the users messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent; //@description A message content that is not supported in the current TDLib version @@ -5745,6 +6382,9 @@ textEntityTypePhoneNumber = TextEntityType; //@description A bank card number. The getBankCardInfo method can be used to get information about the bank card textEntityTypeBankCardNumber = TextEntityType; +//@description An address in the TON blockchain +textEntityTypeTonAddress = TextEntityType; + //@description A bold text textEntityTypeBold = TextEntityType; @@ -5778,16 +6418,21 @@ textEntityTypeExpandableBlockQuote = TextEntityType; //@description A text description shown instead of a raw URL @url HTTP or tg:// URL to be opened when the link is clicked textEntityTypeTextUrl url:string = TextEntityType; -//@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user +//@description A text shown instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user textEntityTypeMentionName user_id:int53 = TextEntityType; -//@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji +//@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji +//@custom_emoji_id Unique identifier of the custom emoji textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType; -//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the link preview of the current message, or in the same places in the replied message +//@description A media timestamp +//@media_timestamp Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. +//-The media can be in the content or the link preview of the current message, or in the same places in the replied message textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; -//@description A date and time @unix_time Point in time (Unix timestamp) representing the date and time @formatting_type Date and time formatting type; may be null if none and the original text must not be changed +//@description A date and time +//@unix_time Point in time (Unix timestamp) representing the date and time +//@formatting_type Date and time formatting type; may be null if none and the original text must not be changed textEntityTypeDateTime unix_time:int32 formatting_type:DateTimeFormattingType = TextEntityType; @@ -5804,7 +6449,7 @@ diffEntityTypeDelete = DiffEntityType; //@description A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size -//@thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported +//@thumbnail Thumbnail file to send. Sending thumbnails by inputFileId or inputFileRemote is currently not supported //@width Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown //@height Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; @@ -5868,7 +6513,7 @@ inputVideo video:InputFile thumbnail:inputThumbnail cover:InputFile start_timest //@length Video width and height; must be positive and not greater than 640 inputVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputVideoNote; -//@description A video note to be sent +//@description A voice note to be sent //@voice_note Voice note file to be sent. The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio channel, or be in MP3 or M4A format as regular audio //@duration Duration of the voice note, in seconds //@waveform Waveform representation of the voice note in 5-bit format @@ -5917,7 +6562,8 @@ messageSchedulingStateSendWhenVideoProcessed send_date:int32 = MessageScheduling //@class MessageSelfDestructType @description Describes when a message will be self-destructed -//@description The message will be self-destructed in the specified time after its content was opened @self_destruct_time The message's self-destruct time, in seconds; must be between 0 and 60 in private chats +//@description The message will be self-destructed in the specified time after its content was opened +//@self_destruct_time The message's self-destruct time, in seconds; must be between 0 and 60 in private chats messageSelfDestructTypeTimer self_destruct_time:int32 = MessageSelfDestructType; //@description The message can be opened only once and will be self-destructed once closed @@ -5931,7 +6577,7 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@allow_paid_broadcast Pass true to allow the message to ignore regular broadcast limits for a small fee; for bots only //@paid_message_star_count The number of Telegram Stars the user agreed to pay to send the messages -//@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 +//@update_order_of_installed_sticker_sets Pass true if the user has 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, sendMessageAlbum in private chats and forwardMessages with one message to private chats @@ -6144,7 +6790,8 @@ inputMessageVideoNote video_note:inputVideoNote self_destruct_type:MessageSelfDe //@self_destruct_type Voice note self-destruct type; may be null if none; pass null if none; private chats only inputMessageVoiceNote voice_note:inputVoiceNote caption:formattedText self_destruct_type:MessageSelfDestructType = InputMessageContent; -//@description A message with a live location @location Initial state of the live location to be sent. Live period must be equal to 0x7FFFFFFF for permanent live locations, or between 60 and 86400 +//@description A message with a live location +//@location Initial state of the live location to be sent. Live period must be equal to 0x7FFFFFFF for permanent live locations, or between 60 and 86400 inputMessageLiveLocation location:liveLocation = InputMessageContent; //@description A message with a location @location Location to be sent @@ -6214,6 +6861,25 @@ inputMessageStory story_poster_chat_id:int53 story_id:int32 = InputMessageConten //@checklist The checklist to send inputMessageChecklist checklist:inputChecklist = InputMessageContent; +//@description A message with an HTML widget; for bots only +//@width Width of the widget; 0 if the widget must occupy the whole width of the message bubble +//@height Height of the widget; 0 if the height of the widget isn't fixed +//@html HTML code of the widget; 1-32768 bytes; must not exceed 4096 bytes when compressed by zlib with the maximal compression level +//@public_data Public data of the widget, which will be available in copies and forwards of the message +//@chat_data Data of the widget, which is specific to the chat +//@caption Widget caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget +//@allow_queries Pass true to allow the widget to send queries to the bot +//@is_shared Pass true to create a shared widget, which can be sent again by its identifier +inputMessageWidget width:int32 height:int32 html:string public_data:string chat_data:string caption:formattedText show_caption_above_media:Bool allow_queries:Bool is_shared:Bool = InputMessageContent; + +//@description A message with an existing shared widget; for bots only +//@widget_id Identifier of the shared widget +//@chat_data Data of the widget, which is specific to the chat +//@caption Widget caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media True, if the caption must be shown above the widget; otherwise, the caption must be shown below the widget +inputMessageSharedWidget widget_id:int64 chat_data:string caption:formattedText show_caption_above_media:Bool = InputMessageContent; + //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from //@message_id Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded @@ -6234,7 +6900,7 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool rep //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false //@can_be_deleted_for_all_users True, if the message can be deleted for all users using the method deleteMessages with revoke == true //@can_be_edited True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. -//-For live location, poll, and checklist messages this fields shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message +//-For live location, poll, and checklist messages this field shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message //@can_be_forwarded True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options //@can_be_paid True, if the message can be paid using inputInvoiceMessage //@can_be_pinned True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage @@ -6249,7 +6915,7 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool rep //@can_get_author True, if author of the message sent on behalf of a chat can be received through getMessageAuthor //@can_get_embedding_code True, if code for message embedding can be received using getMessageEmbeddingCode //@can_get_link True, if a link can be generated for the message using getMessageLink -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption, or link preview description using getMessageLink //@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory //@can_get_poll_vote_statistics True, if the message is a poll and vote statistics are available through getPollVoteStatistics //@can_get_read_date True, if read date of the message can be received through getMessageReadDate @@ -6262,10 +6928,11 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool rep //@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@can_report_supergroup_spam True, if the message can be reported using reportSupergroupSpam //@can_set_fact_check True, if fact check for the message can be changed through setMessageFactCheck +//@custom_emoji_ids Identifiers of custom emoji used in the message //@has_protected_content_by_current_user True, if content of the message can't be saved locally, because it is protected by the current user; if true, then can_be_saved is false //@has_protected_content_by_other_user True, if content of the message can't be saved locally, because it is protected by the other user; if true, then can_be_saved is false //@need_show_statistics True, if message statistics must be available from context menu of the message -messageProperties can_add_offer:Bool can_add_tasks:Bool can_be_approved:Bool can_be_copied:Bool can_be_copied_to_secret_chat:Bool can_be_declined:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_paid:Bool can_be_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_delete_reactions:Bool can_edit_media:Bool can_edit_scheduling_state:Bool can_edit_suggested_post_info:Bool can_get_author:Bool can_get_embedding_code:Bool can_get_link:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_poll_vote_statistics:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_video_advertisements:Bool can_get_viewers:Bool can_mark_tasks_as_done:Bool can_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool has_protected_content_by_current_user:Bool has_protected_content_by_other_user:Bool need_show_statistics:Bool = MessageProperties; +messageProperties can_add_offer:Bool can_add_tasks:Bool can_be_approved:Bool can_be_copied:Bool can_be_copied_to_secret_chat:Bool can_be_declined:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_paid:Bool can_be_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_delete_reactions:Bool can_edit_media:Bool can_edit_scheduling_state:Bool can_edit_suggested_post_info:Bool can_get_author:Bool can_get_embedding_code:Bool can_get_link:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_poll_vote_statistics:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_video_advertisements:Bool can_get_viewers:Bool can_mark_tasks_as_done:Bool can_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool custom_emoji_ids:vector has_protected_content_by_current_user:Bool has_protected_content_by_other_user:Bool need_show_statistics:Bool = MessageProperties; //@description Contains properties of a poll option and describes actions that can be done with the option right now //@can_be_deleted True, if the option can be deleted using deletePollOption @@ -6418,13 +7085,16 @@ userStatusOnline expires:int32 = UserStatus; //@description The user is offline @was_online Point in time (Unix timestamp) when the user was last online userStatusOffline was_online:int32 = UserStatus; -//@description The user was online recently @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +//@description The user was online recently +//@by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium userStatusRecently by_my_privacy_settings:Bool = UserStatus; -//@description The user is offline, but was online last week @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +//@description The user is offline, but was online last week +//@by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium userStatusLastWeek by_my_privacy_settings:Bool = UserStatus; -//@description The user is offline, but was online last month @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +//@description The user is offline, but was online last month +//@by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium userStatusLastMonth by_my_privacy_settings:Bool = UserStatus; @@ -6479,7 +7149,10 @@ stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_o //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; -//@description Represents a list of trending sticker sets @total_count Approximate total number of trending sticker sets @sets List of trending sticker sets @is_premium True, if the list contains sticker sets with premium stickers +//@description Represents a list of trending sticker sets +//@total_count Approximate total number of trending sticker sets +//@sets List of trending sticker sets +//@is_premium True, if the list contains sticker sets with premium stickers trendingStickerSets total_count:int32 sets:vector is_premium:Bool = TrendingStickerSets; @@ -6526,16 +7199,6 @@ emojiCategoryTypeChatPhoto = EmojiCategoryType; currentWeather temperature:double emoji:string = CurrentWeather; -//@description Describes position of a clickable rectangle area on a story media -//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width -//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height -//@width_percentage The width of the rectangle, as a percentage of the media width -//@height_percentage The height of the rectangle, as a percentage of the media height -//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 -//@corner_radius_percentage The radius of the rectangle corner rounding, as a percentage of the media width -storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double corner_radius_percentage:double = StoryAreaPosition; - - //@class StoryAreaType @description Describes type of clickable area on a story media //@description An area pointing to a location @location The location @address Address of the location; may be null if unknown @@ -6554,7 +7217,7 @@ storyAreaTypeSuggestedReaction reaction_type:ReactionType total_count:int32 is_d //@description An area pointing to a message @chat_id Identifier of the chat with the message @message_id Identifier of the message storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; -//@description An area pointing to a HTTP or tg:// link @url HTTP or tg:// URL to be opened when the area is clicked +//@description An area pointing to an HTTP or tg:// link @url HTTP or tg:// URL to be opened when the area is clicked storyAreaTypeLink url:string = StoryAreaType; //@description An area with information about weather @@ -6569,7 +7232,7 @@ storyAreaTypeUpgradedGift gift_name:string = StoryAreaType; //@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area -storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; +storyArea position:areaPosition type:StoryAreaType = StoryArea; //@class InputStoryAreaType @description Describes type of clickable area on a story media to be added @@ -6577,11 +7240,6 @@ storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; //@description An area pointing to a location @location The location @address Address of the location; pass null if unknown inputStoryAreaTypeLocation location:location address:locationAddress = InputStoryAreaType; -//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username") -//@query_id Identifier of the inline query, used to found the venue -//@result_id Identifier of the inline query result -inputStoryAreaTypeFoundVenue query_id:int64 result_id:string = InputStoryAreaType; - //@description An area pointing to a venue already added to the story //@venue_provider Provider of the venue //@venue_id Identifier of the venue in the provider database @@ -6598,7 +7256,7 @@ inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_f //@message_id Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable inputStoryAreaTypeMessage chat_id:int53 message_id:int53 = InputStoryAreaType; -//@description An area pointing to a HTTP or tg:// link +//@description An area pointing to an HTTP or tg:// link //@url HTTP or tg:// URL to be opened when the area is clicked inputStoryAreaTypeLink url:string = InputStoryAreaType; @@ -6613,10 +7271,10 @@ inputStoryAreaTypeUpgradedGift gift_name:string = InputStoryAreaType; //@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area -inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; +inputStoryArea position:areaPosition type:InputStoryAreaType = InputStoryArea; //@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have -//-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, +//-up to 10 inputStoryAreaTypeLocation and inputStoryAreaTypePreviousVenue areas, //-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, //-up to 1 inputStoryAreaTypeMessage area, //-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, @@ -6698,7 +7356,9 @@ storyListArchive = StoryList; //@class StoryOrigin @description Contains information about the origin of a story that was reposted -//@description The original story was a public story that was posted by a known chat @chat_id Identifier of the chat that posted original story @story_id Story identifier of the original story +//@description The original story was a public story that was posted by a known chat +//@chat_id Identifier of the chat that posted original story +//@story_id Story identifier of the original story storyOriginPublicStory chat_id:int53 story_id:int32 = StoryOrigin; //@description The original story was posted by an unknown user @poster_name Name of the user or the chat that posted the story @@ -6744,8 +7404,9 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@content Content of the story //@areas Clickable areas to be shown on the story content //@caption Caption of the story +//@music Music attached to the story; may be null if none //@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_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; +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 music:audio album_ids:vector = Story; //@description Represents a list of stories //@total_count Approximate total number of stories found @@ -6753,7 +7414,10 @@ story id:int32 poster_chat_id:int53 poster_id:MessageSender date:int32 is_being_ //@pinned_story_ids Identifiers of the pinned stories; returned only in getChatPostedToChatPageStories with from_story_id == 0 stories total_count:int32 stories:vector pinned_story_ids:vector = Stories; -//@description Contains a list of stories found by a search @total_count Approximate total number of stories found @stories List of stories @next_offset The offset for the next request. If empty, then there are no more results +//@description Contains a list of stories found by a search +//@total_count Approximate total number of stories found +//@stories List of stories +//@next_offset The offset for the next request. If empty, then there are no more results foundStories total_count:int32 stories:vector next_offset:string = FoundStories; //@description Describes album of stories @@ -6781,7 +7445,7 @@ storyInfo story_id:int32 date:int32 is_for_close_friends:Bool is_live:Bool = Sto //@description Describes active stories posted by a chat //@chat_id Identifier of the chat that posted the stories //@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list -//@order A parameter used to determine order of the stories in the story list; 0 if the stories don't need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order +//@order A parameter used to determine order of the stories in the story list; 0 if the stories don't need to be shown in the story list. Stories must be sorted by the pair (order, chat_id) in descending order //@can_be_archived True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list //-only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can't be archived nor hidden using removeTopChat //@max_read_story_id Identifier of the last read active story @@ -6916,7 +7580,7 @@ chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; //@description The chat created a giveaway //@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 +//@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 giveaways 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 //@is_unclaimed True, if the winner for the corresponding giveaway prize wasn't chosen, because there were not enough participants @@ -7056,7 +7720,9 @@ inputCallFromMessage chat_id:int53 message_id:int53 = InputCall; //@class CallState @description Describes the current call state -//@description The call is pending, waiting to be accepted by a user @is_created True, if the call has already been created by the server @is_received True, if the call has already been received by the other party +//@description The call is pending, waiting to be accepted by a user +//@is_created True, if the call has already been created by the server +//@is_received True, if the call has already been received by the other party callStatePending is_created:Bool is_received:Bool = CallState; //@description The call has been answered and encryption keys are being exchanged @@ -7120,7 +7786,7 @@ groupCallStreams streams:vector = GroupCallStreams; rtmpUrl url:string stream_key:string = RtmpUrl; -//@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, is the user has spoken recently +//@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, if the user has spoken recently groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCallRecentSpeaker; //@description Describes a group call @@ -7159,7 +7825,9 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@duration Call duration, in seconds; for ended calls only 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 +//@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; //@description Contains information about a group call participant's video channel @@ -7192,7 +7860,9 @@ groupCallParticipant participant_id:MessageSender audio_source_id:int32 screen_s //@description Contains identifiers of group call participants @total_count Total number of group call participants @participant_ids Identifiers of the participants groupCallParticipants total_count:int32 participant_ids:vector = GroupCallParticipants; -//@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 +//@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 @@ -7212,7 +7882,7 @@ groupCallMessage message_id:int32 sender_id:MessageSender date:int32 text:format //@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 +//@background_color Background color for the message in 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; @@ -7298,7 +7968,9 @@ call id:int32 unique_id:int64 user_id:int53 is_outgoing:Bool is_video:Bool state //@description Settings for Firebase Authentication in the official Android application firebaseAuthenticationSettingsAndroid = FirebaseAuthenticationSettings; -//@description Settings for Firebase Authentication in the official iOS application @device_token Device token from Apple Push Notification service @is_app_sandbox True, if App Sandbox is enabled +//@description Settings for Firebase Authentication in the official iOS application +//@device_token Device token from Apple Push Notification service +//@is_app_sandbox True, if App Sandbox is enabled firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = FirebaseAuthenticationSettings; @@ -7307,7 +7979,9 @@ firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = Fire //@allow_missed_call Pass true if the authentication code may be sent via a missed call to the specified phone number //@is_current_phone_number Pass true if the authenticated phone number is used on the current device //@has_unknown_phone_number Pass true if there is a SIM card in the current device, but it is not possible to check whether phone number matches -//@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details +//@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API +//-(requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. +//-See https://developers.google.com/identity/sms-retriever/ for more details //@firebase_authentication_settings For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication //@authentication_tokens List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions; for setAuthenticationPhoneNumber only phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool has_unknown_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector = PhoneNumberAuthenticationSettings; @@ -7320,7 +7994,10 @@ phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool i //@date Point in time (Unix timestamp) when the reaction was added addedReaction type:ReactionType sender_id:MessageSender is_outgoing:Bool date:int32 = AddedReaction; -//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, then there are no more results +//@description Represents a list of reactions added to a message +//@total_count The total number of found reactions +//@reactions The list of added reactions +//@next_offset The offset for the next request. If empty, then there are no more results addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; //@description Represents an available reaction @type Type of the reaction @needs_premium True, if Telegram Premium is needed to send the reaction @@ -7404,6 +8081,9 @@ speechRecognitionResultText text:string = SpeechRecognitionResult; //@description The speech recognition failed @error Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized speechRecognitionResultError error:error = SpeechRecognitionResult; +//@description Contains a list of probable languages of speech @language_codes IETF language tags of the languages in descending order of their probability; for example, "en-US" +speechRecognitionLanguages language_codes:vector = SpeechRecognitionLanguages; + //@description Describes a connection of the bot with a business account //@id Unique identifier of the connection @@ -7415,7 +8095,9 @@ speechRecognitionResultError error:error = SpeechRecognitionResult; businessConnection id:string user_id:int53 user_chat_id:int53 date:int32 rights:businessBotRights is_enabled:Bool = BusinessConnection; -//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB format for light themes @dark_color Color in the RGB format for dark themes +//@description Describes a color to highlight a bot added to attachment menu +//@light_color Color in the RGB format for light themes +//@dark_color Color in the RGB format for dark themes attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; //@description Represents a bot, which can be added to attachment or side menu @@ -7464,8 +8146,11 @@ botWriteAccessAllowReasonAcceptedRequest = BotWriteAccessAllowReason; httpUrl url:string = HttpUrl; -//@description Contains an HTTPS URL, which can be used to get information about a user @url The URL @expires_in Left time for which the link is valid, in seconds; 0 if the link is a public username link -userLink url:string expires_in:int32 = UserLink; +//@description Contains an HTTPS URL, which can be used to get information about a user +//@url The URL +//@expires_in Left time for which the link is valid, in seconds; 0 if the link is permanent +//@can_get_permanent_link True, if a permanent link to the current user can be received; false if all links to the current user expire +userLink url:string expires_in:int32 can_get_permanent_link:Bool = UserLink; //@description Describes allowed types for the target chat @@ -7501,7 +8186,8 @@ targetChatInternalLink link:InternalLinkType = TargetChat; //@video_width Width of the video //@video_height Height of the video //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAnimation, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageAnimation, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thumbnail_mime_type:string video_url:string video_mime_type:string video_duration:int32 video_width:int32 video_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an article or web page @@ -7513,7 +8199,8 @@ inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thum //@thumbnail_width Thumbnail width, if known //@thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultArticle id:string url:string title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an MP3 audio file @@ -7523,7 +8210,8 @@ inputInlineQueryResultArticle id:string url:string title:string description:stri //@audio_url The URL of the audio file //@audio_duration Audio file duration, in seconds //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageAudio, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageAudio, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultAudio id:string title:string performer:string audio_url:string audio_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a user contact @@ -7533,7 +8221,8 @@ inputInlineQueryResultAudio id:string title:string performer:string audio_url:st //@thumbnail_width Thumbnail width, if known //@thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultContact id:string contact:contact thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a file @@ -7546,7 +8235,8 @@ inputInlineQueryResultContact id:string contact:contact thumbnail_url:string thu //@thumbnail_width Width of the thumbnail //@thumbnail_height Height of the thumbnail //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageDocument, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageDocument, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultDocument id:string title:string description:string document_url:string mime_type:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a game @@ -7564,7 +8254,8 @@ inputInlineQueryResultGame id:string game_short_name:string reply_markup:ReplyMa //@thumbnail_width Thumbnail width, if known //@thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultLocation id:string location:location live_period:int32 title:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents link to a JPEG image @@ -7576,7 +8267,8 @@ inputInlineQueryResultLocation id:string location:location live_period:int32 tit //@photo_width Width of the photo //@photo_height Height of the photo //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessagePhoto, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessagePhoto, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultPhoto id:string title:string description:string thumbnail_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a WEBP, TGS, or WEBM sticker @@ -7586,7 +8278,8 @@ inputInlineQueryResultPhoto id:string title:string description:string thumbnail_ //@sticker_width Width of the sticker //@sticker_height Height of the sticker //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageSticker, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageSticker, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents information about a venue @@ -7596,7 +8289,8 @@ inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string //@thumbnail_width Thumbnail width, if known //@thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultVenue id:string venue:venue thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a page containing an embedded video player or a video file @@ -7610,7 +8304,8 @@ inputInlineQueryResultVenue id:string venue:venue thumbnail_url:string thumbnail //@video_height Height of the video //@video_duration Video duration, in seconds //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVideo, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageVideo, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultVideo id:string title:string description:string thumbnail_url:string video_url:string mime_type:string video_width:int32 video_height:int32 video_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an opus-encoded audio file within an OGG container, single channel audio @@ -7619,7 +8314,8 @@ inputInlineQueryResultVideo id:string title:string description:string thumbnail_ //@voice_note_url The URL of the voice note file //@voice_note_duration Duration of the voice note, in seconds //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null -//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, inputMessageVoiceNote, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue or inputMessageContact +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageRichMessage, +//-inputMessageVoiceNote, inputMessageInvoice, inputMessageLiveLocation, inputMessageLocation, inputMessageVenue, inputMessageWidget, inputMessageSharedWidget, or inputMessageContact inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voice_note_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -7703,7 +8399,8 @@ inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQ //@class InlineQueryResultsButtonType @description Represents type of button in results of inline query -//@description Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter @parameter The parameter for the bot start message +//@description Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter +//@parameter The parameter for the bot start message inlineQueryResultsButtonTypeStartBot parameter:string = InlineQueryResultsButtonType; //@description Describes the button that opens a Web App by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl @@ -7742,16 +8439,53 @@ preparedInlineMessage inline_query_id:int64 result:InlineQueryResult chat_types: //@description The payload for a general callback button @data Data that was attached to the callback button callbackQueryPayloadData data:bytes = CallbackQueryPayload; -//@description The payload for a callback button requiring password @password The 2-step verification password for the current user @data Data that was attached to the callback button +//@description The payload for a callback button requiring password +//@password The 2-step verification password for the current user +//@data Data that was attached to the callback button callbackQueryPayloadDataWithPassword password:string data:bytes = CallbackQueryPayload; //@description The payload for a game callback button @game_short_name A short name of the game that was attached to the callback button callbackQueryPayloadGame game_short_name:string = CallbackQueryPayload; -//@description Contains a bot's answer to a callback query @text Text of the answer @show_alert True, if an alert must be shown to the user instead of a toast notification @url URL to be opened +//@description Contains a bot's answer to a callback query +//@text Text of the answer +//@show_alert True, if an alert must be shown to the user instead of a toast notification +//@url URL to be opened callbackQueryAnswer text:string show_alert:Bool url:string = CallbackQueryAnswer; +//@description Describes a TON wallet of the user, who is used in a widget query +//@address Address of the wallet +//@gram_amount Balance of the wallet, in the smallest units of the cryptocurrency +//@public_key Public key of the wallet; may be empty if unknown +//@state_init Serialized StateInit of the wallet contract; must be empty if and only if public_key is empty +widgetQueryWallet address:string gram_amount:int64 public_key:bytes state_init:bytes = WidgetQueryWallet; + + +//@class WidgetQueryType @description Describes type of a widget query + +//@description The query contains data for the bot @with_wallet True, if the TON wallet card of the user who sends the query is sent to the bot along with the query +widgetQueryTypeData with_wallet:Bool = WidgetQueryType; + +//@description The query contains data signed by a TON wallet of the user who sends the query +//@wallet The wallet that signed the data +//@sign_data JSON-serialized signed data +widgetQueryTypeSignData wallet:widgetQueryWallet sign_data:string = WidgetQueryType; + +//@description The query notifies the bot about a transaction sent from a TON wallet of the user who sends the query +//@wallet The wallet from which the transaction was sent +//@msg_hash Value of msg_hash of the transaction +widgetQueryTypeSentTransaction wallet:widgetQueryWallet msg_hash:string = WidgetQueryType; + + +//@description Contains an answer to a widget query @data Data returned by the bot +widgetQueryAnswer data:string = WidgetQueryAnswer; + +//@description Contains public data of a widget +//@data Public data of the widget +//@poll_period The number of seconds after which the public data can be polled again +widgetPublicData data:string poll_period:int32 = WidgetPublicData; + //@description Contains the result of a custom request @result A JSON-serialized result customRequestResult result:string = CustomRequestResult; @@ -7769,7 +8503,9 @@ gameHighScores scores:vector = GameHighScores; //@description A message was edited @old_message The original message before the edit @new_message The message after it was edited chatEventMessageEdited old_message:message new_message:message = ChatEventAction; -//@description A message was deleted @message Deleted message @can_report_anti_spam_false_positive True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive +//@description A message was deleted +//@message Deleted message +//@can_report_anti_spam_false_positive True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive chatEventMessageDeleted message:message can_report_anti_spam_false_positive:Bool = ChatEventAction; //@description A message was pinned @message Pinned message @@ -7784,10 +8520,14 @@ chatEventPollStopped message:message = ChatEventAction; //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; -//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat @via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +//@description A new member joined the chat via an invite link +//@invite_link Invite link used to join the chat +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder chatEventMemberJoinedByInviteLink invite_link:chatInviteLink via_chat_folder_invite_link:Bool = ChatEventAction; -//@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null +//@description A new member was accepted to the chat by an administrator +//@approver_user_id User identifier of the chat administrator, approved user join request +//@invite_link Invite link used to join the chat; may be null chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; //@description A new chat member was invited @user_id New member user identifier @status New member status @@ -7796,16 +8536,25 @@ chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction; //@description A member left the chat chatEventMemberLeft = ChatEventAction; -//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member +//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed +//@user_id Affected chat member user identifier +//@old_status Previous status of the chat member +//@new_status New status of the chat member chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; -//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member +//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed +//@member_id Affected chat member identifier +//@old_status Previous status of the chat member +//@new_status New status of the chat member chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; //@description A chat member tag has been changed @user_id Affected chat member user identifier @old_tag Previous tag of the chat member @new_tag New tag of the chat member chatEventMemberTagChanged user_id:int53 old_tag:string new_tag:string = ChatEventAction; -//@description A chat member extended their subscription to the chat @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member +//@description A chat member extended their subscription to the chat +//@user_id Affected chat member user identifier +//@old_status Previous status of the chat member +//@new_status New status of the chat member chatEventMemberSubscriptionExtended user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; //@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions @@ -7826,7 +8575,9 @@ chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = C //@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction; -//@description The message auto-delete timer was changed @old_message_auto_delete_time Previous value of message_auto_delete_time @new_message_auto_delete_time New value of message_auto_delete_time +//@description The message auto-delete timer was changed +//@old_message_auto_delete_time Previous value of message_auto_delete_time +//@new_message_auto_delete_time New value of message_auto_delete_time chatEventMessageAutoDeleteTimeChanged old_message_auto_delete_time:int32 new_message_auto_delete_time:int32 = ChatEventAction; //@description The chat permissions were changed @old_permissions Previous chat permissions @new_permissions New chat permissions @@ -7835,13 +8586,19 @@ chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chat //@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; -//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds +//@description The slow_mode_delay setting of a supergroup was changed +//@old_slow_mode_delay Previous value of slow_mode_delay, in seconds +//@new_slow_mode_delay New value of slow_mode_delay, in seconds chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; -//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +//@description The supergroup sticker set was changed +//@old_sticker_set_id Previous identifier of the chat sticker set; 0 if none +//@new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; -//@description The supergroup sticker set with allowed custom emoji was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +//@description The supergroup sticker set with allowed custom emoji was changed +//@old_sticker_set_id Previous identifier of the chat sticker set; 0 if none +//@new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventCustomEmojiStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; //@description The chat title was changed @old_title Previous chat title @new_title New chat title @@ -7867,7 +8624,7 @@ chatEventAccentColorChanged old_accent_color_id:int32 old_background_custom_emoj //@new_profile_background_custom_emoji_id New identifier of the custom emoji; 0 if none chatEventProfileAccentColorChanged old_profile_accent_color_id:int32 old_profile_background_custom_emoji_id:int64 new_profile_accent_color_id:int32 new_profile_background_custom_emoji_id:int64 = ChatEventAction; -//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content +//@description The has_protected_content setting of a chat was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; //@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission @@ -7909,10 +8666,12 @@ chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEv //@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; -//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents +//@description A video chat participant volume level was changed +//@participant_id Identifier of the affected group call participant +//@volume_level New value of volume_level; 1-20000 in hundreds of percents chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; -//@description The is_forum setting of a channel was toggled @is_forum New value of is_forum +//@description The is_forum setting of a supergroup was toggled @is_forum New value of is_forum chatEventIsForumToggled is_forum:Bool = ChatEventAction; //@description A new forum topic was created @topic_info Information about the topic @@ -7930,7 +8689,9 @@ chatEventForumTopicToggleIsHidden topic_info:forumTopicInfo = ChatEventAction; //@description A forum topic was deleted @topic_info Information about the topic chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction; -//@description A pinned forum topic was changed @old_topic_info Information about the old pinned topic; may be null @new_topic_info Information about the new pinned topic; may be null +//@description A pinned forum topic was changed +//@old_topic_info Information about the old pinned topic; may be null +//@new_topic_info Information about the new pinned topic; may be null chatEventForumTopicPinned old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction; //@description Represents a chat event @@ -8116,7 +8877,7 @@ premiumFeatureAnimatedProfilePhoto = PremiumFeature; //@description The ability to set a custom emoji as a forum topic icon premiumFeatureForumTopicIcon = PremiumFeature; -//@description Allowed to set a premium application icons +//@description Allowed to set premium application icons premiumFeatureAppIcons = PremiumFeature; //@description Allowed to translate chat messages real-time @@ -8207,7 +8968,7 @@ businessFeatureUpgradedStories = BusinessFeature; //@description Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels premiumStoryFeaturePriorityOrder = PremiumStoryFeature; -//@description The ability to hide the fact that the user viewed other's stories +//@description The ability to hide the fact that the user viewed others' stories premiumStoryFeatureStealthMode = PremiumStoryFeature; //@description The ability to check who opened the current user's stories after they expire @@ -8216,7 +8977,7 @@ premiumStoryFeaturePermanentViewsHistory = PremiumStoryFeature; //@description The ability to set custom expiration duration for stories premiumStoryFeatureCustomExpirationDuration = PremiumStoryFeature; -//@description The ability to save other's unprotected stories +//@description The ability to save others' unprotected stories premiumStoryFeatureSaveStories = PremiumStoryFeature; //@description The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas @@ -8226,7 +8987,10 @@ premiumStoryFeatureLinksAndFormatting = PremiumStoryFeature; premiumStoryFeatureVideoQuality = PremiumStoryFeature; -//@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users +//@description Contains information about a limit, increased for Premium users +//@type The type of the limit +//@default_value Default value of the limit +//@premium_value Value of the limit for Premium users premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; //@description Contains information about features, available to Premium users @@ -8247,7 +9011,7 @@ premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource; //@description A user tried to use a Premium feature @feature The used feature premiumSourceFeature feature:PremiumFeature = PremiumSource; -//@description A user tried to use a Business feature @feature The used feature; pass null if none specific feature was used +//@description A user tried to use a Business feature @feature The used feature; pass null if no specific feature was used premiumSourceBusinessFeature feature:BusinessFeature = PremiumSource; //@description A user tried to use a Premium story feature @feature The used feature @@ -8276,7 +9040,9 @@ premiumState state:formattedText payment_options:vector