diff --git a/client/function.go b/client/function.go index c68b368..9d5d34a 100755 --- a/client/function.go +++ b/client/function.go @@ -418,6 +418,35 @@ func (client *Client) CheckAuthenticationPasskey(req *CheckAuthenticationPasskey return UnmarshalOk(result.Data) } +type CheckAuthenticationWebTokenRequest struct { + // The token to check + Token string `json:"token"` + // Identifier of the datacenter of the user + DcId int32 `json:"dc_id"` +} + +// Checks a web token to log in to the corresponding account; for official Telegram apps only. Works only when the current authorization state is authorizationStateWaitPhoneNumber or authorizationStateWaitOtherDeviceConfirmation +func (client *Client) CheckAuthenticationWebToken(req *CheckAuthenticationWebTokenRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationWebToken", + }, + Data: map[string]interface{}{ + "token": req.Token, + "dc_id": req.DcId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type RegisterUserRequest struct { // The first name of the user; 1-64 characters FirstName string `json:"first_name"` @@ -1620,6 +1649,35 @@ func (client *Client) GetMessages(req *GetMessagesRequest) (*Messages, error) { return UnmarshalMessages(result.Data) } +type GetFullRichMessageRequest struct { + // Identifier of the chat the messages belong to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns the full version of a rich message +func (client *Client) GetFullRichMessage(req *GetFullRichMessageRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getFullRichMessage", + }, + 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 UnmarshalRichMessage(result.Data) +} + type GetMessagePropertiesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -1848,7 +1906,7 @@ type GetRemoteFileRequest struct { FileType FileType `json:"file_type"` } -// Returns information about a file by its remote identifier. This is an offline method. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application +// Returns information about a file by its remote identifier. This is an offline method. Can be used to register a URL as a file for further uploading, or sending as a message. Even if the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -1957,6 +2015,8 @@ func (client *Client) SearchPublicChat(req *SearchPublicChatRequest) (*Chat, err type SearchPublicChatsRequest struct { // Query to search for Query string `json:"query"` + // Additional filter for type of the chats to be returned; pass null to search for chats of all types + TypeFilter SearchChatTypeFilter `json:"type_filter"` } // Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results. Excludes private chats with contacts and chats from the chat list from the results @@ -1967,6 +2027,7 @@ func (client *Client) SearchPublicChats(req *SearchPublicChatsRequest) (*Chats, }, Data: map[string]interface{}{ "query": req.Query, + "type_filter": req.TypeFilter, }, }) if err != nil { @@ -1983,6 +2044,8 @@ func (client *Client) SearchPublicChats(req *SearchPublicChatsRequest) (*Chats, type SearchChatsRequest struct { // Query to search for. If the query is empty, returns up to 50 recently found chats Query string `json:"query"` + // Additional filter for type of the chats to be returned; pass null to search for chats of all types + TypeFilter SearchChatTypeFilter `json:"type_filter"` // The maximum number of chats to be returned Limit int32 `json:"limit"` } @@ -1995,6 +2058,7 @@ func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { }, Data: map[string]interface{}{ "query": req.Query, + "type_filter": req.TypeFilter, "limit": req.Limit, }, }) @@ -2012,6 +2076,8 @@ func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { type SearchChatsOnServerRequest struct { // Query to search for Query string `json:"query"` + // Additional filter for type of the chats to be returned; pass null to search for chats of all types + TypeFilter SearchChatTypeFilter `json:"type_filter"` // The maximum number of chats to be returned Limit int32 `json:"limit"` } @@ -2024,6 +2090,7 @@ func (client *Client) SearchChatsOnServer(req *SearchChatsOnServerRequest) (*Cha }, Data: map[string]interface{}{ "query": req.Query, + "type_filter": req.TypeFilter, "limit": req.Limit, }, }) @@ -2286,6 +2353,8 @@ func (client *Client) RemoveTopChat(req *RemoveTopChatRequest) (*Ok, error) { type SearchRecentlyFoundChatsRequest struct { // Query to search for Query string `json:"query"` + // Additional filter for type of the chats to be returned; pass null to search for chats of all types + TypeFilter SearchChatTypeFilter `json:"type_filter"` // The maximum number of chats to be returned Limit int32 `json:"limit"` } @@ -2298,6 +2367,7 @@ func (client *Client) SearchRecentlyFoundChats(req *SearchRecentlyFoundChatsRequ }, Data: map[string]interface{}{ "query": req.Query, + "type_filter": req.TypeFilter, "limit": req.Limit, }, }) @@ -3826,7 +3896,7 @@ type SearchChatRecentLocationMessagesRequest struct { Limit int32 `json:"limit"` } -// Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user +// Returns information about the recent live locations of chat members that were sent to the chat. Returns at most one live location message per user func (client *Client) SearchChatRecentLocationMessages(req *SearchChatRecentLocationMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3890,7 +3960,7 @@ type GetChatSparseMessagePositionsRequest struct { SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } -// Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database +// Returns sparse positions of messages of the specified type in the chat to be used for Shared Media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePositionsRequest) (*MessagePositions, error) { result, err := client.Send(Request{ meta: meta{ @@ -4729,7 +4799,7 @@ type AddTextCompositionStyleRequest struct { Name string `json:"name"` } -// Adds a custom text composition style to the list of used by the user styles. May return an error with a message "TONES_SAVED_TOO_MANY" if the maximum number of added custom styles has been reached +// Adds a custom text composition style to the list of used by the user styles. May return an error with a message "TONES_SAVED_TOO_MANY" if the maximum number of added custom styles getOption("added_text_composition_style_count_max") has been reached func (client *Client) AddTextCompositionStyle(req *AddTextCompositionStyleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4779,7 +4849,7 @@ func (client *Client) RemoveTextCompositionStyle(req *RemoveTextCompositionStyle type TranslateTextRequest struct { // Text to translate Text *FormattedText `json:"text"` - // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" + // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pt-BR", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" ToLanguageCode string `json:"to_language_code"` // Tone of the translation; must be one of "", "formal", "neutral", "casual"; defaults to "neutral" Tone string `json:"tone"` @@ -4808,6 +4878,38 @@ func (client *Client) TranslateText(req *TranslateTextRequest) (*FormattedText, return UnmarshalFormattedText(result.Data) } +type TranslateRichMessageRequest struct { + // Rich message to translate + Message *InputRichMessage `json:"message"` + // Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values + ToLanguageCode string `json:"to_language_code"` + // Tone of the translation; see translateText.tone for the list of supported values + Tone string `json:"tone"` +} + +// Translates a rich message to the given language +func (client *Client) TranslateRichMessage(req *TranslateRichMessageRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateRichMessage", + }, + Data: map[string]interface{}{ + "message": req.Message, + "to_language_code": req.ToLanguageCode, + "tone": req.Tone, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRichMessage(result.Data) +} + type TranslateMessageTextRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -4843,6 +4945,41 @@ func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*F return UnmarshalFormattedText(result.Data) } +type TranslateMessageRichMessageRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values + ToLanguageCode string `json:"to_language_code"` + // Tone of the translation; see translateText.tone for the list of supported values + Tone string `json:"tone"` +} + +// Extracts rich message of the given message and translates it to the given language +func (client *Client) TranslateMessageRichMessage(req *TranslateMessageRichMessageRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateMessageRichMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "to_language_code": req.ToLanguageCode, + "tone": req.Tone, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRichMessage(result.Data) +} + type SummarizeMessageRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -4913,6 +5050,76 @@ func (client *Client) ComposeTextWithAi(req *ComposeTextWithAiRequest) (*Formatt return UnmarshalFormattedText(result.Data) } +type ComposeRichMessageWithAiRequest struct { + // The original message + 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 + 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"` + // Pass true to add emoji to the text + AddEmojis bool `json:"add_emojis"` +} + +// Changes a rich message using an AI model. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) ComposeRichMessageWithAi(req *ComposeRichMessageWithAiRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "composeRichMessageWithAi", + }, + Data: map[string]interface{}{ + "message": req.Message, + "translate_to_language_code": req.TranslateToLanguageCode, + "style_name": req.StyleName, + "custom_prompt": req.CustomPrompt, + "add_emojis": req.AddEmojis, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRichMessage(result.Data) +} + +type CreateRichMessageWithAiRequest struct { + // Prompt that will be used to create the message; 0-getOption("text_composition_style_prompt_length_max") characters + Prompt string `json:"prompt"` + // Pass a language code in which the text will be created + LanguageCode string `json:"language_code"` + // Pass true to add emoji to the text + AddEmojis bool `json:"add_emojis"` +} + +// Creates a new rich message using an AI model. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) CreateRichMessageWithAi(req *CreateRichMessageWithAiRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createRichMessageWithAi", + }, + Data: map[string]interface{}{ + "prompt": req.Prompt, + "language_code": req.LanguageCode, + "add_emojis": req.AddEmojis, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRichMessage(result.Data) +} + type FixTextWithAiRequest struct { // The original text Text *FormattedText `json:"text"` @@ -4939,6 +5146,32 @@ func (client *Client) FixTextWithAi(req *FixTextWithAiRequest) (*FixedText, erro return UnmarshalFixedText(result.Data) } +type FixRichMessageWithAiRequest struct { + // The original message + Message *InputRichMessage `json:"message"` +} + +// Fixes a rich message using an AI model. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) FixRichMessageWithAi(req *FixRichMessageWithAiRequest) (*RichMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "fixRichMessageWithAi", + }, + 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"` @@ -5347,6 +5580,56 @@ func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreensho return UnmarshalOk(result.Data) } +type SendEphemeralMessageRequest struct { + // Target chat + ChatId int64 `json:"chat_id"` + // Topic in which the message will be sent; pass null if none + TopicId MessageTopic `json:"topic_id"` + // Identifier of the user who will receive the message + ReceiverUserId int64 `json:"receiver_user_id"` + // Identifier of the callback query which triggered the message; for bots only + CallbackQueryId JsonInt64 `json:"callback_query_id"` + // Information about the message to be replied; pass null if none. The message can be an incoming ephemeral message + ReplyTo InputMessageReplyTo `json:"reply_to"` + // 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 + OnlyPreview bool `json:"only_preview"` + // Markup for replying to the message; pass null if none; for bots only + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, inputMessageLocation, inputMessageVenue, inputMessageContact + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Sends an ephemeral message which will be received only by one bot in a chat. Currently, only ephemeral bot commands and replies to bot ephemeral messages can be sent using the method. The message is persistent across application restarts only if the message database is used. Returns the sent message +func (client *Client) SendEphemeralMessage(req *SendEphemeralMessageRequest) (*Message, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendEphemeralMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "topic_id": req.TopicId, + "receiver_user_id": req.ReceiverUserId, + "callback_query_id": req.CallbackQueryId, + "reply_to": req.ReplyTo, + "sending_id": req.SendingId, + "only_preview": req.OnlyPreview, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessage(result.Data) +} + type AddLocalMessageRequest struct { // Target chat; channel direct messages chats aren't supported ChatId int64 `json:"chat_id"` @@ -5417,6 +5700,38 @@ func (client *Client) DeleteMessages(req *DeleteMessagesRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type DeleteEphemeralMessageRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the user who received the message + ReceiverUserId int64 `json:"receiver_user_id"` + // Identifiers of the message to be deleted + EphemeralMessageId int32 `json:"ephemeral_message_id"` +} + +// Deletes an ephemeral message; for bots only +func (client *Client) DeleteEphemeralMessage(req *DeleteEphemeralMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteEphemeralMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "receiver_user_id": req.ReceiverUserId, + "ephemeral_message_id": req.EphemeralMessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type DeleteChatMessagesBySenderRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5488,7 +5803,7 @@ type EditMessageTextRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New text content of the message. Must be of type inputMessageText + // New text content of the message. Must be of type inputMessageText or inputMessageRichMessage InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -5523,14 +5838,8 @@ type EditMessageLiveLocationRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New location content of the message; pass null to stop sharing the live location - Location *Location `json:"location"` - // New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period - LivePeriod int32 `json:"live_period"` - // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown - Heading int32 `json:"heading"` - // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled - ProximityAlertRadius int32 `json:"proximity_alert_radius"` + // New live location of the message; pass null to stop sharing the live location. If the new live_period isn't set to 0x7FFFFFFF, then it must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days + Location *LiveLocation `json:"location"` } // Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side @@ -5544,9 +5853,6 @@ func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationReques "message_id": req.MessageId, "reply_markup": req.ReplyMarkup, "location": req.Location, - "live_period": req.LivePeriod, - "heading": req.Heading, - "proximity_alert_radius": req.ProximityAlertRadius, }, }) if err != nil { @@ -5705,11 +6011,11 @@ type EditInlineMessageTextRequest struct { InlineMessageId string `json:"inline_message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New text content of the message. Must be of type inputMessageText + // New text content of the message. Must be of type inputMessageText or inputMessageRichMessage; file upload isn't supported InputMessageContent InputMessageContent `json:"input_message_content"` } -// Edits the text of an inline text or game message sent via a bot; for bots only +// Edits the text of an inline text or game message sent via the bot; for bots only func (client *Client) EditInlineMessageText(req *EditInlineMessageTextRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5737,14 +6043,8 @@ type EditInlineMessageLiveLocationRequest struct { InlineMessageId string `json:"inline_message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New location content of the message; pass null to stop sharing the live location - Location *Location `json:"location"` - // New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period - LivePeriod int32 `json:"live_period"` - // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown - Heading int32 `json:"heading"` - // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled - ProximityAlertRadius int32 `json:"proximity_alert_radius"` + // New live location of the message; pass null to stop sharing the live location. If the new live_period isn't set to 0x7FFFFFFF, then it must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days + Location *LiveLocation `json:"location"` } // Edits the content of a live location in an inline message sent via a bot; for bots only @@ -5757,9 +6057,6 @@ func (client *Client) EditInlineMessageLiveLocation(req *EditInlineMessageLiveLo "inline_message_id": req.InlineMessageId, "reply_markup": req.ReplyMarkup, "location": req.Location, - "live_period": req.LivePeriod, - "heading": req.Heading, - "proximity_alert_radius": req.ProximityAlertRadius, }, }) if err != nil { @@ -5869,6 +6166,44 @@ func (client *Client) EditInlineMessageReplyMarkup(req *EditInlineMessageReplyMa return UnmarshalOk(result.Data) } +type EditEphemeralMessageRequest struct { + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the user who received the message + ReceiverUserId int64 `json:"receiver_user_id"` + // Identifier of the ephemeral message + EphemeralMessageId int32 `json:"ephemeral_message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New content of the message; pass null to edit only reply markup. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Edits the text, caption or reply markup of an ephemeral message sent by the bot; for bots only +func (client *Client) EditEphemeralMessage(req *EditEphemeralMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editEphemeralMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "receiver_user_id": req.ReceiverUserId, + "ephemeral_message_id": req.EphemeralMessageId, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type EditMessageSchedulingStateRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` @@ -6033,7 +6368,7 @@ type EditBusinessMessageTextRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New text content of the message. Must be of type inputMessageText + // New text content of the message. Must be of type inputMessageText or inputMessageRichMessage InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -6071,14 +6406,8 @@ type EditBusinessMessageLiveLocationRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New location content of the message; pass null to stop sharing the live location - Location *Location `json:"location"` - // New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period - LivePeriod int32 `json:"live_period"` - // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown - Heading int32 `json:"heading"` - // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled - ProximityAlertRadius int32 `json:"proximity_alert_radius"` + // New live location of the message; pass null to stop sharing the live location. If the new live_period isn't set to 0x7FFFFFFF, then it must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days + Location *LiveLocation `json:"location"` } // Edits the content of a live location in a message sent on behalf of a business account; for bots only @@ -6093,9 +6422,6 @@ func (client *Client) EditBusinessMessageLiveLocation(req *EditBusinessMessageLi "message_id": req.MessageId, "reply_markup": req.ReplyMarkup, "location": req.Location, - "live_period": req.LivePeriod, - "heading": req.Heading, - "proximity_alert_radius": req.ProximityAlertRadius, }, }) if err != nil { @@ -6859,7 +7185,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 inputMessageLocation with live_period aren't supported + // The content of the message to be added; inputMessagePaidMedia, inputMessageForwarded and inputMessageLiveLocation InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -6959,11 +7285,11 @@ func (client *Client) AddQuickReplyShortcutMessageAlbum(req *AddQuickReplyShortc type ReaddQuickReplyShortcutMessagesRequest struct { // Name of the target shortcut ShortcutName string `json:"shortcut_name"` - // Identifiers of the quick reply messages to readd. Message identifiers must be in a strictly increasing order + // Identifiers of the quick reply messages to re-add. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` } -// Readds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message +// Re-adds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-added, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message func (client *Client) ReaddQuickReplyShortcutMessages(req *ReaddQuickReplyShortcutMessagesRequest) (*QuickReplyMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -6990,7 +7316,7 @@ type EditQuickReplyMessageRequest struct { ShortcutId int32 `json:"shortcut_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageChecklist, inputMessageDocument, inputMessagePhoto, inputMessageText, or inputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageChecklist, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageText, or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -8365,7 +8691,7 @@ type GetCountryFlagEmojiRequest struct { CountryCode string `json:"country_code"` } -// Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously +// Returns an emoji for the flag of the given country. Returns an empty string on failure. Can be called synchronously func GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) { result, err := Execute(Request{ meta: meta{ @@ -8387,7 +8713,7 @@ func GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) { } // deprecated -// Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously +// Returns an emoji for the flag of the given country. Returns an empty string on failure. Can be called synchronously func (client *Client) GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) { return GetCountryFlagEmoji(req)} @@ -9459,7 +9785,7 @@ type GetWebAppLinkUrlRequest struct { } // Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked -func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*HttpUrl, error) { +func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*WebAppUrl, error) { result, err := client.Send(Request{ meta: meta{ Type: "getWebAppLinkUrl", @@ -9481,7 +9807,7 @@ func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*HttpUrl, return nil, buildResponseError(result.Data) } - return UnmarshalHttpUrl(result.Data) + return UnmarshalWebAppUrl(result.Data) } type GetMainWebAppRequest struct { @@ -9529,7 +9855,7 @@ type GetWebAppUrlRequest struct { } // Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button -func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { +func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*WebAppUrl, error) { result, err := client.Send(Request{ meta: meta{ Type: "getWebAppUrl", @@ -9548,7 +9874,36 @@ func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { return nil, buildResponseError(result.Data) } - return UnmarshalHttpUrl(result.Data) + return UnmarshalWebAppUrl(result.Data) +} + +type GetGuardBotWebAppUrlRequest struct { + // Unique identifier of the join request as received in chatJoinResultGuardBotApprovalRequired + QueryId JsonInt64 `json:"query_id"` + // Parameters to use to open the Web App + Parameters *WebAppOpenParameters `json:"parameters"` +} + +// Returns an HTTPS URL of a Web App of a guard bot to open after receiving chatJoinResultGuardBotApprovalRequired +func (client *Client) GetGuardBotWebAppUrl(req *GetGuardBotWebAppUrlRequest) (*WebAppUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGuardBotWebAppUrl", + }, + Data: map[string]interface{}{ + "query_id": req.QueryId, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWebAppUrl(result.Data) } type SendWebAppDataRequest struct { @@ -9711,6 +10066,38 @@ func (client *Client) CheckWebAppFileDownload(req *CheckWebAppFileDownloadReques return UnmarshalOk(result.Data) } +type AnswerChatJoinRequestQueryRequest struct { + // Identifier of the query + QueryId JsonInt64 `json:"query_id"` + // The result + Result ChatJoinRequestResult `json:"result"` + // URL of the Web App to open + Url string `json:"url"` +} + +// Sets the result of a chat join query; for bots only +func (client *Client) AnswerChatJoinRequestQuery(req *AnswerChatJoinRequestQueryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerChatJoinRequestQuery", + }, + Data: map[string]interface{}{ + "query_id": req.QueryId, + "result": req.Result, + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` @@ -10081,6 +10468,41 @@ func (client *Client) SendTextMessageDraft(req *SendTextMessageDraftRequest) (*O return UnmarshalOk(result.Data) } +type SendRichMessageDraftRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The forum topic identifier in which the message will be sent; pass 0 if none + ForumTopicId int32 `json:"forum_topic_id"` + // Unique identifier of the draft + DraftId JsonInt64 `json:"draft_id"` + // Draft of the message; file upload isn't supported + Message *InputRichMessage `json:"message"` +} + +// Sends a draft for a being generated rich message; for bots only +func (client *Client) SendRichMessageDraft(req *SendRichMessageDraftRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendRichMessageDraft", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + "draft_id": req.DraftId, + "message": req.Message, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type OpenChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -10530,7 +10952,7 @@ type GetExternalLinkInfoRequest struct { Link string `json:"link"` } -// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats +// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats, and use directly getLinkWebBrowserType func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (LoginUrlInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -10589,6 +11011,41 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er return UnmarshalHttpUrl(result.Data) } +type GetLinkWebBrowserTypeRequest struct { + // The HTTP link + Link string `json:"link"` +} + +// Returns a type of the web browser which must be used to open the link +func (client *Client) GetLinkWebBrowserType(req *GetLinkWebBrowserTypeRequest) (WebBrowserType, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLinkWebBrowserType", + }, + Data: map[string]interface{}{ + "link": req.Link, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeWebBrowserTypeExternal: + return UnmarshalWebBrowserTypeExternal(result.Data) + + case TypeWebBrowserTypeInApp: + return UnmarshalWebBrowserTypeInApp(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type GetOauthLinkInfoRequest struct { // URL of the link Url string `json:"url"` @@ -12525,8 +12982,8 @@ type JoinChatRequest struct { ChatId int64 `json:"chat_id"` } -// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created -func (client *Client) JoinChat(req *JoinChatRequest) (*Ok, error) { +// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method +func (client *Client) JoinChat(req *JoinChatRequest) (ChatJoinResult, error) { result, err := client.Send(Request{ meta: meta{ Type: "joinChat", @@ -12543,7 +13000,22 @@ func (client *Client) JoinChat(req *JoinChatRequest) (*Ok, error) { return nil, buildResponseError(result.Data) } - return UnmarshalOk(result.Data) + switch result.Type { + case TypeChatJoinResultSuccess: + return UnmarshalChatJoinResultSuccess(result.Data) + + case TypeChatJoinResultRequestSent: + return UnmarshalChatJoinResultRequestSent(result.Data) + + case TypeChatJoinResultGuardBotApprovalRequired: + return UnmarshalChatJoinResultGuardBotApprovalRequired(result.Data) + + case TypeChatJoinResultDeclined: + return UnmarshalChatJoinResultDeclined(result.Data) + + default: + return nil, errors.New("invalid type") + } } type LeaveChatRequest struct { @@ -12642,7 +13114,7 @@ type SetChatMemberStatusRequest struct { Status ChatMemberStatus `json:"status"` } -// Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed +// Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters need to be passed func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12803,7 +13275,7 @@ type GetChatOwnerAfterLeavingRequest struct { ChatId int64 `json:"chat_id"` } -// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the supergroup or channel during that period or immediately for basic groups; requires owner privileges in the chat. Available only for supergroups and channel chats +// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the supergroup or channel during that period or immediately for basic groups; requires owner privileges in the chat. Available only for basic groups, supergroups, and channel chats func (client *Client) GetChatOwnerAfterLeaving(req *GetChatOwnerAfterLeavingRequest) (*User, error) { result, err := client.Send(Request{ meta: meta{ @@ -15771,7 +16243,7 @@ type GetChatInviteLinksRequest struct { ChatId int64 `json:"chat_id"` // User identifier of a chat administrator. Must be an identifier of the current user for non-owner CreatorUserId int64 `json:"creator_user_id"` - // Pass true if revoked links needs to be returned instead of active or expired + // Pass true if revoked links need to be returned instead of active or expired IsRevoked bool `json:"is_revoked"` // Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning OffsetDate int32 `json:"offset_date"` @@ -15963,8 +16435,8 @@ type JoinChatByInviteLinkRequest struct { InviteLink string `json:"invite_link"` } -// Uses an invite link to add the current user to the chat if possible. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created -func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*Chat, error) { +// Uses an invite link to add the current user to the chat if possible +func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (ChatJoinResult, error) { result, err := client.Send(Request{ meta: meta{ Type: "joinChatByInviteLink", @@ -15981,7 +16453,22 @@ func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*C return nil, buildResponseError(result.Data) } - return UnmarshalChat(result.Data) + switch result.Type { + case TypeChatJoinResultSuccess: + return UnmarshalChatJoinResultSuccess(result.Data) + + case TypeChatJoinResultRequestSent: + return UnmarshalChatJoinResultRequestSent(result.Data) + + case TypeChatJoinResultGuardBotApprovalRequired: + return UnmarshalChatJoinResultGuardBotApprovalRequired(result.Data) + + case TypeChatJoinResultDeclined: + return UnmarshalChatJoinResultDeclined(result.Data) + + default: + return nil, errors.New("invalid type") + } } type GetChatJoinRequestsRequest struct { @@ -18662,14 +19149,8 @@ func (client *Client) IsProfileAudio(req *IsProfileAudioRequest) (*Ok, error) { } type AddProfileAudioRequest struct { - // The audio file to be added - Audio InputFile `json:"audio"` - // Duration of the audio, in seconds; may be replaced by the server; ignored for already uploaded files - Duration int32 `json:"duration"` - // Title of the audio; 0-64 characters; may be replaced by the server; ignored for already uploaded files - Title string `json:"title"` - // Performer of the audio; 0-64 characters, may be replaced by the server; ignored for already uploaded files - Performer string `json:"performer"` + // The audio to add + Audio *InputAudio `json:"audio"` } // Adds an audio file to the beginning of the profile audio files of the current user @@ -18680,9 +19161,6 @@ func (client *Client) AddProfileAudio(req *AddProfileAudioRequest) (*Ok, error) }, Data: map[string]interface{}{ "audio": req.Audio, - "duration": req.Duration, - "title": req.Title, - "performer": req.Performer, }, }) if err != nil { @@ -20635,8 +21113,8 @@ func (client *Client) CheckPhoneNumberCode(req *CheckPhoneNumberCodeRequest) (*O return UnmarshalOk(result.Data) } -// Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot -func (client *Client) GetBusinessConnectedBot() (*BusinessConnectedBot, error) { +// Returns information about the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot +func (client *Client) GetBusinessConnectedBot() (*BusinessConnectedBotInfo, error) { result, err := client.Send(Request{ meta: meta{ Type: "getBusinessConnectedBot", @@ -20651,7 +21129,7 @@ func (client *Client) GetBusinessConnectedBot() (*BusinessConnectedBot, error) { return nil, buildResponseError(result.Data) } - return UnmarshalBusinessConnectedBot(result.Data) + return UnmarshalBusinessConnectedBotInfo(result.Data) } type SetBusinessConnectedBotRequest struct { @@ -20680,6 +21158,32 @@ func (client *Client) SetBusinessConnectedBot(req *SetBusinessConnectedBotReques return UnmarshalOk(result.Data) } +type ConfirmBusinessConnectedBotRequest struct { + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` +} + +// Confirms an unconfirmed business connection of the current user from another device +func (client *Client) ConfirmBusinessConnectedBot(req *ConfirmBusinessConnectedBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "confirmBusinessConnectedBot", + }, + 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 DeleteBusinessConnectedBotRequest struct { // Unique user identifier for the bot BotUserId int64 `json:"bot_user_id"` @@ -21457,7 +21961,7 @@ type CreateBotRequest struct { ViaLink bool `json:"via_link"` } -// Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the user already owns the maximum allowed number of bots as per premiumLimitTypeOwnedBotCount. An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error +// Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the user already owns the maximum allowed number of bots as per getOption("owned_bot_count_max"). An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error func (client *Client) CreateBot(req *CreateBotRequest) (*User, error) { result, err := client.Send(Request{ meta: meta{ @@ -21899,7 +22403,7 @@ func (client *Client) RemoveMessageSenderBotVerification(req *RemoveMessageSende return UnmarshalOk(result.Data) } -// Returns all active sessions of the current user +// Returns all active sessions of the current user. Additionally, getBusinessConnectedBot must be used to show the bot on top of active sessions func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ meta: meta{ @@ -21944,7 +22448,7 @@ func (client *Client) TerminateSession(req *TerminateSessionRequest) (*Ok, error return UnmarshalOk(result.Data) } -// Terminates all other sessions of the current user +// Terminates all other sessions of the current user. Additionally, the user must be suggested to delete the connected business bot using deleteBusinessConnectedBot if there is any func (client *Client) TerminateAllOtherSessions() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -22435,6 +22939,10 @@ type ToggleSupergroupJoinByRequestRequest struct { SupergroupId int64 `json:"supergroup_id"` // New value of join_by_request JoinByRequest bool `json:"join_by_request"` + // Identifier of the bot which will be the guard bot in the group; pass 0 if none; ignored if join_by_request == false. The bot must have administrator privileges and can_invite_users right in the supergroup chat, and must have userTypeBot.is_guard == true + GuardBotUserId int64 `json:"guard_bot_user_id"` + // Pass true to apply the change to the existing invite links, including primary links + ApplyToInviteLinks bool `json:"apply_to_invite_links"` } // Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right @@ -22446,6 +22954,8 @@ func (client *Client) ToggleSupergroupJoinByRequest(req *ToggleSupergroupJoinByR Data: map[string]interface{}{ "supergroup_id": req.SupergroupId, "join_by_request": req.JoinByRequest, + "guard_bot_user_id": req.GuardBotUserId, + "apply_to_invite_links": req.ApplyToInviteLinks, }, }) if err != nil { @@ -23499,7 +24009,7 @@ type UpgradeGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Pass true to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails bool `json:"keep_original_details"` - // The Telegram Star amount required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count + // The Telegram Star amount required to pay for the upgrade. If the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count StarCount int64 `json:"star_count"` } @@ -23998,7 +24508,7 @@ func (client *Client) GetUpgradedGiftsPromotionalAnimation() (*Animation, error) type SetGiftResalePriceRequest struct { // Identifier of the unique gift ReceivedGiftId string `json:"received_gift_id"` - // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_ton_earnings_per_mille") Toncoins for each 1000 Toncoins paid for the gift if the gift price is in Toncoins + // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_ton_earnings_per_mille") TON Grams for each 1000 Grams paid for the gift if the gift price is in Grams Price GiftResalePrice `json:"price"` } @@ -25637,7 +26147,7 @@ type GetTonTransactionsRequest struct { Limit int32 `json:"limit"` } -// Returns the list of Toncoin transactions of the current user +// Returns the list of TON blockchain transactions of the current user func (client *Client) GetTonTransactions(req *GetTonTransactionsRequest) (*TonTransactions, error) { result, err := client.Send(Request{ meta: meta{ @@ -25747,16 +26257,16 @@ func (client *Client) GetStarAdAccountUrl(req *GetStarAdAccountUrlRequest) (*Htt return UnmarshalHttpUrl(result.Data) } -type GetTonRevenueStatisticsRequest struct { +type GetGramRevenueStatisticsRequest struct { // Pass true if a dark theme is used by the application IsDark bool `json:"is_dark"` } -// Returns detailed Toncoin revenue statistics of the current user -func (client *Client) GetTonRevenueStatistics(req *GetTonRevenueStatisticsRequest) (*TonRevenueStatistics, error) { +// Returns detailed TON Gram revenue statistics of the current user +func (client *Client) GetGramRevenueStatistics(req *GetGramRevenueStatisticsRequest) (*GramRevenueStatistics, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getTonRevenueStatistics", + Type: "getGramRevenueStatistics", }, Data: map[string]interface{}{ "is_dark": req.IsDark, @@ -25770,19 +26280,19 @@ func (client *Client) GetTonRevenueStatistics(req *GetTonRevenueStatisticsReques return nil, buildResponseError(result.Data) } - return UnmarshalTonRevenueStatistics(result.Data) + return UnmarshalGramRevenueStatistics(result.Data) } -type GetTonWithdrawalUrlRequest struct { +type GetGramWithdrawalUrlRequest struct { // The 2-step verification password of the current user Password string `json:"password"` } -// Returns a URL for Toncoin withdrawal from the current user's account. The user must have at least 10 toncoins to withdraw and can withdraw up to 100000 Toncoins in one transaction -func (client *Client) GetTonWithdrawalUrl(req *GetTonWithdrawalUrlRequest) (*HttpUrl, error) { +// Returns a URL for TON Gram withdrawal from the current user's account. The user must have at least 10 Grams to withdraw and can withdraw up to 100000 Grams in one transaction +func (client *Client) GetGramWithdrawalUrl(req *GetGramWithdrawalUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getTonWithdrawalUrl", + Type: "getGramWithdrawalUrl", }, Data: map[string]interface{}{ "password": req.Password, @@ -26306,6 +26816,109 @@ func (client *Client) ClearAutosaveSettingsExceptions() (*Ok, error) { return UnmarshalOk(result.Data) } +type ChangeWebBrowserSettingsRequest struct { + // Pass true if links must be opened in an external browser by default + OpenExternalBrowser bool `json:"open_external_browser"` + // Pass true if a close button must be shown in the in-app browser; for Android app only + DisplayCloseButton bool `json:"display_close_button"` +} + +// Changes web browser settings +func (client *Client) ChangeWebBrowserSettings(req *ChangeWebBrowserSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "changeWebBrowserSettings", + }, + Data: map[string]interface{}{ + "open_external_browser": req.OpenExternalBrowser, + "display_close_button": req.DisplayCloseButton, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddWebBrowserSettingsExceptionRequest struct { + // Pass true if the specified website must be opened in an external browser; pass false to open it in the in-app browser. There can be at most 100 exceptions in each list of the exceptions + OpenExternalBrowser bool `json:"open_external_browser"` + // URL of the website + Url string `json:"url"` +} + +// Adds a special handling for the opening of the specified URL +func (client *Client) AddWebBrowserSettingsException(req *AddWebBrowserSettingsExceptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addWebBrowserSettingsException", + }, + Data: map[string]interface{}{ + "open_external_browser": req.OpenExternalBrowser, + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveWebBrowserSettingsExceptionRequest struct { + // URL of the website + Url string `json:"url"` +} + +// Removes a special handling for the opening of the specified URL +func (client *Client) RemoveWebBrowserSettingsException(req *RemoveWebBrowserSettingsExceptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeWebBrowserSettingsException", + }, + Data: map[string]interface{}{ + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Removes special handling for the opening of all links +func (client *Client) RemoveAllWebBrowserSettingsExceptions() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeAllWebBrowserSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetBankCardInfoRequest struct { // The bank card number BankCardNumber string `json:"bank_card_number"` @@ -26533,7 +27146,7 @@ type SetPassportElementErrorsRequest struct { Errors []*InputPassportElementError `json:"errors"` } -// Informs the user who some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed +// Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed func (client *Client) SetPassportElementErrors(req *SetPassportElementErrorsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -26779,7 +27392,7 @@ type UploadStickerFileRequest struct { UserId int64 `json:"user_id"` // Sticker format StickerFormat StickerFormat `json:"sticker_format"` - // File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + // File to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` } @@ -26882,7 +27495,7 @@ type CreateNewStickerSetRequest struct { // Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only NeedsRepainting bool `json:"needs_repainting"` // List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown - Stickers []*InputSticker `json:"stickers"` + Stickers []*NewSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` } @@ -26920,7 +27533,7 @@ type AddStickerToSetRequest struct { // Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise Name string `json:"name"` // Sticker to add to the set - Sticker *InputSticker `json:"sticker"` + Sticker *NewSticker `json:"sticker"` } // Adds a new sticker to a set @@ -26954,7 +27567,7 @@ type ReplaceStickerInSetRequest struct { // Sticker to remove from the set OldSticker InputFile `json:"old_sticker"` // Sticker to add to the set - NewSticker *InputSticker `json:"new_sticker"` + NewSticker *NewSticker `json:"new_sticker"` } // Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet @@ -27781,7 +28394,7 @@ func (client *Client) GetStarTransactions(req *GetStarTransactionsRequest) (*Sta } type GetStarSubscriptionsRequest struct { - // Pass true to receive only expiring subscriptions for which there are no enough Telegram Stars to extend + // Pass true to receive only expiring subscriptions for which there aren't enough Telegram Stars to extend OnlyExpiring bool `json:"only_expiring"` // Offset of the first subscription to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` @@ -28132,7 +28745,7 @@ func (client *Client) GetConnectedAffiliateProgram(req *GetConnectedAffiliatePro } type GetConnectedAffiliateProgramsRequest struct { - // The affiliate to which the affiliate program were connected + // The affiliate to which the affiliate programs were connected Affiliate AffiliateType `json:"affiliate"` // Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` @@ -28194,7 +28807,7 @@ type AcceptTermsOfServiceRequest struct { TermsOfServiceId string `json:"terms_of_service_id"` } -// Accepts Telegram terms of services +// Accepts Telegram terms of service func (client *Client) AcceptTermsOfService(req *AcceptTermsOfServiceRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -28358,6 +28971,32 @@ func (client *Client) GetCountries() (*Countries, error) { return UnmarshalCountries(result.Data) } +type GetCountryRequest struct { + // A two-letter ISO 3166-1 alpha-2 country code + CountryCode string `json:"country_code"` +} + +// Returns information about an existing country. Can be called before authorization +func (client *Client) GetCountry(req *GetCountryRequest) (*CountryInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCountry", + }, + Data: map[string]interface{}{ + "country_code": req.CountryCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCountryInfo(result.Data) +} + // Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization func (client *Client) GetCountryCode() (*Text, error) { result, err := client.Send(Request{ @@ -29583,8 +30222,11 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(result.Data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(result.Data) + case TypeUpdatePendingMessage: + return UnmarshalUpdatePendingMessage(result.Data) + + case TypeUpdateCommunity: + return UnmarshalUpdateCommunity(result.Data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(result.Data) @@ -29691,6 +30333,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(result.Data) + case TypeUpdateChatJoinResult: + return UnmarshalUpdateChatJoinResult(result.Data) + case TypeUpdateStory: return UnmarshalUpdateStory(result.Data) @@ -29751,6 +30396,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateProfileAccentColors: return UnmarshalUpdateProfileAccentColors(result.Data) + case TypeUpdateWebBrowserSettings: + return UnmarshalUpdateWebBrowserSettings(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -29796,8 +30444,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(result.Data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(result.Data) + case TypeUpdateOwnedGramCount: + return UnmarshalUpdateOwnedGramCount(result.Data) case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(result.Data) @@ -29805,8 +30453,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(result.Data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(result.Data) + case TypeUpdateGramRevenueStatus: + return UnmarshalUpdateGramRevenueStatus(result.Data) case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(result.Data) @@ -29883,6 +30531,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewCustomQuery: return UnmarshalUpdateNewCustomQuery(result.Data) + case TypeUpdateUserSubscription: + return UnmarshalUpdateUserSubscription(result.Data) + case TypeUpdatePoll: return UnmarshalUpdatePoll(result.Data) diff --git a/client/type.go b/client/type.go index 7db699e..4a3fbae 100755 --- a/client/type.go +++ b/client/type.go @@ -10,6 +10,7 @@ const ( ClassAuthenticationCodeType = "AuthenticationCodeType" ClassEmailAddressAuthentication = "EmailAddressAuthentication" ClassEmailAddressResetState = "EmailAddressResetState" + ClassRichMessageSource = "RichMessageSource" ClassAuthorizationState = "AuthorizationState" ClassFirebaseDeviceVerificationParameters = "FirebaseDeviceVerificationParameters" ClassInputFile = "InputFile" @@ -26,6 +27,7 @@ const ( ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule" ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" + ClassWebAppOpenMode = "WebAppOpenMode" ClassGiftResalePrice = "GiftResalePrice" ClassGiftPurchaseOfferState = "GiftPurchaseOfferState" ClassSuggestedPostPrice = "SuggestedPostPrice" @@ -50,10 +52,13 @@ const ( ClassGiveawayParticipantStatus = "GiveawayParticipantStatus" ClassGiveawayInfo = "GiveawayInfo" ClassGiveawayPrize = "GiveawayPrize" + ClassCommunityMemberStatus = "CommunityMemberStatus" ClassEmojiStatusType = "EmojiStatusType" ClassChatMemberStatus = "ChatMemberStatus" ClassChatMembersFilter = "ChatMembersFilter" ClassSupergroupMembersFilter = "SupergroupMembersFilter" + ClassChatJoinResult = "ChatJoinResult" + ClassChatJoinRequestResult = "ChatJoinRequestResult" ClassInviteLinkChatType = "InviteLinkChatType" ClassSecretChatState = "SecretChatState" ClassMessageSender = "MessageSender" @@ -70,6 +75,7 @@ const ( ClassReportSponsoredResult = "ReportSponsoredResult" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassReactionNotificationSource = "ReactionNotificationSource" + ClassDraftMessageContent = "DraftMessageContent" ClassChatType = "ChatType" ClassChatList = "ChatList" ClassChatSource = "ChatSource" @@ -82,7 +88,6 @@ const ( ClassKeyboardButtonSource = "KeyboardButtonSource" ClassReplyMarkup = "ReplyMarkup" ClassLoginUrlInfo = "LoginUrlInfo" - ClassWebAppOpenMode = "WebAppOpenMode" ClassSavedMessagesTopicType = "SavedMessagesTopicType" ClassBuiltInTheme = "BuiltInTheme" ClassRichText = "RichText" @@ -103,6 +108,7 @@ const ( ClassInputPassportElement = "InputPassportElement" ClassPassportElementErrorSource = "PassportElementErrorSource" ClassInputPassportElementErrorSource = "InputPassportElementErrorSource" + ClassPollMedia = "PollMedia" ClassMessageContent = "MessageContent" ClassDateTimePartPrecision = "DateTimePartPrecision" ClassDateTimeFormattingType = "DateTimeFormattingType" @@ -111,9 +117,12 @@ const ( ClassInputPaidMediaType = "InputPaidMediaType" ClassMessageSchedulingState = "MessageSchedulingState" ClassMessageSelfDestructType = "MessageSelfDestructType" + ClassInputPollMedia = "InputPollMedia" + ClassInputPageBlock = "InputPageBlock" ClassInputMessageContent = "InputMessageContent" ClassSearchMessagesFilter = "SearchMessagesFilter" ClassSearchMessagesChatTypeFilter = "SearchMessagesChatTypeFilter" + ClassSearchChatTypeFilter = "SearchChatTypeFilter" ClassChatAction = "ChatAction" ClassUserStatus = "UserStatus" ClassEmojiCategorySource = "EmojiCategorySource" @@ -181,6 +190,7 @@ const ( ClassUserPrivacySetting = "UserPrivacySetting" ClassCanSendMessageToUserResult = "CanSendMessageToUserResult" ClassSessionType = "SessionType" + ClassSessionDeviceType = "SessionDeviceType" ClassReportReason = "ReportReason" ClassReportChatResult = "ReportChatResult" ClassReportStoryResult = "ReportStoryResult" @@ -191,6 +201,7 @@ const ( ClassNetworkType = "NetworkType" ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" ClassAutosaveSettingsScope = "AutosaveSettingsScope" + ClassWebBrowserType = "WebBrowserType" ClassConnectionState = "ConnectionState" ClassTopChatCategory = "TopChatCategory" ClassTMeUrlType = "TMeUrlType" @@ -214,6 +225,9 @@ const ( ClassTextEntity = "TextEntity" ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" + ClassRichMessage = "RichMessage" + ClassInputRichMessageMedia = "InputRichMessageMedia" + ClassInputRichMessage = "InputRichMessage" ClassDiffEntity = "DiffEntity" ClassDiffText = "DiffText" ClassFixedText = "FixedText" @@ -252,6 +266,7 @@ const ( ClassAnimatedEmoji = "AnimatedEmoji" ClassContact = "Contact" ClassLocation = "Location" + ClassLiveLocation = "LiveLocation" ClassVenue = "Venue" ClassGame = "Game" ClassStakeDiceState = "StakeDiceState" @@ -280,6 +295,7 @@ const ( ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings" ClassBusinessBotRights = "BusinessBotRights" ClassBusinessConnectedBot = "BusinessConnectedBot" + ClassBusinessConnectedBotInfo = "BusinessConnectedBotInfo" ClassBusinessStartPage = "BusinessStartPage" ClassInputBusinessStartPage = "InputBusinessStartPage" ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval" @@ -295,6 +311,12 @@ const ( ClassChatPhotos = "ChatPhotos" ClassChatPermissions = "ChatPermissions" ClassChatAdministratorRights = "ChatAdministratorRights" + ClassThemeParameters = "ThemeParameters" + ClassFoundWebApp = "FoundWebApp" + ClassWebAppUrl = "WebAppUrl" + ClassWebAppInfo = "WebAppInfo" + ClassMainWebApp = "MainWebApp" + ClassWebAppOpenParameters = "WebAppOpenParameters" ClassSuggestedPostInfo = "SuggestedPostInfo" ClassInputSuggestedPostInfo = "InputSuggestedPostInfo" ClassStarAmount = "StarAmount" @@ -363,9 +385,13 @@ const ( ClassStarTransactions = "StarTransactions" ClassTonTransaction = "TonTransaction" ClassTonTransactions = "TonTransactions" + ClassLinkPreviewOptions = "LinkPreviewOptions" ClassAccentColor = "AccentColor" ClassProfileAccentColors = "ProfileAccentColors" ClassProfileAccentColor = "ProfileAccentColor" + ClassCommunityPermissions = "CommunityPermissions" + ClassCommunityAdministratorRights = "CommunityAdministratorRights" + ClassCommunity = "Community" ClassUserRating = "UserRating" ClassRestrictionInfo = "RestrictionInfo" ClassEmojiStatus = "EmojiStatus" @@ -470,11 +496,6 @@ const ( ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" ClassOauthLinkInfo = "OauthLinkInfo" - ClassThemeParameters = "ThemeParameters" - ClassFoundWebApp = "FoundWebApp" - ClassWebAppInfo = "WebAppInfo" - ClassMainWebApp = "MainWebApp" - ClassWebAppOpenParameters = "WebAppOpenParameters" ClassMessageThreadInfo = "MessageThreadInfo" ClassSavedMessagesTopic = "SavedMessagesTopic" ClassDirectMessagesChatTopic = "DirectMessagesChatTopic" @@ -482,12 +503,12 @@ const ( ClassForumTopicInfo = "ForumTopicInfo" ClassForumTopic = "ForumTopic" ClassForumTopics = "ForumTopics" - ClassLinkPreviewOptions = "LinkPreviewOptions" ClassSharedUser = "SharedUser" ClassSharedChat = "SharedChat" ClassThemeSettings = "ThemeSettings" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" + ClassInputPageBlockListItem = "InputPageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" ClassWebPageInstantView = "WebPageInstantView" @@ -528,6 +549,14 @@ const ( ClassEncryptedPassportElement = "EncryptedPassportElement" ClassInputPassportElementError = "InputPassportElementError" ClassInputThumbnail = "InputThumbnail" + ClassInputAnimation = "InputAnimation" + ClassInputAudio = "InputAudio" + ClassInputDocument = "InputDocument" + ClassInputPhoto = "InputPhoto" + ClassInputSticker = "InputSticker" + ClassInputVideo = "InputVideo" + ClassInputVideoNote = "InputVideoNote" + ClassInputVoiceNote = "InputVoiceNote" ClassInputPaidMedia = "InputPaidMedia" ClassMessageSendOptions = "MessageSendOptions" ClassMessageCopyOptions = "MessageCopyOptions" @@ -669,6 +698,8 @@ const ( ClassScopeAutosaveSettings = "ScopeAutosaveSettings" ClassAutosaveSettingsException = "AutosaveSettingsException" ClassAutosaveSettings = "AutosaveSettings" + ClassWebDomainException = "WebDomainException" + ClassWebBrowserSettings = "WebBrowserSettings" ClassAgeVerificationParameters = "AgeVerificationParameters" ClassFoundPosition = "FoundPosition" ClassFoundPositions = "FoundPositions" @@ -683,7 +714,7 @@ const ( ClassDeepLinkInfo = "DeepLinkInfo" ClassAddedProxy = "AddedProxy" ClassAddedProxies = "AddedProxies" - ClassInputSticker = "InputSticker" + ClassNewSticker = "NewSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" ClassChatStatisticsInteractionInfo = "ChatStatisticsInteractionInfo" @@ -699,8 +730,8 @@ const ( ClassChatRevenueTransactions = "ChatRevenueTransactions" ClassStarRevenueStatus = "StarRevenueStatus" ClassStarRevenueStatistics = "StarRevenueStatistics" - ClassTonRevenueStatus = "TonRevenueStatus" - ClassTonRevenueStatistics = "TonRevenueStatistics" + ClassGramRevenueStatus = "GramRevenueStatus" + ClassGramRevenueStatistics = "GramRevenueStatistics" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -738,6 +769,12 @@ const ( TypeTextEntity = "textEntity" TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" + TypeRichMessage = "richMessage" + TypeInputRichMessageMedia = "inputRichMessageMedia" + TypeRichMessageSourceBlocks = "richMessageSourceBlocks" + TypeRichMessageSourceMarkdown = "richMessageSourceMarkdown" + TypeRichMessageSourceHtml = "richMessageSourceHtml" + TypeInputRichMessage = "inputRichMessage" TypeDiffEntity = "diffEntity" TypeDiffText = "diffText" TypeFixedText = "fixedText" @@ -825,6 +862,7 @@ const ( TypeAnimatedEmoji = "animatedEmoji" TypeContact = "contact" TypeLocation = "location" + TypeLiveLocation = "liveLocation" TypeVenue = "venue" TypeGame = "game" TypeStakeDiceState = "stakeDiceState" @@ -868,6 +906,7 @@ const ( TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings" TypeBusinessBotRights = "businessBotRights" TypeBusinessConnectedBot = "businessConnectedBot" + TypeBusinessConnectedBotInfo = "businessConnectedBotInfo" TypeBusinessStartPage = "businessStartPage" TypeInputBusinessStartPage = "inputBusinessStartPage" TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval" @@ -889,13 +928,22 @@ const ( TypeInputChatPhotoSticker = "inputChatPhotoSticker" TypeChatPermissions = "chatPermissions" TypeChatAdministratorRights = "chatAdministratorRights" + TypeThemeParameters = "themeParameters" + TypeWebAppOpenModeCompact = "webAppOpenModeCompact" + TypeWebAppOpenModeFullSize = "webAppOpenModeFullSize" + TypeWebAppOpenModeFullScreen = "webAppOpenModeFullScreen" + TypeFoundWebApp = "foundWebApp" + TypeWebAppUrl = "webAppUrl" + TypeWebAppInfo = "webAppInfo" + TypeMainWebApp = "mainWebApp" + TypeWebAppOpenParameters = "webAppOpenParameters" TypeGiftResalePriceStar = "giftResalePriceStar" - TypeGiftResalePriceTon = "giftResalePriceTon" + TypeGiftResalePriceGram = "giftResalePriceGram" TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" TypeGiftPurchaseOfferStateAccepted = "giftPurchaseOfferStateAccepted" TypeGiftPurchaseOfferStateRejected = "giftPurchaseOfferStateRejected" TypeSuggestedPostPriceStar = "suggestedPostPriceStar" - TypeSuggestedPostPriceTon = "suggestedPostPriceTon" + TypeSuggestedPostPriceGram = "suggestedPostPriceGram" TypeSuggestedPostStatePending = "suggestedPostStatePending" TypeSuggestedPostStateApproved = "suggestedPostStateApproved" TypeSuggestedPostStateDeclined = "suggestedPostStateDeclined" @@ -1075,9 +1123,18 @@ const ( TypeGiveawayInfoCompleted = "giveawayInfoCompleted" TypeGiveawayPrizePremium = "giveawayPrizePremium" TypeGiveawayPrizeStars = "giveawayPrizeStars" + TypeLinkPreviewOptions = "linkPreviewOptions" TypeAccentColor = "accentColor" TypeProfileAccentColors = "profileAccentColors" TypeProfileAccentColor = "profileAccentColor" + TypeCommunityPermissions = "communityPermissions" + TypeCommunityAdministratorRights = "communityAdministratorRights" + TypeCommunityMemberStatusCreator = "communityMemberStatusCreator" + TypeCommunityMemberStatusAdministrator = "communityMemberStatusAdministrator" + TypeCommunityMemberStatusMember = "communityMemberStatusMember" + TypeCommunityMemberStatusLeft = "communityMemberStatusLeft" + TypeCommunityMemberStatusBanned = "communityMemberStatusBanned" + TypeCommunity = "community" TypeUserRating = "userRating" TypeRestrictionInfo = "restrictionInfo" TypeEmojiStatusTypeCustomEmoji = "emojiStatusTypeCustomEmoji" @@ -1116,6 +1173,13 @@ const ( TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" + TypeChatJoinResultSuccess = "chatJoinResultSuccess" + TypeChatJoinResultRequestSent = "chatJoinResultRequestSent" + TypeChatJoinResultGuardBotApprovalRequired = "chatJoinResultGuardBotApprovalRequired" + TypeChatJoinResultDeclined = "chatJoinResultDeclined" + TypeChatJoinRequestResultApproved = "chatJoinRequestResultApproved" + TypeChatJoinRequestResultDeclined = "chatJoinRequestResultDeclined" + TypeChatJoinRequestResultQueued = "chatJoinRequestResultQueued" TypeChatInviteLink = "chatInviteLink" TypeChatInviteLinks = "chatInviteLinks" TypeChatInviteLinkCount = "chatInviteLinkCount" @@ -1189,6 +1253,7 @@ const ( TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" TypeInputMessageReplyToExternalMessage = "inputMessageReplyToExternalMessage" TypeInputMessageReplyToStory = "inputMessageReplyToStory" + TypeInputMessageReplyToEphemeralMessage = "inputMessageReplyToEphemeralMessage" TypeFactCheck = "factCheck" TypeMessage = "message" TypeMessages = "messages" @@ -1237,6 +1302,10 @@ const ( TypeReactionNotificationSourceContacts = "reactionNotificationSourceContacts" TypeReactionNotificationSourceAll = "reactionNotificationSourceAll" TypeReactionNotificationSettings = "reactionNotificationSettings" + TypeDraftMessageContentText = "draftMessageContentText" + TypeDraftMessageContentRichMessage = "draftMessageContentRichMessage" + TypeDraftMessageContentVideoNote = "draftMessageContentVideoNote" + TypeDraftMessageContentVoiceNote = "draftMessageContentVoiceNote" TypeDraftMessage = "draftMessage" TypeChatTypePrivate = "chatTypePrivate" TypeChatTypeBasicGroup = "chatTypeBasicGroup" @@ -1312,14 +1381,6 @@ const ( TypeLoginUrlInfoOpen = "loginUrlInfoOpen" TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" TypeOauthLinkInfo = "oauthLinkInfo" - TypeThemeParameters = "themeParameters" - TypeWebAppOpenModeCompact = "webAppOpenModeCompact" - TypeWebAppOpenModeFullSize = "webAppOpenModeFullSize" - TypeWebAppOpenModeFullScreen = "webAppOpenModeFullScreen" - TypeFoundWebApp = "foundWebApp" - TypeWebAppInfo = "webAppInfo" - TypeMainWebApp = "mainWebApp" - TypeWebAppOpenParameters = "webAppOpenParameters" TypeMessageThreadInfo = "messageThreadInfo" TypeSavedMessagesTopicTypeMyNotes = "savedMessagesTopicTypeMyNotes" TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden" @@ -1330,7 +1391,6 @@ const ( TypeForumTopicInfo = "forumTopicInfo" TypeForumTopic = "forumTopic" TypeForumTopics = "forumTopics" - TypeLinkPreviewOptions = "linkPreviewOptions" TypeSharedUser = "sharedUser" TypeSharedChat = "sharedChat" TypeBuiltInThemeClassic = "builtInThemeClassic" @@ -1344,20 +1404,33 @@ const ( TypeRichTextItalic = "richTextItalic" TypeRichTextUnderline = "richTextUnderline" TypeRichTextStrikethrough = "richTextStrikethrough" - TypeRichTextFixed = "richTextFixed" - TypeRichTextUrl = "richTextUrl" - TypeRichTextEmailAddress = "richTextEmailAddress" + TypeRichTextSpoiler = "richTextSpoiler" TypeRichTextSubscript = "richTextSubscript" TypeRichTextSuperscript = "richTextSuperscript" TypeRichTextMarked = "richTextMarked" + TypeRichTextDateTime = "richTextDateTime" + TypeRichTextMention = "richTextMention" + TypeRichTextHashtag = "richTextHashtag" + TypeRichTextCashtag = "richTextCashtag" + TypeRichTextBankCardNumber = "richTextBankCardNumber" + TypeRichTextBotCommand = "richTextBotCommand" + TypeRichTextFixed = "richTextFixed" + TypeRichTextMentionName = "richTextMentionName" + TypeRichTextUrl = "richTextUrl" + TypeRichTextEmailAddress = "richTextEmailAddress" TypeRichTextPhoneNumber = "richTextPhoneNumber" + TypeRichTextCustomEmoji = "richTextCustomEmoji" TypeRichTextIcon = "richTextIcon" + TypeRichTextMathematicalExpression = "richTextMathematicalExpression" + TypeRichTextDiff = "richTextDiff" TypeRichTextReference = "richTextReference" + TypeRichTextReferenceLink = "richTextReferenceLink" TypeRichTextAnchor = "richTextAnchor" TypeRichTextAnchorLink = "richTextAnchorLink" TypeRichTexts = "richTexts" TypePageBlockCaption = "pageBlockCaption" TypePageBlockListItem = "pageBlockListItem" + TypeInputPageBlockListItem = "inputPageBlockListItem" TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft" TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter" TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight" @@ -1371,11 +1444,14 @@ const ( TypePageBlockAuthorDate = "pageBlockAuthorDate" TypePageBlockHeader = "pageBlockHeader" TypePageBlockSubheader = "pageBlockSubheader" + TypePageBlockSectionHeading = "pageBlockSectionHeading" TypePageBlockKicker = "pageBlockKicker" TypePageBlockParagraph = "pageBlockParagraph" TypePageBlockPreformatted = "pageBlockPreformatted" TypePageBlockFooter = "pageBlockFooter" + TypePageBlockThinking = "pageBlockThinking" TypePageBlockDivider = "pageBlockDivider" + TypePageBlockMathematicalExpression = "pageBlockMathematicalExpression" TypePageBlockAnchor = "pageBlockAnchor" TypePageBlockList = "pageBlockList" TypePageBlockBlockQuote = "pageBlockBlockQuote" @@ -1552,7 +1628,17 @@ const ( TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile" TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles" TypeInputPassportElementError = "inputPassportElementError" + TypePollMediaAnimation = "pollMediaAnimation" + TypePollMediaAudio = "pollMediaAudio" + TypePollMediaDocument = "pollMediaDocument" + TypePollMediaLink = "pollMediaLink" + TypePollMediaLocation = "pollMediaLocation" + TypePollMediaPhoto = "pollMediaPhoto" + TypePollMediaSticker = "pollMediaSticker" + TypePollMediaVenue = "pollMediaVenue" + TypePollMediaVideo = "pollMediaVideo" TypeMessageText = "messageText" + TypeMessageRichMessage = "messageRichMessage" TypeMessageAnimation = "messageAnimation" TypeMessageAudio = "messageAudio" TypeMessageDocument = "messageDocument" @@ -1566,6 +1652,7 @@ const ( TypeMessageExpiredVideo = "messageExpiredVideo" TypeMessageExpiredVideoNote = "messageExpiredVideoNote" TypeMessageExpiredVoiceNote = "messageExpiredVoiceNote" + TypeMessageLiveLocation = "messageLiveLocation" TypeMessageLocation = "messageLocation" TypeMessageVenue = "messageVenue" TypeMessageContact = "messageContact" @@ -1598,6 +1685,8 @@ const ( TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" TypeMessageChatDeleteMember = "messageChatDeleteMember" + TypeMessageChatAddedToCommunity = "messageChatAddedToCommunity" + TypeMessageChatRemovedFromCommunity = "messageChatRemovedFromCommunity" TypeMessageChatUpgradeTo = "messageChatUpgradeTo" TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" TypeMessagePinMessage = "messagePinMessage" @@ -1684,6 +1773,14 @@ const ( TypeDiffEntityTypeReplace = "diffEntityTypeReplace" TypeDiffEntityTypeDelete = "diffEntityTypeDelete" TypeInputThumbnail = "inputThumbnail" + TypeInputAnimation = "inputAnimation" + TypeInputAudio = "inputAudio" + TypeInputDocument = "inputDocument" + TypeInputPhoto = "inputPhoto" + TypeInputSticker = "inputSticker" + TypeInputVideo = "inputVideo" + TypeInputVideoNote = "inputVideoNote" + TypeInputVoiceNote = "inputVoiceNote" TypeInputPaidMediaTypePhoto = "inputPaidMediaTypePhoto" TypeInputPaidMediaTypeVideo = "inputPaidMediaTypeVideo" TypeInputPaidMedia = "inputPaidMedia" @@ -1694,7 +1791,38 @@ const ( TypeMessageSelfDestructTypeImmediately = "messageSelfDestructTypeImmediately" TypeMessageSendOptions = "messageSendOptions" TypeMessageCopyOptions = "messageCopyOptions" + TypeInputPollMediaAnimation = "inputPollMediaAnimation" + TypeInputPollMediaAudio = "inputPollMediaAudio" + TypeInputPollMediaDocument = "inputPollMediaDocument" + TypeInputPollMediaLink = "inputPollMediaLink" + TypeInputPollMediaLocation = "inputPollMediaLocation" + TypeInputPollMediaPhoto = "inputPollMediaPhoto" + TypeInputPollMediaSticker = "inputPollMediaSticker" + TypeInputPollMediaVenue = "inputPollMediaVenue" + TypeInputPollMediaVideo = "inputPollMediaVideo" + TypeInputPageBlockSectionHeading = "inputPageBlockSectionHeading" + TypeInputPageBlockParagraph = "inputPageBlockParagraph" + TypeInputPageBlockPreformatted = "inputPageBlockPreformatted" + TypeInputPageBlockFooter = "inputPageBlockFooter" + TypeInputPageBlockThinking = "inputPageBlockThinking" + TypeInputPageBlockDivider = "inputPageBlockDivider" + TypeInputPageBlockMathematicalExpression = "inputPageBlockMathematicalExpression" + TypeInputPageBlockAnchor = "inputPageBlockAnchor" + TypeInputPageBlockList = "inputPageBlockList" + TypeInputPageBlockBlockQuote = "inputPageBlockBlockQuote" + TypeInputPageBlockPullQuote = "inputPageBlockPullQuote" + TypeInputPageBlockAnimation = "inputPageBlockAnimation" + TypeInputPageBlockAudio = "inputPageBlockAudio" + TypeInputPageBlockPhoto = "inputPageBlockPhoto" + TypeInputPageBlockVideo = "inputPageBlockVideo" + TypeInputPageBlockVoiceNote = "inputPageBlockVoiceNote" + TypeInputPageBlockCollage = "inputPageBlockCollage" + TypeInputPageBlockSlideshow = "inputPageBlockSlideshow" + TypeInputPageBlockTable = "inputPageBlockTable" + TypeInputPageBlockDetails = "inputPageBlockDetails" + TypeInputPageBlockMap = "inputPageBlockMap" TypeInputMessageText = "inputMessageText" + TypeInputMessageRichMessage = "inputMessageRichMessage" TypeInputMessageAnimation = "inputMessageAnimation" TypeInputMessageAudio = "inputMessageAudio" TypeInputMessageDocument = "inputMessageDocument" @@ -1704,6 +1832,7 @@ const ( TypeInputMessageVideo = "inputMessageVideo" TypeInputMessageVideoNote = "inputMessageVideoNote" TypeInputMessageVoiceNote = "inputMessageVoiceNote" + TypeInputMessageLiveLocation = "inputMessageLiveLocation" TypeInputMessageLocation = "inputMessageLocation" TypeInputMessageVenue = "inputMessageVenue" TypeInputMessageContact = "inputMessageContact" @@ -1739,6 +1868,8 @@ const ( TypeSearchMessagesChatTypeFilterPrivate = "searchMessagesChatTypeFilterPrivate" TypeSearchMessagesChatTypeFilterGroup = "searchMessagesChatTypeFilterGroup" TypeSearchMessagesChatTypeFilterChannel = "searchMessagesChatTypeFilterChannel" + TypeSearchChatTypeFilterBot = "searchChatTypeFilterBot" + TypeSearchChatTypeFilterChannel = "searchChatTypeFilterChannel" TypeChatActionTyping = "chatActionTyping" TypeChatActionRecordingVideo = "chatActionRecordingVideo" TypeChatActionUploadingVideo = "chatActionUploadingVideo" @@ -2044,6 +2175,7 @@ const ( TypePremiumLimitTypeChatFolderChosenChatCount = "premiumLimitTypeChatFolderChosenChatCount" TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" TypePremiumLimitTypePinnedSavedMessagesTopicCount = "premiumLimitTypePinnedSavedMessagesTopicCount" + TypePremiumLimitTypeMessageTextLength = "premiumLimitTypeMessageTextLength" TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" @@ -2084,6 +2216,7 @@ const ( TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypePremiumFeatureProtectPrivateChatContent = "premiumFeatureProtectPrivateChatContent" TypePremiumFeatureTextComposition = "premiumFeatureTextComposition" + TypePremiumFeatureRichMessages = "premiumFeatureRichMessages" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -2299,23 +2432,25 @@ const ( TypeCanSendMessageToUserResultUserRestrictsNewChats = "canSendMessageToUserResultUserRestrictsNewChats" TypeAccountTtl = "accountTtl" TypeMessageAutoDeleteTime = "messageAutoDeleteTime" - TypeSessionTypeAndroid = "sessionTypeAndroid" - TypeSessionTypeApple = "sessionTypeApple" - TypeSessionTypeBrave = "sessionTypeBrave" - TypeSessionTypeChrome = "sessionTypeChrome" - TypeSessionTypeEdge = "sessionTypeEdge" - TypeSessionTypeFirefox = "sessionTypeFirefox" - TypeSessionTypeIpad = "sessionTypeIpad" - TypeSessionTypeIphone = "sessionTypeIphone" - TypeSessionTypeLinux = "sessionTypeLinux" - TypeSessionTypeMac = "sessionTypeMac" - TypeSessionTypeOpera = "sessionTypeOpera" - TypeSessionTypeSafari = "sessionTypeSafari" - TypeSessionTypeUbuntu = "sessionTypeUbuntu" - TypeSessionTypeUnknown = "sessionTypeUnknown" - TypeSessionTypeVivaldi = "sessionTypeVivaldi" - TypeSessionTypeWindows = "sessionTypeWindows" - TypeSessionTypeXbox = "sessionTypeXbox" + TypeSessionTypeDevice = "sessionTypeDevice" + TypeSessionTypeConnectedBot = "sessionTypeConnectedBot" + TypeSessionDeviceTypeAndroid = "sessionDeviceTypeAndroid" + TypeSessionDeviceTypeApple = "sessionDeviceTypeApple" + TypeSessionDeviceTypeBrave = "sessionDeviceTypeBrave" + TypeSessionDeviceTypeChrome = "sessionDeviceTypeChrome" + TypeSessionDeviceTypeEdge = "sessionDeviceTypeEdge" + TypeSessionDeviceTypeFirefox = "sessionDeviceTypeFirefox" + TypeSessionDeviceTypeIpad = "sessionDeviceTypeIpad" + TypeSessionDeviceTypeIphone = "sessionDeviceTypeIphone" + TypeSessionDeviceTypeLinux = "sessionDeviceTypeLinux" + TypeSessionDeviceTypeMac = "sessionDeviceTypeMac" + TypeSessionDeviceTypeOpera = "sessionDeviceTypeOpera" + TypeSessionDeviceTypeSafari = "sessionDeviceTypeSafari" + TypeSessionDeviceTypeUbuntu = "sessionDeviceTypeUbuntu" + TypeSessionDeviceTypeUnknown = "sessionDeviceTypeUnknown" + TypeSessionDeviceTypeVivaldi = "sessionDeviceTypeVivaldi" + TypeSessionDeviceTypeWindows = "sessionDeviceTypeWindows" + TypeSessionDeviceTypeXbox = "sessionDeviceTypeXbox" TypeSession = "session" TypeSessions = "sessions" TypeUnconfirmedSession = "unconfirmedSession" @@ -2350,7 +2485,7 @@ const ( TypeSettingsSectionInAppBrowser = "settingsSectionInAppBrowser" TypeSettingsSectionLanguage = "settingsSectionLanguage" TypeSettingsSectionMyStars = "settingsSectionMyStars" - TypeSettingsSectionMyToncoins = "settingsSectionMyToncoins" + TypeSettingsSectionMyGrams = "settingsSectionMyGrams" TypeSettingsSectionNotifications = "settingsSectionNotifications" TypeSettingsSectionPowerSaving = "settingsSectionPowerSaving" TypeSettingsSectionPremium = "settingsSectionPremium" @@ -2469,6 +2604,10 @@ const ( TypeScopeAutosaveSettings = "scopeAutosaveSettings" TypeAutosaveSettingsException = "autosaveSettingsException" TypeAutosaveSettings = "autosaveSettings" + TypeWebDomainException = "webDomainException" + TypeWebBrowserSettings = "webBrowserSettings" + TypeWebBrowserTypeExternal = "webBrowserTypeExternal" + TypeWebBrowserTypeInApp = "webBrowserTypeInApp" TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" TypeConnectionStateConnecting = "connectionStateConnecting" @@ -2523,7 +2662,7 @@ const ( TypeProxyTypeMtproto = "proxyTypeMtproto" TypeAddedProxy = "addedProxy" TypeAddedProxies = "addedProxies" - TypeInputSticker = "inputSticker" + TypeNewSticker = "newSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" TypeStatisticalGraphData = "statisticalGraphData" @@ -2554,8 +2693,8 @@ const ( TypeChatRevenueTransactions = "chatRevenueTransactions" TypeStarRevenueStatus = "starRevenueStatus" TypeStarRevenueStatistics = "starRevenueStatistics" - TypeTonRevenueStatus = "tonRevenueStatus" - TypeTonRevenueStatistics = "tonRevenueStatistics" + TypeGramRevenueStatus = "gramRevenueStatus" + TypeGramRevenueStatistics = "gramRevenueStatistics" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -2640,7 +2779,8 @@ const ( TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" TypeUpdateDeleteMessages = "updateDeleteMessages" TypeUpdateChatAction = "updateChatAction" - TypeUpdatePendingTextMessage = "updatePendingTextMessage" + TypeUpdatePendingMessage = "updatePendingMessage" + TypeUpdateCommunity = "updateCommunity" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" TypeUpdateBasicGroup = "updateBasicGroup" @@ -2676,6 +2816,7 @@ const ( TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" + TypeUpdateChatJoinResult = "updateChatJoinResult" TypeUpdateStory = "updateStory" TypeUpdateStoryDeleted = "updateStoryDeleted" TypeUpdateStoryPostSucceeded = "updateStoryPostSucceeded" @@ -2696,6 +2837,7 @@ const ( TypeUpdateEmojiChatThemes = "updateEmojiChatThemes" TypeUpdateAccentColors = "updateAccentColors" TypeUpdateProfileAccentColors = "updateProfileAccentColors" + TypeUpdateWebBrowserSettings = "updateWebBrowserSettings" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateFreezeState = "updateFreezeState" @@ -2711,10 +2853,10 @@ const ( TypeUpdateSavedMessagesTags = "updateSavedMessagesTags" TypeUpdateActiveLiveLocationMessages = "updateActiveLiveLocationMessages" TypeUpdateOwnedStarCount = "updateOwnedStarCount" - TypeUpdateOwnedTonCount = "updateOwnedTonCount" + TypeUpdateOwnedGramCount = "updateOwnedGramCount" TypeUpdateChatRevenueAmount = "updateChatRevenueAmount" TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" - TypeUpdateTonRevenueStatus = "updateTonRevenueStatus" + TypeUpdateGramRevenueStatus = "updateGramRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" @@ -2740,6 +2882,7 @@ const ( TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" TypeUpdateNewCustomEvent = "updateNewCustomEvent" TypeUpdateNewCustomQuery = "updateNewCustomQuery" + TypeUpdateUserSubscription = "updateUserSubscription" TypeUpdatePoll = "updatePoll" TypeUpdatePollAnswer = "updatePollAnswer" TypeUpdateManagedBot = "updateManagedBot" @@ -2780,6 +2923,11 @@ type EmailAddressResetState interface { EmailAddressResetStateType() string } +// Describes source of a rich message +type RichMessageSource interface { + RichMessageSourceType() string +} + // Represents the current authorization state of the TDLib client type AuthorizationState interface { AuthorizationStateType() string @@ -2860,6 +3008,11 @@ type InputChatPhoto interface { InputChatPhotoType() string } +// Describes mode in which a Web App is opened +type WebAppOpenMode interface { + WebAppOpenModeType() string +} + // Describes price of a resold gift type GiftResalePrice interface { GiftResalePriceType() string @@ -2955,7 +3108,7 @@ type StarTransactionType interface { StarTransactionTypeType() string } -// Describes type of transaction with Toncoins +// Describes type of transaction with TON Grams type TonTransactionType interface { TonTransactionTypeType() string } @@ -2980,6 +3133,11 @@ type GiveawayPrize interface { GiveawayPrizeType() string } +// Provides information about the status of a member in a community +type CommunityMemberStatus interface { + CommunityMemberStatusType() string +} + // Describes type of emoji status type EmojiStatusType interface { EmojiStatusTypeType() string @@ -3000,6 +3158,16 @@ type SupergroupMembersFilter interface { SupergroupMembersFilterType() string } +// Describes result of join of a chat by the current user +type ChatJoinResult interface { + ChatJoinResultType() string +} + +// Describes result of a chat join request +type ChatJoinRequestResult interface { + ChatJoinRequestResultType() string +} + // Describes the type of chat to which points an invite link type InviteLinkChatType interface { InviteLinkChatTypeType() string @@ -3080,6 +3248,11 @@ type ReactionNotificationSource interface { ReactionNotificationSourceType() string } +// Content of the message draft +type DraftMessageContent interface { + DraftMessageContentType() string +} + // Describes the type of chat type ChatType interface { ChatTypeType() string @@ -3140,11 +3313,6 @@ type LoginUrlInfo interface { LoginUrlInfoType() string } -// Describes mode in which a Web App is opened -type WebAppOpenMode interface { - WebAppOpenModeType() string -} - // Describes type of Saved Messages topic type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string @@ -3170,7 +3338,7 @@ type PageBlockVerticalAlignment interface { PageBlockVerticalAlignmentType() string } -// Describes a block of an instant view for a web page +// Describes a block of an instant view for a web page or a block of a rich message type PageBlock interface { PageBlockType() string } @@ -3245,6 +3413,11 @@ type InputPassportElementErrorSource interface { InputPassportElementErrorSourceType() string } +// Contains the media in a poll +type PollMedia interface { + PollMediaType() string +} + // Contains the content of a message type MessageContent interface { MessageContentType() string @@ -3270,7 +3443,7 @@ type DiffEntityType interface { DiffEntityTypeType() string } -// Describes type of paid media to sent +// Describes type of paid media to send type InputPaidMediaType interface { InputPaidMediaTypeType() string } @@ -3285,6 +3458,16 @@ type MessageSelfDestructType interface { MessageSelfDestructTypeType() string } +// The content of a poll media to send +type InputPollMedia interface { + InputPollMediaType() string +} + +// Describes a block of a rich message to send +type InputPageBlock interface { + InputPageBlockType() string +} + // The content of a message to send type InputMessageContent interface { InputMessageContentType() string @@ -3295,11 +3478,16 @@ type SearchMessagesFilter interface { SearchMessagesFilterType() string } -// Represents a filter for type of the chats in which to search messages +// Represents a filter for type of the chats in which to search for messages type SearchMessagesChatTypeFilter interface { SearchMessagesChatTypeFilterType() string } +// Represents a filter for type of the chats to search for +type SearchChatTypeFilter interface { + SearchChatTypeFilterType() string +} + // Describes the different types of activity in a chat type ChatAction interface { ChatActionType() string @@ -3630,11 +3818,16 @@ type CanSendMessageToUserResult interface { CanSendMessageToUserResultType() string } -// Represents the type of session +// Describes type of user session type SessionType interface { SessionTypeType() string } +// Represents the type of device from which session was created +type SessionDeviceType interface { + SessionDeviceTypeType() string +} + // Describes the reason why a chat is reported type ReportReason interface { ReportReasonType() string @@ -3685,6 +3878,11 @@ type AutosaveSettingsScope interface { AutosaveSettingsScopeType() string } +// Describes the type of web browser +type WebBrowserType interface { + WebBrowserTypeType() string +} + // Describes the current state of the connection to Telegram servers type ConnectionState interface { ConnectionStateType() string @@ -4420,6 +4618,247 @@ func (*FormattedText) GetType() string { return TypeFormattedText } +// Describes a message with rich formatting +type RichMessage struct { + meta + // Content of the message + Blocks []PageBlock `json:"blocks"` + // True, if the message must be shown from right to left + IsRtl bool `json:"is_rtl"` + // True, if the object contains the full message. Otherwise, getFullRichMessage must be used to get the full message + IsFull bool `json:"is_full"` +} + +func (entity *RichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*RichMessage) GetClass() string { + return ClassRichMessage +} + +func (*RichMessage) GetType() string { + return TypeRichMessage +} + +func (richMessage *RichMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + IsRtl bool `json:"is_rtl"` + IsFull bool `json:"is_full"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richMessage.IsRtl = tmp.IsRtl + richMessage.IsFull = tmp.IsFull + + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + richMessage.Blocks = fieldBlocks + + return nil +} + +// Describes a media to be used in a sent rich message +type InputRichMessageMedia struct { + meta + // Unique identifier of the media; 1-64 base64url characters + Id string `json:"id"` + // The media to send. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessagePhoto, inputMessageVideo, or inputMessageVoiceNote + Media InputMessageContent `json:"media"` +} + +func (entity *InputRichMessageMedia) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputRichMessageMedia + + return json.Marshal((*stub)(entity)) +} + +func (*InputRichMessageMedia) GetClass() string { + return ClassInputRichMessageMedia +} + +func (*InputRichMessageMedia) GetType() string { + return TypeInputRichMessageMedia +} + +func (inputRichMessageMedia *InputRichMessageMedia) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + Media json.RawMessage `json:"media"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputRichMessageMedia.Id = tmp.Id + + fieldMedia, _ := UnmarshalInputMessageContent(tmp.Media) + inputRichMessageMedia.Media = fieldMedia + + return nil +} + +// A rich message defined by blocks +type RichMessageSourceBlocks struct { + meta + // Content of the message + Blocks []InputPageBlock `json:"blocks"` +} + +func (entity *RichMessageSourceBlocks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichMessageSourceBlocks + + return json.Marshal((*stub)(entity)) +} + +func (*RichMessageSourceBlocks) GetClass() string { + return ClassRichMessageSource +} + +func (*RichMessageSourceBlocks) GetType() string { + return TypeRichMessageSourceBlocks +} + +func (*RichMessageSourceBlocks) RichMessageSourceType() string { + return TypeRichMessageSourceBlocks +} + +func (richMessageSourceBlocks *RichMessageSourceBlocks) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + richMessageSourceBlocks.Blocks = fieldBlocks + + return nil +} + +// A Markdown-formatted rich message; for bots only +type RichMessageSourceMarkdown struct { + meta + // Markdown-formatted text of the message + Text string `json:"text"` + // Media used in the message + Media []*InputRichMessageMedia `json:"media"` +} + +func (entity *RichMessageSourceMarkdown) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichMessageSourceMarkdown + + return json.Marshal((*stub)(entity)) +} + +func (*RichMessageSourceMarkdown) GetClass() string { + return ClassRichMessageSource +} + +func (*RichMessageSourceMarkdown) GetType() string { + return TypeRichMessageSourceMarkdown +} + +func (*RichMessageSourceMarkdown) RichMessageSourceType() string { + return TypeRichMessageSourceMarkdown +} + +// An HTML-formatted rich message; for bots only +type RichMessageSourceHtml struct { + meta + // HTML-formatted text of the message + Text string `json:"text"` + // Media used in the message + Media []*InputRichMessageMedia `json:"media"` +} + +func (entity *RichMessageSourceHtml) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichMessageSourceHtml + + return json.Marshal((*stub)(entity)) +} + +func (*RichMessageSourceHtml) GetClass() string { + return ClassRichMessageSource +} + +func (*RichMessageSourceHtml) GetType() string { + return TypeRichMessageSourceHtml +} + +func (*RichMessageSourceHtml) RichMessageSourceType() string { + return TypeRichMessageSourceHtml +} + +// A rich message to send. Total length of all texts, including custom emoji alternative text and formula source, must not exceed getOption("rich_message_text_length_max"). The total number of all blocks, list items and table rows must not exceed getOption("rich_message_block_count_max"). The maximum allowed depth of nested blocks and rich texts is getOption("rich_message_depth_max"). The total number of media in all blocks must not exceed getOption("rich_message_media_count_max"). The maximum allowed number of table columns is getOption("rich_message_table_column_count_max") +type InputRichMessage struct { + meta + // Source of the rich message + Source RichMessageSource `json:"source"` + // Pass true if the message must be shown from right to left + IsRtl bool `json:"is_rtl"` + // Pass true to enable detection of URLs, email addresses and other automatic blocks + DetectAutomaticBlocks bool `json:"detect_automatic_blocks"` +} + +func (entity *InputRichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputRichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputRichMessage) GetClass() string { + return ClassInputRichMessage +} + +func (*InputRichMessage) GetType() string { + return TypeInputRichMessage +} + +func (inputRichMessage *InputRichMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + Source json.RawMessage `json:"source"` + IsRtl bool `json:"is_rtl"` + DetectAutomaticBlocks bool `json:"detect_automatic_blocks"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputRichMessage.IsRtl = tmp.IsRtl + inputRichMessage.DetectAutomaticBlocks = tmp.DetectAutomaticBlocks + + fieldSource, _ := UnmarshalRichMessageSource(tmp.Source) + inputRichMessage.Source = fieldSource + + return nil +} + // Represents a change of a text type DiffEntity struct { meta @@ -4560,7 +4999,7 @@ type TextCompositionStyle struct { InstallCount int32 `json:"install_count"` // Prompt of the style; for created custom styles only Prompt string `json:"prompt"` - // User identifier of the creator of the style; 0 if none of unknown + // User identifier of the creator of the style; 0 if none or unknown CreatorUserId int64 `json:"creator_user_id"` // Example of the style usage in English; may be null if unknown EnglishExample *TextCompositionStyleExample `json:"english_example"` @@ -4688,7 +5127,7 @@ func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { return TypeAuthorizationStateWaitTdlibParameters } -// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options +// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, checkAuthenticationWebToken, or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct{ meta } @@ -6136,8 +6575,8 @@ type PollOption struct { Id string `json:"id"` // Option text; 1-100 characters; may contain only custom emoji entities Text *FormattedText `json:"text"` - // Option media; may be null if none. If present, currently, can be only of the types messageAnimation, messageLocation, messagePhoto, messageSticker, messageVenue, or messageVideo without caption - Media MessageContent `json:"media"` + // Option media; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaLink, pollMediaLocation, pollMediaPhoto, pollMediaSticker, pollMediaVenue, or pollMediaVideo + Media PollMedia `json:"media"` // Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll VoterCount int32 `json:"voter_count"` // The percentage of votes for this option; 0-100 @@ -6197,7 +6636,7 @@ func (pollOption *PollOption) UnmarshalJSON(data []byte) error { pollOption.IsBeingChosen = tmp.IsBeingChosen pollOption.AdditionDate = tmp.AdditionDate - fieldMedia, _ := UnmarshalMessageContent(tmp.Media) + fieldMedia, _ := UnmarshalPollMedia(tmp.Media) pollOption.Media = fieldMedia fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds) @@ -6214,8 +6653,8 @@ type InputPollOption struct { meta // Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users Text *FormattedText `json:"text"` - // Option media; pass null if none; ignored in addPollOption. Must be one of the following types: inputMessageAnimation, non-live inputMessageLocation, inputMessagePhoto, inputMessageSticker, inputMessageVenue, or inputMessageVideo without caption - Media InputMessageContent `json:"media"` + // Option media; pass null if none; ignored in addPollOption. Must be one of the following types: inputPollMediaAnimation, inputPollMediaLink, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaSticker, inputPollMediaVenue, or inputPollMediaVideo without caption + Media InputPollMedia `json:"media"` } func (entity *InputPollOption) MarshalJSON() ([]byte, error) { @@ -6247,7 +6686,7 @@ func (inputPollOption *InputPollOption) UnmarshalJSON(data []byte) error { inputPollOption.Text = tmp.Text - fieldMedia, _ := UnmarshalInputMessageContent(tmp.Media) + fieldMedia, _ := UnmarshalInputPollMedia(tmp.Media) inputPollOption.Media = fieldMedia return nil @@ -6285,8 +6724,8 @@ type PollTypeQuiz struct { CorrectOptionIds []int32 `json:"correct_option_ids"` // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; empty for a yet unanswered poll Explanation *FormattedText `json:"explanation"` - // Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; may be null if none or the poll is unanswered yet. If present, currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption - ExplanationMedia MessageContent `json:"explanation_media"` + // Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; may be null if none or the poll is unanswered yet. If present, currently, can be only of the types pollMediaAnimation, pollMediaAudio, pollMediaDocument, pollMediaLocation, pollMediaPhoto, pollMediaVenue, or pollMediaVideo + ExplanationMedia PollMedia `json:"explanation_media"` } func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) { @@ -6324,7 +6763,7 @@ func (pollTypeQuiz *PollTypeQuiz) UnmarshalJSON(data []byte) error { pollTypeQuiz.CorrectOptionIds = tmp.CorrectOptionIds pollTypeQuiz.Explanation = tmp.Explanation - fieldExplanationMedia, _ := UnmarshalMessageContent(tmp.ExplanationMedia) + fieldExplanationMedia, _ := UnmarshalPollMedia(tmp.ExplanationMedia) pollTypeQuiz.ExplanationMedia = fieldExplanationMedia return nil @@ -6364,8 +6803,8 @@ type InputPollTypeQuiz struct { CorrectOptionIds []int32 `json:"correct_option_ids"` // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds Explanation *FormattedText `json:"explanation"` - // Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; pass null if none. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, non-live inputMessageLocation, inputMessagePhoto, inputMessageVenue, or inputMessageVideo without caption - ExplanationMedia InputMessageContent `json:"explanation_media"` + // Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption + ExplanationMedia InputPollMedia `json:"explanation_media"` } func (entity *InputPollTypeQuiz) MarshalJSON() ([]byte, error) { @@ -6403,7 +6842,7 @@ func (inputPollTypeQuiz *InputPollTypeQuiz) UnmarshalJSON(data []byte) error { inputPollTypeQuiz.CorrectOptionIds = tmp.CorrectOptionIds inputPollTypeQuiz.Explanation = tmp.Explanation - fieldExplanationMedia, _ := UnmarshalInputMessageContent(tmp.ExplanationMedia) + fieldExplanationMedia, _ := UnmarshalInputPollMedia(tmp.ExplanationMedia) inputPollTypeQuiz.ExplanationMedia = fieldExplanationMedia return nil @@ -6715,7 +7154,7 @@ type Animation struct { FileName string `json:"file_name"` // MIME type of the file, usually "image/gif" or "video/mp4" MimeType string `json:"mime_type"` - // True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets + // True, if stickers were added to the animation. The list of corresponding sticker sets can be received using getAttachedStickerSets HasStickers bool `json:"has_stickers"` // Animation minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` @@ -7187,6 +7626,35 @@ func (*Location) GetType() string { return TypeLocation } +// A live location +type LiveLocation struct { + meta + // The current location + Location *Location `json:"location"` + // Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever + LivePeriod int32 `json:"live_period"` + // The direction in which the location moves, in degrees; 1-360; 0 if unknown + Heading int32 `json:"heading"` + // The maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Can't be enabled in direct messages chats, channels and Saved Messages. Available only to the message sender + ProximityAlertRadius int32 `json:"proximity_alert_radius"` +} + +func (entity *LiveLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LiveLocation + + return json.Marshal((*stub)(entity)) +} + +func (*LiveLocation) GetClass() string { + return ClassLiveLocation +} + +func (*LiveLocation) GetType() string { + return TypeLiveLocation +} + // Describes a venue type Venue struct { meta @@ -7260,15 +7728,15 @@ type StakeDiceState struct { meta // Hash of the state to use for sending the next dice; may be empty if the stake dice can't be sent by the current user StateHash string `json:"state_hash"` - // The Toncoin amount that was staked in the previous roll; in the smallest units of the currency - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency - SuggestedStakeToncoinAmounts []int64 `json:"suggested_stake_toncoin_amounts"` + // The amount of TON Grams staked in the previous roll; in the smallest units of the currency + StakeGramAmount int64 `json:"stake_gram_amount"` + // The amounts of Grams that are suggested to be staked; in the smallest units of the currency + SuggestedStakeGramAmounts []int64 `json:"suggested_stake_gram_amounts"` // The number of rolled sixes towards the streak; 0-2 CurrentStreak int32 `json:"current_streak"` - // The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user + // The number of Grams received by the user for each 1000 Grams staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user PrizePerMille []int32 `json:"prize_per_mille"` - // The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 6 three times in a row with the same stake + // The number of Grams received by the user for each 1000 Grams staked if the dice outcome is 6 three times in a row with the same stake StreakPrizePerMille int32 `json:"streak_prize_per_mille"` } @@ -7334,6 +7802,8 @@ type Poll struct { RecentVoterIds []MessageSender `json:"recent_voter_ids"` // True, if the current user can get voters in the poll using getPollVoters CanGetVoters bool `json:"can_get_voters"` + // True, if the current user can see results of the poll + CanSeeResults bool `json:"can_see_results"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous"` // True, if multiple answer options can be chosen simultaneously @@ -7382,6 +7852,7 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { TotalVoterCount int32 `json:"total_voter_count"` RecentVoterIds []json.RawMessage `json:"recent_voter_ids"` CanGetVoters bool `json:"can_get_voters"` + CanSeeResults bool `json:"can_see_results"` IsAnonymous bool `json:"is_anonymous"` AllowsMultipleAnswers bool `json:"allows_multiple_answers"` AllowsRevoting bool `json:"allows_revoting"` @@ -7405,6 +7876,7 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { poll.Options = tmp.Options poll.TotalVoterCount = tmp.TotalVoterCount poll.CanGetVoters = tmp.CanGetVoters + poll.CanSeeResults = tmp.CanSeeResults poll.IsAnonymous = tmp.IsAnonymous poll.AllowsMultipleAnswers = tmp.AllowsMultipleAnswers poll.AllowsRevoting = tmp.AllowsRevoting @@ -7934,6 +8406,8 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // True, if the bot can be queried by username from any non-secret chat SupportsGuestQueries bool `json:"supports_guest_queries"` + // True, if the bot can be set as a guard bot in supergroup chats + IsGuard bool `json:"is_guard"` // True, if the location of the user is expected to be sent with every inline query to this bot NeedLocation bool `json:"need_location"` // True, if the bot supports connection to user accounts for chat automation @@ -7996,6 +8470,8 @@ type BotCommand struct { Command string `json:"command"` // Description of the bot command Description string `json:"description"` + // True, if the command must send an ephemeral message instead of a regular one + IsEphemeral bool `json:"is_ephemeral"` } func (entity *BotCommand) MarshalJSON() ([]byte, error) { @@ -8449,7 +8925,7 @@ type BusinessGreetingMessageSettings struct { ShortcutId int32 `json:"shortcut_id"` // Chosen recipients of the greeting messages Recipients *BusinessRecipients `json:"recipients"` - // The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28 + // The number of days after which a chat will be considered as inactive; currently, must be one of 7, 14, 21, or 28 InactivityDays int32 `json:"inactivity_days"` } @@ -8518,7 +8994,7 @@ func (*BusinessBotRights) GetType() string { return TypeBusinessBotRights } -// Describes a bot connected to a business account +// Describes a business bot connected to an account type BusinessConnectedBot struct { meta // User identifier of the bot @@ -8545,6 +9021,35 @@ func (*BusinessConnectedBot) GetType() string { return TypeBusinessConnectedBot } +// Describes a connection of a bot to an account +type BusinessConnectedBotInfo struct { + meta + // Information about the bot + Bot *BusinessConnectedBot `json:"bot"` + // Point in time (Unix timestamp) when the bot was added; may be 0 if unknown + ConnectionDate int32 `json:"connection_date"` + // Model of the device that was used for the bot connection, as provided by the application; may be empty if unknown + DeviceModel string `json:"device_model"` + // A human-readable description of the location from which the bot was connected, based on the IP address; may be empty if unknown + Location string `json:"location"` +} + +func (entity *BusinessConnectedBotInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessConnectedBotInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessConnectedBotInfo) GetClass() string { + return ClassBusinessConnectedBotInfo +} + +func (*BusinessConnectedBotInfo) GetType() string { + return TypeBusinessConnectedBotInfo +} + // Describes settings for a business account start page type BusinessStartPage struct { meta @@ -8675,9 +9180,9 @@ type BusinessInfo struct { meta // Location of the business; may be null if none Location *BusinessLocation `json:"location"` - // Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days + // Opening hours of the business; may be null if none. The hours are guaranteed to be valid and have already been split by week days OpeningHours *BusinessOpeningHours `json:"opening_hours"` - // Opening hours of the business in the local time; may be null if none. The hours are guaranteed to be valid and has already been split by week days. Local time zone identifier will be empty. An updateUserFullInfo update is not triggered when value of this field changes + // Opening hours of the business in the local time; may be null if none. The hours are guaranteed to be valid and have already been split by week days. Local time zone identifier will be empty. An updateUserFullInfo update is not triggered when value of this field changes LocalOpeningHours *BusinessOpeningHours `json:"local_opening_hours"` // Time left before the business will open the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes NextOpenIn int32 `json:"next_open_in"` @@ -9145,7 +9650,7 @@ func (*InputChatPhotoSticker) InputChatPhotoType() string { // Describes actions that a user is allowed to take in a chat type ChatPermissions struct { meta - // True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues + // True, if the user can send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations, and venues CanSendBasicMessages bool `json:"can_send_basic_messages"` // True, if the user can send music files CanSendAudios bool `json:"can_send_audios"` @@ -9222,7 +9727,7 @@ type ChatAdministratorRights struct { CanPinMessages bool `json:"can_pin_messages"` // True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only CanManageTopics bool `json:"can_manage_topics"` - // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them + // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them; applicable to supergroups and channels only CanPromoteMembers bool `json:"can_promote_members"` // True, if the administrator can manage video chats CanManageVideoChats bool `json:"can_manage_video_chats"` @@ -9256,6 +9761,301 @@ func (*ChatAdministratorRights) GetType() string { return TypeChatAdministratorRights } +// Contains parameters of the application theme +type ThemeParameters struct { + meta + // A color of the background in the RGB format + BackgroundColor int32 `json:"background_color"` + // A secondary color for the background in the RGB format + SecondaryBackgroundColor int32 `json:"secondary_background_color"` + // A color of the header background in the RGB format + HeaderBackgroundColor int32 `json:"header_background_color"` + // A color of the bottom bar background in the RGB format + BottomBarBackgroundColor int32 `json:"bottom_bar_background_color"` + // A color of the section background in the RGB format + SectionBackgroundColor int32 `json:"section_background_color"` + // A color of the section separator in the RGB format + SectionSeparatorColor int32 `json:"section_separator_color"` + // A color of text in the RGB format + TextColor int32 `json:"text_color"` + // An accent color of the text in the RGB format + AccentTextColor int32 `json:"accent_text_color"` + // A color of text on the section headers in the RGB format + SectionHeaderTextColor int32 `json:"section_header_text_color"` + // A color of the subtitle text in the RGB format + SubtitleTextColor int32 `json:"subtitle_text_color"` + // A color of the text for destructive actions in the RGB format + DestructiveTextColor int32 `json:"destructive_text_color"` + // A color of hints in the RGB format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB format + ButtonTextColor int32 `json:"button_text_color"` +} + +func (entity *ThemeParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThemeParameters + + return json.Marshal((*stub)(entity)) +} + +func (*ThemeParameters) GetClass() string { + return ClassThemeParameters +} + +func (*ThemeParameters) GetType() string { + return TypeThemeParameters +} + +// The Web App is opened in the compact mode +type WebAppOpenModeCompact struct{ + meta +} + +func (entity *WebAppOpenModeCompact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppOpenModeCompact + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppOpenModeCompact) GetClass() string { + return ClassWebAppOpenMode +} + +func (*WebAppOpenModeCompact) GetType() string { + return TypeWebAppOpenModeCompact +} + +func (*WebAppOpenModeCompact) WebAppOpenModeType() string { + return TypeWebAppOpenModeCompact +} + +// The Web App is opened in the full-size mode +type WebAppOpenModeFullSize struct{ + meta +} + +func (entity *WebAppOpenModeFullSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppOpenModeFullSize + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppOpenModeFullSize) GetClass() string { + return ClassWebAppOpenMode +} + +func (*WebAppOpenModeFullSize) GetType() string { + return TypeWebAppOpenModeFullSize +} + +func (*WebAppOpenModeFullSize) WebAppOpenModeType() string { + return TypeWebAppOpenModeFullSize +} + +// The Web App is opened in the full-screen mode +type WebAppOpenModeFullScreen struct{ + meta +} + +func (entity *WebAppOpenModeFullScreen) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppOpenModeFullScreen + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppOpenModeFullScreen) GetClass() string { + return ClassWebAppOpenMode +} + +func (*WebAppOpenModeFullScreen) GetType() string { + return TypeWebAppOpenModeFullScreen +} + +func (*WebAppOpenModeFullScreen) WebAppOpenModeType() string { + return TypeWebAppOpenModeFullScreen +} + +// Contains information about a Web App found by its short name +type FoundWebApp struct { + meta + // The Web App + WebApp *WebApp `json:"web_app"` + // True, if the user must be asked for the permission to the bot to send them messages + RequestWriteAccess bool `json:"request_write_access"` + // True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden + SkipConfirmation bool `json:"skip_confirmation"` +} + +func (entity *FoundWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*FoundWebApp) GetClass() string { + return ClassFoundWebApp +} + +func (*FoundWebApp) GetType() string { + return TypeFoundWebApp +} + +// Contains information about a Web App URL +type WebAppUrl struct { + meta + // The Web App URL to open in a web view + Url string `json:"url"` + // True, if events from the Web App must be accepted only from the same origin as the URL + RequireSameOrigin bool `json:"require_same_origin"` +} + +func (entity *WebAppUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppUrl + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppUrl) GetClass() string { + return ClassWebAppUrl +} + +func (*WebAppUrl) GetType() string { + return TypeWebAppUrl +} + +// Contains information about a Web App +type WebAppInfo struct { + meta + // Unique identifier for the Web App launch + LaunchId JsonInt64 `json:"launch_id"` + // The Web App URL to open in a web view + Url *WebAppUrl `json:"url"` +} + +func (entity *WebAppInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppInfo + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppInfo) GetClass() string { + return ClassWebAppInfo +} + +func (*WebAppInfo) GetType() string { + return TypeWebAppInfo +} + +// Contains information about the main Web App of a bot +type MainWebApp struct { + meta + // URL of the Web App to open + Url *WebAppUrl `json:"url"` + // The mode in which the Web App must be opened + Mode WebAppOpenMode `json:"mode"` +} + +func (entity *MainWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MainWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*MainWebApp) GetClass() string { + return ClassMainWebApp +} + +func (*MainWebApp) GetType() string { + return TypeMainWebApp +} + +func (mainWebApp *MainWebApp) UnmarshalJSON(data []byte) error { + var tmp struct { + Url *WebAppUrl `json:"url"` + Mode json.RawMessage `json:"mode"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + mainWebApp.Url = tmp.Url + + fieldMode, _ := UnmarshalWebAppOpenMode(tmp.Mode) + mainWebApp.Mode = fieldMode + + return nil +} + +// Options to be used when a Web App is opened +type WebAppOpenParameters struct { + meta + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the current application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` + // The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize + Mode WebAppOpenMode `json:"mode"` +} + +func (entity *WebAppOpenParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppOpenParameters + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppOpenParameters) GetClass() string { + return ClassWebAppOpenParameters +} + +func (*WebAppOpenParameters) GetType() string { + return TypeWebAppOpenParameters +} + +func (webAppOpenParameters *WebAppOpenParameters) UnmarshalJSON(data []byte) error { + var tmp struct { + Theme *ThemeParameters `json:"theme"` + ApplicationName string `json:"application_name"` + Mode json.RawMessage `json:"mode"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + webAppOpenParameters.Theme = tmp.Theme + webAppOpenParameters.ApplicationName = tmp.ApplicationName + + fieldMode, _ := UnmarshalWebAppOpenMode(tmp.Mode) + webAppOpenParameters.Mode = fieldMode + + return nil +} + // Describes price of a resold gift in Telegram Stars type GiftResalePriceStar struct { meta @@ -9283,31 +10083,31 @@ func (*GiftResalePriceStar) GiftResalePriceType() string { return TypeGiftResalePriceStar } -// Describes price of a resold gift in Toncoins -type GiftResalePriceTon struct { +// Describes price of a resold gift in TON Grams +type GiftResalePriceGram struct { meta - // The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in the range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") - ToncoinCentCount int64 `json:"toncoin_cent_count"` + // The amount of 1/100 of Gram expected to be paid for the gift. Must be in the range getOption("gift_resale_gram_cent_count_min")-getOption("gift_resale_gram_cent_count_max") + GramCentCount int64 `json:"gram_cent_count"` } -func (entity *GiftResalePriceTon) MarshalJSON() ([]byte, error) { +func (entity *GiftResalePriceGram) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub GiftResalePriceTon + type stub GiftResalePriceGram return json.Marshal((*stub)(entity)) } -func (*GiftResalePriceTon) GetClass() string { +func (*GiftResalePriceGram) GetClass() string { return ClassGiftResalePrice } -func (*GiftResalePriceTon) GetType() string { - return TypeGiftResalePriceTon +func (*GiftResalePriceGram) GetType() string { + return TypeGiftResalePriceGram } -func (*GiftResalePriceTon) GiftResalePriceType() string { - return TypeGiftResalePriceTon +func (*GiftResalePriceGram) GiftResalePriceType() string { + return TypeGiftResalePriceGram } // The offer must be accepted or rejected @@ -9412,31 +10212,31 @@ func (*SuggestedPostPriceStar) SuggestedPostPriceType() string { return TypeSuggestedPostPriceStar } -// Describes price of a suggested post in Toncoins -type SuggestedPostPriceTon struct { +// Describes price of a suggested post in TON Grams +type SuggestedPostPriceGram struct { meta - // The amount of 1/100 of Toncoin expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max") - ToncoinCentCount int64 `json:"toncoin_cent_count"` + // The amount of 1/100 of Gram expected to be paid for the post; getOption("suggested_post_gram_cent_count_min")-getOption("suggested_post_gram_cent_count_max") + GramCentCount int64 `json:"gram_cent_count"` } -func (entity *SuggestedPostPriceTon) MarshalJSON() ([]byte, error) { +func (entity *SuggestedPostPriceGram) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SuggestedPostPriceTon + type stub SuggestedPostPriceGram return json.Marshal((*stub)(entity)) } -func (*SuggestedPostPriceTon) GetClass() string { +func (*SuggestedPostPriceGram) GetClass() string { return ClassSuggestedPostPrice } -func (*SuggestedPostPriceTon) GetType() string { - return TypeSuggestedPostPriceTon +func (*SuggestedPostPriceGram) GetType() string { + return TypeSuggestedPostPriceGram } -func (*SuggestedPostPriceTon) SuggestedPostPriceType() string { - return TypeSuggestedPostPriceTon +func (*SuggestedPostPriceGram) SuggestedPostPriceType() string { + return TypeSuggestedPostPriceGram } // The post must be approved or declined @@ -9575,7 +10375,7 @@ func (suggestedPostInfo *SuggestedPostInfo) UnmarshalJSON(data []byte) error { // Contains information about a post to suggest type InputSuggestedPostInfo struct { meta - // Price of the suggested post; pass null to suggest a post without payment. If the current user isn't an administrator of the channel direct messages chat and has no enough funds to pay for the post, then the error "BALANCE_TOO_LOW" will be returned immediately + // Price of the suggested post; pass null to suggest a post without payment. If the current user isn't an administrator of the channel direct messages chat and doesn't have enough funds to pay for the post, then the error "BALANCE_TOO_LOW" will be returned immediately Price SuggestedPostPrice `json:"price"` // Point in time (Unix timestamp) when the post is expected to be published; pass 0 if the date isn't restricted. If specified, then the date must be getOption("suggested_post_send_delay_min")-getOption("suggested_post_send_delay_max") seconds in the future SendDate int32 `json:"send_date"` @@ -9696,7 +10496,7 @@ type StarSubscriptionTypeChannel struct { meta // True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again CanReuse bool `json:"can_reuse"` - // The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn't available anymore + // The invite link that can be used to renew the subscription if it has expired; may be empty if the link isn't available anymore InviteLink string `json:"invite_link"` } @@ -9789,7 +10589,7 @@ type StarSubscription struct { ExpirationDate int32 `json:"expiration_date"` // True, if the subscription was canceled IsCanceled bool `json:"is_canceled"` - // True, if the subscription expires soon and there are no enough Telegram Stars on the user's balance to extend it + // True, if the subscription expires soon and there aren't enough Telegram Stars on the user's balance to extend it IsExpiring bool `json:"is_expiring"` // The subscription plan Pricing *StarSubscriptionPricing `json:"pricing"` @@ -10797,10 +11597,10 @@ type GiftResaleParameters struct { meta // Resale price of the gift in Telegram Stars StarCount int64 `json:"star_count"` - // Resale price of the gift in 1/100 of Toncoin - ToncoinCentCount int64 `json:"toncoin_cent_count"` - // True, if the gift can be bought only using Toncoins - ToncoinOnly bool `json:"toncoin_only"` + // Resale price of the gift in 1/100 of TON Gram + GramCentCount int64 `json:"gram_cent_count"` + // True, if the gift can be bought only using Grams + GramOnly bool `json:"gram_only"` } func (entity *GiftResaleParameters) MarshalJSON() ([]byte, error) { @@ -11043,7 +11843,7 @@ func (*UpgradedGiftOriginBlockchain) UpgradedGiftOriginType() string { return TypeUpgradedGiftOriginBlockchain } -// The sender or receiver of the message has paid for upgraid of the gift, which has been completed +// The sender or receiver of the message has paid for upgrade of the gift, which has been completed type UpgradedGiftOriginPrepaidUpgrade struct{ meta } @@ -11562,13 +12362,13 @@ type Gift struct { NextSendDate int32 `json:"next_send_date"` // Number of times the gift can be purchased by the current user; may be null if not limited UserLimits *GiftPurchaseLimits `json:"user_limits"` - // Number of times the gift can be purchased all users; may be null if not limited + // 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 *GiftBackground `json:"background"` - // Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only + // 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"` - // Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only + // Point in time (Unix timestamp) when the gift was sent for the last time; for sold out gifts only LastSendDate int32 `json:"last_send_date"` } @@ -11609,7 +12409,7 @@ type UpgradedGift struct { MaxUpgradedCount int32 `json:"max_upgraded_count"` // True, if the gift was used to craft another gift IsBurned bool `json:"is_burned"` - // True, if the gift was craft from another gifts + // True, if the gift was crafted from other gifts IsCrafted bool `json:"is_crafted"` // True, if the original gift could have been bought only by Telegram Premium subscribers IsPremium bool `json:"is_premium"` @@ -12473,7 +13273,7 @@ type ReceivedGift struct { ExportDate int32 `json:"export_date"` // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be used to craft another gift; can be in the past; only for the receiver of the gift CraftDate int32 `json:"craft_date"` } @@ -14720,7 +15520,7 @@ func (*StarTransactions) GetType() string { return TypeStarTransactions } -// The transaction is a deposit of Toncoins from Fragment +// The transaction is a deposit of Grams from Fragment type TonTransactionTypeFragmentDeposit struct { meta // True, if the transaction is a gift from another user @@ -14749,7 +15549,7 @@ func (*TonTransactionTypeFragmentDeposit) TonTransactionTypeType() string { return TypeTonTransactionTypeFragmentDeposit } -// The transaction is a withdrawal of earned Toncoins to Fragment +// The transaction is a withdrawal of earned Grams to Fragment type TonTransactionTypeFragmentWithdrawal struct { meta // State of the withdrawal; may be null for refunds from Fragment @@ -14882,10 +15682,10 @@ type TonTransactionTypeUpgradedGiftSale struct { UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` - // The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift + // The number of Grams received by the Telegram for each 1000 Grams received by the seller of the gift CommissionPerMille int32 `json:"commission_per_mille"` - // The Toncoin amount that was received by the Telegram; in the smallest units of the currency - CommissionToncoinAmount int64 `json:"commission_toncoin_amount"` + // The Gram amount that was received by the Telegram; in the smallest units of the currency + CommissionGramAmount int64 `json:"commission_gram_amount"` // True, if the gift was sold through a purchase offer ViaOffer bool `json:"via_offer"` } @@ -14985,13 +15785,13 @@ func (*TonTransactionTypeUnsupported) TonTransactionTypeType() string { return TypeTonTransactionTypeUnsupported } -// Represents a transaction changing the amount of owned Toncoins +// Represents a transaction changing the amount of owned TON Grams type TonTransaction struct { meta // Unique identifier of the transaction Id string `json:"id"` - // The amount of added owned Toncoins; negative for outgoing transactions - TonAmount int64 `json:"ton_amount"` + // The amount of added owned Grams, in the smallest units of the cryptocurrency; negative for outgoing transactions + GramAmount int64 `json:"gram_amount"` // True, if the transaction is a refund of a previous transaction IsRefund bool `json:"is_refund"` // Point in time (Unix timestamp) when the transaction was completed @@ -15019,7 +15819,7 @@ func (*TonTransaction) GetType() string { func (tonTransaction *TonTransaction) UnmarshalJSON(data []byte) error { var tmp struct { Id string `json:"id"` - TonAmount int64 `json:"ton_amount"` + GramAmount int64 `json:"gram_amount"` IsRefund bool `json:"is_refund"` Date int32 `json:"date"` Type json.RawMessage `json:"type"` @@ -15031,7 +15831,7 @@ func (tonTransaction *TonTransaction) UnmarshalJSON(data []byte) error { } tonTransaction.Id = tmp.Id - tonTransaction.TonAmount = tmp.TonAmount + tonTransaction.GramAmount = tmp.GramAmount tonTransaction.IsRefund = tmp.IsRefund tonTransaction.Date = tmp.Date @@ -15041,12 +15841,12 @@ func (tonTransaction *TonTransaction) UnmarshalJSON(data []byte) error { return nil } -// Represents a list of Toncoin transactions +// Represents a list of TON Gram transactions type TonTransactions struct { meta - // The total amount of owned Toncoins - TonAmount int64 `json:"ton_amount"` - // List of Toncoin transactions + // The total amount of owned Grams, in the smallest units of the cryptocurrency + GramAmount int64 `json:"gram_amount"` + // List of Gram transactions Transactions []*TonTransaction `json:"transactions"` // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` @@ -15249,7 +16049,7 @@ func (*GiveawayParticipantStatusAdministrator) GiveawayParticipantStatusType() s return TypeGiveawayParticipantStatusAdministrator } -// The user can't participate in the giveaway, because they phone number is from a disallowed country +// The user can't participate in the giveaway, because their phone number is from a disallowed country type GiveawayParticipantStatusDisallowedCountry struct { meta // A two-letter ISO 3166-1 alpha-2 country code of the user's country @@ -15423,6 +16223,37 @@ func (*GiveawayPrizeStars) GiveawayPrizeType() string { return TypeGiveawayPrizeStars } +// Options to be used for generation of a link preview +type LinkPreviewOptions struct { + meta + // True, if link preview must be disabled + IsDisabled bool `json:"is_disabled"` + // URL to use for link preview. If empty, then the first URL found in the message text will be used + Url string `json:"url"` + // True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified + ForceSmallMedia bool `json:"force_small_media"` + // True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified + ForceLargeMedia bool `json:"force_large_media"` + // True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats + ShowAboveText bool `json:"show_above_text"` +} + +func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewOptions + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewOptions) GetClass() string { + return ClassLinkPreviewOptions +} + +func (*LinkPreviewOptions) GetType() string { + return TypeLinkPreviewOptions +} + // Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews type AccentColor struct { meta @@ -15512,6 +16343,253 @@ func (*ProfileAccentColor) GetType() string { return TypeProfileAccentColor } +// Describes actions that a user is allowed to take in a community +type CommunityPermissions struct { + meta + // True, if the user can change the chats added to the community + CanEditChatList bool `json:"can_edit_chat_list"` +} + +func (entity *CommunityPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityPermissions) GetClass() string { + return ClassCommunityPermissions +} + +func (*CommunityPermissions) GetType() string { + return TypeCommunityPermissions +} + +// Describes rights of the administrator in a community +type CommunityAdministratorRights struct { + meta + // True, if the user is an administrator. Implied by any other privilege + CanManageCommunity bool `json:"can_manage_community"` + // True, if the administrator can change the community name, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the user can change the chats added to the community + CanEditChatList bool `json:"can_edit_chat_list"` + // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them + CanPromoteMembers bool `json:"can_promote_members"` + // True, if the administrator can ban, or unban community members + CanBanMembers bool `json:"can_ban_members"` +} + +func (entity *CommunityAdministratorRights) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityAdministratorRights + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityAdministratorRights) GetClass() string { + return ClassCommunityAdministratorRights +} + +func (*CommunityAdministratorRights) GetType() string { + return TypeCommunityAdministratorRights +} + +// The user is the owner of the community and has all the administrator privileges +type CommunityMemberStatusCreator struct{ + meta +} + +func (entity *CommunityMemberStatusCreator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberStatusCreator + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberStatusCreator) GetClass() string { + return ClassCommunityMemberStatus +} + +func (*CommunityMemberStatusCreator) GetType() string { + return TypeCommunityMemberStatusCreator +} + +func (*CommunityMemberStatusCreator) CommunityMemberStatusType() string { + return TypeCommunityMemberStatusCreator +} + +// The user is a member of the community and has some additional privileges +type CommunityMemberStatusAdministrator struct { + meta + // True, if the current user can edit the administrator privileges for the called user + CanBeEdited bool `json:"can_be_edited"` + // Rights of the administrator + Rights *CommunityAdministratorRights `json:"rights"` +} + +func (entity *CommunityMemberStatusAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberStatusAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberStatusAdministrator) GetClass() string { + return ClassCommunityMemberStatus +} + +func (*CommunityMemberStatusAdministrator) GetType() string { + return TypeCommunityMemberStatusAdministrator +} + +func (*CommunityMemberStatusAdministrator) CommunityMemberStatusType() string { + return TypeCommunityMemberStatusAdministrator +} + +// The user is a member of the community, without any additional privileges or restrictions +type CommunityMemberStatusMember struct{ + meta +} + +func (entity *CommunityMemberStatusMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberStatusMember + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberStatusMember) GetClass() string { + return ClassCommunityMemberStatus +} + +func (*CommunityMemberStatusMember) GetType() string { + return TypeCommunityMemberStatusMember +} + +func (*CommunityMemberStatusMember) CommunityMemberStatusType() string { + return TypeCommunityMemberStatusMember +} + +// The user or the chat is not a community member +type CommunityMemberStatusLeft struct{ + meta +} + +func (entity *CommunityMemberStatusLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberStatusLeft + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberStatusLeft) GetClass() string { + return ClassCommunityMemberStatus +} + +func (*CommunityMemberStatusLeft) GetType() string { + return TypeCommunityMemberStatusLeft +} + +func (*CommunityMemberStatusLeft) CommunityMemberStatusType() string { + return TypeCommunityMemberStatusLeft +} + +// The user or the chat was banned in the community; implies ban in all chats in the community +type CommunityMemberStatusBanned struct{ + meta +} + +func (entity *CommunityMemberStatusBanned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityMemberStatusBanned + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityMemberStatusBanned) GetClass() string { + return ClassCommunityMemberStatus +} + +func (*CommunityMemberStatusBanned) GetType() string { + return TypeCommunityMemberStatusBanned +} + +func (*CommunityMemberStatusBanned) CommunityMemberStatusType() string { + return TypeCommunityMemberStatusBanned +} + +// Represents a community consisting of supergroup chats, channel chats and chats with bots +type Community struct { + meta + // Community identifier + Id int64 `json:"id"` + // If false, the community is inaccessible, and the only information known about the community is inside this class. Identifier of the community can't be passed to any method + HaveAccess bool `json:"have_access"` + // Community name + Name string `json:"name"` + // Community photo; may be null + Photo *ChatPhotoInfo `json:"photo"` + // 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 + Date int32 `json:"date"` + // Status of the current user in the community + Status CommunityMemberStatus `json:"status"` + // Actions that non-administrator community members are allowed to take in the community + Permissions *CommunityPermissions `json:"permissions"` +} + +func (entity *Community) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Community + + return json.Marshal((*stub)(entity)) +} + +func (*Community) GetClass() string { + return ClassCommunity +} + +func (*Community) GetType() string { + return TypeCommunity +} + +func (community *Community) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + HaveAccess bool `json:"have_access"` + Name string `json:"name"` + Photo *ChatPhotoInfo `json:"photo"` + Date int32 `json:"date"` + Status json.RawMessage `json:"status"` + Permissions *CommunityPermissions `json:"permissions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + community.Id = tmp.Id + community.HaveAccess = tmp.HaveAccess + community.Name = tmp.Name + community.Photo = tmp.Photo + community.Date = tmp.Date + community.Permissions = tmp.Permissions + + fieldStatus, _ := UnmarshalCommunityMemberStatus(tmp.Status) + community.Status = fieldStatus + + return nil +} + // Contains description of user rating type UserRating struct { meta @@ -16046,6 +17124,8 @@ type UserFullInfo struct { Photo *ChatPhoto `json:"photo"` // User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos PublicPhoto *ChatPhoto `json:"public_photo"` + // Identifier of the community to which chat with the bot was added; for bots only + CommunityId int64 `json:"community_id"` // Block list to which the user is added; may be null if none BlockList BlockList `json:"block_list"` // True, if the user can be called @@ -16125,6 +17205,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { PersonalPhoto *ChatPhoto `json:"personal_photo"` Photo *ChatPhoto `json:"photo"` PublicPhoto *ChatPhoto `json:"public_photo"` + CommunityId int64 `json:"community_id"` BlockList json.RawMessage `json:"block_list"` CanBeCalled bool `json:"can_be_called"` SupportsVideoCalls bool `json:"supports_video_calls"` @@ -16163,6 +17244,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.PersonalPhoto = tmp.PersonalPhoto userFullInfo.Photo = tmp.Photo userFullInfo.PublicPhoto = tmp.PublicPhoto + userFullInfo.CommunityId = tmp.CommunityId userFullInfo.CanBeCalled = tmp.CanBeCalled userFullInfo.SupportsVideoCalls = tmp.SupportsVideoCalls userFullInfo.HasPrivateCalls = tmp.HasPrivateCalls @@ -16330,7 +17412,7 @@ func (*ChatMemberStatusCreator) ChatMemberStatusType() string { return TypeChatMemberStatusCreator } -// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges +// 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 type ChatMemberStatusAdministrator struct { meta // True, if the current user can edit the administrator privileges for the called user @@ -16976,6 +18058,187 @@ func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterBots } +// The chat was joined successfully +type ChatJoinResultSuccess struct { + meta + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +func (entity *ChatJoinResultSuccess) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinResultSuccess + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinResultSuccess) GetClass() string { + return ClassChatJoinResult +} + +func (*ChatJoinResultSuccess) GetType() string { + return TypeChatJoinResultSuccess +} + +func (*ChatJoinResultSuccess) ChatJoinResultType() string { + return TypeChatJoinResultSuccess +} + +// The join request was sent and have to be approved by administrators of the chat +type ChatJoinResultRequestSent struct{ + meta +} + +func (entity *ChatJoinResultRequestSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinResultRequestSent + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinResultRequestSent) GetClass() string { + return ClassChatJoinResult +} + +func (*ChatJoinResultRequestSent) GetType() string { + return TypeChatJoinResultRequestSent +} + +func (*ChatJoinResultRequestSent) ChatJoinResultType() string { + return TypeChatJoinResultRequestSent +} + +// An approval from a guard bot through a Web App is required to join the chat +type ChatJoinResultGuardBotApprovalRequired struct { + meta + // Identifier of the guard bot + BotUserId int64 `json:"bot_user_id"` + // Unique identifier of the join request, which will be used in getGuardBotWebAppUrl and updateChatJoinResult + QueryId JsonInt64 `json:"query_id"` +} + +func (entity *ChatJoinResultGuardBotApprovalRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinResultGuardBotApprovalRequired + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinResultGuardBotApprovalRequired) GetClass() string { + return ClassChatJoinResult +} + +func (*ChatJoinResultGuardBotApprovalRequired) GetType() string { + return TypeChatJoinResultGuardBotApprovalRequired +} + +func (*ChatJoinResultGuardBotApprovalRequired) ChatJoinResultType() string { + return TypeChatJoinResultGuardBotApprovalRequired +} + +// The join was declined by the guard bot +type ChatJoinResultDeclined struct{ + meta +} + +func (entity *ChatJoinResultDeclined) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinResultDeclined + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinResultDeclined) GetClass() string { + return ClassChatJoinResult +} + +func (*ChatJoinResultDeclined) GetType() string { + return TypeChatJoinResultDeclined +} + +func (*ChatJoinResultDeclined) ChatJoinResultType() string { + return TypeChatJoinResultDeclined +} + +// The request was approved +type ChatJoinRequestResultApproved struct{ + meta +} + +func (entity *ChatJoinRequestResultApproved) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequestResultApproved + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequestResultApproved) GetClass() string { + return ClassChatJoinRequestResult +} + +func (*ChatJoinRequestResultApproved) GetType() string { + return TypeChatJoinRequestResultApproved +} + +func (*ChatJoinRequestResultApproved) ChatJoinRequestResultType() string { + return TypeChatJoinRequestResultApproved +} + +// The request was declined +type ChatJoinRequestResultDeclined struct{ + meta +} + +func (entity *ChatJoinRequestResultDeclined) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequestResultDeclined + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequestResultDeclined) GetClass() string { + return ClassChatJoinRequestResult +} + +func (*ChatJoinRequestResultDeclined) GetType() string { + return TypeChatJoinRequestResultDeclined +} + +func (*ChatJoinRequestResultDeclined) ChatJoinRequestResultType() string { + return TypeChatJoinRequestResultDeclined +} + +// The request was postponed without a decision +type ChatJoinRequestResultQueued struct{ + meta +} + +func (entity *ChatJoinRequestResultQueued) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequestResultQueued + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequestResultQueued) GetClass() string { + return ClassChatJoinRequestResult +} + +func (*ChatJoinRequestResultQueued) GetType() string { + return TypeChatJoinRequestResultQueued +} + +func (*ChatJoinRequestResultQueued) ChatJoinRequestResultType() string { + return TypeChatJoinRequestResultQueued +} + // Contains a chat invite link type ChatInviteLink struct { meta @@ -17514,7 +18777,7 @@ func (*BasicGroupFullInfo) GetType() string { return TypeBasicGroupFullInfo } -// Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers +// Represents a supergroup or channel with zero or more members (subscribers in the case of channels) type Supergroup struct { meta // Supergroup or channel identifier @@ -17543,11 +18806,11 @@ type Supergroup struct { ShowMessageSender bool `json:"show_message_sender"` // True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups JoinToSendMessages bool `json:"join_to_send_messages"` - // True, if all users directly joining the supergroup need to be approved by supergroup administrators. May be true only for non-broadcast supergroups with username, location, or a linked chat + // True, if all users directly joining the supergroup need to be approved by supergroup administrators JoinByRequest bool `json:"join_by_request"` // True, if the slow mode is enabled in the supergroup IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` - // True, if the supergroup is a channel + // True, if the supergroup is a channel, which can have an unlimited number of subscribers, but only administrators can post there and see the list of subscribers IsChannel bool `json:"is_channel"` // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members IsBroadcastGroup bool `json:"is_broadcast_group"` @@ -17661,6 +18924,8 @@ type SupergroupFullInfo struct { meta // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo Photo *ChatPhoto `json:"photo"` + // Identifier of the community to which the corresponding chat was added + CommunityId int64 `json:"community_id"` // Supergroup or channel description Description string `json:"description"` // Number of members in the supergroup or channel; 0 if unknown @@ -17729,6 +18994,8 @@ type SupergroupFullInfo struct { Location *ChatLocation `json:"location"` // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` + // User identifier of the guard bot in the group; for chat administrators only + GuardBotUserId int64 `json:"guard_bot_user_id"` // List of commands of bots in the group BotCommands []*BotCommands `json:"bot_commands"` // Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown @@ -17760,6 +19027,7 @@ func (*SupergroupFullInfo) GetType() string { func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { var tmp struct { Photo *ChatPhoto `json:"photo"` + CommunityId int64 `json:"community_id"` Description string `json:"description"` MemberCount int32 `json:"member_count"` AdministratorCount int32 `json:"administrator_count"` @@ -17794,6 +19062,7 @@ func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` Location *ChatLocation `json:"location"` InviteLink *ChatInviteLink `json:"invite_link"` + GuardBotUserId int64 `json:"guard_bot_user_id"` BotCommands []*BotCommands `json:"bot_commands"` BotVerification *BotVerification `json:"bot_verification"` MainProfileTab json.RawMessage `json:"main_profile_tab"` @@ -17807,6 +19076,7 @@ func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { } supergroupFullInfo.Photo = tmp.Photo + supergroupFullInfo.CommunityId = tmp.CommunityId supergroupFullInfo.Description = tmp.Description supergroupFullInfo.MemberCount = tmp.MemberCount supergroupFullInfo.AdministratorCount = tmp.AdministratorCount @@ -17841,6 +19111,7 @@ func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { supergroupFullInfo.CustomEmojiStickerSetId = tmp.CustomEmojiStickerSetId supergroupFullInfo.Location = tmp.Location supergroupFullInfo.InviteLink = tmp.InviteLink + supergroupFullInfo.GuardBotUserId = tmp.GuardBotUserId supergroupFullInfo.BotCommands = tmp.BotCommands supergroupFullInfo.BotVerification = tmp.BotVerification supergroupFullInfo.UpgradedFromBasicGroupId = tmp.UpgradedFromBasicGroupId @@ -19677,6 +20948,33 @@ func (*InputMessageReplyToStory) InputMessageReplyToType() string { return TypeInputMessageReplyToStory } +// Describes an ephemeral message to be replied; for bots only +type InputMessageReplyToEphemeralMessage struct { + meta + // The identifier of the ephemeral message to be replied + EphemeralMessageId int32 `json:"ephemeral_message_id"` +} + +func (entity *InputMessageReplyToEphemeralMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToEphemeralMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToEphemeralMessage) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToEphemeralMessage) GetType() string { + return TypeInputMessageReplyToEphemeralMessage +} + +func (*InputMessageReplyToEphemeralMessage) InputMessageReplyToType() string { + return TypeInputMessageReplyToEphemeralMessage +} + // Describes a fact-check added to the message by an independent checker type FactCheck struct { meta @@ -19709,6 +21007,8 @@ type Message struct { Id int64 `json:"id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` + // Identifier of the user or the chat which received the ephemeral message; may be null. Always null for non-ephemeral messages + ReceiverId MessageSender `json:"receiver_id"` // Chat identifier ChatId int64 `json:"chat_id"` // The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent @@ -19729,15 +21029,15 @@ type Message struct { IsChannelPost bool `json:"is_channel_post"` // True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending IsPaidStarSuggestedPost bool `json:"is_paid_star_suggested_post"` - // True, if the message is a suggested channel post which was paid in Toncoins; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending - IsPaidTonSuggestedPost bool `json:"is_paid_ton_suggested_post"` + // True, if the message is a suggested channel post which was paid in TON Grams; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending + IsPaidGramSuggestedPost bool `json:"is_paid_gram_suggested_post"` // True, if the message contains an unread mention for the current user ContainsUnreadMention bool `json:"contains_unread_mention"` // True, if the message is a poll message with unread votes ContainsUnreadPollVotes bool `json:"contains_unread_poll_votes"` // Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages Date int32 `json:"date"` - // Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages + // Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages. If getOption("show_message_edit_date_by_default") is true, then the date must be shown along with the message instead of the date when the message was sent EditDate int32 `json:"edit_date"` // Information about the initial message sender; may be null if none or unknown ForwardInfo *MessageForwardInfo `json:"forward_info"` @@ -19787,6 +21087,8 @@ type Message struct { Content MessageContent `json:"content"` // Reply markup for the message; may be null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` + // Unique identifier of the ephemeral message if the message is ephemeral; for bots only + EphemeralMessageId int32 `json:"ephemeral_message_id"` } func (entity *Message) MarshalJSON() ([]byte, error) { @@ -19809,6 +21111,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { var tmp struct { Id int64 `json:"id"` SenderId json.RawMessage `json:"sender_id"` + ReceiverId json.RawMessage `json:"receiver_id"` ChatId int64 `json:"chat_id"` SendingState json.RawMessage `json:"sending_state"` SchedulingState json.RawMessage `json:"scheduling_state"` @@ -19819,7 +21122,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { HasTimestampedMedia bool `json:"has_timestamped_media"` IsChannelPost bool `json:"is_channel_post"` IsPaidStarSuggestedPost bool `json:"is_paid_star_suggested_post"` - IsPaidTonSuggestedPost bool `json:"is_paid_ton_suggested_post"` + IsPaidGramSuggestedPost bool `json:"is_paid_gram_suggested_post"` ContainsUnreadMention bool `json:"contains_unread_mention"` ContainsUnreadPollVotes bool `json:"contains_unread_poll_votes"` Date int32 `json:"date"` @@ -19848,6 +21151,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { SummaryLanguageCode string `json:"summary_language_code"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` + EphemeralMessageId int32 `json:"ephemeral_message_id"` } err := json.Unmarshal(data, &tmp) @@ -19864,7 +21168,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost message.IsPaidStarSuggestedPost = tmp.IsPaidStarSuggestedPost - message.IsPaidTonSuggestedPost = tmp.IsPaidTonSuggestedPost + message.IsPaidGramSuggestedPost = tmp.IsPaidGramSuggestedPost message.ContainsUnreadMention = tmp.ContainsUnreadMention message.ContainsUnreadPollVotes = tmp.ContainsUnreadPollVotes message.Date = tmp.Date @@ -19887,10 +21191,14 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.EffectId = tmp.EffectId message.RestrictionInfo = tmp.RestrictionInfo message.SummaryLanguageCode = tmp.SummaryLanguageCode + message.EphemeralMessageId = tmp.EphemeralMessageId fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId + fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) + message.ReceiverId = fieldReceiverId + fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState) message.SendingState = fieldSendingState @@ -21236,6 +22544,174 @@ func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON( return nil } +// A text message draft +type DraftMessageContentText struct { + meta + // Formatted text to be saved as a draft; 0-getOption("message_text_length_max") characters + Text *FormattedText `json:"text"` + // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` +} + +func (entity *DraftMessageContentText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessageContentText + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessageContentText) GetClass() string { + return ClassDraftMessageContent +} + +func (*DraftMessageContentText) GetType() string { + return TypeDraftMessageContentText +} + +func (*DraftMessageContentText) DraftMessageContentType() string { + return TypeDraftMessageContentText +} + +// A rich message draft; not supported in setChatDraftMessage +type DraftMessageContentRichMessage struct { + meta + // The rich message; the message must not have not yet uploaded media + Message *RichMessage `json:"message"` +} + +func (entity *DraftMessageContentRichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessageContentRichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessageContentRichMessage) GetClass() string { + return ClassDraftMessageContent +} + +func (*DraftMessageContentRichMessage) GetType() string { + return TypeDraftMessageContentRichMessage +} + +func (*DraftMessageContentRichMessage) DraftMessageContentType() string { + return TypeDraftMessageContentRichMessage +} + +// A video note message draft +type DraftMessageContentVideoNote struct { + meta + // Path to the file with the video note + FilePath string `json:"file_path"` + // Duration of the video, in seconds; 0-60 + Duration int32 `json:"duration"` + // Video width and height; must be positive and not greater than 640 + Length int32 `json:"length"` + // Video note self-destruct type; may be null if none; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` +} + +func (entity *DraftMessageContentVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessageContentVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessageContentVideoNote) GetClass() string { + return ClassDraftMessageContent +} + +func (*DraftMessageContentVideoNote) GetType() string { + return TypeDraftMessageContentVideoNote +} + +func (*DraftMessageContentVideoNote) DraftMessageContentType() string { + return TypeDraftMessageContentVideoNote +} + +func (draftMessageContentVideoNote *DraftMessageContentVideoNote) UnmarshalJSON(data []byte) error { + var tmp struct { + FilePath string `json:"file_path"` + Duration int32 `json:"duration"` + Length int32 `json:"length"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + draftMessageContentVideoNote.FilePath = tmp.FilePath + draftMessageContentVideoNote.Duration = tmp.Duration + draftMessageContentVideoNote.Length = tmp.Length + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + draftMessageContentVideoNote.SelfDestructType = fieldSelfDestructType + + return nil +} + +// A voice note message draft +type DraftMessageContentVoiceNote struct { + meta + // Path to the file with the voice note + FilePath string `json:"file_path"` + // Duration of the voice note, in seconds + Duration int32 `json:"duration"` + // Waveform representation of the voice note in 5-bit format + Waveform []byte `json:"waveform"` + // Voice note self-destruct type; may be null if none; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` +} + +func (entity *DraftMessageContentVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessageContentVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessageContentVoiceNote) GetClass() string { + return ClassDraftMessageContent +} + +func (*DraftMessageContentVoiceNote) GetType() string { + return TypeDraftMessageContentVoiceNote +} + +func (*DraftMessageContentVoiceNote) DraftMessageContentType() string { + return TypeDraftMessageContentVoiceNote +} + +func (draftMessageContentVoiceNote *DraftMessageContentVoiceNote) UnmarshalJSON(data []byte) error { + var tmp struct { + FilePath string `json:"file_path"` + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + draftMessageContentVoiceNote.FilePath = tmp.FilePath + draftMessageContentVoiceNote.Duration = tmp.Duration + draftMessageContentVoiceNote.Waveform = tmp.Waveform + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + draftMessageContentVoiceNote.SelfDestructType = fieldSelfDestructType + + return nil +} + // Contains information about a message draft type DraftMessage struct { meta @@ -21243,8 +22719,8 @@ type DraftMessage struct { ReplyTo InputMessageReplyTo `json:"reply_to"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` - // Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote - InputMessageText InputMessageContent `json:"input_message_text"` + // Content of the message draft + Content DraftMessageContent `json:"content"` // Identifier of the effect to apply to the message when it is sent; 0 if none EffectId JsonInt64 `json:"effect_id"` // Information about the suggested post; may be null if none @@ -21271,7 +22747,7 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { var tmp struct { ReplyTo json.RawMessage `json:"reply_to"` Date int32 `json:"date"` - InputMessageText json.RawMessage `json:"input_message_text"` + Content json.RawMessage `json:"content"` EffectId JsonInt64 `json:"effect_id"` SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` } @@ -21288,8 +22764,8 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) draftMessage.ReplyTo = fieldReplyTo - fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) - draftMessage.InputMessageText = fieldInputMessageText + fieldContent, _ := UnmarshalDraftMessageContent(tmp.Content) + draftMessage.Content = fieldContent return nil } @@ -23744,276 +25220,6 @@ func (*OauthLinkInfo) GetType() string { return TypeOauthLinkInfo } -// Contains parameters of the application theme -type ThemeParameters struct { - meta - // A color of the background in the RGB format - BackgroundColor int32 `json:"background_color"` - // A secondary color for the background in the RGB format - SecondaryBackgroundColor int32 `json:"secondary_background_color"` - // A color of the header background in the RGB format - HeaderBackgroundColor int32 `json:"header_background_color"` - // A color of the bottom bar background in the RGB format - BottomBarBackgroundColor int32 `json:"bottom_bar_background_color"` - // A color of the section background in the RGB format - SectionBackgroundColor int32 `json:"section_background_color"` - // A color of the section separator in the RGB format - SectionSeparatorColor int32 `json:"section_separator_color"` - // A color of text in the RGB format - TextColor int32 `json:"text_color"` - // An accent color of the text in the RGB format - AccentTextColor int32 `json:"accent_text_color"` - // A color of text on the section headers in the RGB format - SectionHeaderTextColor int32 `json:"section_header_text_color"` - // A color of the subtitle text in the RGB format - SubtitleTextColor int32 `json:"subtitle_text_color"` - // A color of the text for destructive actions in the RGB format - DestructiveTextColor int32 `json:"destructive_text_color"` - // A color of hints in the RGB format - HintColor int32 `json:"hint_color"` - // A color of links in the RGB format - LinkColor int32 `json:"link_color"` - // A color of the buttons in the RGB format - ButtonColor int32 `json:"button_color"` - // A color of text on the buttons in the RGB format - ButtonTextColor int32 `json:"button_text_color"` -} - -func (entity *ThemeParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThemeParameters - - return json.Marshal((*stub)(entity)) -} - -func (*ThemeParameters) GetClass() string { - return ClassThemeParameters -} - -func (*ThemeParameters) GetType() string { - return TypeThemeParameters -} - -// The Web App is opened in the compact mode -type WebAppOpenModeCompact struct{ - meta -} - -func (entity *WebAppOpenModeCompact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppOpenModeCompact - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppOpenModeCompact) GetClass() string { - return ClassWebAppOpenMode -} - -func (*WebAppOpenModeCompact) GetType() string { - return TypeWebAppOpenModeCompact -} - -func (*WebAppOpenModeCompact) WebAppOpenModeType() string { - return TypeWebAppOpenModeCompact -} - -// The Web App is opened in the full-size mode -type WebAppOpenModeFullSize struct{ - meta -} - -func (entity *WebAppOpenModeFullSize) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppOpenModeFullSize - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppOpenModeFullSize) GetClass() string { - return ClassWebAppOpenMode -} - -func (*WebAppOpenModeFullSize) GetType() string { - return TypeWebAppOpenModeFullSize -} - -func (*WebAppOpenModeFullSize) WebAppOpenModeType() string { - return TypeWebAppOpenModeFullSize -} - -// The Web App is opened in the full-screen mode -type WebAppOpenModeFullScreen struct{ - meta -} - -func (entity *WebAppOpenModeFullScreen) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppOpenModeFullScreen - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppOpenModeFullScreen) GetClass() string { - return ClassWebAppOpenMode -} - -func (*WebAppOpenModeFullScreen) GetType() string { - return TypeWebAppOpenModeFullScreen -} - -func (*WebAppOpenModeFullScreen) WebAppOpenModeType() string { - return TypeWebAppOpenModeFullScreen -} - -// Contains information about a Web App found by its short name -type FoundWebApp struct { - meta - // The Web App - WebApp *WebApp `json:"web_app"` - // True, if the user must be asked for the permission to the bot to send them messages - RequestWriteAccess bool `json:"request_write_access"` - // True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden - SkipConfirmation bool `json:"skip_confirmation"` -} - -func (entity *FoundWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FoundWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*FoundWebApp) GetClass() string { - return ClassFoundWebApp -} - -func (*FoundWebApp) GetType() string { - return TypeFoundWebApp -} - -// Contains information about a Web App -type WebAppInfo struct { - meta - // Unique identifier for the Web App launch - LaunchId JsonInt64 `json:"launch_id"` - // A Web App URL to open in a web view - Url string `json:"url"` -} - -func (entity *WebAppInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppInfo - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppInfo) GetClass() string { - return ClassWebAppInfo -} - -func (*WebAppInfo) GetType() string { - return TypeWebAppInfo -} - -// Contains information about the main Web App of a bot -type MainWebApp struct { - meta - // URL of the Web App to open - Url string `json:"url"` - // The mode in which the Web App must be opened - Mode WebAppOpenMode `json:"mode"` -} - -func (entity *MainWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MainWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*MainWebApp) GetClass() string { - return ClassMainWebApp -} - -func (*MainWebApp) GetType() string { - return TypeMainWebApp -} - -func (mainWebApp *MainWebApp) UnmarshalJSON(data []byte) error { - var tmp struct { - Url string `json:"url"` - Mode json.RawMessage `json:"mode"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - mainWebApp.Url = tmp.Url - - fieldMode, _ := UnmarshalWebAppOpenMode(tmp.Mode) - mainWebApp.Mode = fieldMode - - return nil -} - -// Options to be used when a Web App is opened -type WebAppOpenParameters struct { - meta - // Preferred Web App theme; pass null to use the default theme - Theme *ThemeParameters `json:"theme"` - // Short name of the current application; 0-64 English letters, digits, and underscores - ApplicationName string `json:"application_name"` - // The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize - Mode WebAppOpenMode `json:"mode"` -} - -func (entity *WebAppOpenParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppOpenParameters - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppOpenParameters) GetClass() string { - return ClassWebAppOpenParameters -} - -func (*WebAppOpenParameters) GetType() string { - return TypeWebAppOpenParameters -} - -func (webAppOpenParameters *WebAppOpenParameters) UnmarshalJSON(data []byte) error { - var tmp struct { - Theme *ThemeParameters `json:"theme"` - ApplicationName string `json:"application_name"` - Mode json.RawMessage `json:"mode"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - webAppOpenParameters.Theme = tmp.Theme - webAppOpenParameters.ApplicationName = tmp.ApplicationName - - fieldMode, _ := UnmarshalWebAppOpenMode(tmp.Mode) - webAppOpenParameters.Mode = fieldMode - - return nil -} - // Contains information about a message thread type MessageThreadInfo struct { meta @@ -24449,37 +25655,6 @@ func (*ForumTopics) GetType() string { return TypeForumTopics } -// Options to be used for generation of a link preview -type LinkPreviewOptions struct { - meta - // True, if link preview must be disabled - IsDisabled bool `json:"is_disabled"` - // URL to use for link preview. If empty, then the first URL found in the message text will be used - Url string `json:"url"` - // True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified - ForceSmallMedia bool `json:"force_small_media"` - // True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified - ForceLargeMedia bool `json:"force_large_media"` - // True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats - ShowAboveText bool `json:"show_above_text"` -} - -func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkPreviewOptions - - return json.Marshal((*stub)(entity)) -} - -func (*LinkPreviewOptions) GetClass() string { - return ClassLinkPreviewOptions -} - -func (*LinkPreviewOptions) GetType() string { - return TypeLinkPreviewOptions -} - // Contains information about a user shared with a bot type SharedUser struct { meta @@ -24926,34 +26101,34 @@ func (richTextStrikethrough *RichTextStrikethrough) UnmarshalJSON(data []byte) e return nil } -// A fixed-width rich text -type RichTextFixed struct { +// A spoilered rich text +type RichTextSpoiler struct { meta // Text Text RichText `json:"text"` } -func (entity *RichTextFixed) MarshalJSON() ([]byte, error) { +func (entity *RichTextSpoiler) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub RichTextFixed + type stub RichTextSpoiler return json.Marshal((*stub)(entity)) } -func (*RichTextFixed) GetClass() string { +func (*RichTextSpoiler) GetClass() string { return ClassRichText } -func (*RichTextFixed) GetType() string { - return TypeRichTextFixed +func (*RichTextSpoiler) GetType() string { + return TypeRichTextSpoiler } -func (*RichTextFixed) RichTextType() string { - return TypeRichTextFixed +func (*RichTextSpoiler) RichTextType() string { + return TypeRichTextSpoiler } -func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error { +func (richTextSpoiler *RichTextSpoiler) UnmarshalJSON(data []byte) error { var tmp struct { Text json.RawMessage `json:"text"` } @@ -24964,107 +26139,7 @@ func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error { } fieldText, _ := UnmarshalRichText(tmp.Text) - richTextFixed.Text = fieldText - - return nil -} - -// A rich text URL link -type RichTextUrl struct { - meta - // Text - Text RichText `json:"text"` - // URL - Url string `json:"url"` - // True, if the URL has cached instant view server-side - IsCached bool `json:"is_cached"` -} - -func (entity *RichTextUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextUrl - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextUrl) GetClass() string { - return ClassRichText -} - -func (*RichTextUrl) GetType() string { - return TypeRichTextUrl -} - -func (*RichTextUrl) RichTextType() string { - return TypeRichTextUrl -} - -func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Url string `json:"url"` - IsCached bool `json:"is_cached"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextUrl.Url = tmp.Url - richTextUrl.IsCached = tmp.IsCached - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextUrl.Text = fieldText - - return nil -} - -// A rich text email link -type RichTextEmailAddress struct { - meta - // Text - Text RichText `json:"text"` - // Email address - EmailAddress string `json:"email_address"` -} - -func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextEmailAddress) GetClass() string { - return ClassRichText -} - -func (*RichTextEmailAddress) GetType() string { - return TypeRichTextEmailAddress -} - -func (*RichTextEmailAddress) RichTextType() string { - return TypeRichTextEmailAddress -} - -func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - EmailAddress string `json:"email_address"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextEmailAddress.EmailAddress = tmp.EmailAddress - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextEmailAddress.Text = fieldText + richTextSpoiler.Text = fieldText return nil } @@ -25198,6 +26273,491 @@ func (richTextMarked *RichTextMarked) UnmarshalJSON(data []byte) error { return nil } +// A date and time +type RichTextDateTime struct { + meta + // Original text + Text RichText `json:"text"` + // Point in time (Unix timestamp) representing the date and time + UnixTime int32 `json:"unix_time"` + // Date and time formatting type; may be null if none and the original text must not be changed + FormattingType DateTimeFormattingType `json:"formatting_type"` +} + +func (entity *RichTextDateTime) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextDateTime + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextDateTime) GetClass() string { + return ClassRichText +} + +func (*RichTextDateTime) GetType() string { + return TypeRichTextDateTime +} + +func (*RichTextDateTime) RichTextType() string { + return TypeRichTextDateTime +} + +func (richTextDateTime *RichTextDateTime) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + UnixTime int32 `json:"unix_time"` + FormattingType json.RawMessage `json:"formatting_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextDateTime.UnixTime = tmp.UnixTime + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextDateTime.Text = fieldText + + fieldFormattingType, _ := UnmarshalDateTimeFormattingType(tmp.FormattingType) + richTextDateTime.FormattingType = fieldFormattingType + + return nil +} + +// A mention of a Telegram user or chat by a username +type RichTextMention struct { + meta + // Text + Text RichText `json:"text"` + // The username + Username string `json:"username"` +} + +func (entity *RichTextMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextMention + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextMention) GetClass() string { + return ClassRichText +} + +func (*RichTextMention) GetType() string { + return TypeRichTextMention +} + +func (*RichTextMention) RichTextType() string { + return TypeRichTextMention +} + +func (richTextMention *RichTextMention) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Username string `json:"username"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextMention.Username = tmp.Username + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextMention.Text = fieldText + + return nil +} + +// A hashtag +type RichTextHashtag struct { + meta + // Text + Text RichText `json:"text"` + // The hashtag + Hashtag string `json:"hashtag"` +} + +func (entity *RichTextHashtag) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextHashtag + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextHashtag) GetClass() string { + return ClassRichText +} + +func (*RichTextHashtag) GetType() string { + return TypeRichTextHashtag +} + +func (*RichTextHashtag) RichTextType() string { + return TypeRichTextHashtag +} + +func (richTextHashtag *RichTextHashtag) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Hashtag string `json:"hashtag"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextHashtag.Hashtag = tmp.Hashtag + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextHashtag.Text = fieldText + + return nil +} + +// A cashtag +type RichTextCashtag struct { + meta + // Text + Text RichText `json:"text"` + // The cashtag + Cashtag string `json:"cashtag"` +} + +func (entity *RichTextCashtag) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextCashtag + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextCashtag) GetClass() string { + return ClassRichText +} + +func (*RichTextCashtag) GetType() string { + return TypeRichTextCashtag +} + +func (*RichTextCashtag) RichTextType() string { + return TypeRichTextCashtag +} + +func (richTextCashtag *RichTextCashtag) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Cashtag string `json:"cashtag"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextCashtag.Cashtag = tmp.Cashtag + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextCashtag.Text = fieldText + + return nil +} + +// A bank card number +type RichTextBankCardNumber struct { + meta + // Text + Text RichText `json:"text"` + // The number of the bank card + BankCardNumber string `json:"bank_card_number"` +} + +func (entity *RichTextBankCardNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextBankCardNumber + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextBankCardNumber) GetClass() string { + return ClassRichText +} + +func (*RichTextBankCardNumber) GetType() string { + return TypeRichTextBankCardNumber +} + +func (*RichTextBankCardNumber) RichTextType() string { + return TypeRichTextBankCardNumber +} + +func (richTextBankCardNumber *RichTextBankCardNumber) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + BankCardNumber string `json:"bank_card_number"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextBankCardNumber.BankCardNumber = tmp.BankCardNumber + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextBankCardNumber.Text = fieldText + + return nil +} + +// A bot command +type RichTextBotCommand struct { + meta + // Text + Text RichText `json:"text"` + // The bot command + BotCommand string `json:"bot_command"` +} + +func (entity *RichTextBotCommand) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextBotCommand + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextBotCommand) GetClass() string { + return ClassRichText +} + +func (*RichTextBotCommand) GetType() string { + return TypeRichTextBotCommand +} + +func (*RichTextBotCommand) RichTextType() string { + return TypeRichTextBotCommand +} + +func (richTextBotCommand *RichTextBotCommand) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + BotCommand string `json:"bot_command"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextBotCommand.BotCommand = tmp.BotCommand + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextBotCommand.Text = fieldText + + return nil +} + +// A fixed-width rich text +type RichTextFixed struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextFixed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextFixed + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextFixed) GetClass() string { + return ClassRichText +} + +func (*RichTextFixed) GetType() string { + return TypeRichTextFixed +} + +func (*RichTextFixed) RichTextType() string { + return TypeRichTextFixed +} + +func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextFixed.Text = fieldText + + return nil +} + +// A rich text that serves as a mention of a user +type RichTextMentionName struct { + meta + // Text + Text RichText `json:"text"` + // Identifier of the mentioned user + UserId int64 `json:"user_id"` +} + +func (entity *RichTextMentionName) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextMentionName + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextMentionName) GetClass() string { + return ClassRichText +} + +func (*RichTextMentionName) GetType() string { + return TypeRichTextMentionName +} + +func (*RichTextMentionName) RichTextType() string { + return TypeRichTextMentionName +} + +func (richTextMentionName *RichTextMentionName) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + UserId int64 `json:"user_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextMentionName.UserId = tmp.UserId + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextMentionName.Text = fieldText + + return nil +} + +// A rich text URL link +type RichTextUrl struct { + meta + // Text + Text RichText `json:"text"` + // URL + Url string `json:"url"` + // True, if the URL has cached instant view server-side; instant view only + IsCached bool `json:"is_cached"` +} + +func (entity *RichTextUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextUrl + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextUrl) GetClass() string { + return ClassRichText +} + +func (*RichTextUrl) GetType() string { + return TypeRichTextUrl +} + +func (*RichTextUrl) RichTextType() string { + return TypeRichTextUrl +} + +func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Url string `json:"url"` + IsCached bool `json:"is_cached"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextUrl.Url = tmp.Url + richTextUrl.IsCached = tmp.IsCached + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextUrl.Text = fieldText + + return nil +} + +// A rich text email address +type RichTextEmailAddress struct { + meta + // Text + Text RichText `json:"text"` + // Email address + EmailAddress string `json:"email_address"` +} + +func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextEmailAddress) GetClass() string { + return ClassRichText +} + +func (*RichTextEmailAddress) GetType() string { + return TypeRichTextEmailAddress +} + +func (*RichTextEmailAddress) RichTextType() string { + return TypeRichTextEmailAddress +} + +func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + EmailAddress string `json:"email_address"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextEmailAddress.EmailAddress = tmp.EmailAddress + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextEmailAddress.Text = fieldText + + return nil +} + // A rich text phone number type RichTextPhoneNumber struct { meta @@ -25246,7 +26806,36 @@ func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error return nil } -// A small image inside the text +// A custom emoji +type RichTextCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // Alternative text for the custom emoji + AlternativeText string `json:"alternative_text"` +} + +func (entity *RichTextCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextCustomEmoji) GetClass() string { + return ClassRichText +} + +func (*RichTextCustomEmoji) GetType() string { + return TypeRichTextCustomEmoji +} + +func (*RichTextCustomEmoji) RichTextType() string { + return TypeRichTextCustomEmoji +} + +// 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 @@ -25277,15 +26866,89 @@ func (*RichTextIcon) RichTextType() string { return TypeRichTextIcon } -// A reference to a richTexts object on the same page +// A mathematical expression +type RichTextMathematicalExpression struct { + meta + // The expression in LaTeX format + Expression string `json:"expression"` +} + +func (entity *RichTextMathematicalExpression) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextMathematicalExpression + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextMathematicalExpression) GetClass() string { + return ClassRichText +} + +func (*RichTextMathematicalExpression) GetType() string { + return TypeRichTextMathematicalExpression +} + +func (*RichTextMathematicalExpression) RichTextType() string { + return TypeRichTextMathematicalExpression +} + +// A rich text replacing another rich text; not supported in inputRichMessage +type RichTextDiff struct { + meta + // Text + Text RichText `json:"text"` + // The old text + OldText RichText `json:"old_text"` +} + +func (entity *RichTextDiff) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextDiff + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextDiff) GetClass() string { + return ClassRichText +} + +func (*RichTextDiff) GetType() string { + return TypeRichTextDiff +} + +func (*RichTextDiff) RichTextType() string { + return TypeRichTextDiff +} + +func (richTextDiff *RichTextDiff) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + OldText json.RawMessage `json:"old_text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextDiff.Text = fieldText + + fieldOldText, _ := UnmarshalRichText(tmp.OldText) + richTextDiff.OldText = fieldOldText + + return nil +} + +// A reference type RichTextReference struct { meta - // The text + // Reference name + Name string `json:"name"` + // Text of the reference Text RichText `json:"text"` - // The name of a richTextAnchor object, which is the first element of the target richTexts object - AnchorName string `json:"anchor_name"` - // An HTTP URL, opening the reference - Url string `json:"url"` } func (entity *RichTextReference) MarshalJSON() ([]byte, error) { @@ -25310,8 +26973,58 @@ func (*RichTextReference) RichTextType() string { func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error { var tmp struct { + Name string `json:"name"` Text json.RawMessage `json:"text"` - AnchorName string `json:"anchor_name"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextReference.Name = tmp.Name + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextReference.Text = fieldText + + return nil +} + +// A link to a reference on the same page +type RichTextReferenceLink struct { + meta + // The link text + Text RichText `json:"text"` + // The reference name + ReferenceName string `json:"reference_name"` + // An HTTP URL that opens the reference + Url string `json:"url"` +} + +func (entity *RichTextReferenceLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextReferenceLink + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextReferenceLink) GetClass() string { + return ClassRichText +} + +func (*RichTextReferenceLink) GetType() string { + return TypeRichTextReferenceLink +} + +func (*RichTextReferenceLink) RichTextType() string { + return TypeRichTextReferenceLink +} + +func (richTextReferenceLink *RichTextReferenceLink) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + ReferenceName string `json:"reference_name"` Url string `json:"url"` } @@ -25320,11 +27033,11 @@ func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error { return err } - richTextReference.AnchorName = tmp.AnchorName - richTextReference.Url = tmp.Url + richTextReferenceLink.ReferenceName = tmp.ReferenceName + richTextReferenceLink.Url = tmp.Url fieldText, _ := UnmarshalRichText(tmp.Text) - richTextReference.Text = fieldText + richTextReferenceLink.Text = fieldText return nil } @@ -25363,7 +27076,7 @@ type RichTextAnchorLink struct { Text RichText `json:"text"` // The anchor name. If the name is empty, the link must bring back to top AnchorName string `json:"anchor_name"` - // An HTTP URL, opening the anchor + // An HTTP URL that opens the anchor Url string `json:"url"` } @@ -25456,7 +27169,7 @@ type PageBlockCaption struct { meta // Content of the caption Text RichText `json:"text"` - // Block credit (like HTML tag ) + // Block credit (like HTML tag ); may be null if none Credit RichText `json:"credit"` } @@ -25502,7 +27215,15 @@ type PageBlockListItem struct { // Item label Label string `json:"label"` // Item blocks - PageBlocks []PageBlock `json:"page_blocks"` + Blocks []PageBlock `json:"blocks"` + // True, if the item has a checkbox + HasCheckbox bool `json:"has_checkbox"` + // True, if the item is checked + 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 string `json:"type"` } func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) { @@ -25524,7 +27245,11 @@ func (*PageBlockListItem) GetType() string { func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error { var tmp struct { Label string `json:"label"` - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` + HasCheckbox bool `json:"has_checkbox"` + IsChecked bool `json:"is_checked"` + Value int32 `json:"value"` + Type string `json:"type"` } err := json.Unmarshal(data, &tmp) @@ -25533,9 +27258,69 @@ func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error { } pageBlockListItem.Label = tmp.Label + pageBlockListItem.HasCheckbox = tmp.HasCheckbox + pageBlockListItem.IsChecked = tmp.IsChecked + pageBlockListItem.Value = tmp.Value + pageBlockListItem.Type = tmp.Type - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockListItem.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockListItem.Blocks = fieldBlocks + + return nil +} + +// Describes an item of a list page block to be sent +type InputPageBlockListItem struct { + meta + // Item blocks + Blocks []InputPageBlock `json:"blocks"` + // True, if the item has a checkbox + HasCheckbox bool `json:"has_checkbox"` + // True, if the item is checked + 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 string `json:"type"` +} + +func (entity *InputPageBlockListItem) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockListItem + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockListItem) GetClass() string { + return ClassInputPageBlockListItem +} + +func (*InputPageBlockListItem) GetType() string { + return TypeInputPageBlockListItem +} + +func (inputPageBlockListItem *InputPageBlockListItem) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + HasCheckbox bool `json:"has_checkbox"` + IsChecked bool `json:"is_checked"` + Value int32 `json:"value"` + Type string `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockListItem.HasCheckbox = tmp.HasCheckbox + inputPageBlockListItem.IsChecked = tmp.IsChecked + inputPageBlockListItem.Value = tmp.Value + inputPageBlockListItem.Type = tmp.Type + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + inputPageBlockListItem.Blocks = fieldBlocks return nil } @@ -25787,7 +27572,7 @@ func (*PageBlockRelatedArticle) GetType() string { return TypePageBlockRelatedArticle } -// The title of a page +// The title of a page; instant view only type PageBlockTitle struct { meta // Title @@ -25830,7 +27615,7 @@ func (pageBlockTitle *PageBlockTitle) UnmarshalJSON(data []byte) error { return nil } -// The subtitle of a page +// The subtitle of a page; instant view only type PageBlockSubtitle struct { meta // Subtitle @@ -25873,7 +27658,7 @@ func (pageBlockSubtitle *PageBlockSubtitle) UnmarshalJSON(data []byte) error { return nil } -// The author and publishing date of a page +// The author and publishing date of a page; instant view only type PageBlockAuthorDate struct { meta // Author @@ -25921,7 +27706,7 @@ func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error return nil } -// A header +// A header; instant view only type PageBlockHeader struct { meta // Header @@ -25964,7 +27749,7 @@ func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error { return nil } -// A subheader +// A subheader; instant view only type PageBlockSubheader struct { meta // Subheader @@ -26007,7 +27792,55 @@ func (pageBlockSubheader *PageBlockSubheader) UnmarshalJSON(data []byte) error { return nil } -// A kicker +// A section heading +type PageBlockSectionHeading struct { + meta + // Text of the section heading + Text RichText `json:"text"` + // Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest + Size int32 `json:"size"` +} + +func (entity *PageBlockSectionHeading) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockSectionHeading + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockSectionHeading) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockSectionHeading) GetType() string { + return TypePageBlockSectionHeading +} + +func (*PageBlockSectionHeading) PageBlockType() string { + return TypePageBlockSectionHeading +} + +func (pageBlockSectionHeading *PageBlockSectionHeading) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Size int32 `json:"size"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockSectionHeading.Size = tmp.Size + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockSectionHeading.Text = fieldText + + return nil +} + +// A kicker; instant view only type PageBlockKicker struct { meta // Kicker @@ -26184,6 +28017,49 @@ func (pageBlockFooter *PageBlockFooter) UnmarshalJSON(data []byte) error { return nil } +// A "Thinking..." placeholder; for pending rich messages only +type PageBlockThinking struct { + meta + // Text of the placeholder + Text RichText `json:"text"` +} + +func (entity *PageBlockThinking) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockThinking + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockThinking) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockThinking) GetType() string { + return TypePageBlockThinking +} + +func (*PageBlockThinking) PageBlockType() string { + return TypePageBlockThinking +} + +func (pageBlockThinking *PageBlockThinking) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockThinking.Text = fieldText + + return nil +} + // An empty block separating a page type PageBlockDivider struct{ meta @@ -26209,6 +28085,33 @@ func (*PageBlockDivider) PageBlockType() string { return TypePageBlockDivider } +// A mathematical expression +type PageBlockMathematicalExpression struct { + meta + // The expression in LaTeX format + Expression string `json:"expression"` +} + +func (entity *PageBlockMathematicalExpression) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockMathematicalExpression + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockMathematicalExpression) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockMathematicalExpression) GetType() string { + return TypePageBlockMathematicalExpression +} + +func (*PageBlockMathematicalExpression) PageBlockType() string { + return TypePageBlockMathematicalExpression +} + // An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor type PageBlockAnchor struct { meta @@ -26266,9 +28169,9 @@ func (*PageBlockList) PageBlockType() string { // A block quote type PageBlockBlockQuote struct { meta - // Quote text - Text RichText `json:"text"` - // Quote credit + // Quote blocks + Blocks []PageBlock `json:"blocks"` + // Quote credit; may be null if none Credit RichText `json:"credit"` } @@ -26294,7 +28197,7 @@ func (*PageBlockBlockQuote) PageBlockType() string { func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error { var tmp struct { - Text json.RawMessage `json:"text"` + Blocks []json.RawMessage `json:"blocks"` Credit json.RawMessage `json:"credit"` } @@ -26303,8 +28206,8 @@ func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error return err } - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockBlockQuote.Text = fieldText + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockBlockQuote.Blocks = fieldBlocks fieldCredit, _ := UnmarshalRichText(tmp.Credit) pageBlockBlockQuote.Credit = fieldCredit @@ -26317,7 +28220,7 @@ type PageBlockPullQuote struct { meta // Quote text Text RichText `json:"text"` - // Quote credit + // Quote credit; may be null if none Credit RichText `json:"credit"` } @@ -26366,10 +28269,12 @@ type PageBlockAnimation struct { meta // Animation file; may be null Animation *Animation `json:"animation"` - // Animation caption + // Animation caption; may be null if none Caption *PageBlockCaption `json:"caption"` // True, if the animation must be played automatically NeedAutoplay bool `json:"need_autoplay"` + // True, if the animation preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` } func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) { @@ -26397,7 +28302,7 @@ type PageBlockAudio struct { meta // Audio file; may be null Audio *Audio `json:"audio"` - // Audio file caption + // Audio file caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26426,10 +28331,12 @@ type PageBlockPhoto struct { meta // Photo file; may be null Photo *Photo `json:"photo"` - // Photo caption + // Photo caption; may be null if none Caption *PageBlockCaption `json:"caption"` - // URL that needs to be opened when the photo is clicked + // URL that needs to be opened when the photo is clicked; instant view only Url string `json:"url"` + // True, if the photo preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` } func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) { @@ -26457,12 +28364,14 @@ type PageBlockVideo struct { meta // Video file; may be null Video *Video `json:"video"` - // Video caption + // Video caption; may be null if none Caption *PageBlockCaption `json:"caption"` // True, if the video must be played automatically NeedAutoplay bool `json:"need_autoplay"` // True, if the video must be looped IsLooped bool `json:"is_looped"` + // True, if the video preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` } func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) { @@ -26490,7 +28399,7 @@ type PageBlockVoiceNote struct { meta // Voice note; may be null VoiceNote *VoiceNote `json:"voice_note"` - // Voice note caption + // Voice note caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26514,7 +28423,7 @@ func (*PageBlockVoiceNote) PageBlockType() string { return TypePageBlockVoiceNote } -// A page cover +// A page cover; instant view only type PageBlockCover struct { meta // Cover @@ -26557,7 +28466,7 @@ func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error { return nil } -// An embedded web page +// An embedded web page; instant view only type PageBlockEmbedded struct { meta // URL of the embedded page, if available @@ -26570,7 +28479,7 @@ type PageBlockEmbedded struct { Width int32 `json:"width"` // Block height; 0 if unknown Height int32 `json:"height"` - // Block caption + // Block caption; may be null if none Caption *PageBlockCaption `json:"caption"` // True, if the block must be full width IsFullWidth bool `json:"is_full_width"` @@ -26598,7 +28507,7 @@ func (*PageBlockEmbedded) PageBlockType() string { return TypePageBlockEmbedded } -// An embedded post +// An embedded post; instant view only type PageBlockEmbeddedPost struct { meta // URL of the embedded post @@ -26610,8 +28519,8 @@ type PageBlockEmbeddedPost struct { // Point in time (Unix timestamp) when the post was created; 0 if unknown Date int32 `json:"date"` // Post content - PageBlocks []PageBlock `json:"page_blocks"` - // Post caption + Blocks []PageBlock `json:"blocks"` + // Post caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26641,7 +28550,7 @@ func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) e Author string `json:"author"` AuthorPhoto *Photo `json:"author_photo"` Date int32 `json:"date"` - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` Caption *PageBlockCaption `json:"caption"` } @@ -26656,8 +28565,8 @@ func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) e pageBlockEmbeddedPost.Date = tmp.Date pageBlockEmbeddedPost.Caption = tmp.Caption - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockEmbeddedPost.Blocks = fieldBlocks return nil } @@ -26666,8 +28575,8 @@ func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) e type PageBlockCollage struct { meta // Collage item contents - PageBlocks []PageBlock `json:"page_blocks"` - // Block caption + Blocks []PageBlock `json:"blocks"` + // Block caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26693,7 +28602,7 @@ func (*PageBlockCollage) PageBlockType() string { func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error { var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` Caption *PageBlockCaption `json:"caption"` } @@ -26704,8 +28613,8 @@ func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error { pageBlockCollage.Caption = tmp.Caption - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockCollage.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockCollage.Blocks = fieldBlocks return nil } @@ -26714,8 +28623,8 @@ func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error { type PageBlockSlideshow struct { meta // Slideshow item contents - PageBlocks []PageBlock `json:"page_blocks"` - // Block caption + Blocks []PageBlock `json:"blocks"` + // Block caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26741,7 +28650,7 @@ func (*PageBlockSlideshow) PageBlockType() string { func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error { var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` Caption *PageBlockCaption `json:"caption"` } @@ -26752,13 +28661,13 @@ func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error { pageBlockSlideshow.Caption = tmp.Caption - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockSlideshow.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockSlideshow.Blocks = fieldBlocks return nil } -// A link to a chat +// A link to a chat; instant view only type PageBlockChatLink struct { meta // Chat title @@ -26794,7 +28703,7 @@ func (*PageBlockChatLink) PageBlockType() string { // A table type PageBlockTable struct { meta - // Table caption + // Table caption; may be null if none Caption RichText `json:"caption"` // Table cells Cells [][]*PageBlockTableCell `json:"cells"` @@ -26853,7 +28762,7 @@ type PageBlockDetails struct { // Always visible heading for the block Header RichText `json:"header"` // Block contents - PageBlocks []PageBlock `json:"page_blocks"` + Blocks []PageBlock `json:"blocks"` // True, if the block is open by default IsOpen bool `json:"is_open"` } @@ -26881,7 +28790,7 @@ func (*PageBlockDetails) PageBlockType() string { func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error { var tmp struct { Header json.RawMessage `json:"header"` - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` IsOpen bool `json:"is_open"` } @@ -26895,13 +28804,13 @@ func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error { fieldHeader, _ := UnmarshalRichText(tmp.Header) pageBlockDetails.Header = fieldHeader - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockDetails.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + pageBlockDetails.Blocks = fieldBlocks return nil } -// Related articles +// Related articles; instant view only type PageBlockRelatedArticles struct { meta // Block header @@ -26960,7 +28869,7 @@ type PageBlockMap struct { Width int32 `json:"width"` // Map height Height int32 `json:"height"` - // Block caption + // Block caption; may be null if none Caption *PageBlockCaption `json:"caption"` } @@ -26988,7 +28897,7 @@ func (*PageBlockMap) PageBlockType() string { type WebPageInstantView struct { meta // Content of the instant view page - PageBlocks []PageBlock `json:"page_blocks"` + Blocks []PageBlock `json:"blocks"` // Number of the instant view views; 0 if unknown ViewCount int32 `json:"view_count"` // Version of the instant view; currently, can be 1 or 2 @@ -27019,7 +28928,7 @@ func (*WebPageInstantView) GetType() string { func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` + Blocks []json.RawMessage `json:"blocks"` ViewCount int32 `json:"view_count"` Version int32 `json:"version"` IsRtl bool `json:"is_rtl"` @@ -27037,8 +28946,8 @@ func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { webPageInstantView.IsRtl = tmp.IsRtl webPageInstantView.IsFull = tmp.IsFull - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - webPageInstantView.PageBlocks = fieldPageBlocks + fieldBlocks, _ := UnmarshalListOfPageBlock(tmp.Blocks) + webPageInstantView.Blocks = fieldBlocks fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink) webPageInstantView.FeedbackLink = fieldFeedbackLink @@ -27202,7 +29111,7 @@ func (*LinkPreviewTypeApp) LinkPreviewTypeType() string { return TypeLinkPreviewTypeApp } -// The link is a link to a web site +// The link is a link to a website type LinkPreviewTypeArticle struct { meta // Article's main photo; may be null @@ -28302,7 +30211,7 @@ type LinkPreview struct { Url string `json:"url"` // URL to display DisplayUrl string `json:"display_url"` - // Short name of the site (e.g., Google Docs, App Store) + // Short name of the website (e.g., Google Docs, App Store) SiteName string `json:"site_name"` // Title of the content Title string `json:"title"` @@ -28392,6 +30301,8 @@ type CountryInfo struct { Name string `json:"name"` // English name of the country EnglishName string `json:"english_name"` + // An emoji for the flag of the country; may be empty if unknown + FlagEmoji string `json:"flag_emoji"` // True, if the country must be hidden from the list of all countries IsHidden bool `json:"is_hidden"` // List of country calling codes @@ -31793,6 +33704,261 @@ func (inputPassportElementError *InputPassportElementError) UnmarshalJSON(data [ return nil } +// An animation +type PollMediaAnimation struct { + meta + // The animation + Animation *Animation `json:"animation"` +} + +func (entity *PollMediaAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaAnimation) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaAnimation) GetType() string { + return TypePollMediaAnimation +} + +func (*PollMediaAnimation) PollMediaType() string { + return TypePollMediaAnimation +} + +// An audio +type PollMediaAudio struct { + meta + // The audio + Audio *Audio `json:"audio"` +} + +func (entity *PollMediaAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaAudio + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaAudio) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaAudio) GetType() string { + return TypePollMediaAudio +} + +func (*PollMediaAudio) PollMediaType() string { + return TypePollMediaAudio +} + +// A document (general file) +type PollMediaDocument struct { + meta + // The document + Document *Document `json:"document"` +} + +func (entity *PollMediaDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaDocument + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaDocument) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaDocument) GetType() string { + return TypePollMediaDocument +} + +func (*PollMediaDocument) PollMediaType() string { + return TypePollMediaDocument +} + +// A link +type PollMediaLink struct { + meta + // URL of the link + Url string `json:"url"` + // Preview of the link; may be null if unknown + LinkPreview *LinkPreview `json:"link_preview"` +} + +func (entity *PollMediaLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaLink + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaLink) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaLink) GetType() string { + return TypePollMediaLink +} + +func (*PollMediaLink) PollMediaType() string { + return TypePollMediaLink +} + +// A location +type PollMediaLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *PollMediaLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaLocation + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaLocation) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaLocation) GetType() string { + return TypePollMediaLocation +} + +func (*PollMediaLocation) PollMediaType() string { + return TypePollMediaLocation +} + +// A photo +type PollMediaPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // The video representing the live photo; may be null if the photo is static + Video *Video `json:"video"` +} + +func (entity *PollMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaPhoto) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaPhoto) GetType() string { + return TypePollMediaPhoto +} + +func (*PollMediaPhoto) PollMediaType() string { + return TypePollMediaPhoto +} + +// A sticker +type PollMediaSticker struct { + meta + // The sticker + Sticker *Sticker `json:"sticker"` +} + +func (entity *PollMediaSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaSticker + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaSticker) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaSticker) GetType() string { + return TypePollMediaSticker +} + +func (*PollMediaSticker) PollMediaType() string { + return TypePollMediaSticker +} + +// A venue +type PollMediaVenue struct { + meta + // The venue + Venue *Venue `json:"venue"` +} + +func (entity *PollMediaVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaVenue + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaVenue) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaVenue) GetType() string { + return TypePollMediaVenue +} + +func (*PollMediaVenue) PollMediaType() string { + return TypePollMediaVenue +} + +// A video +type PollMediaVideo struct { + meta + // The video description + Video *Video `json:"video"` + // Alternative qualities of the video + AlternativeVideos []*AlternativeVideo `json:"alternative_videos"` + // Available storyboards for the video + Storyboards []*VideoStoryboard `json:"storyboards"` + // Cover of the video; may be null if none + Cover *Photo `json:"cover"` + // Timestamp from which the video playing must start, in seconds + StartTimestamp int32 `json:"start_timestamp"` +} + +func (entity *PollMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*PollMediaVideo) GetClass() string { + return ClassPollMedia +} + +func (*PollMediaVideo) GetType() string { + return TypePollMediaVideo +} + +func (*PollMediaVideo) PollMediaType() string { + return TypePollMediaVideo +} + // A text message type MessageText struct { meta @@ -31824,6 +33990,33 @@ func (*MessageText) MessageContentType() string { return TypeMessageText } +// A rich message; the message can have multiple media of the same type, all of which must be shown in the corresponding profile tab +type MessageRichMessage struct { + meta + // The rich message + Message *RichMessage `json:"message"` +} + +func (entity *MessageRichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageRichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*MessageRichMessage) GetClass() string { + return ClassMessageContent +} + +func (*MessageRichMessage) GetType() string { + return TypeMessageRichMessage +} + +func (*MessageRichMessage) MessageContentType() string { + return TypeMessageRichMessage +} + // An animation message (GIF-style). type MessageAnimation struct { meta @@ -32244,19 +34437,40 @@ func (*MessageExpiredVoiceNote) MessageContentType() string { return TypeMessageExpiredVoiceNote } +// A message with a live location +type MessageLiveLocation struct { + meta + // The current location + Location *LiveLocation `json:"location"` + // Left time for which the location can be updated, in seconds. If 0, then the location can't be updated anymore. The update updateMessageContent is not sent when this field changes + ExpiresIn int32 `json:"expires_in"` +} + +func (entity *MessageLiveLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageLiveLocation + + return json.Marshal((*stub)(entity)) +} + +func (*MessageLiveLocation) GetClass() string { + return ClassMessageContent +} + +func (*MessageLiveLocation) GetType() string { + return TypeMessageLiveLocation +} + +func (*MessageLiveLocation) MessageContentType() string { + return TypeMessageLiveLocation +} + // A message with a location type MessageLocation struct { meta - // The location description + // The location Location *Location `json:"location"` - // Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever - LivePeriod int32 `json:"live_period"` - // Left time for which the location can be updated, in seconds. If 0, then the location can't be updated anymore. The update updateMessageContent is not sent when this field changes - ExpiresIn int32 `json:"expires_in"` - // For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown - Heading int32 `json:"heading"` - // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender - ProximityAlertRadius int32 `json:"proximity_alert_radius"` } func (entity *MessageLocation) MarshalJSON() ([]byte, error) { @@ -32458,8 +34672,8 @@ type MessagePoll struct { Poll *Poll `json:"poll"` // Description of the poll Description *FormattedText `json:"description"` - // Media attached to the poll; may be null if none. If present, currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption - Media MessageContent `json:"media"` + // Media attached to the poll; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaAudio, pollMediaDocument, pollMediaLocation, pollMediaPhoto, pollMediaVenue, or pollMediaVideo + Media PollMedia `json:"media"` // True, if an option can be added to the poll using addPollOption CanAddOption bool `json:"can_add_option"` } @@ -32501,7 +34715,7 @@ func (messagePoll *MessagePoll) UnmarshalJSON(data []byte) error { messagePoll.Description = tmp.Description messagePoll.CanAddOption = tmp.CanAddOption - fieldMedia, _ := UnmarshalMessageContent(tmp.Media) + fieldMedia, _ := UnmarshalPollMedia(tmp.Media) messagePoll.Media = fieldMedia return nil @@ -32516,10 +34730,10 @@ type MessageStakeDice struct { FinalState DiceStickers `json:"final_state"` // The dice value. If the value is 0, then the dice don't have final state yet Value int32 `json:"value"` - // The Toncoin amount that was staked; in the smallest units of the currency - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // The Toncoin amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet - PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` + // The TON Gram amount that was staked; in the smallest units of the currency + StakeGramAmount int64 `json:"stake_gram_amount"` + // The TON Gram amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet + PrizeGramAmount int64 `json:"prize_gram_amount"` } func (entity *MessageStakeDice) MarshalJSON() ([]byte, error) { @@ -32547,8 +34761,8 @@ func (messageStakeDice *MessageStakeDice) UnmarshalJSON(data []byte) error { InitialState json.RawMessage `json:"initial_state"` FinalState json.RawMessage `json:"final_state"` Value int32 `json:"value"` - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` + StakeGramAmount int64 `json:"stake_gram_amount"` + PrizeGramAmount int64 `json:"prize_gram_amount"` } err := json.Unmarshal(data, &tmp) @@ -32557,8 +34771,8 @@ func (messageStakeDice *MessageStakeDice) UnmarshalJSON(data []byte) error { } messageStakeDice.Value = tmp.Value - messageStakeDice.StakeToncoinAmount = tmp.StakeToncoinAmount - messageStakeDice.PrizeToncoinAmount = tmp.PrizeToncoinAmount + messageStakeDice.StakeGramAmount = tmp.StakeGramAmount + messageStakeDice.PrizeGramAmount = tmp.PrizeGramAmount fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) messageStakeDice.InitialState = fieldInitialState @@ -33348,6 +35562,58 @@ func (*MessageChatDeleteMember) MessageContentType() string { return TypeMessageChatDeleteMember } +// The chat was added to a community +type MessageChatAddedToCommunity struct { + meta + // Identifier of the community to which the chat was added + CommunityId int64 `json:"community_id"` +} + +func (entity *MessageChatAddedToCommunity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatAddedToCommunity + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatAddedToCommunity) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatAddedToCommunity) GetType() string { + return TypeMessageChatAddedToCommunity +} + +func (*MessageChatAddedToCommunity) MessageContentType() string { + return TypeMessageChatAddedToCommunity +} + +// The chat was removed from a community +type MessageChatRemovedFromCommunity struct{ + meta +} + +func (entity *MessageChatRemovedFromCommunity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatRemovedFromCommunity + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatRemovedFromCommunity) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatRemovedFromCommunity) GetType() string { + return TypeMessageChatRemovedFromCommunity +} + +func (*MessageChatRemovedFromCommunity) MessageContentType() string { + return TypeMessageChatRemovedFromCommunity +} + // A basic group was upgraded to a supergroup and was deactivated as the result type MessageChatUpgradeTo struct { meta @@ -34367,16 +36633,16 @@ func (*MessageGiftedStars) MessageContentType() string { return TypeMessageGiftedStars } -// Toncoins were gifted to a user +// TON Grams were gifted to a user type MessageGiftedTon struct { meta - // The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Grams; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user who received Toncoins; 0 if the gift is incoming + // The identifier of a user who received Grams; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` - // The received Toncoin amount, in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` - // Identifier of the transaction for Toncoin credit; for receiver only + // The received Gram amount, in the smallest units of the cryptocurrency + GramAmount int64 `json:"gram_amount"` + // Identifier of the transaction for Gram credit; for receiver only TransactionId string `json:"transaction_id"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -34402,7 +36668,7 @@ func (*MessageGiftedTon) MessageContentType() string { return TypeMessageGiftedTon } -// A Telegram Stars were received by the current user from a giveaway +// Telegram Stars were received by the current user from a giveaway type MessageGiveawayPrizeStars struct { meta // Number of Telegram Stars that were received @@ -34586,7 +36852,7 @@ type MessageUpgradedGift struct { NextResaleDate int32 `json:"next_resale_date"` // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` - // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be used to craft another gift; can be in the past; only for the receiver of the gift CraftDate int32 `json:"craft_date"` } @@ -34976,7 +37242,7 @@ func (*MessageChecklistTasksAdded) MessageContentType() string { return TypeMessageChecklistTasksAdded } -// Approval of suggested post has failed, because the user which proposed the post had no enough funds +// Approval of suggested post has failed, because the user who proposed the post didn't have enough funds type MessageSuggestedPostApprovalFailed struct { meta // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message @@ -35112,8 +37378,8 @@ type MessageSuggestedPostPaid struct { SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // The amount of received Telegram Stars StarAmount *StarAmount `json:"star_amount"` - // The amount of received Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` + // The amount of received TON Grams; in the smallest units of the cryptocurrency + GramAmount int64 `json:"gram_amount"` } func (entity *MessageSuggestedPostPaid) MarshalJSON() ([]byte, error) { @@ -36404,6 +38670,458 @@ func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { return nil } +// An animation to be sent +type InputAnimation struct { + meta + // Animation file to be sent + Animation InputFile `json:"animation"` + // Animation thumbnail; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // File identifiers of the stickers added to the animation, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Duration of the animation, in seconds; may be replaced by the server + Duration int32 `json:"duration"` + // Width of the animation; may be replaced by the server + Width int32 `json:"width"` + // Height of the animation; may be replaced by the server + Height int32 `json:"height"` +} + +func (entity *InputAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputAnimation) GetClass() string { + return ClassInputAnimation +} + +func (*InputAnimation) GetType() string { + return TypeInputAnimation +} + +func (inputAnimation *InputAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Animation json.RawMessage `json:"animation"` + Thumbnail *InputThumbnail `json:"thumbnail"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration int32 `json:"duration"` + Width int32 `json:"width"` + Height int32 `json:"height"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputAnimation.Thumbnail = tmp.Thumbnail + inputAnimation.AddedStickerFileIds = tmp.AddedStickerFileIds + inputAnimation.Duration = tmp.Duration + inputAnimation.Width = tmp.Width + inputAnimation.Height = tmp.Height + + fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) + inputAnimation.Animation = fieldAnimation + + return nil +} + +// An audio to be sent +type InputAudio struct { + meta + // Audio file to be sent + Audio InputFile `json:"audio"` + // Thumbnail of the cover for the album; pass null to skip thumbnail uploading + AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"` + // Duration of the audio, in seconds; may be replaced by the server + Duration int32 `json:"duration"` + // Title of the audio; 0-64 characters; may be replaced by the server + Title string `json:"title"` + // Performer of the audio; 0-64 characters, may be replaced by the server + Performer string `json:"performer"` +} + +func (entity *InputAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InputAudio) GetClass() string { + return ClassInputAudio +} + +func (*InputAudio) GetType() string { + return TypeInputAudio +} + +func (inputAudio *InputAudio) UnmarshalJSON(data []byte) error { + var tmp struct { + Audio json.RawMessage `json:"audio"` + AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"` + Duration int32 `json:"duration"` + Title string `json:"title"` + Performer string `json:"performer"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail + inputAudio.Duration = tmp.Duration + inputAudio.Title = tmp.Title + inputAudio.Performer = tmp.Performer + + fieldAudio, _ := UnmarshalInputFile(tmp.Audio) + inputAudio.Audio = fieldAudio + + return nil +} + +// A document (general file) to be sent +type InputDocument struct { + meta + // File to be sent + Document InputFile `json:"document"` + // Document thumbnail; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats + DisableContentTypeDetection bool `json:"disable_content_type_detection"` +} + +func (entity *InputDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputDocument) GetClass() string { + return ClassInputDocument +} + +func (*InputDocument) GetType() string { + return TypeInputDocument +} + +func (inputDocument *InputDocument) UnmarshalJSON(data []byte) error { + var tmp struct { + Document json.RawMessage `json:"document"` + Thumbnail *InputThumbnail `json:"thumbnail"` + DisableContentTypeDetection bool `json:"disable_content_type_detection"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputDocument.Thumbnail = tmp.Thumbnail + inputDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection + + fieldDocument, _ := UnmarshalInputFile(tmp.Document) + inputDocument.Document = fieldDocument + + return nil +} + +// A photo to be sent +type InputPhoto struct { + meta + // Photo to be sent. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 + Photo InputFile `json:"photo"` + // Photo thumbnail; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats + Thumbnail *InputThumbnail `json:"thumbnail"` + // Video of the live photo; not supported in secret chats; pass null if the photo isn't a live photo + Video InputFile `json:"video"` + // File identifiers of the stickers added to the photo, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Photo width; may be replaced by the server + Width int32 `json:"width"` + // Photo height; may be replaced by the server + Height int32 `json:"height"` +} + +func (entity *InputPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputPhoto) GetClass() string { + return ClassInputPhoto +} + +func (*InputPhoto) GetType() string { + return TypeInputPhoto +} + +func (inputPhoto *InputPhoto) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Video json.RawMessage `json:"video"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Width int32 `json:"width"` + Height int32 `json:"height"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPhoto.Thumbnail = tmp.Thumbnail + inputPhoto.AddedStickerFileIds = tmp.AddedStickerFileIds + inputPhoto.Width = tmp.Width + inputPhoto.Height = tmp.Height + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputPhoto.Photo = fieldPhoto + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputPhoto.Video = fieldVideo + + return nil +} + +// A sticker to be sent +type InputSticker struct { + meta + // Sticker to be sent + Sticker InputFile `json:"sticker"` + // Sticker thumbnail; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Sticker width + Width int32 `json:"width"` + // Sticker height + Height int32 `json:"height"` +} + +func (entity *InputSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputSticker) GetClass() string { + return ClassInputSticker +} + +func (*InputSticker) GetType() string { + return TypeInputSticker +} + +func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { + var tmp struct { + Sticker json.RawMessage `json:"sticker"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Width int32 `json:"width"` + Height int32 `json:"height"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputSticker.Thumbnail = tmp.Thumbnail + inputSticker.Width = tmp.Width + inputSticker.Height = tmp.Height + + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputSticker.Sticker = fieldSticker + + return nil +} + +// A video to be sent +type InputVideo struct { + meta + // Video file to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender + Video InputFile `json:"video"` + // Video thumbnail; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Cover of the video; pass null to skip cover uploading; not supported in secret chats and for self-destructing messages + Cover InputFile `json:"cover"` + // Timestamp from which the video playing must start, in seconds + StartTimestamp int32 `json:"start_timestamp"` + // File identifiers of the stickers added to the video, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Duration of the video, in seconds + Duration int32 `json:"duration"` + // Video width + Width int32 `json:"width"` + // Video height + Height int32 `json:"height"` + // True, if the video is expected to be streamed + SupportsStreaming bool `json:"supports_streaming"` +} + +func (entity *InputVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputVideo) GetClass() string { + return ClassInputVideo +} + +func (*InputVideo) GetType() string { + return TypeInputVideo +} + +func (inputVideo *InputVideo) UnmarshalJSON(data []byte) error { + var tmp struct { + Video json.RawMessage `json:"video"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Cover json.RawMessage `json:"cover"` + StartTimestamp int32 `json:"start_timestamp"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration int32 `json:"duration"` + Width int32 `json:"width"` + Height int32 `json:"height"` + SupportsStreaming bool `json:"supports_streaming"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputVideo.Thumbnail = tmp.Thumbnail + inputVideo.StartTimestamp = tmp.StartTimestamp + inputVideo.AddedStickerFileIds = tmp.AddedStickerFileIds + inputVideo.Duration = tmp.Duration + inputVideo.Width = tmp.Width + inputVideo.Height = tmp.Height + inputVideo.SupportsStreaming = tmp.SupportsStreaming + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputVideo.Video = fieldVideo + + fieldCover, _ := UnmarshalInputFile(tmp.Cover) + inputVideo.Cover = fieldCover + + return nil +} + +// A video note to be sent +type InputVideoNote struct { + meta + // Video note file to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle + VideoNote InputFile `json:"video_note"` + // Video thumbnail; may be null if empty; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Duration of the video, in seconds; 0-60 + Duration int32 `json:"duration"` + // Video width and height; must be positive and not greater than 640 + Length int32 `json:"length"` +} + +func (entity *InputVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputVideoNote) GetClass() string { + return ClassInputVideoNote +} + +func (*InputVideoNote) GetType() string { + return TypeInputVideoNote +} + +func (inputVideoNote *InputVideoNote) UnmarshalJSON(data []byte) error { + var tmp struct { + VideoNote json.RawMessage `json:"video_note"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Duration int32 `json:"duration"` + Length int32 `json:"length"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputVideoNote.Thumbnail = tmp.Thumbnail + inputVideoNote.Duration = tmp.Duration + inputVideoNote.Length = tmp.Length + + fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote) + inputVideoNote.VideoNote = fieldVideoNote + + return nil +} + +// A video 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 + VoiceNote InputFile `json:"voice_note"` + // Duration of the voice note, in seconds + Duration int32 `json:"duration"` + // Waveform representation of the voice note in 5-bit format + Waveform []byte `json:"waveform"` +} + +func (entity *InputVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputVoiceNote) GetClass() string { + return ClassInputVoiceNote +} + +func (*InputVoiceNote) GetType() string { + return TypeInputVoiceNote +} + +func (inputVoiceNote *InputVoiceNote) UnmarshalJSON(data []byte) error { + var tmp struct { + VoiceNote json.RawMessage `json:"voice_note"` + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputVoiceNote.Duration = tmp.Duration + inputVoiceNote.Waveform = tmp.Waveform + + fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote) + inputVoiceNote.VoiceNote = fieldVoiceNote + + return nil +} + // The media is a photo. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 type InputPaidMediaTypePhoto struct { meta @@ -36807,6 +39525,1070 @@ func (*MessageCopyOptions) GetType() string { return TypeMessageCopyOptions } +// An animation +type InputPollMediaAnimation struct { + meta + // The animation to be sent + Animation *InputAnimation `json:"animation"` +} + +func (entity *InputPollMediaAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaAnimation) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaAnimation) GetType() string { + return TypeInputPollMediaAnimation +} + +func (*InputPollMediaAnimation) InputPollMediaType() string { + return TypeInputPollMediaAnimation +} + +// An audio +type InputPollMediaAudio struct { + meta + // The audio to be sent + Audio *InputAudio `json:"audio"` +} + +func (entity *InputPollMediaAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaAudio) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaAudio) GetType() string { + return TypeInputPollMediaAudio +} + +func (*InputPollMediaAudio) InputPollMediaType() string { + return TypeInputPollMediaAudio +} + +// A document (general file) +type InputPollMediaDocument struct { + meta + // The document to be sent + Document *InputDocument `json:"document"` +} + +func (entity *InputPollMediaDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaDocument) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaDocument) GetType() string { + return TypeInputPollMediaDocument +} + +func (*InputPollMediaDocument) InputPollMediaType() string { + return TypeInputPollMediaDocument +} + +// A link +type InputPollMediaLink struct { + meta + // URL of the link + Url string `json:"url"` +} + +func (entity *InputPollMediaLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaLink + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaLink) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaLink) GetType() string { + return TypeInputPollMediaLink +} + +func (*InputPollMediaLink) InputPollMediaType() string { + return TypeInputPollMediaLink +} + +// A location +type InputPollMediaLocation struct { + meta + // Location to be sent + Location *Location `json:"location"` +} + +func (entity *InputPollMediaLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaLocation) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaLocation) GetType() string { + return TypeInputPollMediaLocation +} + +func (*InputPollMediaLocation) InputPollMediaType() string { + return TypeInputPollMediaLocation +} + +// A photo +type InputPollMediaPhoto struct { + meta + // Photo to be sent + Photo *InputPhoto `json:"photo"` +} + +func (entity *InputPollMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaPhoto) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaPhoto) GetType() string { + return TypeInputPollMediaPhoto +} + +func (*InputPollMediaPhoto) InputPollMediaType() string { + return TypeInputPollMediaPhoto +} + +// A sticker +type InputPollMediaSticker struct { + meta + // Sticker to be sent + Sticker *InputSticker `json:"sticker"` +} + +func (entity *InputPollMediaSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaSticker) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaSticker) GetType() string { + return TypeInputPollMediaSticker +} + +func (*InputPollMediaSticker) InputPollMediaType() string { + return TypeInputPollMediaSticker +} + +// A venue +type InputPollMediaVenue struct { + meta + // Venue to send + Venue *Venue `json:"venue"` +} + +func (entity *InputPollMediaVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaVenue) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaVenue) GetType() string { + return TypeInputPollMediaVenue +} + +func (*InputPollMediaVenue) InputPollMediaType() string { + return TypeInputPollMediaVenue +} + +// A video +type InputPollMediaVideo struct { + meta + // The video to be sent + Video *InputVideo `json:"video"` +} + +func (entity *InputPollMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollMediaVideo) GetClass() string { + return ClassInputPollMedia +} + +func (*InputPollMediaVideo) GetType() string { + return TypeInputPollMediaVideo +} + +func (*InputPollMediaVideo) InputPollMediaType() string { + return TypeInputPollMediaVideo +} + +// A section heading +type InputPageBlockSectionHeading struct { + meta + // Text of the section heading + Text RichText `json:"text"` + // Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest + Size int32 `json:"size"` +} + +func (entity *InputPageBlockSectionHeading) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockSectionHeading + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockSectionHeading) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockSectionHeading) GetType() string { + return TypeInputPageBlockSectionHeading +} + +func (*InputPageBlockSectionHeading) InputPageBlockType() string { + return TypeInputPageBlockSectionHeading +} + +func (inputPageBlockSectionHeading *InputPageBlockSectionHeading) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Size int32 `json:"size"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockSectionHeading.Size = tmp.Size + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockSectionHeading.Text = fieldText + + return nil +} + +// A text paragraph +type InputPageBlockParagraph struct { + meta + // Paragraph text + Text RichText `json:"text"` +} + +func (entity *InputPageBlockParagraph) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockParagraph + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockParagraph) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockParagraph) GetType() string { + return TypeInputPageBlockParagraph +} + +func (*InputPageBlockParagraph) InputPageBlockType() string { + return TypeInputPageBlockParagraph +} + +func (inputPageBlockParagraph *InputPageBlockParagraph) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockParagraph.Text = fieldText + + return nil +} + +// A preformatted text paragraph +type InputPageBlockPreformatted struct { + meta + // Paragraph text + Text RichText `json:"text"` + // Programming language for which the text needs to be formatted + Language string `json:"language"` +} + +func (entity *InputPageBlockPreformatted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockPreformatted + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockPreformatted) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockPreformatted) GetType() string { + return TypeInputPageBlockPreformatted +} + +func (*InputPageBlockPreformatted) InputPageBlockType() string { + return TypeInputPageBlockPreformatted +} + +func (inputPageBlockPreformatted *InputPageBlockPreformatted) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Language string `json:"language"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockPreformatted.Language = tmp.Language + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockPreformatted.Text = fieldText + + return nil +} + +// The footer of the page +type InputPageBlockFooter struct { + meta + // Footer + Footer RichText `json:"footer"` +} + +func (entity *InputPageBlockFooter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockFooter + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockFooter) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockFooter) GetType() string { + return TypeInputPageBlockFooter +} + +func (*InputPageBlockFooter) InputPageBlockType() string { + return TypeInputPageBlockFooter +} + +func (inputPageBlockFooter *InputPageBlockFooter) UnmarshalJSON(data []byte) error { + var tmp struct { + Footer json.RawMessage `json:"footer"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFooter, _ := UnmarshalRichText(tmp.Footer) + inputPageBlockFooter.Footer = fieldFooter + + return nil +} + +// A "Thinking..." placeholder; for pending rich messages only; for bots only +type InputPageBlockThinking struct { + meta + // Text of the placeholder + Text RichText `json:"text"` +} + +func (entity *InputPageBlockThinking) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockThinking + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockThinking) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockThinking) GetType() string { + return TypeInputPageBlockThinking +} + +func (*InputPageBlockThinking) InputPageBlockType() string { + return TypeInputPageBlockThinking +} + +func (inputPageBlockThinking *InputPageBlockThinking) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockThinking.Text = fieldText + + return nil +} + +// An empty block separating the page +type InputPageBlockDivider struct{ + meta +} + +func (entity *InputPageBlockDivider) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockDivider + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockDivider) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockDivider) GetType() string { + return TypeInputPageBlockDivider +} + +func (*InputPageBlockDivider) InputPageBlockType() string { + return TypeInputPageBlockDivider +} + +// A mathematical expression +type InputPageBlockMathematicalExpression struct { + meta + // The expression in LaTeX format + Expression string `json:"expression"` +} + +func (entity *InputPageBlockMathematicalExpression) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockMathematicalExpression + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockMathematicalExpression) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockMathematicalExpression) GetType() string { + return TypeInputPageBlockMathematicalExpression +} + +func (*InputPageBlockMathematicalExpression) InputPageBlockType() string { + return TypeInputPageBlockMathematicalExpression +} + +// An invisible anchor +type InputPageBlockAnchor struct { + meta + // Name of the anchor + Name string `json:"name"` +} + +func (entity *InputPageBlockAnchor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockAnchor + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockAnchor) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockAnchor) GetType() string { + return TypeInputPageBlockAnchor +} + +func (*InputPageBlockAnchor) InputPageBlockType() string { + return TypeInputPageBlockAnchor +} + +// A list of data blocks +type InputPageBlockList struct { + meta + // The items of the list + Items []*InputPageBlockListItem `json:"items"` +} + +func (entity *InputPageBlockList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockList + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockList) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockList) GetType() string { + return TypeInputPageBlockList +} + +func (*InputPageBlockList) InputPageBlockType() string { + return TypeInputPageBlockList +} + +// A block quote +type InputPageBlockBlockQuote struct { + meta + // Quote blocks + Blocks []InputPageBlock `json:"blocks"` + // Quote credit; pass null if none + Credit RichText `json:"credit"` +} + +func (entity *InputPageBlockBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockBlockQuote) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockBlockQuote) GetType() string { + return TypeInputPageBlockBlockQuote +} + +func (*InputPageBlockBlockQuote) InputPageBlockType() string { + return TypeInputPageBlockBlockQuote +} + +func (inputPageBlockBlockQuote *InputPageBlockBlockQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + inputPageBlockBlockQuote.Blocks = fieldBlocks + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + inputPageBlockBlockQuote.Credit = fieldCredit + + return nil +} + +// A pull quote +type InputPageBlockPullQuote struct { + meta + // Quote text + Text RichText `json:"text"` + // Quote credit; pass null if none + Credit RichText `json:"credit"` +} + +func (entity *InputPageBlockPullQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockPullQuote + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockPullQuote) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockPullQuote) GetType() string { + return TypeInputPageBlockPullQuote +} + +func (*InputPageBlockPullQuote) InputPageBlockType() string { + return TypeInputPageBlockPullQuote +} + +func (inputPageBlockPullQuote *InputPageBlockPullQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockPullQuote.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + inputPageBlockPullQuote.Credit = fieldCredit + + return nil +} + +// An animation +type InputPageBlockAnimation struct { + meta + // The animation to be sent + Animation *InputAnimation `json:"animation"` + // Animation caption; pass null if none + Caption *PageBlockCaption `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputPageBlockAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockAnimation) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockAnimation) GetType() string { + return TypeInputPageBlockAnimation +} + +func (*InputPageBlockAnimation) InputPageBlockType() string { + return TypeInputPageBlockAnimation +} + +// An audio file +type InputPageBlockAudio struct { + meta + // The audio to be sent + Audio *InputAudio `json:"audio"` + // Audio file caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockAudio) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockAudio) GetType() string { + return TypeInputPageBlockAudio +} + +func (*InputPageBlockAudio) InputPageBlockType() string { + return TypeInputPageBlockAudio +} + +// A photo +type InputPageBlockPhoto struct { + meta + // The photo to be sent + Photo *InputPhoto `json:"photo"` + // Photo caption; pass null if none + Caption *PageBlockCaption `json:"caption"` + // True, if the photo preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputPageBlockPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockPhoto) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockPhoto) GetType() string { + return TypeInputPageBlockPhoto +} + +func (*InputPageBlockPhoto) InputPageBlockType() string { + return TypeInputPageBlockPhoto +} + +// A video +type InputPageBlockVideo struct { + meta + // The video to be sent + Video *InputVideo `json:"video"` + // Video caption; pass null if none + Caption *PageBlockCaption `json:"caption"` + // True, if the video preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputPageBlockVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockVideo) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockVideo) GetType() string { + return TypeInputPageBlockVideo +} + +func (*InputPageBlockVideo) InputPageBlockType() string { + return TypeInputPageBlockVideo +} + +// A voice note +type InputPageBlockVoiceNote struct { + meta + // The voice note to be sent + VoiceNote *InputVoiceNote `json:"voice_note"` + // Voice note caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockVoiceNote) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockVoiceNote) GetType() string { + return TypeInputPageBlockVoiceNote +} + +func (*InputPageBlockVoiceNote) InputPageBlockType() string { + return TypeInputPageBlockVoiceNote +} + +// A collage +type InputPageBlockCollage struct { + meta + // Collage item contents + Blocks []InputPageBlock `json:"blocks"` + // Block caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockCollage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockCollage + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockCollage) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockCollage) GetType() string { + return TypeInputPageBlockCollage +} + +func (*InputPageBlockCollage) InputPageBlockType() string { + return TypeInputPageBlockCollage +} + +func (inputPageBlockCollage *InputPageBlockCollage) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + Caption *PageBlockCaption `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockCollage.Caption = tmp.Caption + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + inputPageBlockCollage.Blocks = fieldBlocks + + return nil +} + +// A slideshow +type InputPageBlockSlideshow struct { + meta + // Slideshow item contents + Blocks []InputPageBlock `json:"blocks"` + // Block caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockSlideshow) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockSlideshow + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockSlideshow) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockSlideshow) GetType() string { + return TypeInputPageBlockSlideshow +} + +func (*InputPageBlockSlideshow) InputPageBlockType() string { + return TypeInputPageBlockSlideshow +} + +func (inputPageBlockSlideshow *InputPageBlockSlideshow) UnmarshalJSON(data []byte) error { + var tmp struct { + Blocks []json.RawMessage `json:"blocks"` + Caption *PageBlockCaption `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockSlideshow.Caption = tmp.Caption + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + inputPageBlockSlideshow.Blocks = fieldBlocks + + return nil +} + +// A table +type InputPageBlockTable struct { + meta + // Table caption + Caption RichText `json:"caption"` + // Table cells + Cells [][]*PageBlockTableCell `json:"cells"` + // True, if the table is bordered + IsBordered bool `json:"is_bordered"` + // True, if the table is striped + IsStriped bool `json:"is_striped"` +} + +func (entity *InputPageBlockTable) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockTable + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockTable) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockTable) GetType() string { + return TypeInputPageBlockTable +} + +func (*InputPageBlockTable) InputPageBlockType() string { + return TypeInputPageBlockTable +} + +func (inputPageBlockTable *InputPageBlockTable) UnmarshalJSON(data []byte) error { + var tmp struct { + Caption json.RawMessage `json:"caption"` + Cells [][]*PageBlockTableCell `json:"cells"` + IsBordered bool `json:"is_bordered"` + IsStriped bool `json:"is_striped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockTable.Cells = tmp.Cells + inputPageBlockTable.IsBordered = tmp.IsBordered + inputPageBlockTable.IsStriped = tmp.IsStriped + + fieldCaption, _ := UnmarshalRichText(tmp.Caption) + inputPageBlockTable.Caption = fieldCaption + + return nil +} + +// A collapsible block +type InputPageBlockDetails struct { + meta + // Always visible heading for the block + Header RichText `json:"header"` + // Block contents + Blocks []InputPageBlock `json:"blocks"` + // True, if the block is open by default + IsOpen bool `json:"is_open"` +} + +func (entity *InputPageBlockDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockDetails + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockDetails) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockDetails) GetType() string { + return TypeInputPageBlockDetails +} + +func (*InputPageBlockDetails) InputPageBlockType() string { + return TypeInputPageBlockDetails +} + +func (inputPageBlockDetails *InputPageBlockDetails) UnmarshalJSON(data []byte) error { + var tmp struct { + Header json.RawMessage `json:"header"` + Blocks []json.RawMessage `json:"blocks"` + IsOpen bool `json:"is_open"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockDetails.IsOpen = tmp.IsOpen + + fieldHeader, _ := UnmarshalRichText(tmp.Header) + inputPageBlockDetails.Header = fieldHeader + + fieldBlocks, _ := UnmarshalListOfInputPageBlock(tmp.Blocks) + inputPageBlockDetails.Blocks = fieldBlocks + + return nil +} + +// A map. The map's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 +type InputPageBlockMap struct { + meta + // Location of the map center + Location *Location `json:"location"` + // Map zoom level; 0-24 + Zoom int32 `json:"zoom"` + // Map width; 0-10000 + Width int32 `json:"width"` + // Map height; 0-10000 + Height int32 `json:"height"` + // Block caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockMap) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockMap + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockMap) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockMap) GetType() string { + return TypeInputPageBlockMap +} + +func (*InputPageBlockMap) InputPageBlockType() string { + return TypeInputPageBlockMap +} + // A text message type InputMessageText struct { meta @@ -36814,7 +40596,7 @@ type InputMessageText struct { Text *FormattedText `json:"text"` // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` - // True, if the chat message draft must be deleted + // Pass true to delete message draft in the chat ClearDraft bool `json:"clear_draft"` } @@ -36838,21 +40620,40 @@ func (*InputMessageText) InputMessageContentType() string { return TypeInputMessageText } +// A rich message +type InputMessageRichMessage struct { + meta + // The rich message to send + Message *InputRichMessage `json:"message"` + // Pass true to delete message draft in the chat + ClearDraft bool `json:"clear_draft"` +} + +func (entity *InputMessageRichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageRichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageRichMessage) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageRichMessage) GetType() string { + return TypeInputMessageRichMessage +} + +func (*InputMessageRichMessage) InputMessageContentType() string { + return TypeInputMessageRichMessage +} + // An animation message (GIF-style). type InputMessageAnimation struct { meta - // Animation file to be sent - Animation InputFile `json:"animation"` - // Animation thumbnail; pass null to skip thumbnail uploading - Thumbnail *InputThumbnail `json:"thumbnail"` - // File identifiers of the stickers added to the animation, if applicable - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - // Duration of the animation, in seconds - Duration int32 `json:"duration"` - // Width of the animation; may be replaced by the server - Width int32 `json:"width"` - // Height of the animation; may be replaced by the server - Height int32 `json:"height"` + // The animation to be sent + Animation *InputAnimation `json:"animation"` // Animation 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 animation; otherwise, the caption must be shown below the animation; not supported in secret chats @@ -36881,52 +40682,11 @@ func (*InputMessageAnimation) InputMessageContentType() string { return TypeInputMessageAnimation } -func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error { - var tmp struct { - Animation json.RawMessage `json:"animation"` - Thumbnail *InputThumbnail `json:"thumbnail"` - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - Duration int32 `json:"duration"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Caption *FormattedText `json:"caption"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media"` - HasSpoiler bool `json:"has_spoiler"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageAnimation.Thumbnail = tmp.Thumbnail - inputMessageAnimation.AddedStickerFileIds = tmp.AddedStickerFileIds - inputMessageAnimation.Duration = tmp.Duration - inputMessageAnimation.Width = tmp.Width - inputMessageAnimation.Height = tmp.Height - inputMessageAnimation.Caption = tmp.Caption - inputMessageAnimation.ShowCaptionAboveMedia = tmp.ShowCaptionAboveMedia - inputMessageAnimation.HasSpoiler = tmp.HasSpoiler - - fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) - inputMessageAnimation.Animation = fieldAnimation - - return nil -} - // An audio message type InputMessageAudio struct { meta - // Audio file to be sent - Audio InputFile `json:"audio"` - // Thumbnail of the cover for the album; pass null to skip thumbnail uploading - AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"` - // Duration of the audio, in seconds; may be replaced by the server - Duration int32 `json:"duration"` - // Title of the audio; 0-64 characters; may be replaced by the server - Title string `json:"title"` - // Performer of the audio; 0-64 characters, may be replaced by the server - Performer string `json:"performer"` + // Audio to be sent + Audio *InputAudio `json:"audio"` // Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -36951,42 +40711,11 @@ func (*InputMessageAudio) InputMessageContentType() string { return TypeInputMessageAudio } -func (inputMessageAudio *InputMessageAudio) UnmarshalJSON(data []byte) error { - var tmp struct { - Audio json.RawMessage `json:"audio"` - AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"` - Duration int32 `json:"duration"` - Title string `json:"title"` - Performer string `json:"performer"` - Caption *FormattedText `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail - inputMessageAudio.Duration = tmp.Duration - inputMessageAudio.Title = tmp.Title - inputMessageAudio.Performer = tmp.Performer - inputMessageAudio.Caption = tmp.Caption - - fieldAudio, _ := UnmarshalInputFile(tmp.Audio) - inputMessageAudio.Audio = fieldAudio - - return nil -} - // A document message (general file) type InputMessageDocument struct { meta // Document to be sent - Document InputFile `json:"document"` - // Document thumbnail; pass null to skip thumbnail uploading - Thumbnail *InputThumbnail `json:"thumbnail"` - // Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats - DisableContentTypeDetection bool `json:"disable_content_type_detection"` + Document *InputDocument `json:"document"` // Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -37011,29 +40740,6 @@ func (*InputMessageDocument) InputMessageContentType() string { return TypeInputMessageDocument } -func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error { - var tmp struct { - Document json.RawMessage `json:"document"` - Thumbnail *InputThumbnail `json:"thumbnail"` - DisableContentTypeDetection bool `json:"disable_content_type_detection"` - Caption *FormattedText `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageDocument.Thumbnail = tmp.Thumbnail - inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection - inputMessageDocument.Caption = tmp.Caption - - fieldDocument, _ := UnmarshalInputFile(tmp.Document) - inputMessageDocument.Document = fieldDocument - - return nil -} - // A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed type InputMessagePaidMedia struct { meta @@ -37072,18 +40778,8 @@ func (*InputMessagePaidMedia) InputMessageContentType() string { // A photo message type InputMessagePhoto struct { meta - // Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 - Photo InputFile `json:"photo"` - // Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats - Thumbnail *InputThumbnail `json:"thumbnail"` - // Video of the live photo; not supported in secret chats; pass null if the photo isn't a live photo - Video InputFile `json:"video"` - // File identifiers of the stickers added to the photo, if applicable - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - // Photo width - Width int32 `json:"width"` - // Photo height - Height int32 `json:"height"` + // Photo to be sent + Photo *InputPhoto `json:"photo"` // Photo 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 photo; otherwise, the caption must be shown below the photo; not supported in secret chats @@ -37116,12 +40812,7 @@ func (*InputMessagePhoto) InputMessageContentType() string { func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { var tmp struct { - Photo json.RawMessage `json:"photo"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Video json.RawMessage `json:"video"` - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - Width int32 `json:"width"` - Height int32 `json:"height"` + Photo *InputPhoto `json:"photo"` Caption *FormattedText `json:"caption"` ShowCaptionAboveMedia bool `json:"show_caption_above_media"` SelfDestructType json.RawMessage `json:"self_destruct_type"` @@ -37133,20 +40824,11 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { return err } - inputMessagePhoto.Thumbnail = tmp.Thumbnail - inputMessagePhoto.AddedStickerFileIds = tmp.AddedStickerFileIds - inputMessagePhoto.Width = tmp.Width - inputMessagePhoto.Height = tmp.Height + inputMessagePhoto.Photo = tmp.Photo inputMessagePhoto.Caption = tmp.Caption inputMessagePhoto.ShowCaptionAboveMedia = tmp.ShowCaptionAboveMedia inputMessagePhoto.HasSpoiler = tmp.HasSpoiler - fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) - inputMessagePhoto.Photo = fieldPhoto - - fieldVideo, _ := UnmarshalInputFile(tmp.Video) - inputMessagePhoto.Video = fieldVideo - fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) inputMessagePhoto.SelfDestructType = fieldSelfDestructType @@ -37157,13 +40839,7 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { type InputMessageSticker struct { meta // Sticker to be sent - Sticker InputFile `json:"sticker"` - // Sticker thumbnail; pass null to skip thumbnail uploading - Thumbnail *InputThumbnail `json:"thumbnail"` - // Sticker width - Width int32 `json:"width"` - // Sticker height - Height int32 `json:"height"` + Sticker *InputSticker `json:"sticker"` // Emoji used to choose the sticker Emoji string `json:"emoji"` } @@ -37188,52 +40864,11 @@ func (*InputMessageSticker) InputMessageContentType() string { return TypeInputMessageSticker } -func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Emoji string `json:"emoji"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageSticker.Thumbnail = tmp.Thumbnail - inputMessageSticker.Width = tmp.Width - inputMessageSticker.Height = tmp.Height - inputMessageSticker.Emoji = tmp.Emoji - - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputMessageSticker.Sticker = fieldSticker - - return nil -} - // A video message type InputMessageVideo struct { meta - // Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender - Video InputFile `json:"video"` - // Video thumbnail; pass null to skip thumbnail uploading - Thumbnail *InputThumbnail `json:"thumbnail"` - // Cover of the video; pass null to skip cover uploading; not supported in secret chats and for self-destructing messages - Cover InputFile `json:"cover"` - // Timestamp from which the video playing must start, in seconds - StartTimestamp int32 `json:"start_timestamp"` - // File identifiers of the stickers added to the video, if applicable - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - // Duration of the video, in seconds - Duration int32 `json:"duration"` - // Video width - Width int32 `json:"width"` - // Video height - Height int32 `json:"height"` - // True, if the video is expected to be streamed - SupportsStreaming bool `json:"supports_streaming"` + // Video to be sent + Video *InputVideo `json:"video"` // Video 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 video; otherwise, the caption must be shown below the video; not supported in secret chats @@ -37266,15 +40901,7 @@ func (*InputMessageVideo) InputMessageContentType() string { func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { var tmp struct { - Video json.RawMessage `json:"video"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Cover json.RawMessage `json:"cover"` - StartTimestamp int32 `json:"start_timestamp"` - AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` - Duration int32 `json:"duration"` - Width int32 `json:"width"` - Height int32 `json:"height"` - SupportsStreaming bool `json:"supports_streaming"` + Video *InputVideo `json:"video"` Caption *FormattedText `json:"caption"` ShowCaptionAboveMedia bool `json:"show_caption_above_media"` SelfDestructType json.RawMessage `json:"self_destruct_type"` @@ -37286,23 +40913,11 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { return err } - inputMessageVideo.Thumbnail = tmp.Thumbnail - inputMessageVideo.StartTimestamp = tmp.StartTimestamp - inputMessageVideo.AddedStickerFileIds = tmp.AddedStickerFileIds - inputMessageVideo.Duration = tmp.Duration - inputMessageVideo.Width = tmp.Width - inputMessageVideo.Height = tmp.Height - inputMessageVideo.SupportsStreaming = tmp.SupportsStreaming + inputMessageVideo.Video = tmp.Video inputMessageVideo.Caption = tmp.Caption inputMessageVideo.ShowCaptionAboveMedia = tmp.ShowCaptionAboveMedia inputMessageVideo.HasSpoiler = tmp.HasSpoiler - fieldVideo, _ := UnmarshalInputFile(tmp.Video) - inputMessageVideo.Video = fieldVideo - - fieldCover, _ := UnmarshalInputFile(tmp.Cover) - inputMessageVideo.Cover = fieldCover - fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) inputMessageVideo.SelfDestructType = fieldSelfDestructType @@ -37312,14 +40927,8 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { // A video note message type InputMessageVideoNote struct { meta - // Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle - VideoNote InputFile `json:"video_note"` - // Video thumbnail; may be null if empty; pass null to skip thumbnail uploading - Thumbnail *InputThumbnail `json:"thumbnail"` - // Duration of the video, in seconds; 0-60 - Duration int32 `json:"duration"` - // Video width and height; must be positive and not greater than 640 - Length int32 `json:"length"` + // Video note to be sent + VideoNote *InputVideoNote `json:"video_note"` // Video note self-destruct type; may be null if none; pass null if none; private chats only SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` } @@ -37346,10 +40955,7 @@ func (*InputMessageVideoNote) InputMessageContentType() string { func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) error { var tmp struct { - VideoNote json.RawMessage `json:"video_note"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Duration int32 `json:"duration"` - Length int32 `json:"length"` + VideoNote *InputVideoNote `json:"video_note"` SelfDestructType json.RawMessage `json:"self_destruct_type"` } @@ -37358,12 +40964,7 @@ func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) e return err } - inputMessageVideoNote.Thumbnail = tmp.Thumbnail - inputMessageVideoNote.Duration = tmp.Duration - inputMessageVideoNote.Length = tmp.Length - - fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote) - inputMessageVideoNote.VideoNote = fieldVideoNote + inputMessageVideoNote.VideoNote = tmp.VideoNote fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) inputMessageVideoNote.SelfDestructType = fieldSelfDestructType @@ -37374,13 +40975,9 @@ func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) e // A voice note message type InputMessageVoiceNote struct { meta - // Voice note 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 - VoiceNote InputFile `json:"voice_note"` - // Duration of the voice note, in seconds - Duration int32 `json:"duration"` - // Waveform representation of the voice note in 5-bit format - Waveform []byte `json:"waveform"` - // Voice note caption; may be null if empty; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters + // Voice note to be sent + VoiceNote *InputVoiceNote `json:"voice_note"` + // Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` // Voice note self-destruct type; may be null if none; pass null if none; private chats only SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` @@ -37408,9 +41005,7 @@ func (*InputMessageVoiceNote) InputMessageContentType() string { func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) error { var tmp struct { - VoiceNote json.RawMessage `json:"voice_note"` - Duration int32 `json:"duration"` - Waveform []byte `json:"waveform"` + VoiceNote *InputVoiceNote `json:"voice_note"` Caption *FormattedText `json:"caption"` SelfDestructType json.RawMessage `json:"self_destruct_type"` } @@ -37420,30 +41015,47 @@ func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) e return err } - inputMessageVoiceNote.Duration = tmp.Duration - inputMessageVoiceNote.Waveform = tmp.Waveform + inputMessageVoiceNote.VoiceNote = tmp.VoiceNote inputMessageVoiceNote.Caption = tmp.Caption - fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote) - inputMessageVoiceNote.VoiceNote = fieldVoiceNote - fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) inputMessageVoiceNote.SelfDestructType = fieldSelfDestructType return nil } +// A message with a live location +type InputMessageLiveLocation struct { + meta + // 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 + Location *LiveLocation `json:"location"` +} + +func (entity *InputMessageLiveLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageLiveLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageLiveLocation) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageLiveLocation) GetType() string { + return TypeInputMessageLiveLocation +} + +func (*InputMessageLiveLocation) InputMessageContentType() string { + return TypeInputMessageLiveLocation +} + // A message with a location type InputMessageLocation struct { meta // Location to be sent Location *Location `json:"location"` - // Period for which the location can be updated, in seconds; must be between 60 and 86400 for a temporary live location, 0x7FFFFFFF for permanent live location, and 0 otherwise - LivePeriod int32 `json:"live_period"` - // For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown - Heading int32 `json:"heading"` - // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages - ProximityAlertRadius int32 `json:"proximity_alert_radius"` } func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) { @@ -37525,7 +41137,7 @@ type InputMessageDice struct { meta // Emoji on which the dice throw animation is based Emoji string `json:"emoji"` - // True, if the chat message draft must be deleted + // Pass true to delete message draft in the chat ClearDraft bool `json:"clear_draft"` } @@ -37638,8 +41250,8 @@ type InputMessagePoll struct { Options []*InputPollOption `json:"options"` // Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters Description *FormattedText `json:"description"` - // Media attached to the poll; pass null if none. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, non-live inputMessageLocation, inputMessagePhoto, inputMessageVenue, or inputMessageVideo without caption - Media InputMessageContent `json:"media"` + // Media attached to the poll; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption + Media InputPollMedia `json:"media"` // True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels IsAnonymous bool `json:"is_anonymous"` // True, if multiple answer options can be chosen simultaneously @@ -37722,7 +41334,7 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { inputMessagePoll.CloseDate = tmp.CloseDate inputMessagePoll.IsClosed = tmp.IsClosed - fieldMedia, _ := UnmarshalInputMessageContent(tmp.Media) + fieldMedia, _ := UnmarshalInputPollMedia(tmp.Media) inputMessagePoll.Media = fieldMedia fieldType, _ := UnmarshalInputPollType(tmp.Type) @@ -37736,9 +41348,9 @@ type InputMessageStakeDice struct { meta // Hash of the stake dice state. The state hash can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState StateHash string `json:"state_hash"` - // The Toncoin amount that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // True, if the chat message draft must be deleted + // The TON Gram amount that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") + StakeGramAmount int64 `json:"stake_gram_amount"` + // Pass true to delete message draft in the chat ClearDraft bool `json:"clear_draft"` } @@ -37882,7 +41494,7 @@ type MessageProperties struct { CanBePaid bool `json:"can_be_paid"` // True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage CanBePinned bool `json:"can_be_pinned"` - // True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage + // True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage. Ephemeral messages can be replied only by other ephemeral messages CanBeReplied bool `json:"can_be_replied"` // True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` @@ -38533,6 +42145,56 @@ func (*SearchMessagesChatTypeFilterChannel) SearchMessagesChatTypeFilterType() s return TypeSearchMessagesChatTypeFilterChannel } +// Returns only private chats with bots +type SearchChatTypeFilterBot struct{ + meta +} + +func (entity *SearchChatTypeFilterBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchChatTypeFilterBot + + return json.Marshal((*stub)(entity)) +} + +func (*SearchChatTypeFilterBot) GetClass() string { + return ClassSearchChatTypeFilter +} + +func (*SearchChatTypeFilterBot) GetType() string { + return TypeSearchChatTypeFilterBot +} + +func (*SearchChatTypeFilterBot) SearchChatTypeFilterType() string { + return TypeSearchChatTypeFilterBot +} + +// Returns only channel chats +type SearchChatTypeFilterChannel struct{ + meta +} + +func (entity *SearchChatTypeFilterChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchChatTypeFilterChannel + + return json.Marshal((*stub)(entity)) +} + +func (*SearchChatTypeFilterChannel) GetClass() string { + return ClassSearchChatTypeFilter +} + +func (*SearchChatTypeFilterChannel) GetType() string { + return TypeSearchChatTypeFilterChannel +} + +func (*SearchChatTypeFilterChannel) SearchChatTypeFilterType() string { + return TypeSearchChatTypeFilterChannel +} + // The user is typing a message type ChatActionTyping struct{ meta @@ -39759,7 +43421,7 @@ func (*StoryAreaTypeVenue) StoryAreaTypeType() string { return TypeStoryAreaTypeVenue } -// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the area is clicked type StoryAreaTypeSuggestedReaction struct { meta // Type of the reaction @@ -40677,7 +44339,7 @@ func (*StoryListMain) StoryListType() string { return TypeStoryListMain } -// The list of stories, shown in the Arvhive chat list +// The list of stories, shown in the Archive chat list type StoryListArchive struct{ meta } @@ -40870,7 +44532,7 @@ type Story struct { CanGetStatistics bool `json:"can_get_statistics"` // True, if interactions with the story can be received through getStoryInteractions CanGetInteractions bool `json:"can_get_interactions"` - // True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago + // True, if users who viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago HasExpiredViewers bool `json:"has_expired_viewers"` // Information about the original story; may be null if the story wasn't reposted RepostInfo *StoryRepostInfo `json:"repost_info"` @@ -45051,7 +48713,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, inputMessageAnimation, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45133,7 +48795,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, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45207,7 +48869,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, inputMessageAudio, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45277,7 +48939,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, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45353,7 +49015,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, inputMessageDocument, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45485,7 +49147,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, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45563,7 +49225,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, inputMessagePhoto, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45637,7 +49299,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, inputMessageSticker, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45707,7 +49369,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, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45785,7 +49447,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, inputMessageVideo, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -45861,7 +49523,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, inputMessageVoiceNote, inputMessageInvoice, 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 or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -48952,6 +52614,31 @@ func (*PremiumLimitTypePinnedSavedMessagesTopicCount) PremiumLimitTypeType() str return TypePremiumLimitTypePinnedSavedMessagesTopicCount } +// The maximum length of text of sent messages +type PremiumLimitTypeMessageTextLength struct{ + meta +} + +func (entity *PremiumLimitTypeMessageTextLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeMessageTextLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeMessageTextLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeMessageTextLength) GetType() string { + return TypePremiumLimitTypeMessageTextLength +} + +func (*PremiumLimitTypeMessageTextLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeMessageTextLength +} + // The maximum length of sent media caption type PremiumLimitTypeCaptionLength struct{ meta @@ -49952,6 +53639,31 @@ func (*PremiumFeatureTextComposition) PremiumFeatureType() string { return TypePremiumFeatureTextComposition } +// The ability to send rich messages +type PremiumFeatureRichMessages struct{ + meta +} + +func (entity *PremiumFeatureRichMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureRichMessages + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureRichMessages) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureRichMessages) GetType() string { + return TypePremiumFeatureRichMessages +} + +func (*PremiumFeatureRichMessages) PremiumFeatureType() string { + return TypePremiumFeatureRichMessages +} + // The ability to set location type BusinessFeatureLocation struct{ meta @@ -56176,429 +59888,483 @@ func (*MessageAutoDeleteTime) GetType() string { return TypeMessageAutoDeleteTime } -// The session is running on an Android device -type SessionTypeAndroid struct{ +// A regular session from a device +type SessionTypeDevice struct { meta + // Unique identifier of the session. Use terminateSession to terminate it or confirmSession to confirm it if it isn't confirmed yet + SessionId JsonInt64 `json:"session_id"` } -func (entity *SessionTypeAndroid) MarshalJSON() ([]byte, error) { +func (entity *SessionTypeDevice) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeAndroid + type stub SessionTypeDevice return json.Marshal((*stub)(entity)) } -func (*SessionTypeAndroid) GetClass() string { +func (*SessionTypeDevice) GetClass() string { return ClassSessionType } -func (*SessionTypeAndroid) GetType() string { - return TypeSessionTypeAndroid +func (*SessionTypeDevice) GetType() string { + return TypeSessionTypeDevice } -func (*SessionTypeAndroid) SessionTypeType() string { - return TypeSessionTypeAndroid +func (*SessionTypeDevice) SessionTypeType() string { + return TypeSessionTypeDevice +} + +// A business bot connected to the current user's account +type SessionTypeConnectedBot struct { + meta + // User identifier of the bot. Use deleteBusinessConnectedBot to remove it or confirmBusinessConnectedBot to confirm it if it isn't confirmed yet + BotUserId int64 `json:"bot_user_id"` +} + +func (entity *SessionTypeConnectedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeConnectedBot + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeConnectedBot) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeConnectedBot) GetType() string { + return TypeSessionTypeConnectedBot +} + +func (*SessionTypeConnectedBot) SessionTypeType() string { + return TypeSessionTypeConnectedBot +} + +// The session is running on an Android device +type SessionDeviceTypeAndroid struct{ + meta +} + +func (entity *SessionDeviceTypeAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionDeviceTypeAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*SessionDeviceTypeAndroid) GetClass() string { + return ClassSessionDeviceType +} + +func (*SessionDeviceTypeAndroid) GetType() string { + return TypeSessionDeviceTypeAndroid +} + +func (*SessionDeviceTypeAndroid) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeAndroid } // The session is running on a generic Apple device -type SessionTypeApple struct{ +type SessionDeviceTypeApple struct{ meta } -func (entity *SessionTypeApple) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeApple) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeApple + type stub SessionDeviceTypeApple return json.Marshal((*stub)(entity)) } -func (*SessionTypeApple) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeApple) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeApple) GetType() string { - return TypeSessionTypeApple +func (*SessionDeviceTypeApple) GetType() string { + return TypeSessionDeviceTypeApple } -func (*SessionTypeApple) SessionTypeType() string { - return TypeSessionTypeApple +func (*SessionDeviceTypeApple) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeApple } // The session is running on the Brave browser -type SessionTypeBrave struct{ +type SessionDeviceTypeBrave struct{ meta } -func (entity *SessionTypeBrave) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeBrave) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeBrave + type stub SessionDeviceTypeBrave return json.Marshal((*stub)(entity)) } -func (*SessionTypeBrave) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeBrave) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeBrave) GetType() string { - return TypeSessionTypeBrave +func (*SessionDeviceTypeBrave) GetType() string { + return TypeSessionDeviceTypeBrave } -func (*SessionTypeBrave) SessionTypeType() string { - return TypeSessionTypeBrave +func (*SessionDeviceTypeBrave) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeBrave } // The session is running on the Chrome browser -type SessionTypeChrome struct{ +type SessionDeviceTypeChrome struct{ meta } -func (entity *SessionTypeChrome) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeChrome) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeChrome + type stub SessionDeviceTypeChrome return json.Marshal((*stub)(entity)) } -func (*SessionTypeChrome) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeChrome) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeChrome) GetType() string { - return TypeSessionTypeChrome +func (*SessionDeviceTypeChrome) GetType() string { + return TypeSessionDeviceTypeChrome } -func (*SessionTypeChrome) SessionTypeType() string { - return TypeSessionTypeChrome +func (*SessionDeviceTypeChrome) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeChrome } // The session is running on the Edge browser -type SessionTypeEdge struct{ +type SessionDeviceTypeEdge struct{ meta } -func (entity *SessionTypeEdge) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeEdge) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeEdge + type stub SessionDeviceTypeEdge return json.Marshal((*stub)(entity)) } -func (*SessionTypeEdge) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeEdge) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeEdge) GetType() string { - return TypeSessionTypeEdge +func (*SessionDeviceTypeEdge) GetType() string { + return TypeSessionDeviceTypeEdge } -func (*SessionTypeEdge) SessionTypeType() string { - return TypeSessionTypeEdge +func (*SessionDeviceTypeEdge) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeEdge } // The session is running on the Firefox browser -type SessionTypeFirefox struct{ +type SessionDeviceTypeFirefox struct{ meta } -func (entity *SessionTypeFirefox) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeFirefox) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeFirefox + type stub SessionDeviceTypeFirefox return json.Marshal((*stub)(entity)) } -func (*SessionTypeFirefox) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeFirefox) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeFirefox) GetType() string { - return TypeSessionTypeFirefox +func (*SessionDeviceTypeFirefox) GetType() string { + return TypeSessionDeviceTypeFirefox } -func (*SessionTypeFirefox) SessionTypeType() string { - return TypeSessionTypeFirefox +func (*SessionDeviceTypeFirefox) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeFirefox } // The session is running on an iPad device -type SessionTypeIpad struct{ +type SessionDeviceTypeIpad struct{ meta } -func (entity *SessionTypeIpad) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeIpad) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeIpad + type stub SessionDeviceTypeIpad return json.Marshal((*stub)(entity)) } -func (*SessionTypeIpad) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeIpad) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeIpad) GetType() string { - return TypeSessionTypeIpad +func (*SessionDeviceTypeIpad) GetType() string { + return TypeSessionDeviceTypeIpad } -func (*SessionTypeIpad) SessionTypeType() string { - return TypeSessionTypeIpad +func (*SessionDeviceTypeIpad) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeIpad } // The session is running on an iPhone device -type SessionTypeIphone struct{ +type SessionDeviceTypeIphone struct{ meta } -func (entity *SessionTypeIphone) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeIphone) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeIphone + type stub SessionDeviceTypeIphone return json.Marshal((*stub)(entity)) } -func (*SessionTypeIphone) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeIphone) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeIphone) GetType() string { - return TypeSessionTypeIphone +func (*SessionDeviceTypeIphone) GetType() string { + return TypeSessionDeviceTypeIphone } -func (*SessionTypeIphone) SessionTypeType() string { - return TypeSessionTypeIphone +func (*SessionDeviceTypeIphone) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeIphone } // The session is running on a Linux device -type SessionTypeLinux struct{ +type SessionDeviceTypeLinux struct{ meta } -func (entity *SessionTypeLinux) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeLinux) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeLinux + type stub SessionDeviceTypeLinux return json.Marshal((*stub)(entity)) } -func (*SessionTypeLinux) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeLinux) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeLinux) GetType() string { - return TypeSessionTypeLinux +func (*SessionDeviceTypeLinux) GetType() string { + return TypeSessionDeviceTypeLinux } -func (*SessionTypeLinux) SessionTypeType() string { - return TypeSessionTypeLinux +func (*SessionDeviceTypeLinux) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeLinux } // The session is running on a Mac device -type SessionTypeMac struct{ +type SessionDeviceTypeMac struct{ meta } -func (entity *SessionTypeMac) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeMac) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeMac + type stub SessionDeviceTypeMac return json.Marshal((*stub)(entity)) } -func (*SessionTypeMac) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeMac) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeMac) GetType() string { - return TypeSessionTypeMac +func (*SessionDeviceTypeMac) GetType() string { + return TypeSessionDeviceTypeMac } -func (*SessionTypeMac) SessionTypeType() string { - return TypeSessionTypeMac +func (*SessionDeviceTypeMac) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeMac } // The session is running on the Opera browser -type SessionTypeOpera struct{ +type SessionDeviceTypeOpera struct{ meta } -func (entity *SessionTypeOpera) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeOpera) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeOpera + type stub SessionDeviceTypeOpera return json.Marshal((*stub)(entity)) } -func (*SessionTypeOpera) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeOpera) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeOpera) GetType() string { - return TypeSessionTypeOpera +func (*SessionDeviceTypeOpera) GetType() string { + return TypeSessionDeviceTypeOpera } -func (*SessionTypeOpera) SessionTypeType() string { - return TypeSessionTypeOpera +func (*SessionDeviceTypeOpera) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeOpera } // The session is running on the Safari browser -type SessionTypeSafari struct{ +type SessionDeviceTypeSafari struct{ meta } -func (entity *SessionTypeSafari) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeSafari) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeSafari + type stub SessionDeviceTypeSafari return json.Marshal((*stub)(entity)) } -func (*SessionTypeSafari) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeSafari) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeSafari) GetType() string { - return TypeSessionTypeSafari +func (*SessionDeviceTypeSafari) GetType() string { + return TypeSessionDeviceTypeSafari } -func (*SessionTypeSafari) SessionTypeType() string { - return TypeSessionTypeSafari +func (*SessionDeviceTypeSafari) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeSafari } // The session is running on an Ubuntu device -type SessionTypeUbuntu struct{ +type SessionDeviceTypeUbuntu struct{ meta } -func (entity *SessionTypeUbuntu) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeUbuntu) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeUbuntu + type stub SessionDeviceTypeUbuntu return json.Marshal((*stub)(entity)) } -func (*SessionTypeUbuntu) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeUbuntu) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeUbuntu) GetType() string { - return TypeSessionTypeUbuntu +func (*SessionDeviceTypeUbuntu) GetType() string { + return TypeSessionDeviceTypeUbuntu } -func (*SessionTypeUbuntu) SessionTypeType() string { - return TypeSessionTypeUbuntu +func (*SessionDeviceTypeUbuntu) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeUbuntu } // The session is running on an unknown type of device -type SessionTypeUnknown struct{ +type SessionDeviceTypeUnknown struct{ meta } -func (entity *SessionTypeUnknown) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeUnknown) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeUnknown + type stub SessionDeviceTypeUnknown return json.Marshal((*stub)(entity)) } -func (*SessionTypeUnknown) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeUnknown) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeUnknown) GetType() string { - return TypeSessionTypeUnknown +func (*SessionDeviceTypeUnknown) GetType() string { + return TypeSessionDeviceTypeUnknown } -func (*SessionTypeUnknown) SessionTypeType() string { - return TypeSessionTypeUnknown +func (*SessionDeviceTypeUnknown) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeUnknown } // The session is running on the Vivaldi browser -type SessionTypeVivaldi struct{ +type SessionDeviceTypeVivaldi struct{ meta } -func (entity *SessionTypeVivaldi) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeVivaldi) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeVivaldi + type stub SessionDeviceTypeVivaldi return json.Marshal((*stub)(entity)) } -func (*SessionTypeVivaldi) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeVivaldi) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeVivaldi) GetType() string { - return TypeSessionTypeVivaldi +func (*SessionDeviceTypeVivaldi) GetType() string { + return TypeSessionDeviceTypeVivaldi } -func (*SessionTypeVivaldi) SessionTypeType() string { - return TypeSessionTypeVivaldi +func (*SessionDeviceTypeVivaldi) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeVivaldi } // The session is running on a Windows device -type SessionTypeWindows struct{ +type SessionDeviceTypeWindows struct{ meta } -func (entity *SessionTypeWindows) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeWindows) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeWindows + type stub SessionDeviceTypeWindows return json.Marshal((*stub)(entity)) } -func (*SessionTypeWindows) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeWindows) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeWindows) GetType() string { - return TypeSessionTypeWindows +func (*SessionDeviceTypeWindows) GetType() string { + return TypeSessionDeviceTypeWindows } -func (*SessionTypeWindows) SessionTypeType() string { - return TypeSessionTypeWindows +func (*SessionDeviceTypeWindows) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeWindows } // The session is running on an Xbox console -type SessionTypeXbox struct{ +type SessionDeviceTypeXbox struct{ meta } -func (entity *SessionTypeXbox) MarshalJSON() ([]byte, error) { +func (entity *SessionDeviceTypeXbox) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SessionTypeXbox + type stub SessionDeviceTypeXbox return json.Marshal((*stub)(entity)) } -func (*SessionTypeXbox) GetClass() string { - return ClassSessionType +func (*SessionDeviceTypeXbox) GetClass() string { + return ClassSessionDeviceType } -func (*SessionTypeXbox) GetType() string { - return TypeSessionTypeXbox +func (*SessionDeviceTypeXbox) GetType() string { + return TypeSessionDeviceTypeXbox } -func (*SessionTypeXbox) SessionTypeType() string { - return TypeSessionTypeXbox +func (*SessionDeviceTypeXbox) SessionDeviceTypeType() string { + return TypeSessionDeviceTypeXbox } // Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order @@ -56616,8 +60382,8 @@ type Session struct { CanAcceptSecretChats bool `json:"can_accept_secret_chats"` // True, if incoming calls can be accepted by the session CanAcceptCalls bool `json:"can_accept_calls"` - // Session type based on the system and application version, which can be used to display a corresponding icon - Type SessionType `json:"type"` + // Session device type based on the system and application version, which can be used to display a corresponding icon + DeviceType SessionDeviceType `json:"device_type"` // Telegram API identifier, as provided by the application ApiId int32 `json:"api_id"` // Name of the application, as provided by the application @@ -56666,7 +60432,7 @@ func (session *Session) UnmarshalJSON(data []byte) error { IsUnconfirmed bool `json:"is_unconfirmed"` CanAcceptSecretChats bool `json:"can_accept_secret_chats"` CanAcceptCalls bool `json:"can_accept_calls"` - Type json.RawMessage `json:"type"` + DeviceType json.RawMessage `json:"device_type"` ApiId int32 `json:"api_id"` ApplicationName string `json:"application_name"` ApplicationVersion string `json:"application_version"` @@ -56703,8 +60469,8 @@ func (session *Session) UnmarshalJSON(data []byte) error { session.IpAddress = tmp.IpAddress session.Location = tmp.Location - fieldType, _ := UnmarshalSessionType(tmp.Type) - session.Type = fieldType + fieldDeviceType, _ := UnmarshalSessionDeviceType(tmp.DeviceType) + session.DeviceType = fieldDeviceType return nil } @@ -56737,10 +60503,10 @@ func (*Sessions) GetType() string { // Contains information about an unconfirmed session type UnconfirmedSession struct { meta - // Session identifier - Id JsonInt64 `json:"id"` - // Point in time (Unix timestamp) when the user has logged in - LogInDate int32 `json:"log_in_date"` + // Session type + Type SessionType `json:"type"` + // Point in time (Unix timestamp) when the user has logged in or the business bot was connected + Date int32 `json:"date"` // Model of the device that was used for the session creation, as provided by the application DeviceModel string `json:"device_model"` // A human-readable description of the location from which the session was created, based on the IP address @@ -56763,6 +60529,29 @@ func (*UnconfirmedSession) GetType() string { return TypeUnconfirmedSession } +func (unconfirmedSession *UnconfirmedSession) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Date int32 `json:"date"` + DeviceModel string `json:"device_model"` + Location string `json:"location"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + unconfirmedSession.Date = tmp.Date + unconfirmedSession.DeviceModel = tmp.DeviceModel + unconfirmedSession.Location = tmp.Location + + fieldType, _ := UnmarshalSessionType(tmp.Type) + unconfirmedSession.Type = fieldType + + return nil +} + // Contains information about one website the current user is logged in with Telegram type ConnectedWebsite struct { meta @@ -57584,29 +61373,29 @@ func (*SettingsSectionMyStars) SettingsSectionType() string { return TypeSettingsSectionMyStars } -// The Toncoin balance and transaction section -type SettingsSectionMyToncoins struct{ +// The TON Gram balance and transaction section +type SettingsSectionMyGrams struct{ meta } -func (entity *SettingsSectionMyToncoins) MarshalJSON() ([]byte, error) { +func (entity *SettingsSectionMyGrams) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SettingsSectionMyToncoins + type stub SettingsSectionMyGrams return json.Marshal((*stub)(entity)) } -func (*SettingsSectionMyToncoins) GetClass() string { +func (*SettingsSectionMyGrams) GetClass() string { return ClassSettingsSection } -func (*SettingsSectionMyToncoins) GetType() string { - return TypeSettingsSectionMyToncoins +func (*SettingsSectionMyGrams) GetType() string { + return TypeSettingsSectionMyGrams } -func (*SettingsSectionMyToncoins) SettingsSectionType() string { - return TypeSettingsSectionMyToncoins +func (*SettingsSectionMyGrams) SettingsSectionType() string { + return TypeSettingsSectionMyGrams } // The notification settings section @@ -60783,7 +64572,7 @@ type AutoDownloadSettings struct { PreloadLargeVideos bool `json:"preload_large_videos"` // True, if the next audio track needs to be preloaded while the user is listening to an audio file PreloadNextAudio bool `json:"preload_next_audio"` - // True, if stories needs to be preloaded + // True, if stories need to be preloaded PreloadStories bool `json:"preload_stories"` // True, if "use less data for calls" option needs to be enabled UseLessDataForCalls bool `json:"use_less_data_for_calls"` @@ -61015,6 +64804,114 @@ func (*AutosaveSettings) GetType() string { return TypeAutosaveSettings } +// Describes an exception for built-in browser usage +type WebDomainException struct { + meta + // URL for which the exception is done + Url string `json:"url"` + // Domain of the URL. All URLs on the domain and subdomains of the domain are subject to the exception + Domain string `json:"domain"` + // Title of the website + Title string `json:"title"` + // Identifier of the custom emoji with favicon of the website; may be 0 if unknown, in which case the first letter of the domain must be used + FaviconCustomEmojiId JsonInt64 `json:"favicon_custom_emoji_id"` +} + +func (entity *WebDomainException) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebDomainException + + return json.Marshal((*stub)(entity)) +} + +func (*WebDomainException) GetClass() string { + return ClassWebDomainException +} + +func (*WebDomainException) GetType() string { + return TypeWebDomainException +} + +// Describes web browser settings +type WebBrowserSettings struct { + meta + // True, if links are opened in an external browser by default + OpenExternalBrowser bool `json:"open_external_browser"` + // The list of websites which must always be opened in an external browser + ExternalExceptions []*WebDomainException `json:"external_exceptions"` + // The list of websites which must always be opened in the in-app browser + InAppExceptions []*WebDomainException `json:"in_app_exceptions"` + // True, if a close button must be shown in the in-app browser; for Android app only + DisplayCloseButton bool `json:"display_close_button"` +} + +func (entity *WebBrowserSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebBrowserSettings + + return json.Marshal((*stub)(entity)) +} + +func (*WebBrowserSettings) GetClass() string { + return ClassWebBrowserSettings +} + +func (*WebBrowserSettings) GetType() string { + return TypeWebBrowserSettings +} + +// An external web browser +type WebBrowserTypeExternal struct{ + meta +} + +func (entity *WebBrowserTypeExternal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebBrowserTypeExternal + + return json.Marshal((*stub)(entity)) +} + +func (*WebBrowserTypeExternal) GetClass() string { + return ClassWebBrowserType +} + +func (*WebBrowserTypeExternal) GetType() string { + return TypeWebBrowserTypeExternal +} + +func (*WebBrowserTypeExternal) WebBrowserTypeType() string { + return TypeWebBrowserTypeExternal +} + +// The in-app browser +type WebBrowserTypeInApp struct{ + meta +} + +func (entity *WebBrowserTypeInApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebBrowserTypeInApp + + return json.Marshal((*stub)(entity)) +} + +func (*WebBrowserTypeInApp) GetClass() string { + return ClassWebBrowserType +} + +func (*WebBrowserTypeInApp) GetType() string { + return TypeWebBrowserTypeInApp +} + +func (*WebBrowserTypeInApp) WebBrowserTypeType() string { + return TypeWebBrowserTypeInApp +} + // Waiting for the network to become available. Use setNetworkType to change the available network type type ConnectionStateWaitingForNetwork struct{ meta @@ -62413,7 +66310,7 @@ func (*AddedProxies) GetType() string { } // A sticker to be added to a sticker set -type InputSticker struct { +type NewSticker struct { meta // File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` @@ -62427,23 +66324,23 @@ type InputSticker struct { Keywords []string `json:"keywords"` } -func (entity *InputSticker) MarshalJSON() ([]byte, error) { +func (entity *NewSticker) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputSticker + type stub NewSticker return json.Marshal((*stub)(entity)) } -func (*InputSticker) GetClass() string { - return ClassInputSticker +func (*NewSticker) GetClass() string { + return ClassNewSticker } -func (*InputSticker) GetType() string { - return TypeInputSticker +func (*NewSticker) GetType() string { + return TypeNewSticker } -func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { +func (newSticker *NewSticker) UnmarshalJSON(data []byte) error { var tmp struct { Sticker json.RawMessage `json:"sticker"` Format json.RawMessage `json:"format"` @@ -62457,15 +66354,15 @@ func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { return err } - inputSticker.Emojis = tmp.Emojis - inputSticker.MaskPosition = tmp.MaskPosition - inputSticker.Keywords = tmp.Keywords + newSticker.Emojis = tmp.Emojis + newSticker.MaskPosition = tmp.MaskPosition + newSticker.Keywords = tmp.Keywords fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputSticker.Sticker = fieldSticker + newSticker.Sticker = fieldSticker fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) - inputSticker.Format = fieldFormat + newSticker.Format = fieldFormat return nil } @@ -63560,8 +67457,8 @@ func (chatRevenueTransaction *ChatRevenueTransaction) UnmarshalJSON(data []byte) // Contains a list of chat revenue transactions type ChatRevenueTransactions struct { meta - // The amount of owned Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` + // The amount of owned TON Grams; in the smallest units of the cryptocurrency + GramAmount int64 `json:"gram_amount"` // List of transactions Transactions []*ChatRevenueTransaction `json:"transactions"` // The offset for the next request. If empty, then there are no more results @@ -63663,66 +67560,66 @@ func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) e return nil } -// Contains information about Toncoins earned by the current user -type TonRevenueStatus struct { +// Contains information about TON Grams earned by the current user +type GramRevenueStatus struct { meta - // Total Toncoin amount earned; in the smallest units of the cryptocurrency + // Total Gram amount earned; in the smallest units of the cryptocurrency TotalAmount JsonInt64 `json:"total_amount"` - // The Toncoin amount that isn't withdrawn yet; in the smallest units of the cryptocurrency + // The Gram amount that isn't withdrawn yet; in the smallest units of the cryptocurrency BalanceAmount JsonInt64 `json:"balance_amount"` - // The Toncoin amount that is available for withdrawal; in the smallest units of the cryptocurrency + // The Gram amount that is available for withdrawal; in the smallest units of the cryptocurrency AvailableAmount JsonInt64 `json:"available_amount"` - // True, if Toncoins can be withdrawn + // True, if Grams can be withdrawn WithdrawalEnabled bool `json:"withdrawal_enabled"` } -func (entity *TonRevenueStatus) MarshalJSON() ([]byte, error) { +func (entity *GramRevenueStatus) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub TonRevenueStatus + type stub GramRevenueStatus return json.Marshal((*stub)(entity)) } -func (*TonRevenueStatus) GetClass() string { - return ClassTonRevenueStatus +func (*GramRevenueStatus) GetClass() string { + return ClassGramRevenueStatus } -func (*TonRevenueStatus) GetType() string { - return TypeTonRevenueStatus +func (*GramRevenueStatus) GetType() string { + return TypeGramRevenueStatus } -// A detailed statistics about Toncoins earned by the current user -type TonRevenueStatistics struct { +// A detailed statistics about TON Grams earned by the current user +type GramRevenueStatistics struct { meta // A graph containing amount of revenue in a given day RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` // Amount of earned revenue - Status *TonRevenueStatus `json:"status"` - // Current conversion rate of nanotoncoin to USD cents + Status *GramRevenueStatus `json:"status"` + // Current conversion rate of nanogram to USD cents UsdRate float64 `json:"usd_rate"` } -func (entity *TonRevenueStatistics) MarshalJSON() ([]byte, error) { +func (entity *GramRevenueStatistics) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub TonRevenueStatistics + type stub GramRevenueStatistics return json.Marshal((*stub)(entity)) } -func (*TonRevenueStatistics) GetClass() string { - return ClassTonRevenueStatistics +func (*GramRevenueStatistics) GetClass() string { + return ClassGramRevenueStatistics } -func (*TonRevenueStatistics) GetType() string { - return TypeTonRevenueStatistics +func (*GramRevenueStatistics) GetType() string { + return TypeGramRevenueStatistics } -func (tonRevenueStatistics *TonRevenueStatistics) UnmarshalJSON(data []byte) error { +func (gramRevenueStatistics *GramRevenueStatistics) UnmarshalJSON(data []byte) error { var tmp struct { RevenueByDayGraph json.RawMessage `json:"revenue_by_day_graph"` - Status *TonRevenueStatus `json:"status"` + Status *GramRevenueStatus `json:"status"` UsdRate float64 `json:"usd_rate"` } @@ -63731,11 +67628,11 @@ func (tonRevenueStatistics *TonRevenueStatistics) UnmarshalJSON(data []byte) err return err } - tonRevenueStatistics.Status = tmp.Status - tonRevenueStatistics.UsdRate = tmp.UsdRate + gramRevenueStatistics.Status = tmp.Status + gramRevenueStatistics.UsdRate = tmp.UsdRate fieldRevenueByDayGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueByDayGraph) - tonRevenueStatistics.RevenueByDayGraph = fieldRevenueByDayGraph + gramRevenueStatistics.RevenueByDayGraph = fieldRevenueByDayGraph return nil } @@ -66489,8 +70386,8 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { return nil } -// A new pending text message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received -type UpdatePendingTextMessage struct { +// A new pending text or rich message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received +type UpdatePendingMessage struct { meta // Chat identifier ChatId int64 `json:"chat_id"` @@ -66498,28 +70395,78 @@ type UpdatePendingTextMessage struct { ForumTopicId int32 `json:"forum_topic_id"` // Unique identifier of the message draft within the message thread DraftId JsonInt64 `json:"draft_id"` - // Text of the pending message - Text *FormattedText `json:"text"` + // Content of the message; always of the type messageText or messageRichMessage + Content MessageContent `json:"content"` } -func (entity *UpdatePendingTextMessage) MarshalJSON() ([]byte, error) { +func (entity *UpdatePendingMessage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdatePendingTextMessage + type stub UpdatePendingMessage return json.Marshal((*stub)(entity)) } -func (*UpdatePendingTextMessage) GetClass() string { +func (*UpdatePendingMessage) GetClass() string { return ClassUpdate } -func (*UpdatePendingTextMessage) GetType() string { - return TypeUpdatePendingTextMessage +func (*UpdatePendingMessage) GetType() string { + return TypeUpdatePendingMessage } -func (*UpdatePendingTextMessage) UpdateType() string { - return TypeUpdatePendingTextMessage +func (*UpdatePendingMessage) UpdateType() string { + return TypeUpdatePendingMessage +} + +func (updatePendingMessage *UpdatePendingMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + ForumTopicId int32 `json:"forum_topic_id"` + DraftId JsonInt64 `json:"draft_id"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updatePendingMessage.ChatId = tmp.ChatId + updatePendingMessage.ForumTopicId = tmp.ForumTopicId + updatePendingMessage.DraftId = tmp.DraftId + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + updatePendingMessage.Content = fieldContent + + return nil +} + +// Some data of a community has changed. This update is guaranteed to come before the community identifier is returned to the application +type UpdateCommunity struct { + meta + // New data about the community + Community *Community `json:"community"` +} + +func (entity *UpdateCommunity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateCommunity + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateCommunity) GetClass() string { + return ClassUpdate +} + +func (*UpdateCommunity) GetType() string { + return TypeUpdateCommunity +} + +func (*UpdateCommunity) UpdateType() string { + return TypeUpdateCommunity } // The user went online or offline @@ -67484,7 +71431,7 @@ func (*UpdateGiftAuctionState) UpdateType() string { return TypeUpdateGiftAuctionState } -// The list of auctions in which participate the current user has changed +// The list of auctions in which the current user participates has changed type UpdateActiveGiftAuctions struct { meta // New states of the auctions @@ -67675,6 +71622,58 @@ func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) e return nil } +// A join request from the user was completed +type UpdateChatJoinResult struct { + meta + // Identifier of the join request query as received in chatJoinResultGuardBotApprovalRequired. If the corresponding Web App is still open, then it must be closed + QueryId JsonInt64 `json:"query_id"` + // Identifier of the joined chat, or 0 if the request wasn't approved + ChatId int64 `json:"chat_id"` + // Result of the join + Result ChatJoinRequestResult `json:"result"` +} + +func (entity *UpdateChatJoinResult) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatJoinResult + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatJoinResult) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatJoinResult) GetType() string { + return TypeUpdateChatJoinResult +} + +func (*UpdateChatJoinResult) UpdateType() string { + return TypeUpdateChatJoinResult +} + +func (updateChatJoinResult *UpdateChatJoinResult) UnmarshalJSON(data []byte) error { + var tmp struct { + QueryId JsonInt64 `json:"query_id"` + ChatId int64 `json:"chat_id"` + Result json.RawMessage `json:"result"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatJoinResult.QueryId = tmp.QueryId + updateChatJoinResult.ChatId = tmp.ChatId + + fieldResult, _ := UnmarshalChatJoinRequestResult(tmp.Result) + updateChatJoinResult.Result = fieldResult + + return nil +} + // A story was changed type UpdateStory struct { meta @@ -68338,6 +72337,33 @@ func (*UpdateProfileAccentColors) UpdateType() string { return TypeUpdateProfileAccentColors } +// Web browser settings have been updated +type UpdateWebBrowserSettings struct { + meta + // New settings + Settings *WebBrowserSettings `json:"settings"` +} + +func (entity *UpdateWebBrowserSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebBrowserSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebBrowserSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebBrowserSettings) GetType() string { + return TypeUpdateWebBrowserSettings +} + +func (*UpdateWebBrowserSettings) UpdateType() string { + return TypeUpdateWebBrowserSettings +} + // Some language pack strings have been updated type UpdateLanguagePackStrings struct { meta @@ -68445,7 +72471,7 @@ func (*UpdateFreezeState) UpdateType() string { return TypeUpdateFreezeState } -// The parameters for age verification of the current user's account has changed +// The parameters for age verification of the current user's account have changed type UpdateAgeVerificationParameters struct { meta // Parameters for the age verification; may be null if age verification isn't needed @@ -68506,6 +72532,8 @@ type UpdateUnconfirmedSession struct { meta // The unconfirmed session; may be null if none Session *UnconfirmedSession `json:"session"` + // The total number of unconfirmed sessions + UnconfirmedSessionCount int32 `json:"unconfirmed_session_count"` } func (entity *UpdateUnconfirmedSession) MarshalJSON() ([]byte, error) { @@ -68807,31 +72835,31 @@ func (*UpdateOwnedStarCount) UpdateType() string { return TypeUpdateOwnedStarCount } -// The number of Toncoins owned by the current user has changed -type UpdateOwnedTonCount struct { +// The number of TON Grams owned by the current user has changed +type UpdateOwnedGramCount struct { meta - // The new amount of owned Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` + // The new amount of owned Grams; in the smallest units of the cryptocurrency + GramAmount int64 `json:"gram_amount"` } -func (entity *UpdateOwnedTonCount) MarshalJSON() ([]byte, error) { +func (entity *UpdateOwnedGramCount) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateOwnedTonCount + type stub UpdateOwnedGramCount return json.Marshal((*stub)(entity)) } -func (*UpdateOwnedTonCount) GetClass() string { +func (*UpdateOwnedGramCount) GetClass() string { return ClassUpdate } -func (*UpdateOwnedTonCount) GetType() string { - return TypeUpdateOwnedTonCount +func (*UpdateOwnedGramCount) GetType() string { + return TypeUpdateOwnedGramCount } -func (*UpdateOwnedTonCount) UpdateType() string { - return TypeUpdateOwnedTonCount +func (*UpdateOwnedGramCount) UpdateType() string { + return TypeUpdateOwnedGramCount } // 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 @@ -68911,34 +72939,34 @@ func (updateStarRevenueStatus *UpdateStarRevenueStatus) UnmarshalJSON(data []byt return nil } -// The Toncoin revenue earned by the current user has changed. If Toncoin transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions -type UpdateTonRevenueStatus struct { +// The TON Gram revenue earned by the current user has changed. If Gram transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions +type UpdateGramRevenueStatus struct { meta - // New Toncoin revenue status - Status *TonRevenueStatus `json:"status"` + // New Gram revenue status + Status *GramRevenueStatus `json:"status"` } -func (entity *UpdateTonRevenueStatus) MarshalJSON() ([]byte, error) { +func (entity *UpdateGramRevenueStatus) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateTonRevenueStatus + type stub UpdateGramRevenueStatus return json.Marshal((*stub)(entity)) } -func (*UpdateTonRevenueStatus) GetClass() string { +func (*UpdateGramRevenueStatus) GetClass() string { return ClassUpdate } -func (*UpdateTonRevenueStatus) GetType() string { - return TypeUpdateTonRevenueStatus +func (*UpdateGramRevenueStatus) GetType() string { + return TypeUpdateGramRevenueStatus } -func (*UpdateTonRevenueStatus) UpdateType() string { - return TypeUpdateTonRevenueStatus +func (*UpdateGramRevenueStatus) UpdateType() string { + return TypeUpdateGramRevenueStatus } -// The parameters of speech recognition without Telegram Premium subscription has changed +// The parameters of speech recognition without Telegram Premium subscription have changed type UpdateSpeechRecognitionTrial struct { meta // The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds @@ -69083,7 +73111,7 @@ func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string { return TypeUpdateAnimatedEmojiMessageClicked } -// The parameters of animation search through getOption("animation_search_bot_username") bot has changed +// The parameters of animation search through getOption("animation_search_bot_username") bot have changed type UpdateAnimationSearchParameters struct { meta // Name of the animation search provider @@ -69188,7 +73216,7 @@ func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) return nil } -// Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user. Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium +// Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a file being downloaded or uploaded is visible to the user. Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium type UpdateSpeedLimitNotification struct { meta // True, if upload speed was limited; false, if download speed was limited @@ -69854,6 +73882,41 @@ func (*UpdateNewCustomQuery) UpdateType() string { return TypeUpdateNewCustomQuery } +// Subscription of a user to the bot was changed; for bots only +type UpdateUserSubscription struct { + meta + // Identifier of the user + UserId int64 `json:"user_id"` + // Bot-specified subscription invoice payload + Payload string `json:"payload"` + // True, if the subscription was canceled + IsCanceled bool `json:"is_canceled"` + // True, if the subscription was restored + IsRestored bool `json:"is_restored"` + // True, if the payment for the subscription has failed + IsPaymentFailed bool `json:"is_payment_failed"` +} + +func (entity *UpdateUserSubscription) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateUserSubscription + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateUserSubscription) GetClass() string { + return ClassUpdate +} + +func (*UpdateUserSubscription) GetType() string { + return TypeUpdateUserSubscription +} + +func (*UpdateUserSubscription) UpdateType() string { + return TypeUpdateUserSubscription +} + // A poll was updated; for bots only type UpdatePoll struct { meta @@ -70018,6 +74081,8 @@ type UpdateNewChatJoinRequest struct { UserChatId int64 `json:"user_chat_id"` // The invite link, which was used to send join request; may be null InviteLink *ChatInviteLink `json:"invite_link"` + // Identifier of the join request query, which can be used in answerChatJoinRequestQuery; 0 if none + QueryId JsonInt64 `json:"query_id"` } func (entity *UpdateNewChatJoinRequest) MarshalJSON() ([]byte, error) { diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 13a0b00..aa02f39 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -136,6 +136,43 @@ func UnmarshalListOfEmailAddressResetState(dataList []json.RawMessage) ([]EmailA return list, nil } +func UnmarshalRichMessageSource(data json.RawMessage) (RichMessageSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeRichMessageSourceBlocks: + return UnmarshalRichMessageSourceBlocks(data) + + case TypeRichMessageSourceMarkdown: + return UnmarshalRichMessageSourceMarkdown(data) + + case TypeRichMessageSourceHtml: + return UnmarshalRichMessageSourceHtml(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfRichMessageSource(dataList []json.RawMessage) ([]RichMessageSource, error) { + list := []RichMessageSource{} + + for _, data := range dataList { + entity, err := UnmarshalRichMessageSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, error) { var meta meta @@ -794,6 +831,43 @@ func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto return list, nil } +func UnmarshalWebAppOpenMode(data json.RawMessage) (WebAppOpenMode, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeWebAppOpenModeCompact: + return UnmarshalWebAppOpenModeCompact(data) + + case TypeWebAppOpenModeFullSize: + return UnmarshalWebAppOpenModeFullSize(data) + + case TypeWebAppOpenModeFullScreen: + return UnmarshalWebAppOpenModeFullScreen(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfWebAppOpenMode(dataList []json.RawMessage) ([]WebAppOpenMode, error) { + list := []WebAppOpenMode{} + + for _, data := range dataList { + entity, err := UnmarshalWebAppOpenMode(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalGiftResalePrice(data json.RawMessage) (GiftResalePrice, error) { var meta meta @@ -806,8 +880,8 @@ func UnmarshalGiftResalePrice(data json.RawMessage) (GiftResalePrice, error) { case TypeGiftResalePriceStar: return UnmarshalGiftResalePriceStar(data) - case TypeGiftResalePriceTon: - return UnmarshalGiftResalePriceTon(data) + case TypeGiftResalePriceGram: + return UnmarshalGiftResalePriceGram(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -877,8 +951,8 @@ func UnmarshalSuggestedPostPrice(data json.RawMessage) (SuggestedPostPrice, erro case TypeSuggestedPostPriceStar: return UnmarshalSuggestedPostPriceStar(data) - case TypeSuggestedPostPriceTon: - return UnmarshalSuggestedPostPriceTon(data) + case TypeSuggestedPostPriceGram: + return UnmarshalSuggestedPostPriceGram(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -1820,6 +1894,49 @@ func UnmarshalListOfGiveawayPrize(dataList []json.RawMessage) ([]GiveawayPrize, return list, nil } +func UnmarshalCommunityMemberStatus(data json.RawMessage) (CommunityMemberStatus, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCommunityMemberStatusCreator: + return UnmarshalCommunityMemberStatusCreator(data) + + case TypeCommunityMemberStatusAdministrator: + return UnmarshalCommunityMemberStatusAdministrator(data) + + case TypeCommunityMemberStatusMember: + return UnmarshalCommunityMemberStatusMember(data) + + case TypeCommunityMemberStatusLeft: + return UnmarshalCommunityMemberStatusLeft(data) + + case TypeCommunityMemberStatusBanned: + return UnmarshalCommunityMemberStatusBanned(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCommunityMemberStatus(dataList []json.RawMessage) ([]CommunityMemberStatus, error) { + list := []CommunityMemberStatus{} + + for _, data := range dataList { + entity, err := UnmarshalCommunityMemberStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalEmojiStatusType(data json.RawMessage) (EmojiStatusType, error) { var meta meta @@ -2001,6 +2118,83 @@ func UnmarshalListOfSupergroupMembersFilter(dataList []json.RawMessage) ([]Super return list, nil } +func UnmarshalChatJoinResult(data json.RawMessage) (ChatJoinResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatJoinResultSuccess: + return UnmarshalChatJoinResultSuccess(data) + + case TypeChatJoinResultRequestSent: + return UnmarshalChatJoinResultRequestSent(data) + + case TypeChatJoinResultGuardBotApprovalRequired: + return UnmarshalChatJoinResultGuardBotApprovalRequired(data) + + case TypeChatJoinResultDeclined: + return UnmarshalChatJoinResultDeclined(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatJoinResult(dataList []json.RawMessage) ([]ChatJoinResult, error) { + list := []ChatJoinResult{} + + for _, data := range dataList { + entity, err := UnmarshalChatJoinResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalChatJoinRequestResult(data json.RawMessage) (ChatJoinRequestResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatJoinRequestResultApproved: + return UnmarshalChatJoinRequestResultApproved(data) + + case TypeChatJoinRequestResultDeclined: + return UnmarshalChatJoinRequestResultDeclined(data) + + case TypeChatJoinRequestResultQueued: + return UnmarshalChatJoinRequestResultQueued(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatJoinRequestResult(dataList []json.RawMessage) ([]ChatJoinRequestResult, error) { + list := []ChatJoinRequestResult{} + + for _, data := range dataList { + entity, err := UnmarshalChatJoinRequestResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInviteLinkChatType(data json.RawMessage) (InviteLinkChatType, error) { var meta meta @@ -2426,6 +2620,9 @@ func UnmarshalInputMessageReplyTo(data json.RawMessage) (InputMessageReplyTo, er case TypeInputMessageReplyToStory: return UnmarshalInputMessageReplyToStory(data) + case TypeInputMessageReplyToEphemeralMessage: + return UnmarshalInputMessageReplyToEphemeralMessage(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2623,6 +2820,46 @@ func UnmarshalListOfReactionNotificationSource(dataList []json.RawMessage) ([]Re return list, nil } +func UnmarshalDraftMessageContent(data json.RawMessage) (DraftMessageContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeDraftMessageContentText: + return UnmarshalDraftMessageContentText(data) + + case TypeDraftMessageContentRichMessage: + return UnmarshalDraftMessageContentRichMessage(data) + + case TypeDraftMessageContentVideoNote: + return UnmarshalDraftMessageContentVideoNote(data) + + case TypeDraftMessageContentVoiceNote: + return UnmarshalDraftMessageContentVoiceNote(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfDraftMessageContent(dataList []json.RawMessage) ([]DraftMessageContent, error) { + list := []DraftMessageContent{} + + for _, data := range dataList { + entity, err := UnmarshalDraftMessageContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatType(data json.RawMessage) (ChatType, error) { var meta meta @@ -3106,43 +3343,6 @@ func UnmarshalListOfLoginUrlInfo(dataList []json.RawMessage) ([]LoginUrlInfo, er return list, nil } -func UnmarshalWebAppOpenMode(data json.RawMessage) (WebAppOpenMode, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeWebAppOpenModeCompact: - return UnmarshalWebAppOpenModeCompact(data) - - case TypeWebAppOpenModeFullSize: - return UnmarshalWebAppOpenModeFullSize(data) - - case TypeWebAppOpenModeFullScreen: - return UnmarshalWebAppOpenModeFullScreen(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfWebAppOpenMode(dataList []json.RawMessage) ([]WebAppOpenMode, error) { - list := []WebAppOpenMode{} - - for _, data := range dataList { - entity, err := UnmarshalWebAppOpenMode(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalSavedMessagesTopicType(data json.RawMessage) (SavedMessagesTopicType, error) { var meta meta @@ -3247,14 +3447,8 @@ func UnmarshalRichText(data json.RawMessage) (RichText, error) { case TypeRichTextStrikethrough: return UnmarshalRichTextStrikethrough(data) - case TypeRichTextFixed: - return UnmarshalRichTextFixed(data) - - case TypeRichTextUrl: - return UnmarshalRichTextUrl(data) - - case TypeRichTextEmailAddress: - return UnmarshalRichTextEmailAddress(data) + case TypeRichTextSpoiler: + return UnmarshalRichTextSpoiler(data) case TypeRichTextSubscript: return UnmarshalRichTextSubscript(data) @@ -3265,15 +3459,57 @@ func UnmarshalRichText(data json.RawMessage) (RichText, error) { case TypeRichTextMarked: return UnmarshalRichTextMarked(data) + case TypeRichTextDateTime: + return UnmarshalRichTextDateTime(data) + + case TypeRichTextMention: + return UnmarshalRichTextMention(data) + + case TypeRichTextHashtag: + return UnmarshalRichTextHashtag(data) + + case TypeRichTextCashtag: + return UnmarshalRichTextCashtag(data) + + case TypeRichTextBankCardNumber: + return UnmarshalRichTextBankCardNumber(data) + + case TypeRichTextBotCommand: + return UnmarshalRichTextBotCommand(data) + + case TypeRichTextFixed: + return UnmarshalRichTextFixed(data) + + case TypeRichTextMentionName: + return UnmarshalRichTextMentionName(data) + + case TypeRichTextUrl: + return UnmarshalRichTextUrl(data) + + case TypeRichTextEmailAddress: + return UnmarshalRichTextEmailAddress(data) + case TypeRichTextPhoneNumber: return UnmarshalRichTextPhoneNumber(data) + case TypeRichTextCustomEmoji: + return UnmarshalRichTextCustomEmoji(data) + case TypeRichTextIcon: return UnmarshalRichTextIcon(data) + case TypeRichTextMathematicalExpression: + return UnmarshalRichTextMathematicalExpression(data) + + case TypeRichTextDiff: + return UnmarshalRichTextDiff(data) + case TypeRichTextReference: return UnmarshalRichTextReference(data) + case TypeRichTextReferenceLink: + return UnmarshalRichTextReferenceLink(data) + case TypeRichTextAnchor: return UnmarshalRichTextAnchor(data) @@ -3400,6 +3636,9 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockSubheader: return UnmarshalPageBlockSubheader(data) + case TypePageBlockSectionHeading: + return UnmarshalPageBlockSectionHeading(data) + case TypePageBlockKicker: return UnmarshalPageBlockKicker(data) @@ -3412,9 +3651,15 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockFooter: return UnmarshalPageBlockFooter(data) + case TypePageBlockThinking: + return UnmarshalPageBlockThinking(data) + case TypePageBlockDivider: return UnmarshalPageBlockDivider(data) + case TypePageBlockMathematicalExpression: + return UnmarshalPageBlockMathematicalExpression(data) + case TypePageBlockAnchor: return UnmarshalPageBlockAnchor(data) @@ -4243,6 +4488,61 @@ func UnmarshalListOfInputPassportElementErrorSource(dataList []json.RawMessage) return list, nil } +func UnmarshalPollMedia(data json.RawMessage) (PollMedia, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePollMediaAnimation: + return UnmarshalPollMediaAnimation(data) + + case TypePollMediaAudio: + return UnmarshalPollMediaAudio(data) + + case TypePollMediaDocument: + return UnmarshalPollMediaDocument(data) + + case TypePollMediaLink: + return UnmarshalPollMediaLink(data) + + case TypePollMediaLocation: + return UnmarshalPollMediaLocation(data) + + case TypePollMediaPhoto: + return UnmarshalPollMediaPhoto(data) + + case TypePollMediaSticker: + return UnmarshalPollMediaSticker(data) + + case TypePollMediaVenue: + return UnmarshalPollMediaVenue(data) + + case TypePollMediaVideo: + return UnmarshalPollMediaVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPollMedia(dataList []json.RawMessage) ([]PollMedia, error) { + list := []PollMedia{} + + for _, data := range dataList { + entity, err := UnmarshalPollMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { var meta meta @@ -4255,6 +4555,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageText: return UnmarshalMessageText(data) + case TypeMessageRichMessage: + return UnmarshalMessageRichMessage(data) + case TypeMessageAnimation: return UnmarshalMessageAnimation(data) @@ -4294,6 +4597,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageExpiredVoiceNote: return UnmarshalMessageExpiredVoiceNote(data) + case TypeMessageLiveLocation: + return UnmarshalMessageLiveLocation(data) + case TypeMessageLocation: return UnmarshalMessageLocation(data) @@ -4390,6 +4696,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) + case TypeMessageChatAddedToCommunity: + return UnmarshalMessageChatAddedToCommunity(data) + + case TypeMessageChatRemovedFromCommunity: + return UnmarshalMessageChatRemovedFromCommunity(data) + case TypeMessageChatUpgradeTo: return UnmarshalMessageChatUpgradeTo(data) @@ -4881,6 +5193,152 @@ func UnmarshalListOfMessageSelfDestructType(dataList []json.RawMessage) ([]Messa return list, nil } +func UnmarshalInputPollMedia(data json.RawMessage) (InputPollMedia, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputPollMediaAnimation: + return UnmarshalInputPollMediaAnimation(data) + + case TypeInputPollMediaAudio: + return UnmarshalInputPollMediaAudio(data) + + case TypeInputPollMediaDocument: + return UnmarshalInputPollMediaDocument(data) + + case TypeInputPollMediaLink: + return UnmarshalInputPollMediaLink(data) + + case TypeInputPollMediaLocation: + return UnmarshalInputPollMediaLocation(data) + + case TypeInputPollMediaPhoto: + return UnmarshalInputPollMediaPhoto(data) + + case TypeInputPollMediaSticker: + return UnmarshalInputPollMediaSticker(data) + + case TypeInputPollMediaVenue: + return UnmarshalInputPollMediaVenue(data) + + case TypeInputPollMediaVideo: + return UnmarshalInputPollMediaVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputPollMedia(dataList []json.RawMessage) ([]InputPollMedia, error) { + list := []InputPollMedia{} + + for _, data := range dataList { + entity, err := UnmarshalInputPollMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputPageBlock(data json.RawMessage) (InputPageBlock, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputPageBlockSectionHeading: + return UnmarshalInputPageBlockSectionHeading(data) + + case TypeInputPageBlockParagraph: + return UnmarshalInputPageBlockParagraph(data) + + case TypeInputPageBlockPreformatted: + return UnmarshalInputPageBlockPreformatted(data) + + case TypeInputPageBlockFooter: + return UnmarshalInputPageBlockFooter(data) + + case TypeInputPageBlockThinking: + return UnmarshalInputPageBlockThinking(data) + + case TypeInputPageBlockDivider: + return UnmarshalInputPageBlockDivider(data) + + case TypeInputPageBlockMathematicalExpression: + return UnmarshalInputPageBlockMathematicalExpression(data) + + case TypeInputPageBlockAnchor: + return UnmarshalInputPageBlockAnchor(data) + + case TypeInputPageBlockList: + return UnmarshalInputPageBlockList(data) + + case TypeInputPageBlockBlockQuote: + return UnmarshalInputPageBlockBlockQuote(data) + + case TypeInputPageBlockPullQuote: + return UnmarshalInputPageBlockPullQuote(data) + + case TypeInputPageBlockAnimation: + return UnmarshalInputPageBlockAnimation(data) + + case TypeInputPageBlockAudio: + return UnmarshalInputPageBlockAudio(data) + + case TypeInputPageBlockPhoto: + return UnmarshalInputPageBlockPhoto(data) + + case TypeInputPageBlockVideo: + return UnmarshalInputPageBlockVideo(data) + + case TypeInputPageBlockVoiceNote: + return UnmarshalInputPageBlockVoiceNote(data) + + case TypeInputPageBlockCollage: + return UnmarshalInputPageBlockCollage(data) + + case TypeInputPageBlockSlideshow: + return UnmarshalInputPageBlockSlideshow(data) + + case TypeInputPageBlockTable: + return UnmarshalInputPageBlockTable(data) + + case TypeInputPageBlockDetails: + return UnmarshalInputPageBlockDetails(data) + + case TypeInputPageBlockMap: + return UnmarshalInputPageBlockMap(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputPageBlock(dataList []json.RawMessage) ([]InputPageBlock, error) { + list := []InputPageBlock{} + + for _, data := range dataList { + entity, err := UnmarshalInputPageBlock(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, error) { var meta meta @@ -4893,6 +5351,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessageText: return UnmarshalInputMessageText(data) + case TypeInputMessageRichMessage: + return UnmarshalInputMessageRichMessage(data) + case TypeInputMessageAnimation: return UnmarshalInputMessageAnimation(data) @@ -4920,6 +5381,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessageVoiceNote: return UnmarshalInputMessageVoiceNote(data) + case TypeInputMessageLiveLocation: + return UnmarshalInputMessageLiveLocation(data) + case TypeInputMessageLocation: return UnmarshalInputMessageLocation(data) @@ -5094,6 +5558,40 @@ func UnmarshalListOfSearchMessagesChatTypeFilter(dataList []json.RawMessage) ([] return list, nil } +func UnmarshalSearchChatTypeFilter(data json.RawMessage) (SearchChatTypeFilter, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSearchChatTypeFilterBot: + return UnmarshalSearchChatTypeFilterBot(data) + + case TypeSearchChatTypeFilterChannel: + return UnmarshalSearchChatTypeFilterChannel(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSearchChatTypeFilter(dataList []json.RawMessage) ([]SearchChatTypeFilter, error) { + list := []SearchChatTypeFilter{} + + for _, data := range dataList { + entity, err := UnmarshalSearchChatTypeFilter(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) { var meta meta @@ -6750,6 +7248,9 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypePinnedSavedMessagesTopicCount: return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data) + case TypePremiumLimitTypeMessageTextLength: + return UnmarshalPremiumLimitTypeMessageTextLength(data) + case TypePremiumLimitTypeCaptionLength: return UnmarshalPremiumLimitTypeCaptionLength(data) @@ -6898,6 +7399,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureTextComposition: return UnmarshalPremiumFeatureTextComposition(data) + case TypePremiumFeatureRichMessages: + return UnmarshalPremiumFeatureRichMessages(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -8283,56 +8787,11 @@ func UnmarshalSessionType(data json.RawMessage) (SessionType, error) { } switch meta.Type { - case TypeSessionTypeAndroid: - return UnmarshalSessionTypeAndroid(data) + case TypeSessionTypeDevice: + return UnmarshalSessionTypeDevice(data) - case TypeSessionTypeApple: - return UnmarshalSessionTypeApple(data) - - case TypeSessionTypeBrave: - return UnmarshalSessionTypeBrave(data) - - case TypeSessionTypeChrome: - return UnmarshalSessionTypeChrome(data) - - case TypeSessionTypeEdge: - return UnmarshalSessionTypeEdge(data) - - case TypeSessionTypeFirefox: - return UnmarshalSessionTypeFirefox(data) - - case TypeSessionTypeIpad: - return UnmarshalSessionTypeIpad(data) - - case TypeSessionTypeIphone: - return UnmarshalSessionTypeIphone(data) - - case TypeSessionTypeLinux: - return UnmarshalSessionTypeLinux(data) - - case TypeSessionTypeMac: - return UnmarshalSessionTypeMac(data) - - case TypeSessionTypeOpera: - return UnmarshalSessionTypeOpera(data) - - case TypeSessionTypeSafari: - return UnmarshalSessionTypeSafari(data) - - case TypeSessionTypeUbuntu: - return UnmarshalSessionTypeUbuntu(data) - - case TypeSessionTypeUnknown: - return UnmarshalSessionTypeUnknown(data) - - case TypeSessionTypeVivaldi: - return UnmarshalSessionTypeVivaldi(data) - - case TypeSessionTypeWindows: - return UnmarshalSessionTypeWindows(data) - - case TypeSessionTypeXbox: - return UnmarshalSessionTypeXbox(data) + case TypeSessionTypeConnectedBot: + return UnmarshalSessionTypeConnectedBot(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -8353,6 +8812,85 @@ func UnmarshalListOfSessionType(dataList []json.RawMessage) ([]SessionType, erro return list, nil } +func UnmarshalSessionDeviceType(data json.RawMessage) (SessionDeviceType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSessionDeviceTypeAndroid: + return UnmarshalSessionDeviceTypeAndroid(data) + + case TypeSessionDeviceTypeApple: + return UnmarshalSessionDeviceTypeApple(data) + + case TypeSessionDeviceTypeBrave: + return UnmarshalSessionDeviceTypeBrave(data) + + case TypeSessionDeviceTypeChrome: + return UnmarshalSessionDeviceTypeChrome(data) + + case TypeSessionDeviceTypeEdge: + return UnmarshalSessionDeviceTypeEdge(data) + + case TypeSessionDeviceTypeFirefox: + return UnmarshalSessionDeviceTypeFirefox(data) + + case TypeSessionDeviceTypeIpad: + return UnmarshalSessionDeviceTypeIpad(data) + + case TypeSessionDeviceTypeIphone: + return UnmarshalSessionDeviceTypeIphone(data) + + case TypeSessionDeviceTypeLinux: + return UnmarshalSessionDeviceTypeLinux(data) + + case TypeSessionDeviceTypeMac: + return UnmarshalSessionDeviceTypeMac(data) + + case TypeSessionDeviceTypeOpera: + return UnmarshalSessionDeviceTypeOpera(data) + + case TypeSessionDeviceTypeSafari: + return UnmarshalSessionDeviceTypeSafari(data) + + case TypeSessionDeviceTypeUbuntu: + return UnmarshalSessionDeviceTypeUbuntu(data) + + case TypeSessionDeviceTypeUnknown: + return UnmarshalSessionDeviceTypeUnknown(data) + + case TypeSessionDeviceTypeVivaldi: + return UnmarshalSessionDeviceTypeVivaldi(data) + + case TypeSessionDeviceTypeWindows: + return UnmarshalSessionDeviceTypeWindows(data) + + case TypeSessionDeviceTypeXbox: + return UnmarshalSessionDeviceTypeXbox(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSessionDeviceType(dataList []json.RawMessage) ([]SessionDeviceType, error) { + list := []SessionDeviceType{} + + for _, data := range dataList { + entity, err := UnmarshalSessionDeviceType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalReportReason(data json.RawMessage) (ReportReason, error) { var meta meta @@ -8533,8 +9071,8 @@ func UnmarshalSettingsSection(data json.RawMessage) (SettingsSection, error) { case TypeSettingsSectionMyStars: return UnmarshalSettingsSectionMyStars(data) - case TypeSettingsSectionMyToncoins: - return UnmarshalSettingsSectionMyToncoins(data) + case TypeSettingsSectionMyGrams: + return UnmarshalSettingsSectionMyGrams(data) case TypeSettingsSectionNotifications: return UnmarshalSettingsSectionNotifications(data) @@ -9032,6 +9570,40 @@ func UnmarshalListOfAutosaveSettingsScope(dataList []json.RawMessage) ([]Autosav return list, nil } +func UnmarshalWebBrowserType(data json.RawMessage) (WebBrowserType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeWebBrowserTypeExternal: + return UnmarshalWebBrowserTypeExternal(data) + + case TypeWebBrowserTypeInApp: + return UnmarshalWebBrowserTypeInApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfWebBrowserType(dataList []json.RawMessage) ([]WebBrowserType, error) { + list := []WebBrowserType{} + + for _, data := range dataList { + entity, err := UnmarshalWebBrowserType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalConnectionState(data json.RawMessage) (ConnectionState, error) { var meta meta @@ -9847,8 +10419,11 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(data) + case TypeUpdatePendingMessage: + return UnmarshalUpdatePendingMessage(data) + + case TypeUpdateCommunity: + return UnmarshalUpdateCommunity(data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -9955,6 +10530,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateChatJoinResult: + return UnmarshalUpdateChatJoinResult(data) + case TypeUpdateStory: return UnmarshalUpdateStory(data) @@ -10015,6 +10593,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateProfileAccentColors: return UnmarshalUpdateProfileAccentColors(data) + case TypeUpdateWebBrowserSettings: + return UnmarshalUpdateWebBrowserSettings(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -10060,8 +10641,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(data) + case TypeUpdateOwnedGramCount: + return UnmarshalUpdateOwnedGramCount(data) case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) @@ -10069,8 +10650,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(data) + case TypeUpdateGramRevenueStatus: + return UnmarshalUpdateGramRevenueStatus(data) case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) @@ -10147,6 +10728,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewCustomQuery: return UnmarshalUpdateNewCustomQuery(data) + case TypeUpdateUserSubscription: + return UnmarshalUpdateUserSubscription(data) + case TypeUpdatePoll: return UnmarshalUpdatePoll(data) @@ -10406,6 +10990,54 @@ func UnmarshalFormattedText(data json.RawMessage) (*FormattedText, error) { return &resp, err } +func UnmarshalRichMessage(data json.RawMessage) (*RichMessage, error) { + var resp RichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputRichMessageMedia(data json.RawMessage) (*InputRichMessageMedia, error) { + var resp InputRichMessageMedia + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichMessageSourceBlocks(data json.RawMessage) (*RichMessageSourceBlocks, error) { + var resp RichMessageSourceBlocks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichMessageSourceMarkdown(data json.RawMessage) (*RichMessageSourceMarkdown, error) { + var resp RichMessageSourceMarkdown + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichMessageSourceHtml(data json.RawMessage) (*RichMessageSourceHtml, error) { + var resp RichMessageSourceHtml + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputRichMessage(data json.RawMessage) (*InputRichMessage, error) { + var resp InputRichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDiffEntity(data json.RawMessage) (*DiffEntity, error) { var resp DiffEntity @@ -11102,6 +11734,14 @@ func UnmarshalLocation(data json.RawMessage) (*Location, error) { return &resp, err } +func UnmarshalLiveLocation(data json.RawMessage) (*LiveLocation, error) { + var resp LiveLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalVenue(data json.RawMessage) (*Venue, error) { var resp Venue @@ -11446,6 +12086,14 @@ func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, return &resp, err } +func UnmarshalBusinessConnectedBotInfo(data json.RawMessage) (*BusinessConnectedBotInfo, error) { + var resp BusinessConnectedBotInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessStartPage(data json.RawMessage) (*BusinessStartPage, error) { var resp BusinessStartPage @@ -11614,6 +12262,78 @@ func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorR return &resp, err } +func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { + var resp ThemeParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppOpenModeCompact(data json.RawMessage) (*WebAppOpenModeCompact, error) { + var resp WebAppOpenModeCompact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppOpenModeFullSize(data json.RawMessage) (*WebAppOpenModeFullSize, error) { + var resp WebAppOpenModeFullSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppOpenModeFullScreen(data json.RawMessage) (*WebAppOpenModeFullScreen, error) { + var resp WebAppOpenModeFullScreen + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundWebApp(data json.RawMessage) (*FoundWebApp, error) { + var resp FoundWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppUrl(data json.RawMessage) (*WebAppUrl, error) { + var resp WebAppUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { + var resp WebAppInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMainWebApp(data json.RawMessage) (*MainWebApp, error) { + var resp MainWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppOpenParameters(data json.RawMessage) (*WebAppOpenParameters, error) { + var resp WebAppOpenParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiftResalePriceStar(data json.RawMessage) (*GiftResalePriceStar, error) { var resp GiftResalePriceStar @@ -11622,8 +12342,8 @@ func UnmarshalGiftResalePriceStar(data json.RawMessage) (*GiftResalePriceStar, e return &resp, err } -func UnmarshalGiftResalePriceTon(data json.RawMessage) (*GiftResalePriceTon, error) { - var resp GiftResalePriceTon +func UnmarshalGiftResalePriceGram(data json.RawMessage) (*GiftResalePriceGram, error) { + var resp GiftResalePriceGram err := json.Unmarshal(data, &resp) @@ -11662,8 +12382,8 @@ func UnmarshalSuggestedPostPriceStar(data json.RawMessage) (*SuggestedPostPriceS return &resp, err } -func UnmarshalSuggestedPostPriceTon(data json.RawMessage) (*SuggestedPostPriceTon, error) { - var resp SuggestedPostPriceTon +func UnmarshalSuggestedPostPriceGram(data json.RawMessage) (*SuggestedPostPriceGram, error) { + var resp SuggestedPostPriceGram err := json.Unmarshal(data, &resp) @@ -13102,6 +13822,14 @@ func UnmarshalGiveawayPrizeStars(data json.RawMessage) (*GiveawayPrizeStars, err return &resp, err } +func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, error) { + var resp LinkPreviewOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAccentColor(data json.RawMessage) (*AccentColor, error) { var resp AccentColor @@ -13126,6 +13854,70 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err return &resp, err } +func UnmarshalCommunityPermissions(data json.RawMessage) (*CommunityPermissions, error) { + var resp CommunityPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityAdministratorRights(data json.RawMessage) (*CommunityAdministratorRights, error) { + var resp CommunityAdministratorRights + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberStatusCreator(data json.RawMessage) (*CommunityMemberStatusCreator, error) { + var resp CommunityMemberStatusCreator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberStatusAdministrator(data json.RawMessage) (*CommunityMemberStatusAdministrator, error) { + var resp CommunityMemberStatusAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberStatusMember(data json.RawMessage) (*CommunityMemberStatusMember, error) { + var resp CommunityMemberStatusMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberStatusLeft(data json.RawMessage) (*CommunityMemberStatusLeft, error) { + var resp CommunityMemberStatusLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityMemberStatusBanned(data json.RawMessage) (*CommunityMemberStatusBanned, error) { + var resp CommunityMemberStatusBanned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunity(data json.RawMessage) (*Community, error) { + var resp Community + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserRating(data json.RawMessage) (*UserRating, error) { var resp UserRating @@ -13430,6 +14222,62 @@ func UnmarshalSupergroupMembersFilterBots(data json.RawMessage) (*SupergroupMemb return &resp, err } +func UnmarshalChatJoinResultSuccess(data json.RawMessage) (*ChatJoinResultSuccess, error) { + var resp ChatJoinResultSuccess + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinResultRequestSent(data json.RawMessage) (*ChatJoinResultRequestSent, error) { + var resp ChatJoinResultRequestSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinResultGuardBotApprovalRequired(data json.RawMessage) (*ChatJoinResultGuardBotApprovalRequired, error) { + var resp ChatJoinResultGuardBotApprovalRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinResultDeclined(data json.RawMessage) (*ChatJoinResultDeclined, error) { + var resp ChatJoinResultDeclined + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequestResultApproved(data json.RawMessage) (*ChatJoinRequestResultApproved, error) { + var resp ChatJoinRequestResultApproved + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequestResultDeclined(data json.RawMessage) (*ChatJoinRequestResultDeclined, error) { + var resp ChatJoinRequestResultDeclined + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequestResultQueued(data json.RawMessage) (*ChatJoinRequestResultQueued, error) { + var resp ChatJoinRequestResultQueued + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { var resp ChatInviteLink @@ -14014,6 +14862,14 @@ func UnmarshalInputMessageReplyToStory(data json.RawMessage) (*InputMessageReply return &resp, err } +func UnmarshalInputMessageReplyToEphemeralMessage(data json.RawMessage) (*InputMessageReplyToEphemeralMessage, error) { + var resp InputMessageReplyToEphemeralMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFactCheck(data json.RawMessage) (*FactCheck, error) { var resp FactCheck @@ -14398,6 +15254,38 @@ func UnmarshalReactionNotificationSettings(data json.RawMessage) (*ReactionNotif return &resp, err } +func UnmarshalDraftMessageContentText(data json.RawMessage) (*DraftMessageContentText, error) { + var resp DraftMessageContentText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDraftMessageContentRichMessage(data json.RawMessage) (*DraftMessageContentRichMessage, error) { + var resp DraftMessageContentRichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDraftMessageContentVideoNote(data json.RawMessage) (*DraftMessageContentVideoNote, error) { + var resp DraftMessageContentVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDraftMessageContentVoiceNote(data json.RawMessage) (*DraftMessageContentVoiceNote, error) { + var resp DraftMessageContentVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDraftMessage(data json.RawMessage) (*DraftMessage, error) { var resp DraftMessage @@ -14998,70 +15886,6 @@ func UnmarshalOauthLinkInfo(data json.RawMessage) (*OauthLinkInfo, error) { return &resp, err } -func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { - var resp ThemeParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppOpenModeCompact(data json.RawMessage) (*WebAppOpenModeCompact, error) { - var resp WebAppOpenModeCompact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppOpenModeFullSize(data json.RawMessage) (*WebAppOpenModeFullSize, error) { - var resp WebAppOpenModeFullSize - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppOpenModeFullScreen(data json.RawMessage) (*WebAppOpenModeFullScreen, error) { - var resp WebAppOpenModeFullScreen - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFoundWebApp(data json.RawMessage) (*FoundWebApp, error) { - var resp FoundWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { - var resp WebAppInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMainWebApp(data json.RawMessage) (*MainWebApp, error) { - var resp MainWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppOpenParameters(data json.RawMessage) (*WebAppOpenParameters, error) { - var resp WebAppOpenParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -15142,14 +15966,6 @@ func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { return &resp, err } -func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, error) { - var resp LinkPreviewOptions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSharedUser(data json.RawMessage) (*SharedUser, error) { var resp SharedUser @@ -15254,24 +16070,8 @@ func UnmarshalRichTextStrikethrough(data json.RawMessage) (*RichTextStrikethroug return &resp, err } -func UnmarshalRichTextFixed(data json.RawMessage) (*RichTextFixed, error) { - var resp RichTextFixed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextUrl(data json.RawMessage) (*RichTextUrl, error) { - var resp RichTextUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextEmailAddress(data json.RawMessage) (*RichTextEmailAddress, error) { - var resp RichTextEmailAddress +func UnmarshalRichTextSpoiler(data json.RawMessage) (*RichTextSpoiler, error) { + var resp RichTextSpoiler err := json.Unmarshal(data, &resp) @@ -15302,6 +16102,86 @@ func UnmarshalRichTextMarked(data json.RawMessage) (*RichTextMarked, error) { return &resp, err } +func UnmarshalRichTextDateTime(data json.RawMessage) (*RichTextDateTime, error) { + var resp RichTextDateTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextMention(data json.RawMessage) (*RichTextMention, error) { + var resp RichTextMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextHashtag(data json.RawMessage) (*RichTextHashtag, error) { + var resp RichTextHashtag + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextCashtag(data json.RawMessage) (*RichTextCashtag, error) { + var resp RichTextCashtag + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextBankCardNumber(data json.RawMessage) (*RichTextBankCardNumber, error) { + var resp RichTextBankCardNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextBotCommand(data json.RawMessage) (*RichTextBotCommand, error) { + var resp RichTextBotCommand + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextFixed(data json.RawMessage) (*RichTextFixed, error) { + var resp RichTextFixed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextMentionName(data json.RawMessage) (*RichTextMentionName, error) { + var resp RichTextMentionName + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextUrl(data json.RawMessage) (*RichTextUrl, error) { + var resp RichTextUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextEmailAddress(data json.RawMessage) (*RichTextEmailAddress, error) { + var resp RichTextEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPhoneNumber(data json.RawMessage) (*RichTextPhoneNumber, error) { var resp RichTextPhoneNumber @@ -15310,6 +16190,14 @@ func UnmarshalRichTextPhoneNumber(data json.RawMessage) (*RichTextPhoneNumber, e return &resp, err } +func UnmarshalRichTextCustomEmoji(data json.RawMessage) (*RichTextCustomEmoji, error) { + var resp RichTextCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextIcon(data json.RawMessage) (*RichTextIcon, error) { var resp RichTextIcon @@ -15318,6 +16206,22 @@ func UnmarshalRichTextIcon(data json.RawMessage) (*RichTextIcon, error) { return &resp, err } +func UnmarshalRichTextMathematicalExpression(data json.RawMessage) (*RichTextMathematicalExpression, error) { + var resp RichTextMathematicalExpression + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextDiff(data json.RawMessage) (*RichTextDiff, error) { + var resp RichTextDiff + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextReference(data json.RawMessage) (*RichTextReference, error) { var resp RichTextReference @@ -15326,6 +16230,14 @@ func UnmarshalRichTextReference(data json.RawMessage) (*RichTextReference, error return &resp, err } +func UnmarshalRichTextReferenceLink(data json.RawMessage) (*RichTextReferenceLink, error) { + var resp RichTextReferenceLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextAnchor(data json.RawMessage) (*RichTextAnchor, error) { var resp RichTextAnchor @@ -15366,6 +16278,14 @@ func UnmarshalPageBlockListItem(data json.RawMessage) (*PageBlockListItem, error return &resp, err } +func UnmarshalInputPageBlockListItem(data json.RawMessage) (*InputPageBlockListItem, error) { + var resp InputPageBlockListItem + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockHorizontalAlignmentLeft(data json.RawMessage) (*PageBlockHorizontalAlignmentLeft, error) { var resp PageBlockHorizontalAlignmentLeft @@ -15470,6 +16390,14 @@ func UnmarshalPageBlockSubheader(data json.RawMessage) (*PageBlockSubheader, err return &resp, err } +func UnmarshalPageBlockSectionHeading(data json.RawMessage) (*PageBlockSectionHeading, error) { + var resp PageBlockSectionHeading + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockKicker(data json.RawMessage) (*PageBlockKicker, error) { var resp PageBlockKicker @@ -15502,6 +16430,14 @@ func UnmarshalPageBlockFooter(data json.RawMessage) (*PageBlockFooter, error) { return &resp, err } +func UnmarshalPageBlockThinking(data json.RawMessage) (*PageBlockThinking, error) { + var resp PageBlockThinking + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockDivider(data json.RawMessage) (*PageBlockDivider, error) { var resp PageBlockDivider @@ -15510,6 +16446,14 @@ func UnmarshalPageBlockDivider(data json.RawMessage) (*PageBlockDivider, error) return &resp, err } +func UnmarshalPageBlockMathematicalExpression(data json.RawMessage) (*PageBlockMathematicalExpression, error) { + var resp PageBlockMathematicalExpression + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockAnchor(data json.RawMessage) (*PageBlockAnchor, error) { var resp PageBlockAnchor @@ -16918,6 +17862,78 @@ func UnmarshalInputPassportElementError(data json.RawMessage) (*InputPassportEle return &resp, err } +func UnmarshalPollMediaAnimation(data json.RawMessage) (*PollMediaAnimation, error) { + var resp PollMediaAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaAudio(data json.RawMessage) (*PollMediaAudio, error) { + var resp PollMediaAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaDocument(data json.RawMessage) (*PollMediaDocument, error) { + var resp PollMediaDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaLink(data json.RawMessage) (*PollMediaLink, error) { + var resp PollMediaLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaLocation(data json.RawMessage) (*PollMediaLocation, error) { + var resp PollMediaLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaPhoto(data json.RawMessage) (*PollMediaPhoto, error) { + var resp PollMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaSticker(data json.RawMessage) (*PollMediaSticker, error) { + var resp PollMediaSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaVenue(data json.RawMessage) (*PollMediaVenue, error) { + var resp PollMediaVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollMediaVideo(data json.RawMessage) (*PollMediaVideo, error) { + var resp PollMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageText(data json.RawMessage) (*MessageText, error) { var resp MessageText @@ -16926,6 +17942,14 @@ func UnmarshalMessageText(data json.RawMessage) (*MessageText, error) { return &resp, err } +func UnmarshalMessageRichMessage(data json.RawMessage) (*MessageRichMessage, error) { + var resp MessageRichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageAnimation(data json.RawMessage) (*MessageAnimation, error) { var resp MessageAnimation @@ -17030,6 +18054,14 @@ func UnmarshalMessageExpiredVoiceNote(data json.RawMessage) (*MessageExpiredVoic return &resp, err } +func UnmarshalMessageLiveLocation(data json.RawMessage) (*MessageLiveLocation, error) { + var resp MessageLiveLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageLocation(data json.RawMessage) (*MessageLocation, error) { var resp MessageLocation @@ -17286,6 +18318,22 @@ func UnmarshalMessageChatDeleteMember(data json.RawMessage) (*MessageChatDeleteM return &resp, err } +func UnmarshalMessageChatAddedToCommunity(data json.RawMessage) (*MessageChatAddedToCommunity, error) { + var resp MessageChatAddedToCommunity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatRemovedFromCommunity(data json.RawMessage) (*MessageChatRemovedFromCommunity, error) { + var resp MessageChatRemovedFromCommunity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatUpgradeTo(data json.RawMessage) (*MessageChatUpgradeTo, error) { var resp MessageChatUpgradeTo @@ -17974,6 +19022,70 @@ func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { return &resp, err } +func UnmarshalInputAnimation(data json.RawMessage) (*InputAnimation, error) { + var resp InputAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputAudio(data json.RawMessage) (*InputAudio, error) { + var resp InputAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputDocument(data json.RawMessage) (*InputDocument, error) { + var resp InputDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPhoto(data json.RawMessage) (*InputPhoto, error) { + var resp InputPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { + var resp InputSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputVideo(data json.RawMessage) (*InputVideo, error) { + var resp InputVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputVideoNote(data json.RawMessage) (*InputVideoNote, error) { + var resp InputVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputVoiceNote(data json.RawMessage) (*InputVoiceNote, error) { + var resp InputVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputPaidMediaTypePhoto(data json.RawMessage) (*InputPaidMediaTypePhoto, error) { var resp InputPaidMediaTypePhoto @@ -18054,6 +19166,246 @@ func UnmarshalMessageCopyOptions(data json.RawMessage) (*MessageCopyOptions, err return &resp, err } +func UnmarshalInputPollMediaAnimation(data json.RawMessage) (*InputPollMediaAnimation, error) { + var resp InputPollMediaAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaAudio(data json.RawMessage) (*InputPollMediaAudio, error) { + var resp InputPollMediaAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaDocument(data json.RawMessage) (*InputPollMediaDocument, error) { + var resp InputPollMediaDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaLink(data json.RawMessage) (*InputPollMediaLink, error) { + var resp InputPollMediaLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaLocation(data json.RawMessage) (*InputPollMediaLocation, error) { + var resp InputPollMediaLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaPhoto(data json.RawMessage) (*InputPollMediaPhoto, error) { + var resp InputPollMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaSticker(data json.RawMessage) (*InputPollMediaSticker, error) { + var resp InputPollMediaSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaVenue(data json.RawMessage) (*InputPollMediaVenue, error) { + var resp InputPollMediaVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollMediaVideo(data json.RawMessage) (*InputPollMediaVideo, error) { + var resp InputPollMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockSectionHeading(data json.RawMessage) (*InputPageBlockSectionHeading, error) { + var resp InputPageBlockSectionHeading + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockParagraph(data json.RawMessage) (*InputPageBlockParagraph, error) { + var resp InputPageBlockParagraph + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockPreformatted(data json.RawMessage) (*InputPageBlockPreformatted, error) { + var resp InputPageBlockPreformatted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockFooter(data json.RawMessage) (*InputPageBlockFooter, error) { + var resp InputPageBlockFooter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockThinking(data json.RawMessage) (*InputPageBlockThinking, error) { + var resp InputPageBlockThinking + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockDivider(data json.RawMessage) (*InputPageBlockDivider, error) { + var resp InputPageBlockDivider + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockMathematicalExpression(data json.RawMessage) (*InputPageBlockMathematicalExpression, error) { + var resp InputPageBlockMathematicalExpression + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockAnchor(data json.RawMessage) (*InputPageBlockAnchor, error) { + var resp InputPageBlockAnchor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockList(data json.RawMessage) (*InputPageBlockList, error) { + var resp InputPageBlockList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockBlockQuote(data json.RawMessage) (*InputPageBlockBlockQuote, error) { + var resp InputPageBlockBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockPullQuote(data json.RawMessage) (*InputPageBlockPullQuote, error) { + var resp InputPageBlockPullQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockAnimation(data json.RawMessage) (*InputPageBlockAnimation, error) { + var resp InputPageBlockAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockAudio(data json.RawMessage) (*InputPageBlockAudio, error) { + var resp InputPageBlockAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockPhoto(data json.RawMessage) (*InputPageBlockPhoto, error) { + var resp InputPageBlockPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockVideo(data json.RawMessage) (*InputPageBlockVideo, error) { + var resp InputPageBlockVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockVoiceNote(data json.RawMessage) (*InputPageBlockVoiceNote, error) { + var resp InputPageBlockVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockCollage(data json.RawMessage) (*InputPageBlockCollage, error) { + var resp InputPageBlockCollage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockSlideshow(data json.RawMessage) (*InputPageBlockSlideshow, error) { + var resp InputPageBlockSlideshow + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockTable(data json.RawMessage) (*InputPageBlockTable, error) { + var resp InputPageBlockTable + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockDetails(data json.RawMessage) (*InputPageBlockDetails, error) { + var resp InputPageBlockDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPageBlockMap(data json.RawMessage) (*InputPageBlockMap, error) { + var resp InputPageBlockMap + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageText(data json.RawMessage) (*InputMessageText, error) { var resp InputMessageText @@ -18062,6 +19414,14 @@ func UnmarshalInputMessageText(data json.RawMessage) (*InputMessageText, error) return &resp, err } +func UnmarshalInputMessageRichMessage(data json.RawMessage) (*InputMessageRichMessage, error) { + var resp InputMessageRichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageAnimation(data json.RawMessage) (*InputMessageAnimation, error) { var resp InputMessageAnimation @@ -18134,6 +19494,14 @@ func UnmarshalInputMessageVoiceNote(data json.RawMessage) (*InputMessageVoiceNot return &resp, err } +func UnmarshalInputMessageLiveLocation(data json.RawMessage) (*InputMessageLiveLocation, error) { + var resp InputMessageLiveLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageLocation(data json.RawMessage) (*InputMessageLocation, error) { var resp InputMessageLocation @@ -18414,6 +19782,22 @@ func UnmarshalSearchMessagesChatTypeFilterChannel(data json.RawMessage) (*Search return &resp, err } +func UnmarshalSearchChatTypeFilterBot(data json.RawMessage) (*SearchChatTypeFilterBot, error) { + var resp SearchChatTypeFilterBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchChatTypeFilterChannel(data json.RawMessage) (*SearchChatTypeFilterChannel, error) { + var resp SearchChatTypeFilterChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) { var resp ChatActionTyping @@ -20854,6 +22238,14 @@ func UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data json.RawMessage return &resp, err } +func UnmarshalPremiumLimitTypeMessageTextLength(data json.RawMessage) (*PremiumLimitTypeMessageTextLength, error) { + var resp PremiumLimitTypeMessageTextLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) { var resp PremiumLimitTypeCaptionLength @@ -21174,6 +22566,14 @@ func UnmarshalPremiumFeatureTextComposition(data json.RawMessage) (*PremiumFeatu return &resp, err } +func UnmarshalPremiumFeatureRichMessages(data json.RawMessage) (*PremiumFeatureRichMessages, error) { + var resp PremiumFeatureRichMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { var resp BusinessFeatureLocation @@ -22894,136 +24294,152 @@ func UnmarshalMessageAutoDeleteTime(data json.RawMessage) (*MessageAutoDeleteTim return &resp, err } -func UnmarshalSessionTypeAndroid(data json.RawMessage) (*SessionTypeAndroid, error) { - var resp SessionTypeAndroid +func UnmarshalSessionTypeDevice(data json.RawMessage) (*SessionTypeDevice, error) { + var resp SessionTypeDevice err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeApple(data json.RawMessage) (*SessionTypeApple, error) { - var resp SessionTypeApple +func UnmarshalSessionTypeConnectedBot(data json.RawMessage) (*SessionTypeConnectedBot, error) { + var resp SessionTypeConnectedBot err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeBrave(data json.RawMessage) (*SessionTypeBrave, error) { - var resp SessionTypeBrave +func UnmarshalSessionDeviceTypeAndroid(data json.RawMessage) (*SessionDeviceTypeAndroid, error) { + var resp SessionDeviceTypeAndroid err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeChrome(data json.RawMessage) (*SessionTypeChrome, error) { - var resp SessionTypeChrome +func UnmarshalSessionDeviceTypeApple(data json.RawMessage) (*SessionDeviceTypeApple, error) { + var resp SessionDeviceTypeApple err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeEdge(data json.RawMessage) (*SessionTypeEdge, error) { - var resp SessionTypeEdge +func UnmarshalSessionDeviceTypeBrave(data json.RawMessage) (*SessionDeviceTypeBrave, error) { + var resp SessionDeviceTypeBrave err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeFirefox(data json.RawMessage) (*SessionTypeFirefox, error) { - var resp SessionTypeFirefox +func UnmarshalSessionDeviceTypeChrome(data json.RawMessage) (*SessionDeviceTypeChrome, error) { + var resp SessionDeviceTypeChrome err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeIpad(data json.RawMessage) (*SessionTypeIpad, error) { - var resp SessionTypeIpad +func UnmarshalSessionDeviceTypeEdge(data json.RawMessage) (*SessionDeviceTypeEdge, error) { + var resp SessionDeviceTypeEdge err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeIphone(data json.RawMessage) (*SessionTypeIphone, error) { - var resp SessionTypeIphone +func UnmarshalSessionDeviceTypeFirefox(data json.RawMessage) (*SessionDeviceTypeFirefox, error) { + var resp SessionDeviceTypeFirefox err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeLinux(data json.RawMessage) (*SessionTypeLinux, error) { - var resp SessionTypeLinux +func UnmarshalSessionDeviceTypeIpad(data json.RawMessage) (*SessionDeviceTypeIpad, error) { + var resp SessionDeviceTypeIpad err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeMac(data json.RawMessage) (*SessionTypeMac, error) { - var resp SessionTypeMac +func UnmarshalSessionDeviceTypeIphone(data json.RawMessage) (*SessionDeviceTypeIphone, error) { + var resp SessionDeviceTypeIphone err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeOpera(data json.RawMessage) (*SessionTypeOpera, error) { - var resp SessionTypeOpera +func UnmarshalSessionDeviceTypeLinux(data json.RawMessage) (*SessionDeviceTypeLinux, error) { + var resp SessionDeviceTypeLinux err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeSafari(data json.RawMessage) (*SessionTypeSafari, error) { - var resp SessionTypeSafari +func UnmarshalSessionDeviceTypeMac(data json.RawMessage) (*SessionDeviceTypeMac, error) { + var resp SessionDeviceTypeMac err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeUbuntu(data json.RawMessage) (*SessionTypeUbuntu, error) { - var resp SessionTypeUbuntu +func UnmarshalSessionDeviceTypeOpera(data json.RawMessage) (*SessionDeviceTypeOpera, error) { + var resp SessionDeviceTypeOpera err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeUnknown(data json.RawMessage) (*SessionTypeUnknown, error) { - var resp SessionTypeUnknown +func UnmarshalSessionDeviceTypeSafari(data json.RawMessage) (*SessionDeviceTypeSafari, error) { + var resp SessionDeviceTypeSafari err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeVivaldi(data json.RawMessage) (*SessionTypeVivaldi, error) { - var resp SessionTypeVivaldi +func UnmarshalSessionDeviceTypeUbuntu(data json.RawMessage) (*SessionDeviceTypeUbuntu, error) { + var resp SessionDeviceTypeUbuntu err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeWindows(data json.RawMessage) (*SessionTypeWindows, error) { - var resp SessionTypeWindows +func UnmarshalSessionDeviceTypeUnknown(data json.RawMessage) (*SessionDeviceTypeUnknown, error) { + var resp SessionDeviceTypeUnknown err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalSessionTypeXbox(data json.RawMessage) (*SessionTypeXbox, error) { - var resp SessionTypeXbox +func UnmarshalSessionDeviceTypeVivaldi(data json.RawMessage) (*SessionDeviceTypeVivaldi, error) { + var resp SessionDeviceTypeVivaldi + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionDeviceTypeWindows(data json.RawMessage) (*SessionDeviceTypeWindows, error) { + var resp SessionDeviceTypeWindows + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionDeviceTypeXbox(data json.RawMessage) (*SessionDeviceTypeXbox, error) { + var resp SessionDeviceTypeXbox err := json.Unmarshal(data, &resp) @@ -23302,8 +24718,8 @@ func UnmarshalSettingsSectionMyStars(data json.RawMessage) (*SettingsSectionMySt return &resp, err } -func UnmarshalSettingsSectionMyToncoins(data json.RawMessage) (*SettingsSectionMyToncoins, error) { - var resp SettingsSectionMyToncoins +func UnmarshalSettingsSectionMyGrams(data json.RawMessage) (*SettingsSectionMyGrams, error) { + var resp SettingsSectionMyGrams err := json.Unmarshal(data, &resp) @@ -24254,6 +25670,38 @@ func UnmarshalAutosaveSettings(data json.RawMessage) (*AutosaveSettings, error) return &resp, err } +func UnmarshalWebDomainException(data json.RawMessage) (*WebDomainException, error) { + var resp WebDomainException + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebBrowserSettings(data json.RawMessage) (*WebBrowserSettings, error) { + var resp WebBrowserSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebBrowserTypeExternal(data json.RawMessage) (*WebBrowserTypeExternal, error) { + var resp WebBrowserTypeExternal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebBrowserTypeInApp(data json.RawMessage) (*WebBrowserTypeInApp, error) { + var resp WebBrowserTypeInApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalConnectionStateWaitingForNetwork(data json.RawMessage) (*ConnectionStateWaitingForNetwork, error) { var resp ConnectionStateWaitingForNetwork @@ -24686,8 +26134,8 @@ func UnmarshalAddedProxies(data json.RawMessage) (*AddedProxies, error) { return &resp, err } -func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { - var resp InputSticker +func UnmarshalNewSticker(data json.RawMessage) (*NewSticker, error) { + var resp NewSticker err := json.Unmarshal(data, &resp) @@ -24934,16 +26382,16 @@ func UnmarshalStarRevenueStatistics(data json.RawMessage) (*StarRevenueStatistic return &resp, err } -func UnmarshalTonRevenueStatus(data json.RawMessage) (*TonRevenueStatus, error) { - var resp TonRevenueStatus +func UnmarshalGramRevenueStatus(data json.RawMessage) (*GramRevenueStatus, error) { + var resp GramRevenueStatus err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalTonRevenueStatistics(data json.RawMessage) (*TonRevenueStatistics, error) { - var resp TonRevenueStatistics +func UnmarshalGramRevenueStatistics(data json.RawMessage) (*GramRevenueStatistics, error) { + var resp GramRevenueStatistics err := json.Unmarshal(data, &resp) @@ -25622,8 +27070,16 @@ func UnmarshalUpdateChatAction(data json.RawMessage) (*UpdateChatAction, error) return &resp, err } -func UnmarshalUpdatePendingTextMessage(data json.RawMessage) (*UpdatePendingTextMessage, error) { - var resp UpdatePendingTextMessage +func UnmarshalUpdatePendingMessage(data json.RawMessage) (*UpdatePendingMessage, error) { + var resp UpdatePendingMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateCommunity(data json.RawMessage) (*UpdateCommunity, error) { + var resp UpdateCommunity err := json.Unmarshal(data, &resp) @@ -25910,6 +27366,14 @@ func UnmarshalUpdateUnreadChatCount(data json.RawMessage) (*UpdateUnreadChatCoun return &resp, err } +func UnmarshalUpdateChatJoinResult(data json.RawMessage) (*UpdateChatJoinResult, error) { + var resp UpdateChatJoinResult + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateStory(data json.RawMessage) (*UpdateStory, error) { var resp UpdateStory @@ -26070,6 +27534,14 @@ func UnmarshalUpdateProfileAccentColors(data json.RawMessage) (*UpdateProfileAcc return &resp, err } +func UnmarshalUpdateWebBrowserSettings(data json.RawMessage) (*UpdateWebBrowserSettings, error) { + var resp UpdateWebBrowserSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { var resp UpdateLanguagePackStrings @@ -26190,8 +27662,8 @@ func UnmarshalUpdateOwnedStarCount(data json.RawMessage) (*UpdateOwnedStarCount, return &resp, err } -func UnmarshalUpdateOwnedTonCount(data json.RawMessage) (*UpdateOwnedTonCount, error) { - var resp UpdateOwnedTonCount +func UnmarshalUpdateOwnedGramCount(data json.RawMessage) (*UpdateOwnedGramCount, error) { + var resp UpdateOwnedGramCount err := json.Unmarshal(data, &resp) @@ -26214,8 +27686,8 @@ func UnmarshalUpdateStarRevenueStatus(data json.RawMessage) (*UpdateStarRevenueS return &resp, err } -func UnmarshalUpdateTonRevenueStatus(data json.RawMessage) (*UpdateTonRevenueStatus, error) { - var resp UpdateTonRevenueStatus +func UnmarshalUpdateGramRevenueStatus(data json.RawMessage) (*UpdateGramRevenueStatus, error) { + var resp UpdateGramRevenueStatus err := json.Unmarshal(data, &resp) @@ -26422,6 +27894,14 @@ func UnmarshalUpdateNewCustomQuery(data json.RawMessage) (*UpdateNewCustomQuery, return &resp, err } +func UnmarshalUpdateUserSubscription(data json.RawMessage) (*UpdateUserSubscription, error) { + var resp UpdateUserSubscription + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdatePoll(data json.RawMessage) (*UpdatePoll, error) { var resp UpdatePoll @@ -26681,6 +28161,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFormattedText: return UnmarshalFormattedText(data) + case TypeRichMessage: + return UnmarshalRichMessage(data) + + case TypeInputRichMessageMedia: + return UnmarshalInputRichMessageMedia(data) + + case TypeRichMessageSourceBlocks: + return UnmarshalRichMessageSourceBlocks(data) + + case TypeRichMessageSourceMarkdown: + return UnmarshalRichMessageSourceMarkdown(data) + + case TypeRichMessageSourceHtml: + return UnmarshalRichMessageSourceHtml(data) + + case TypeInputRichMessage: + return UnmarshalInputRichMessage(data) + case TypeDiffEntity: return UnmarshalDiffEntity(data) @@ -26942,6 +28440,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLocation: return UnmarshalLocation(data) + case TypeLiveLocation: + return UnmarshalLiveLocation(data) + case TypeVenue: return UnmarshalVenue(data) @@ -27071,6 +28572,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBusinessConnectedBot: return UnmarshalBusinessConnectedBot(data) + case TypeBusinessConnectedBotInfo: + return UnmarshalBusinessConnectedBotInfo(data) + case TypeBusinessStartPage: return UnmarshalBusinessStartPage(data) @@ -27134,11 +28638,38 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministratorRights: return UnmarshalChatAdministratorRights(data) + case TypeThemeParameters: + return UnmarshalThemeParameters(data) + + case TypeWebAppOpenModeCompact: + return UnmarshalWebAppOpenModeCompact(data) + + case TypeWebAppOpenModeFullSize: + return UnmarshalWebAppOpenModeFullSize(data) + + case TypeWebAppOpenModeFullScreen: + return UnmarshalWebAppOpenModeFullScreen(data) + + case TypeFoundWebApp: + return UnmarshalFoundWebApp(data) + + case TypeWebAppUrl: + return UnmarshalWebAppUrl(data) + + case TypeWebAppInfo: + return UnmarshalWebAppInfo(data) + + case TypeMainWebApp: + return UnmarshalMainWebApp(data) + + case TypeWebAppOpenParameters: + return UnmarshalWebAppOpenParameters(data) + case TypeGiftResalePriceStar: return UnmarshalGiftResalePriceStar(data) - case TypeGiftResalePriceTon: - return UnmarshalGiftResalePriceTon(data) + case TypeGiftResalePriceGram: + return UnmarshalGiftResalePriceGram(data) case TypeGiftPurchaseOfferStatePending: return UnmarshalGiftPurchaseOfferStatePending(data) @@ -27152,8 +28683,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedPostPriceStar: return UnmarshalSuggestedPostPriceStar(data) - case TypeSuggestedPostPriceTon: - return UnmarshalSuggestedPostPriceTon(data) + case TypeSuggestedPostPriceGram: + return UnmarshalSuggestedPostPriceGram(data) case TypeSuggestedPostStatePending: return UnmarshalSuggestedPostStatePending(data) @@ -27692,6 +29223,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiveawayPrizeStars: return UnmarshalGiveawayPrizeStars(data) + case TypeLinkPreviewOptions: + return UnmarshalLinkPreviewOptions(data) + case TypeAccentColor: return UnmarshalAccentColor(data) @@ -27701,6 +29235,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfileAccentColor: return UnmarshalProfileAccentColor(data) + case TypeCommunityPermissions: + return UnmarshalCommunityPermissions(data) + + case TypeCommunityAdministratorRights: + return UnmarshalCommunityAdministratorRights(data) + + case TypeCommunityMemberStatusCreator: + return UnmarshalCommunityMemberStatusCreator(data) + + case TypeCommunityMemberStatusAdministrator: + return UnmarshalCommunityMemberStatusAdministrator(data) + + case TypeCommunityMemberStatusMember: + return UnmarshalCommunityMemberStatusMember(data) + + case TypeCommunityMemberStatusLeft: + return UnmarshalCommunityMemberStatusLeft(data) + + case TypeCommunityMemberStatusBanned: + return UnmarshalCommunityMemberStatusBanned(data) + + case TypeCommunity: + return UnmarshalCommunity(data) + case TypeUserRating: return UnmarshalUserRating(data) @@ -27815,6 +29373,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSupergroupMembersFilterBots: return UnmarshalSupergroupMembersFilterBots(data) + case TypeChatJoinResultSuccess: + return UnmarshalChatJoinResultSuccess(data) + + case TypeChatJoinResultRequestSent: + return UnmarshalChatJoinResultRequestSent(data) + + case TypeChatJoinResultGuardBotApprovalRequired: + return UnmarshalChatJoinResultGuardBotApprovalRequired(data) + + case TypeChatJoinResultDeclined: + return UnmarshalChatJoinResultDeclined(data) + + case TypeChatJoinRequestResultApproved: + return UnmarshalChatJoinRequestResultApproved(data) + + case TypeChatJoinRequestResultDeclined: + return UnmarshalChatJoinRequestResultDeclined(data) + + case TypeChatJoinRequestResultQueued: + return UnmarshalChatJoinRequestResultQueued(data) + case TypeChatInviteLink: return UnmarshalChatInviteLink(data) @@ -28034,6 +29613,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageReplyToStory: return UnmarshalInputMessageReplyToStory(data) + case TypeInputMessageReplyToEphemeralMessage: + return UnmarshalInputMessageReplyToEphemeralMessage(data) + case TypeFactCheck: return UnmarshalFactCheck(data) @@ -28178,6 +29760,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReactionNotificationSettings: return UnmarshalReactionNotificationSettings(data) + case TypeDraftMessageContentText: + return UnmarshalDraftMessageContentText(data) + + case TypeDraftMessageContentRichMessage: + return UnmarshalDraftMessageContentRichMessage(data) + + case TypeDraftMessageContentVideoNote: + return UnmarshalDraftMessageContentVideoNote(data) + + case TypeDraftMessageContentVoiceNote: + return UnmarshalDraftMessageContentVoiceNote(data) + case TypeDraftMessage: return UnmarshalDraftMessage(data) @@ -28403,30 +29997,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeOauthLinkInfo: return UnmarshalOauthLinkInfo(data) - case TypeThemeParameters: - return UnmarshalThemeParameters(data) - - case TypeWebAppOpenModeCompact: - return UnmarshalWebAppOpenModeCompact(data) - - case TypeWebAppOpenModeFullSize: - return UnmarshalWebAppOpenModeFullSize(data) - - case TypeWebAppOpenModeFullScreen: - return UnmarshalWebAppOpenModeFullScreen(data) - - case TypeFoundWebApp: - return UnmarshalFoundWebApp(data) - - case TypeWebAppInfo: - return UnmarshalWebAppInfo(data) - - case TypeMainWebApp: - return UnmarshalMainWebApp(data) - - case TypeWebAppOpenParameters: - return UnmarshalWebAppOpenParameters(data) - case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) @@ -28457,9 +30027,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeForumTopics: return UnmarshalForumTopics(data) - case TypeLinkPreviewOptions: - return UnmarshalLinkPreviewOptions(data) - case TypeSharedUser: return UnmarshalSharedUser(data) @@ -28499,14 +30066,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRichTextStrikethrough: return UnmarshalRichTextStrikethrough(data) - case TypeRichTextFixed: - return UnmarshalRichTextFixed(data) - - case TypeRichTextUrl: - return UnmarshalRichTextUrl(data) - - case TypeRichTextEmailAddress: - return UnmarshalRichTextEmailAddress(data) + case TypeRichTextSpoiler: + return UnmarshalRichTextSpoiler(data) case TypeRichTextSubscript: return UnmarshalRichTextSubscript(data) @@ -28517,15 +30078,57 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRichTextMarked: return UnmarshalRichTextMarked(data) + case TypeRichTextDateTime: + return UnmarshalRichTextDateTime(data) + + case TypeRichTextMention: + return UnmarshalRichTextMention(data) + + case TypeRichTextHashtag: + return UnmarshalRichTextHashtag(data) + + case TypeRichTextCashtag: + return UnmarshalRichTextCashtag(data) + + case TypeRichTextBankCardNumber: + return UnmarshalRichTextBankCardNumber(data) + + case TypeRichTextBotCommand: + return UnmarshalRichTextBotCommand(data) + + case TypeRichTextFixed: + return UnmarshalRichTextFixed(data) + + case TypeRichTextMentionName: + return UnmarshalRichTextMentionName(data) + + case TypeRichTextUrl: + return UnmarshalRichTextUrl(data) + + case TypeRichTextEmailAddress: + return UnmarshalRichTextEmailAddress(data) + case TypeRichTextPhoneNumber: return UnmarshalRichTextPhoneNumber(data) + case TypeRichTextCustomEmoji: + return UnmarshalRichTextCustomEmoji(data) + case TypeRichTextIcon: return UnmarshalRichTextIcon(data) + case TypeRichTextMathematicalExpression: + return UnmarshalRichTextMathematicalExpression(data) + + case TypeRichTextDiff: + return UnmarshalRichTextDiff(data) + case TypeRichTextReference: return UnmarshalRichTextReference(data) + case TypeRichTextReferenceLink: + return UnmarshalRichTextReferenceLink(data) + case TypeRichTextAnchor: return UnmarshalRichTextAnchor(data) @@ -28541,6 +30144,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockListItem: return UnmarshalPageBlockListItem(data) + case TypeInputPageBlockListItem: + return UnmarshalInputPageBlockListItem(data) + case TypePageBlockHorizontalAlignmentLeft: return UnmarshalPageBlockHorizontalAlignmentLeft(data) @@ -28580,6 +30186,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockSubheader: return UnmarshalPageBlockSubheader(data) + case TypePageBlockSectionHeading: + return UnmarshalPageBlockSectionHeading(data) + case TypePageBlockKicker: return UnmarshalPageBlockKicker(data) @@ -28592,9 +30201,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockFooter: return UnmarshalPageBlockFooter(data) + case TypePageBlockThinking: + return UnmarshalPageBlockThinking(data) + case TypePageBlockDivider: return UnmarshalPageBlockDivider(data) + case TypePageBlockMathematicalExpression: + return UnmarshalPageBlockMathematicalExpression(data) + case TypePageBlockAnchor: return UnmarshalPageBlockAnchor(data) @@ -29123,9 +30738,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputPassportElementError: return UnmarshalInputPassportElementError(data) + case TypePollMediaAnimation: + return UnmarshalPollMediaAnimation(data) + + case TypePollMediaAudio: + return UnmarshalPollMediaAudio(data) + + case TypePollMediaDocument: + return UnmarshalPollMediaDocument(data) + + case TypePollMediaLink: + return UnmarshalPollMediaLink(data) + + case TypePollMediaLocation: + return UnmarshalPollMediaLocation(data) + + case TypePollMediaPhoto: + return UnmarshalPollMediaPhoto(data) + + case TypePollMediaSticker: + return UnmarshalPollMediaSticker(data) + + case TypePollMediaVenue: + return UnmarshalPollMediaVenue(data) + + case TypePollMediaVideo: + return UnmarshalPollMediaVideo(data) + case TypeMessageText: return UnmarshalMessageText(data) + case TypeMessageRichMessage: + return UnmarshalMessageRichMessage(data) + case TypeMessageAnimation: return UnmarshalMessageAnimation(data) @@ -29165,6 +30810,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageExpiredVoiceNote: return UnmarshalMessageExpiredVoiceNote(data) + case TypeMessageLiveLocation: + return UnmarshalMessageLiveLocation(data) + case TypeMessageLocation: return UnmarshalMessageLocation(data) @@ -29261,6 +30909,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) + case TypeMessageChatAddedToCommunity: + return UnmarshalMessageChatAddedToCommunity(data) + + case TypeMessageChatRemovedFromCommunity: + return UnmarshalMessageChatRemovedFromCommunity(data) + case TypeMessageChatUpgradeTo: return UnmarshalMessageChatUpgradeTo(data) @@ -29519,6 +31173,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputThumbnail: return UnmarshalInputThumbnail(data) + case TypeInputAnimation: + return UnmarshalInputAnimation(data) + + case TypeInputAudio: + return UnmarshalInputAudio(data) + + case TypeInputDocument: + return UnmarshalInputDocument(data) + + case TypeInputPhoto: + return UnmarshalInputPhoto(data) + + case TypeInputSticker: + return UnmarshalInputSticker(data) + + case TypeInputVideo: + return UnmarshalInputVideo(data) + + case TypeInputVideoNote: + return UnmarshalInputVideoNote(data) + + case TypeInputVoiceNote: + return UnmarshalInputVoiceNote(data) + case TypeInputPaidMediaTypePhoto: return UnmarshalInputPaidMediaTypePhoto(data) @@ -29549,9 +31227,102 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageCopyOptions: return UnmarshalMessageCopyOptions(data) + case TypeInputPollMediaAnimation: + return UnmarshalInputPollMediaAnimation(data) + + case TypeInputPollMediaAudio: + return UnmarshalInputPollMediaAudio(data) + + case TypeInputPollMediaDocument: + return UnmarshalInputPollMediaDocument(data) + + case TypeInputPollMediaLink: + return UnmarshalInputPollMediaLink(data) + + case TypeInputPollMediaLocation: + return UnmarshalInputPollMediaLocation(data) + + case TypeInputPollMediaPhoto: + return UnmarshalInputPollMediaPhoto(data) + + case TypeInputPollMediaSticker: + return UnmarshalInputPollMediaSticker(data) + + case TypeInputPollMediaVenue: + return UnmarshalInputPollMediaVenue(data) + + case TypeInputPollMediaVideo: + return UnmarshalInputPollMediaVideo(data) + + case TypeInputPageBlockSectionHeading: + return UnmarshalInputPageBlockSectionHeading(data) + + case TypeInputPageBlockParagraph: + return UnmarshalInputPageBlockParagraph(data) + + case TypeInputPageBlockPreformatted: + return UnmarshalInputPageBlockPreformatted(data) + + case TypeInputPageBlockFooter: + return UnmarshalInputPageBlockFooter(data) + + case TypeInputPageBlockThinking: + return UnmarshalInputPageBlockThinking(data) + + case TypeInputPageBlockDivider: + return UnmarshalInputPageBlockDivider(data) + + case TypeInputPageBlockMathematicalExpression: + return UnmarshalInputPageBlockMathematicalExpression(data) + + case TypeInputPageBlockAnchor: + return UnmarshalInputPageBlockAnchor(data) + + case TypeInputPageBlockList: + return UnmarshalInputPageBlockList(data) + + case TypeInputPageBlockBlockQuote: + return UnmarshalInputPageBlockBlockQuote(data) + + case TypeInputPageBlockPullQuote: + return UnmarshalInputPageBlockPullQuote(data) + + case TypeInputPageBlockAnimation: + return UnmarshalInputPageBlockAnimation(data) + + case TypeInputPageBlockAudio: + return UnmarshalInputPageBlockAudio(data) + + case TypeInputPageBlockPhoto: + return UnmarshalInputPageBlockPhoto(data) + + case TypeInputPageBlockVideo: + return UnmarshalInputPageBlockVideo(data) + + case TypeInputPageBlockVoiceNote: + return UnmarshalInputPageBlockVoiceNote(data) + + case TypeInputPageBlockCollage: + return UnmarshalInputPageBlockCollage(data) + + case TypeInputPageBlockSlideshow: + return UnmarshalInputPageBlockSlideshow(data) + + case TypeInputPageBlockTable: + return UnmarshalInputPageBlockTable(data) + + case TypeInputPageBlockDetails: + return UnmarshalInputPageBlockDetails(data) + + case TypeInputPageBlockMap: + return UnmarshalInputPageBlockMap(data) + case TypeInputMessageText: return UnmarshalInputMessageText(data) + case TypeInputMessageRichMessage: + return UnmarshalInputMessageRichMessage(data) + case TypeInputMessageAnimation: return UnmarshalInputMessageAnimation(data) @@ -29579,6 +31350,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageVoiceNote: return UnmarshalInputMessageVoiceNote(data) + case TypeInputMessageLiveLocation: + return UnmarshalInputMessageLiveLocation(data) + case TypeInputMessageLocation: return UnmarshalInputMessageLocation(data) @@ -29684,6 +31458,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesChatTypeFilterChannel: return UnmarshalSearchMessagesChatTypeFilterChannel(data) + case TypeSearchChatTypeFilterBot: + return UnmarshalSearchChatTypeFilterBot(data) + + case TypeSearchChatTypeFilterChannel: + return UnmarshalSearchChatTypeFilterChannel(data) + case TypeChatActionTyping: return UnmarshalChatActionTyping(data) @@ -30599,6 +32379,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypePinnedSavedMessagesTopicCount: return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data) + case TypePremiumLimitTypeMessageTextLength: + return UnmarshalPremiumLimitTypeMessageTextLength(data) + case TypePremiumLimitTypeCaptionLength: return UnmarshalPremiumLimitTypeCaptionLength(data) @@ -30719,6 +32502,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureTextComposition: return UnmarshalPremiumFeatureTextComposition(data) + case TypePremiumFeatureRichMessages: + return UnmarshalPremiumFeatureRichMessages(data) + case TypeBusinessFeatureLocation: return UnmarshalBusinessFeatureLocation(data) @@ -31364,56 +33150,62 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageAutoDeleteTime: return UnmarshalMessageAutoDeleteTime(data) - case TypeSessionTypeAndroid: - return UnmarshalSessionTypeAndroid(data) + case TypeSessionTypeDevice: + return UnmarshalSessionTypeDevice(data) - case TypeSessionTypeApple: - return UnmarshalSessionTypeApple(data) + case TypeSessionTypeConnectedBot: + return UnmarshalSessionTypeConnectedBot(data) - case TypeSessionTypeBrave: - return UnmarshalSessionTypeBrave(data) + case TypeSessionDeviceTypeAndroid: + return UnmarshalSessionDeviceTypeAndroid(data) - case TypeSessionTypeChrome: - return UnmarshalSessionTypeChrome(data) + case TypeSessionDeviceTypeApple: + return UnmarshalSessionDeviceTypeApple(data) - case TypeSessionTypeEdge: - return UnmarshalSessionTypeEdge(data) + case TypeSessionDeviceTypeBrave: + return UnmarshalSessionDeviceTypeBrave(data) - case TypeSessionTypeFirefox: - return UnmarshalSessionTypeFirefox(data) + case TypeSessionDeviceTypeChrome: + return UnmarshalSessionDeviceTypeChrome(data) - case TypeSessionTypeIpad: - return UnmarshalSessionTypeIpad(data) + case TypeSessionDeviceTypeEdge: + return UnmarshalSessionDeviceTypeEdge(data) - case TypeSessionTypeIphone: - return UnmarshalSessionTypeIphone(data) + case TypeSessionDeviceTypeFirefox: + return UnmarshalSessionDeviceTypeFirefox(data) - case TypeSessionTypeLinux: - return UnmarshalSessionTypeLinux(data) + case TypeSessionDeviceTypeIpad: + return UnmarshalSessionDeviceTypeIpad(data) - case TypeSessionTypeMac: - return UnmarshalSessionTypeMac(data) + case TypeSessionDeviceTypeIphone: + return UnmarshalSessionDeviceTypeIphone(data) - case TypeSessionTypeOpera: - return UnmarshalSessionTypeOpera(data) + case TypeSessionDeviceTypeLinux: + return UnmarshalSessionDeviceTypeLinux(data) - case TypeSessionTypeSafari: - return UnmarshalSessionTypeSafari(data) + case TypeSessionDeviceTypeMac: + return UnmarshalSessionDeviceTypeMac(data) - case TypeSessionTypeUbuntu: - return UnmarshalSessionTypeUbuntu(data) + case TypeSessionDeviceTypeOpera: + return UnmarshalSessionDeviceTypeOpera(data) - case TypeSessionTypeUnknown: - return UnmarshalSessionTypeUnknown(data) + case TypeSessionDeviceTypeSafari: + return UnmarshalSessionDeviceTypeSafari(data) - case TypeSessionTypeVivaldi: - return UnmarshalSessionTypeVivaldi(data) + case TypeSessionDeviceTypeUbuntu: + return UnmarshalSessionDeviceTypeUbuntu(data) - case TypeSessionTypeWindows: - return UnmarshalSessionTypeWindows(data) + case TypeSessionDeviceTypeUnknown: + return UnmarshalSessionDeviceTypeUnknown(data) - case TypeSessionTypeXbox: - return UnmarshalSessionTypeXbox(data) + case TypeSessionDeviceTypeVivaldi: + return UnmarshalSessionDeviceTypeVivaldi(data) + + case TypeSessionDeviceTypeWindows: + return UnmarshalSessionDeviceTypeWindows(data) + + case TypeSessionDeviceTypeXbox: + return UnmarshalSessionDeviceTypeXbox(data) case TypeSession: return UnmarshalSession(data) @@ -31517,8 +33309,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSettingsSectionMyStars: return UnmarshalSettingsSectionMyStars(data) - case TypeSettingsSectionMyToncoins: - return UnmarshalSettingsSectionMyToncoins(data) + case TypeSettingsSectionMyGrams: + return UnmarshalSettingsSectionMyGrams(data) case TypeSettingsSectionNotifications: return UnmarshalSettingsSectionNotifications(data) @@ -31874,6 +33666,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAutosaveSettings: return UnmarshalAutosaveSettings(data) + case TypeWebDomainException: + return UnmarshalWebDomainException(data) + + case TypeWebBrowserSettings: + return UnmarshalWebBrowserSettings(data) + + case TypeWebBrowserTypeExternal: + return UnmarshalWebBrowserTypeExternal(data) + + case TypeWebBrowserTypeInApp: + return UnmarshalWebBrowserTypeInApp(data) + case TypeConnectionStateWaitingForNetwork: return UnmarshalConnectionStateWaitingForNetwork(data) @@ -32036,8 +33840,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddedProxies: return UnmarshalAddedProxies(data) - case TypeInputSticker: - return UnmarshalInputSticker(data) + case TypeNewSticker: + return UnmarshalNewSticker(data) case TypeDateRange: return UnmarshalDateRange(data) @@ -32129,11 +33933,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarRevenueStatistics: return UnmarshalStarRevenueStatistics(data) - case TypeTonRevenueStatus: - return UnmarshalTonRevenueStatus(data) + case TypeGramRevenueStatus: + return UnmarshalGramRevenueStatus(data) - case TypeTonRevenueStatistics: - return UnmarshalTonRevenueStatistics(data) + case TypeGramRevenueStatistics: + return UnmarshalGramRevenueStatistics(data) case TypePoint: return UnmarshalPoint(data) @@ -32387,8 +34191,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(data) + case TypeUpdatePendingMessage: + return UnmarshalUpdatePendingMessage(data) + + case TypeUpdateCommunity: + return UnmarshalUpdateCommunity(data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -32495,6 +34302,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateChatJoinResult: + return UnmarshalUpdateChatJoinResult(data) + case TypeUpdateStory: return UnmarshalUpdateStory(data) @@ -32555,6 +34365,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateProfileAccentColors: return UnmarshalUpdateProfileAccentColors(data) + case TypeUpdateWebBrowserSettings: + return UnmarshalUpdateWebBrowserSettings(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -32600,8 +34413,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(data) + case TypeUpdateOwnedGramCount: + return UnmarshalUpdateOwnedGramCount(data) case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) @@ -32609,8 +34422,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(data) + case TypeUpdateGramRevenueStatus: + return UnmarshalUpdateGramRevenueStatus(data) case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) @@ -32687,6 +34500,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewCustomQuery: return UnmarshalUpdateNewCustomQuery(data) + case TypeUpdateUserSubscription: + return UnmarshalUpdateUserSubscription(data) + case TypeUpdatePoll: return UnmarshalUpdatePoll(data) diff --git a/data/td_api.tl b/data/td_api.tl index cdbcf9d..be096e6 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -116,6 +116,38 @@ textEntities entities:vector = TextEntities; //-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 +//@blocks Content of the message +//@is_rtl True, if the message must be shown from right to left +//@is_full True, if the object contains the full message. Otherwise, getFullRichMessage must be used to get the full message +richMessage blocks:vector is_rtl:Bool is_full:Bool = RichMessage; + +//@description Describes a media to be used in a sent rich message +//@id Unique identifier of the media; 1-64 base64url characters +//@media The media to send. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessagePhoto, inputMessageVideo, or inputMessageVoiceNote +inputRichMessageMedia id:string media:InputMessageContent = InputRichMessageMedia; + +//@class RichMessageSource @description Describes source of a rich message + +//@description A rich message defined by blocks @blocks Content of the message +richMessageSourceBlocks blocks:vector = RichMessageSource; + +//@description A Markdown-formatted rich message; for bots only @text Markdown-formatted text of the message @media Media used in the message +richMessageSourceMarkdown text:string media:vector = RichMessageSource; + +//@description An HTML-formatted rich message; for bots only @text HTML-formatted text of the message @media Media used in the message +richMessageSourceHtml text:string media:vector = RichMessageSource; + +//@description A rich message to send. Total length of all texts, including custom emoji alternative text and formula source, must not exceed getOption("rich_message_text_length_max"). +//-The total number of all blocks, list items and table rows must not exceed getOption("rich_message_block_count_max"). +//-The maximum allowed depth of nested blocks and rich texts is getOption("rich_message_depth_max"). +//-The total number of media in all blocks must not exceed getOption("rich_message_media_count_max"). +//-The maximum allowed number of table columns is getOption("rich_message_table_column_count_max") +//@source Source of the rich message +//@is_rtl Pass true if the message must be shown from right to left +//@detect_automatic_blocks Pass true to enable detection of URLs, email addresses and other automatic blocks +inputRichMessage source:RichMessageSource is_rtl:Bool detect_automatic_blocks:Bool = InputRichMessage; + //@description Represents a change of a text @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 diffEntity offset:int32 length:int32 type:DiffEntityType = DiffEntity; @@ -139,7 +171,7 @@ textCompositionStyleExample source_text:formattedText result_text:formattedText //@is_creator True, if the user is creator of the style //@install_count Number of users that installed the style; for created custom styles only; 0 if unknown //@prompt Prompt of the style; for created custom styles only -//@creator_user_id User identifier of the creator of the style; 0 if none of unknown +//@creator_user_id User identifier of the creator of the style; 0 if none or unknown //@english_example Example of the style usage in English; may be null if unknown 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; @@ -166,7 +198,7 @@ passkeys passkeys:vector = Passkeys; authorizationStateWaitTdlibParameters = AuthorizationState; //@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, -//-or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options +//-or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, checkAuthenticationWebToken, or checkAuthenticationBotToken for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; //@description The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction @@ -414,7 +446,7 @@ outline paths:vector = Outline; //@description Describes one answer option of a poll //@id Unique identifier of the option in the poll; may be empty if yet unassigned //@text Option text; 1-100 characters; may contain only custom emoji entities -//@media Option media; may be null if none. If present, currently, can be only of the types messageAnimation, messageLocation, messagePhoto, messageSticker, messageVenue, or messageVideo without caption +//@media Option media; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaLink, pollMediaLocation, pollMediaPhoto, pollMediaSticker, pollMediaVenue, or pollMediaVideo //@voter_count Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll //@vote_percentage The percentage of votes for this option; 0-100 //@recent_voter_ids Identifiers of recent voters for the option, if the poll is non-anonymous and poll results are available @@ -422,13 +454,13 @@ outline paths:vector = Outline; //@is_being_chosen True, if the option is being chosen by a pending setPollAnswer request //@author Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll //@addition_date Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll -pollOption id:string text:formattedText media:MessageContent voter_count:int32 vote_percentage:int32 recent_voter_ids:vector is_chosen:Bool is_being_chosen:Bool author:MessageSender addition_date:int32 = PollOption; +pollOption id:string text:formattedText media:PollMedia voter_count:int32 vote_percentage:int32 recent_voter_ids:vector is_chosen:Bool is_being_chosen:Bool author:MessageSender addition_date:int32 = PollOption; //@description Describes one answer option of a poll to be created //@text Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users //@media Option media; pass null if none; ignored in addPollOption. Must be one of the following types: -//-inputMessageAnimation, non-live inputMessageLocation, inputMessagePhoto, inputMessageSticker, inputMessageVenue, or inputMessageVideo without caption -inputPollOption text:formattedText media:InputMessageContent = InputPollOption; +//-inputPollMediaAnimation, inputPollMediaLink, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaSticker, inputPollMediaVenue, or inputPollMediaVideo without caption +inputPollOption text:formattedText media:InputPollMedia = InputPollOption; //@class PollType @description Describes the type of poll @@ -440,8 +472,8 @@ pollTypeRegular = PollType; //@correct_option_ids Increasing list of 0-based identifiers of the correct answer options; empty for a yet unanswered poll //@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; empty for a yet unanswered poll //@explanation_media Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; may be null if none or the poll is unanswered yet. -//-If present, currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption -pollTypeQuiz correct_option_ids:vector explanation:formattedText explanation_media:MessageContent = PollType; +//-If present, currently, can be only of the types pollMediaAnimation, pollMediaAudio, pollMediaDocument, pollMediaLocation, pollMediaPhoto, pollMediaVenue, or pollMediaVideo +pollTypeQuiz correct_option_ids:vector explanation:formattedText explanation_media:PollMedia = PollType; //@class InputPollType @description Describes the type of poll to send @@ -453,8 +485,8 @@ inputPollTypeRegular allow_adding_options:Bool = InputPollType; //@correct_option_ids Increasing list of 0-based identifiers of the correct answer options; must be non-empty //@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds //@explanation_media Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; pass null if none. Must be one of the following types: -//-inputMessageAnimation, inputMessageAudio, inputMessageDocument, non-live inputMessageLocation, inputMessagePhoto, inputMessageVenue, or inputMessageVideo without caption -inputPollTypeQuiz correct_option_ids:vector explanation:formattedText explanation_media:InputMessageContent = InputPollType; +//-inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption +inputPollTypeQuiz correct_option_ids:vector explanation:formattedText explanation_media:InputPollMedia = InputPollType; //@class PollVoteRestrictionReason @description Reason of vote restriction in the poll for the current user @@ -514,7 +546,7 @@ inputChecklist title:formattedText tasks:vector others_can_a //@height Height of the animation //@file_name Original name of the file; as defined by the sender //@mime_type MIME type of the file, usually "image/gif" or "video/mp4" -//@has_stickers True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets +//@has_stickers True, if stickers were added to the animation. The list of corresponding sticker sets can be received using getAttachedStickerSets //@minithumbnail Animation minithumbnail; may be null //@thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null //@animation File containing the animation @@ -614,6 +646,14 @@ contact phone_number:string first_name:string last_name:string vcard:string user //@horizontal_accuracy The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown location latitude:double longitude:double horizontal_accuracy:double = Location; +//@description A live location +//@location The current location +//@live_period Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever +//@heading The direction in which the location moves, in degrees; 1-360; 0 if unknown +//@proximity_alert_radius The maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. +//-Can't be enabled in direct messages chats, channels and Saved Messages. Available only to the message sender +liveLocation location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = LiveLocation; + //@description Describes a venue //@location Venue location; as defined by the sender //@title Venue name; as defined by the sender @@ -635,12 +675,12 @@ game id:int64 short_name:string title:string text:formattedText description:stri //@description Describes state of the stake dice //@state_hash Hash of the state to use for sending the next dice; may be empty if the stake dice can't be sent by the current user -//@stake_toncoin_amount The Toncoin amount that was staked in the previous roll; in the smallest units of the currency -//@suggested_stake_toncoin_amounts The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency +//@stake_gram_amount The amount of TON Grams staked in the previous roll; in the smallest units of the currency +//@suggested_stake_gram_amounts The amounts of Grams that are suggested to be staked; in the smallest units of the currency //@current_streak The number of rolled sixes towards the streak; 0-2 -//@prize_per_mille The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user -//@streak_prize_per_mille The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 6 three times in a row with the same stake -stakeDiceState state_hash:string stake_toncoin_amount:int53 suggested_stake_toncoin_amounts:vector current_streak:int32 prize_per_mille:vector streak_prize_per_mille:int32 = StakeDiceState; +//@prize_per_mille The number of Grams received by the user for each 1000 Grams staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user +//@streak_prize_per_mille The number of Grams received by the user for each 1000 Grams staked if the dice outcome is 6 three times in a row with the same stake +stakeDiceState state_hash:string stake_gram_amount:int53 suggested_stake_gram_amounts:vector current_streak:int32 prize_per_mille:vector streak_prize_per_mille:int32 = StakeDiceState; //@description Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App //@short_name Web App short name @@ -657,6 +697,7 @@ webApp short_name:string title:string description:string photo:photo animation:a //@total_voter_count Total number of voters, participating in the poll //@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous and poll results are available //@can_get_voters True, if the current user can get voters in the poll using getPollVoters +//@can_see_results True, if the current user can see results of the poll //@is_anonymous True, if the poll is anonymous //@allows_multiple_answers True, if multiple answer options can be chosen simultaneously //@allows_revoting True, if the poll can be answered multiple times @@ -668,7 +709,7 @@ webApp short_name:string title:string description:string photo:photo animation:a //@close_date Point in time (Unix timestamp) when the poll will automatically be closed //@is_closed True, if the poll is closed //@vote_restriction_reason The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll -poll id:int64 question:formattedText options:vector total_voter_count:int32 recent_voter_ids:vector can_get_voters:Bool is_anonymous:Bool allows_multiple_answers:Bool allows_revoting:Bool members_only:Bool country_codes:vector option_order:vector type:PollType open_period:int32 close_date:int32 is_closed:Bool vote_restriction_reason:PollVoteRestrictionReason = Poll; +poll id:int64 question:formattedText options:vector total_voter_count:int32 recent_voter_ids:vector can_get_voters:Bool can_see_results:Bool is_anonymous:Bool allows_multiple_answers:Bool allows_revoting:Bool members_only:Bool country_codes:vector option_order:vector type:PollType open_period:int32 close_date:int32 is_closed:Bool vote_restriction_reason:PollVoteRestrictionReason = Poll; //@description Describes an alternative re-encoded quality of a video file @@ -768,18 +809,22 @@ userTypeDeleted = UserType; //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@supports_guest_queries True, if the bot can be queried by username from any non-secret chat +//@is_guard True, if the bot can be set as a guard bot in supergroup chats //@need_location True, if the location of the user is expected to be sent with every inline query to this bot //@can_connect_to_business True, if the bot supports connection to 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 need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool allows_users_to_create_topics:Bool 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 userTypeUnknown = UserType; -//@description Represents a command supported by a bot @command Text of the bot command @param_description Description of the bot command -botCommand command:string description:string = BotCommand; +//@description Represents a command supported by a bot +//@command Text of the bot command +//@param_description Description of the bot command +//@is_ephemeral True, if the command must send an ephemeral message instead of a regular one +botCommand command:string description:string is_ephemeral:Bool = BotCommand; //@description Contains a list of bot commands @bot_user_id Bot's user identifier @commands List of bot commands botCommands bot_user_id:int53 commands:vector = BotCommands; @@ -864,7 +909,7 @@ businessAwayMessageSettings shortcut_id:int32 recipients:businessRecipients sche //@description Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat //@shortcut_id Unique quick reply shortcut identifier for the greeting messages //@recipients Chosen recipients of the greeting messages -//@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28 +//@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be one of 7, 14, 21, or 28 businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients inactivity_days:int32 = BusinessGreetingMessageSettings; //@description Describes rights of a business bot @@ -884,12 +929,19 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@can_manage_stories True, if the bot can post, edit and delete stories businessBotRights can_reply:Bool can_read_messages:Bool can_delete_sent_messages:Bool can_delete_all_messages:Bool can_edit_name:Bool can_edit_bio:Bool can_edit_profile_photo:Bool can_edit_username:Bool can_view_gifts_and_stars:Bool can_sell_gifts:Bool can_change_gift_settings:Bool can_transfer_and_upgrade_gifts:Bool can_transfer_stars:Bool can_manage_stories:Bool = BusinessBotRights; -//@description Describes a bot connected to a business account +//@description Describes a business bot connected to an account //@bot_user_id User identifier of the bot //@recipients Private chats that will be accessible to the bot //@rights Rights of the bot businessConnectedBot bot_user_id:int53 recipients:businessRecipients rights:businessBotRights = BusinessConnectedBot; +//@description Describes a connection of a bot to an account +//@bot Information about the bot +//@connection_date Point in time (Unix timestamp) when the bot was added; may be 0 if unknown +//@device_model Model of the device that was used for the bot connection, as provided by the application; may be empty if unknown +//@location A human-readable description of the location from which the bot was connected, based on the IP address; may be empty if unknown +businessConnectedBotInfo bot:businessConnectedBot connection_date:int32 device_model:string location:string = BusinessConnectedBotInfo; + //@description Describes settings for a business account start page //@title Title text of the start page //@message Message text of the start page @@ -912,8 +964,8 @@ businessOpeningHours time_zone_id:string opening_hours:vector