From c49a8e3771f385ea289c6517aa99f7cd0cefe38e Mon Sep 17 00:00:00 2001 From: astravexton Date: Wed, 8 Dec 2021 13:17:55 +0000 Subject: [PATCH 1/7] fix import --- client/puller/chats.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/puller/chats.go b/client/puller/chats.go index bfd65c6..8055f18 100644 --- a/client/puller/chats.go +++ b/client/puller/chats.go @@ -1,8 +1,6 @@ package puller import ( - "math" - "git.zio.sh/astra/go-tdlib/client" ) From 3bf4cb7f464c87c45a0c94d41287a45963782fda Mon Sep 17 00:00:00 2001 From: Astra Vexton Date: Sat, 11 Dec 2021 17:37:28 +0000 Subject: [PATCH 2/7] Update tag to 1.7.10 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 83428a1..10affdb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := master +TAG := a53cb30 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl From 1e67a2c70d97343fa07e507528d6ecc8b4318c9c Mon Sep 17 00:00:00 2001 From: astravexton Date: Mon, 18 Apr 2022 20:45:01 +0000 Subject: [PATCH 3/7] Update tdlib code to 1.8.3 --- Makefile | 2 +- client/function.go | 1447 +++++++++++--- client/tdjson.go | 1 + client/tdjson_dynamic.go | 1 + client/tdjson_static.go | 1 + client/type.go | 4041 ++++++++++++++++++++++++++------------ client/unmarshaler.go | 1579 ++++++++++----- data/td_api.json | 3288 ++++++++++++++++++++++--------- data/td_api.tl | 1165 +++++++---- 9 files changed, 8287 insertions(+), 3238 deletions(-) diff --git a/Makefile b/Makefile index 83428a1..b207c64 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := master +TAG := 054a823c1a812ee3e038f702c6d8ba3e6974be9c schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 2fbeb7b..01d6d02 100755 --- a/client/function.go +++ b/client/function.go @@ -525,7 +525,7 @@ type SetPasswordRequest struct { NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` - // Pass true if the recovery email address must be changed + // Pass true to change also the recovery email address SetRecoveryEmailAddress bool `json:"set_recovery_email_address"` // New recovery email address; may be empty NewRecoveryEmailAddress string `json:"new_recovery_email_address"` @@ -1094,7 +1094,7 @@ type GetMessageLocallyRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message, if it is available locally without sending network request. This is an offline request +// Returns information about a message, if it is available without sending network request. This is an offline request func (client *Client) GetMessageLocally(req *GetMessageLocallyRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1408,7 +1408,7 @@ type SearchPublicChatRequest struct { Username string `json:"username"` } -// Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned +// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned func (client *Client) SearchPublicChat(req *SearchPublicChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1434,7 +1434,7 @@ type SearchPublicChatsRequest struct { Query string `json:"query"` } -// 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 +// 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 func (client *Client) SearchPublicChats(req *SearchPublicChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1872,7 +1872,7 @@ type GetChatHistoryRequest struct { Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages that are available locally without sending network requests + // Pass true to get only messages that are available without sending network requests OnlyLocal bool `json:"only_local"` } @@ -1942,9 +1942,9 @@ func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryReques type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true if the chat needs to be removed from the chat list + // Pass true to remove the chat from all chat lists RemoveFromChatList bool `json:"remove_from_chat_list"` - // Pass true to try to delete chat history for all users + // Pass true to delete chat history for all users Revoke bool `json:"revoke"` } @@ -1976,7 +1976,7 @@ type DeleteChatRequest struct { ChatId int64 `json:"chat_id"` } -// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method +// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2057,7 +2057,7 @@ type SearchMessagesRequest struct { OffsetMessageId int64 `json:"offset_message_id"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // If not 0, the minimum date of the messages to return MinDate int32 `json:"min_date"` @@ -2099,7 +2099,7 @@ type SearchSecretMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for. If empty, searchChatMessages must be used instead Query string `json:"query"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2137,7 +2137,7 @@ type SearchCallMessagesRequest struct { FromMessageId int64 `json:"from_message_id"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages with missed calls + // Pass true to search only for messages with missed/declined calls OnlyMissed bool `json:"only_missed"` } @@ -2164,6 +2164,35 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa return UnmarshalMessages(result.Data) } +type SearchOutgoingDocumentMessagesRequest struct { + // Query to search for in document file name and message caption + Query string `json:"query"` + // The maximum number of messages to be returned; up to 100 + Limit int32 `json:"limit"` +} + +// Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order +func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocumentMessagesRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchOutgoingDocumentMessages", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) +} + type DeleteAllCallMessagesRequest struct { // Pass true to delete the messages for all users Revoke bool `json:"revoke"` @@ -2270,7 +2299,7 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M type GetChatSparseMessagePositionsRequest struct { // Identifier of the chat in which to return information about message positions ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about message positions FromMessageId int64 `json:"from_message_id"` @@ -2305,13 +2334,13 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` } -// Returns information about the next messages of the specified type in the chat splitted by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" +// Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) (*MessageCalendar, error) { result, err := client.Send(Request{ meta: meta{ @@ -2339,7 +2368,7 @@ type GetChatMessageCountRequest struct { ChatId int64 `json:"chat_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` - // If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown + // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally ReturnLocal bool `json:"return_local"` } @@ -2397,7 +2426,7 @@ type GetMessagePublicForwardsRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2427,16 +2456,16 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ return UnmarshalFoundMessages(result.Data) } -type GetChatSponsoredMessagesRequest struct { +type GetChatSponsoredMessageRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` } -// Returns sponsored messages to be shown in a chat; for channel chats only -func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequest) (*SponsoredMessages, error) { +// Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat +func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageRequest) (*SponsoredMessage, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatSponsoredMessages", + Type: "getChatSponsoredMessage", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -2450,36 +2479,7 @@ func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequ return nil, buildResponseError(result.Data) } - return UnmarshalSponsoredMessages(result.Data) -} - -type ViewSponsoredMessageRequest struct { - // Identifier of the chat with the sponsored message - ChatId int64 `json:"chat_id"` - // The identifier of the sponsored message being viewed - SponsoredMessageId int32 `json:"sponsored_message_id"` -} - -// Informs TDLib that a sponsored message was viewed by the user -func (client *Client) ViewSponsoredMessage(req *ViewSponsoredMessageRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "viewSponsoredMessage", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "sponsored_message_id": req.SponsoredMessageId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) + return UnmarshalSponsoredMessage(result.Data) } type RemoveNotificationRequest struct { @@ -2636,6 +2636,38 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa return UnmarshalMessageLinkInfo(result.Data) } +type TranslateTextRequest struct { + // Text to translate + Text string `json:"text"` + // A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically + FromLanguageCode string `json:"from_language_code"` + // A two-letter ISO 639-1 language code of the language to which the message is translated + ToLanguageCode string `json:"to_language_code"` +} + +// Translates a text to the given language. Returns a 404 error if the translation can't be performed +func (client *Client) TranslateText(req *TranslateTextRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateText", + }, + Data: map[string]interface{}{ + "text": req.Text, + "from_language_code": req.FromLanguageCode, + "to_language_code": req.ToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type GetChatAvailableMessageSendersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -2662,22 +2694,22 @@ func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessag return UnmarshalMessageSenders(result.Data) } -type SetChatDefaultMessageSenderRequest struct { +type SetChatMessageSenderRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New default message sender in the chat - DefaultMessageSenderId MessageSender `json:"default_message_sender_id"` + // New message sender for the chat + MessageSenderId MessageSender `json:"message_sender_id"` } -// Changes default message sender that is chosen in a chat -func (client *Client) SetChatDefaultMessageSender(req *SetChatDefaultMessageSenderRequest) (*Ok, error) { +// Selects a message sender to send messages in a chat +func (client *Client) SetChatMessageSender(req *SetChatMessageSenderRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setChatDefaultMessageSender", + Type: "setChatMessageSender", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "default_message_sender_id": req.DefaultMessageSenderId, + "chat_id": req.ChatId, + "message_sender_id": req.MessageSenderId, }, }) if err != nil { @@ -2696,7 +2728,7 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the message to reply to or 0 + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2737,15 +2769,17 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 + // Identifier of a replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` + // Pass true to get fake messages instead of actually sending them + OnlyPreview bool `json:"only_preview"` } -// Sends 2-10 messages grouped together into an album. Currently only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +// Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -2757,6 +2791,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "input_message_contents": req.InputMessageContents, + "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -2807,7 +2842,7 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 + // Identifier of a replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2815,7 +2850,7 @@ type SendInlineQueryResultMessageRequest struct { QueryId JsonInt64 `json:"query_id"` // Identifier of the inline result ResultId string `json:"result_id"` - // If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") + // Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username"), and GetOption("venue_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -2855,11 +2890,11 @@ type ForwardMessagesRequest struct { MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local + // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local SendCopy bool `json:"send_copy"` - // If true, media caption of message copies will be removed. Ignored if send_copy is false + // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // If true, messages will not be forwarded and instead fake messages will be returned + // Pass true to get fake messages instead of actually forwarding them OnlyPreview bool `json:"only_preview"` } @@ -2950,7 +2985,7 @@ type AddLocalMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the message to reply to or 0 + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` @@ -2988,7 +3023,7 @@ type DeleteMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifiers of the messages to be deleted MessageIds []int64 `json:"message_ids"` - // Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats + // Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats Revoke bool `json:"revoke"` } @@ -3051,7 +3086,7 @@ type DeleteChatMessagesByDateRequest struct { MinDate int32 `json:"min_date"` // The maximum date of the messages to delete MaxDate int32 `json:"max_date"` - // Pass true to try to delete chat messages for all users; private chats only + // Pass true to delete chat messages for all users; private chats only Revoke bool `json:"revoke"` } @@ -3452,6 +3487,108 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +type GetMessageAvailableReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message +func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAvailableReactions", + }, + 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 UnmarshalAvailableReactions(result.Data) +} + +type SetMessageReactionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction + Reaction string `json:"reaction"` + // Pass true if the reaction is added with a big animation + IsBig bool `json:"is_big"` +} + +// Changes chosen reaction for a message +func (client *Client) SetMessageReaction(req *SetMessageReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMessageReaction", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction": req.Reaction, + "is_big": req.IsBig, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMessageAddedReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // If non-empty, only added reactions with the specified text representation will be returned + Reaction string `json:"reaction"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of reactions to be returned; must be positive and can't be greater than 100 + Limit int32 `json:"limit"` +} + +// Returns reactions added for a message, along with their sender +func (client *Client) GetMessageAddedReactions(req *GetMessageAddedReactionsRequest) (*AddedReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAddedReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction": req.Reaction, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAddedReactions(result.Data) +} + type GetTextEntitiesRequest struct { // The text in which to look for entites Text string `json:"text"` @@ -3485,7 +3622,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3508,7 +3645,7 @@ func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*Formatt } type ParseMarkdownRequest struct { - // The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" + // The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" Text *FormattedText `json:"text"` } @@ -3757,6 +3894,32 @@ func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { return UnmarshalText(result.Data) } +type GetThemeParametersJsonStringRequest struct { + // Theme parameters to convert to JSON + Theme *ThemeParameters `json:"theme"` +} + +// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously +func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getThemeParametersJsonString", + }, + Data: map[string]interface{}{ + "theme": req.Theme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type SetPollAnswerRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -3933,7 +4096,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // True, if the user allowed the bot to send them messages + // Pass true to allow the bot to send messages to the current user AllowWriteAccess bool `json:"allow_write_access"` } @@ -4002,7 +4165,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // True, if the result of the query can be cached for the specified user + // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` // The results of the query Results []InputInlineQueryResult `json:"results"` @@ -4043,6 +4206,163 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type GetWebAppUrlRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The URL from the keyboardButtonTypeWebApp button + Url string `json:"url"` + // Preferred web app theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` +} + +// Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed +func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWebAppUrl", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + +type SendWebAppDataRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Text of the keyboardButtonTypeWebApp button, which opened the web app + ButtonText string `json:"button_text"` + // Received data + Data string `json:"data"` +} + +// Sends data received from a keyboardButtonTypeWebApp web app to a bot +func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendWebAppData", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "button_text": req.ButtonText, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type OpenWebAppRequest struct { + // Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now + ChatId int64 `json:"chat_id"` + // Identifier of the bot, providing the web app + BotUserId int64 `json:"bot_user_id"` + // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise + Url string `json:"url"` + // Preferred web app theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Identifier of the replied message for the message sent by the web app; 0 if none + ReplyToMessageId int64 `json:"reply_to_message_id"` +} + +// Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once +func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openWebApp", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "reply_to_message_id": req.ReplyToMessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWebAppInfo(result.Data) +} + +type CloseWebAppRequest struct { + // Identifier of web app launch, received from openWebApp + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +// Informs TDLib that a previously opened web app was closed +func (client *Client) CloseWebApp(req *CloseWebAppRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeWebApp", + }, + Data: map[string]interface{}{ + "web_app_launch_id": req.WebAppLaunchId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AnswerWebAppQueryRequest struct { + // Identifier of the web app query + WebAppQueryId string `json:"web_app_query_id"` + // The result of the query + Result InputInlineQueryResult `json:"result"` +} + +// Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only +func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerWebAppQuery", + }, + Data: map[string]interface{}{ + "web_app_query_id": req.WebAppQueryId, + "result": req.Result, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSentWebAppMessage(result.Data) +} + type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` @@ -4080,7 +4400,7 @@ type AnswerCallbackQueryRequest struct { CallbackQueryId JsonInt64 `json:"callback_query_id"` // Text of the answer Text string `json:"text"` - // If true, an alert must be shown to the user instead of a toast notification + // Pass true to show an alert to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -4179,7 +4499,7 @@ type SetGameScoreRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4218,7 +4538,7 @@ func (client *Client) SetGameScore(req *SetGameScoreRequest) (*Message, error) { type SetInlineGameScoreRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4434,11 +4754,11 @@ type ViewMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // True, if messages in closed chats must be marked as read by the request + // Pass true to mark as read the specified messages even the chat is closed ForceRead bool `json:"force_read"` } -// Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels) +// Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels) func (client *Client) ViewMessages(req *ViewMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4547,6 +4867,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(result.Data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(result.Data) @@ -4559,6 +4882,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) @@ -4574,6 +4900,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(result.Data) @@ -4586,6 +4915,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -4613,6 +4945,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(result.Data) @@ -4659,7 +4994,7 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -4711,10 +5046,36 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } +type ReadAllChatReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Marks all reactions in a chat as read +func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllChatReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4743,7 +5104,7 @@ func (client *Client) CreatePrivateChat(req *CreatePrivateChatRequest) (*Chat, e type CreateBasicGroupChatRequest struct { // Basic group identifier BasicGroupId int64 `json:"basic_group_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4772,7 +5133,7 @@ func (client *Client) CreateBasicGroupChat(req *CreateBasicGroupChatRequest) (*C type CreateSupergroupChatRequest struct { // Supergroup or channel identifier SupergroupId int64 `json:"supergroup_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4856,13 +5217,13 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // True, if a channel chat needs to be created + // Pass true to create a channel chat IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` // Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat Location *ChatLocation `json:"location"` - // True, if the supergroup is created for importing messages using importMessage + // Pass true to create a supergroup for importing messages using importMessage ForImport bool `json:"for_import"` } @@ -5234,18 +5595,18 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SetChatMessageTtlSettingRequest struct { +type SetChatMessageTtlRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret + // New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400 Ttl int32 `json:"ttl"` } -// Changes the message TTL setting (sets a new self-destruct timer) in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL setting of a chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed -func (client *Client) SetChatMessageTtlSetting(req *SetChatMessageTtlSettingRequest) (*Ok, error) { +// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setChatMessageTtlSetting", + Type: "setChatMessageTtl", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -5385,7 +5746,7 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin type ToggleChatHasProtectedContentRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // True, if chat content can't be saved locally, forwarded, or copied + // New value of has_protected_content HasProtectedContent bool `json:"has_protected_content"` } @@ -5469,6 +5830,35 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul return UnmarshalOk(result.Data) } +type SetChatAvailableReactionsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // New list of reactions, available in the chat. All reactions must be active + AvailableReactions []string `json:"available_reactions"` +} + +// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +func (client *Client) SetChatAvailableReactions(req *SetChatAvailableReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatAvailableReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "available_reactions": req.AvailableReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatClientDataRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5619,9 +6009,9 @@ type PinChatMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the new pinned message MessageId int64 `json:"message_id"` - // True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats + // Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats DisableNotification bool `json:"disable_notification"` - // True, if the message needs to be pinned for one side only; private chats only + // Pass true to pin the message only for self; private chats only OnlyForSelf bool `json:"only_for_self"` } @@ -5795,7 +6185,7 @@ type AddChatMembersRequest struct { UserIds []int64 `json:"user_ids"` } -// Adds multiple new members to a chat. Currently this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +// Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5854,7 +6244,7 @@ type BanChatMemberRequest struct { ChatId int64 `json:"chat_id"` // Member identifier MemberId MessageSender `json:"member_id"` - // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups + // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned BannedUntilDate int32 `json:"banned_until_date"` // Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels RevokeMessages bool `json:"revoke_messages"` @@ -6041,11 +6431,11 @@ func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) ( } type ClearAllDraftMessagesRequest struct { - // If true, local draft messages in secret chats will not be cleared + // Pass true to keep local message drafts in secret chats ExcludeSecretChats bool `json:"exclude_secret_chats"` } -// Clears draft messages in all chats +// Clears message drafts in all chats func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6066,10 +6456,107 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } +type GetSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier +func (client *Client) GetSavedNotificationSound(req *GetSavedNotificationSoundRequest) (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used +func (client *Client) GetSavedNotificationSounds() (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSounds", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +type AddSavedNotificationSoundRequest struct { + // Notification sound file to add + Sound InputFile `json:"sound"` +} + +// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed +func (client *Client) AddSavedNotificationSound(req *AddSavedNotificationSoundRequest) (*NotificationSound, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addSavedNotificationSound", + }, + Data: map[string]interface{}{ + "sound": req.Sound, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSound(result.Data) +} + +type RemoveSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Removes a notification sound from the list of saved notification sounds +func (client *Client) RemoveSavedNotificationSound(req *RemoveSavedNotificationSoundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatNotificationSettingsExceptionsRequest struct { // If specified, only chats from the scope will be returned; pass null to return chats from all scopes Scope NotificationSettingsScope `json:"scope"` - // If true, also chats with non-default sound will be returned + // Pass true to include in the response chats with only non-default sound CompareSound bool `json:"compare_sound"` } @@ -6150,7 +6637,7 @@ func (client *Client) SetScopeNotificationSettings(req *SetScopeNotificationSett return UnmarshalOk(result.Data) } -// Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown +// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown func (client *Client) ResetAllNotificationSettings() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6174,11 +6661,11 @@ type ToggleChatIsPinnedRequest struct { ChatList ChatList `json:"chat_list"` // Chat identifier ChatId int64 `json:"chat_id"` - // True, if the chat is pinned + // Pass true to pin the chat; pass false to unpin it IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list +// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6230,16 +6717,71 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetAttachmentMenuBotRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` +} + +// Returns information about a bot that can be added to attachment menu +func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAttachmentMenuBot", + }, + 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 UnmarshalAttachmentMenuBot(result.Data) +} + +type ToggleBotIsAddedToAttachmentMenuRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` + // Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu + IsAdded bool `json:"is_added"` +} + +// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true +func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBotIsAddedToAttachmentMenu", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "is_added": req.IsAdded, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` - // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first Priority int32 `json:"priority"` // The starting position from which the file needs to be downloaded Offset int32 `json:"offset"` // Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit Limit int32 `json:"limit"` - // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent + // Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started Synchronous bool `json:"synchronous"` } @@ -6564,6 +7106,195 @@ func (client *Client) DeleteFile(req *DeleteFileRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type AddFileToDownloadsRequest struct { + // Identifier of the file to download + FileId int32 `json:"file_id"` + // Chat identifier of the message with the file + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first + Priority int32 `json:"priority"` +} + +// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +func (client *Client) AddFileToDownloads(req *AddFileToDownloadsRequest) (*File, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addFileToDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "priority": req.Priority, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFile(result.Data) +} + +type ToggleDownloadIsPausedRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true if the download is paused + IsPaused bool `json:"is_paused"` +} + +// Changes pause state of a file in the file download list +func (client *Client) ToggleDownloadIsPaused(req *ToggleDownloadIsPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleDownloadIsPaused", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "is_paused": req.IsPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleAllDownloadsArePausedRequest struct { + // Pass true to pause all downloads; pass false to unpause them + ArePaused bool `json:"are_paused"` +} + +// Changes pause state of all files in the file download list +func (client *Client) ToggleAllDownloadsArePaused(req *ToggleAllDownloadsArePausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleAllDownloadsArePaused", + }, + Data: map[string]interface{}{ + "are_paused": req.ArePaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveFileFromDownloadsRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes a file from the file download list +func (client *Client) RemoveFileFromDownloads(req *RemoveFileFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeFileFromDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveAllFilesFromDownloadsRequest struct { + // Pass true to remove only active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to remove only completed downloads + OnlyCompleted bool `json:"only_completed"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes all files from the file download list +func (client *Client) RemoveAllFilesFromDownloads(req *RemoveAllFilesFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeAllFilesFromDownloads", + }, + Data: map[string]interface{}{ + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchFileDownloadsRequest struct { + // Query to search for; may be empty to return all downloaded files + Query string `json:"query"` + // Pass true to search only for active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to search only for completed downloads + OnlyCompleted bool `json:"only_completed"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of files to be returned + Limit int32 `json:"limit"` +} + +// Searches for files in the file download list or recently downloaded files from the list +func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*FoundFileDownloads, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchFileDownloads", + }, + Data: map[string]interface{}{ + "query": req.Query, + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundFileDownloads(result.Data) +} + type GetMessageFileTypeRequest struct { // Beginning of the message file; up to 100 first lines MessageFileHead string `json:"message_file_head"` @@ -6692,10 +7423,10 @@ type CreateChatInviteLinkRequest struct { // Invite link name; 0-32 characters Name string `json:"name"` // Point in time (Unix timestamp) when the link will expire; pass 0 if never - ExpireDate int32 `json:"expire_date"` - // The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited + ExpirationDate int32 `json:"expiration_date"` + // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -6708,7 +7439,7 @@ func (client *Client) CreateChatInviteLink(req *CreateChatInviteLinkRequest) (*C Data: map[string]interface{}{ "chat_id": req.ChatId, "name": req.Name, - "expire_date": req.ExpireDate, + "expiration_date": req.ExpirationDate, "member_limit": req.MemberLimit, "creates_join_request": req.CreatesJoinRequest, }, @@ -6732,10 +7463,10 @@ type EditChatInviteLinkRequest struct { // Invite link name; 0-32 characters Name string `json:"name"` // Point in time (Unix timestamp) when the link will expire; pass 0 if never - ExpireDate int32 `json:"expire_date"` - // The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited + ExpirationDate int32 `json:"expiration_date"` + // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -6749,7 +7480,7 @@ func (client *Client) EditChatInviteLink(req *EditChatInviteLinkRequest) (*ChatI "chat_id": req.ChatId, "invite_link": req.InviteLink, "name": req.Name, - "expire_date": req.ExpireDate, + "expiration_date": req.ExpirationDate, "member_limit": req.MemberLimit, "creates_join_request": req.CreatesJoinRequest, }, @@ -6872,7 +7603,7 @@ type GetChatInviteLinkMembersRequest struct { Limit int32 `json:"limit"` } -// Returns chat members joined a chat by an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +// Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links func (client *Client) GetChatInviteLinkMembers(req *GetChatInviteLinkMembersRequest) (*ChatInviteLinkMembers, error) { result, err := client.Send(Request{ meta: meta{ @@ -7044,7 +7775,7 @@ type GetChatJoinRequestsRequest struct { Query string `json:"query"` // A chat join request from which to return next requests; pass null to get results from the beginning OffsetRequest *ChatJoinRequest `json:"offset_request"` - // The maximum number of chat join requests to return + // The maximum number of requests to join the chat to return Limit int32 `json:"limit"` } @@ -7078,7 +7809,7 @@ type ProcessChatJoinRequestRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user that sent the request UserId int64 `json:"user_id"` - // True, if the request is approved. Otherwise the request is declived + // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` } @@ -7110,7 +7841,7 @@ type ProcessChatJoinRequestsRequest struct { ChatId int64 `json:"chat_id"` // Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links InviteLink string `json:"invite_link"` - // True, if the requests are approved. Otherwise the requests are declived + // Pass true to approve all requests; pass false to decline them Approve bool `json:"approve"` } @@ -7142,7 +7873,7 @@ type CreateCallRequest struct { UserId int64 `json:"user_id"` // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` - // True, if a video call needs to be created + // Pass true to create a video call IsVideo bool `json:"is_video"` } @@ -7230,11 +7961,11 @@ func (client *Client) SendCallSignalingData(req *SendCallSignalingDataRequest) ( type DiscardCallRequest struct { // Call identifier CallId int32 `json:"call_id"` - // True, if the user was disconnected + // Pass true if the user was disconnected IsDisconnected bool `json:"is_disconnected"` // The call duration, in seconds Duration int32 `json:"duration"` - // True, if the call was a video call + // Pass true if the call was a video call IsVideo bool `json:"is_video"` // Identifier of the connection used during the call ConnectionId JsonInt64 `json:"connection_id"` @@ -7334,7 +8065,7 @@ type GetVideoChatAvailableParticipantsRequest struct { ChatId int64 `json:"chat_id"` } -// Returns list of participant identifiers, which can be used to join video chats in a chat +// Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined func (client *Client) GetVideoChatAvailableParticipants(req *GetVideoChatAvailableParticipantsRequest) (*MessageSenders, error) { result, err := client.Send(Request{ meta: meta{ @@ -7362,7 +8093,7 @@ type SetVideoChatDefaultParticipantRequest struct { DefaultParticipantId MessageSender `json:"default_participant_id"` } -// Changes default participant identifier, which can be used to join video chats in a chat +// Changes default participant identifier, on whose behalf a video chat in the chat will be joined func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultParticipantRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7385,12 +8116,14 @@ func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultPar } type CreateVideoChatRequest struct { - // Chat identifier, in which the video chat will be created + // Identifier of a chat in which the video chat will be created ChatId int64 `json:"chat_id"` // Group call title; if empty, chat title will be used Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future StartDate int32 `json:"start_date"` + // Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges + IsRtmpStream bool `json:"is_rtmp_stream"` } // Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights @@ -7400,9 +8133,10 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId Type: "createVideoChat", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "title": req.Title, - "start_date": req.StartDate, + "chat_id": req.ChatId, + "title": req.Title, + "start_date": req.StartDate, + "is_rtmp_stream": req.IsRtmpStream, }, }) if err != nil { @@ -7416,6 +8150,58 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId return UnmarshalGroupCallId(result.Data) } +type GetVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + +type ReplaceVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Replaces the current RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -7506,9 +8292,9 @@ type JoinGroupCallRequest struct { AudioSourceId int32 `json:"audio_source_id"` // Group call join payload; received from tgcalls Payload string `json:"payload"` - // True, if the user's microphone is muted + // Pass true to join the call with muted microphone IsMuted bool `json:"is_muted"` - // True, if the user's video is enabled + // Pass true if the user's video is enabled IsMyVideoEnabled bool `json:"is_my_video_enabled"` // If non-empty, invite hash to be used to join the group call without being muted by administrators InviteHash string `json:"invite_hash"` @@ -7686,32 +8472,6 @@ func (client *Client) ToggleGroupCallMuteNewParticipants(req *ToggleGroupCallMut return UnmarshalOk(result.Data) } -type RevokeGroupCallInviteLinkRequest struct { - // Group call identifier - GroupCallId int32 `json:"group_call_id"` -} - -// Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag -func (client *Client) RevokeGroupCallInviteLink(req *RevokeGroupCallInviteLinkRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "revokeGroupCallInviteLink", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type InviteGroupCallParticipantsRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -7770,6 +8530,32 @@ func (client *Client) GetGroupCallInviteLink(req *GetGroupCallInviteLinkRequest) return UnmarshalHttpUrl(result.Data) } +type RevokeGroupCallInviteLinkRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag +func (client *Client) RevokeGroupCallInviteLink(req *RevokeGroupCallInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "revokeGroupCallInviteLink", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type StartGroupCallRecordingRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -7894,7 +8680,7 @@ type SetGroupCallParticipantIsSpeakingRequest struct { GroupCallId int32 `json:"group_call_id"` // Group call participant's synchronization audio source identifier, or 0 for the current user AudioSource int32 `json:"audio_source"` - // True, if the user is speaking + // Pass true if the user is speaking IsSpeaking bool `json:"is_speaking"` } @@ -7926,7 +8712,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true if the user must be muted and false otherwise + // Pass true to mute the user; pass false to unmute the them IsMuted bool `json:"is_muted"` } @@ -8072,16 +8858,16 @@ func (client *Client) LeaveGroupCall(req *LeaveGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type DiscardGroupCallRequest struct { +type EndGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` } -// Discards a group call. Requires groupCall.can_be_managed -func (client *Client) DiscardGroupCall(req *DiscardGroupCallRequest) (*Ok, error) { +// Ends a group call. Requires groupCall.can_be_managed +func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "discardGroupCall", + Type: "endGroupCall", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -8098,6 +8884,32 @@ func (client *Client) DiscardGroupCall(req *DiscardGroupCallRequest) (*Ok, error return UnmarshalOk(result.Data) } +type GetGroupCallStreamsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about available group call streams +func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCallStreams", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallStreams(result.Data) +} + type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -8168,11 +8980,11 @@ func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlo type BlockMessageSenderFromRepliesRequest struct { // The identifier of an incoming message in the Replies chat MessageId int64 `json:"message_id"` - // Pass true if the message must be deleted + // Pass true to delete the message DeleteMessage bool `json:"delete_message"` - // Pass true if all messages from the same sender must be deleted + // Pass true to delete all messages from the same sender DeleteAllMessages bool `json:"delete_all_messages"` - // Pass true if the sender must be reported to the Telegram moderators + // Pass true to report the sender to the Telegram moderators ReportSpam bool `json:"report_spam"` } @@ -8230,9 +9042,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored + // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored Contact *Contact `json:"contact"` - // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number + // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -8422,6 +9234,32 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +type SearchUserByPhoneNumberRequest struct { + // Phone number to search for + PhoneNumber string `json:"phone_number"` +} + +// Searches a user by their phone number +func (client *Client) SearchUserByPhoneNumber(req *SearchUserByPhoneNumberRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchUserByPhoneNumber", + }, + Data: map[string]interface{}{ + "phone_number": req.PhoneNumber, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type SharePhoneNumberRequest struct { // Identifier of the user with whom to share the phone number. The user must be a mutual contact UserId int64 `json:"user_id"` @@ -8630,7 +9468,7 @@ type GetAttachedStickerSetsRequest struct { FileId int32 `json:"file_id"` } -// Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets +// Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets func (client *Client) GetAttachedStickerSets(req *GetAttachedStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ @@ -9058,7 +9896,7 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e type SearchEmojisRequest struct { // Text to search for Text string `json:"text"` - // True, if only emojis, which exactly match text needs to be returned + // Pass true if only emojis, which exactly match the text, needs to be returned ExactMatch bool `json:"exact_match"` // List of possible IETF language tags of the user's input language; may be empty if unknown InputLanguageCodes []string `json:"input_language_codes"` @@ -9313,7 +10151,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage type GetWebPageInstantViewRequest struct { // The web page URL Url string `json:"url"` - // If true, the full instant view for the web page will be returned + // Pass true to get full instant view for the web page ForceFull bool `json:"force_full"` } @@ -9575,7 +10413,7 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode type SetCommandsRequest struct { // The scope to which the commands are relevant; pass null to change commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands + // A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands LanguageCode string `json:"language_code"` // List of the bot's commands Commands []*BotCommand `json:"commands"` @@ -9607,7 +10445,7 @@ func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { type DeleteCommandsRequest struct { // The scope to which the commands are relevant; pass null to delete commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } @@ -9636,7 +10474,7 @@ func (client *Client) DeleteCommands(req *DeleteCommandsRequest) (*Ok, error) { type GetCommandsRequest struct { // The scope to which the commands are relevant; pass null to get commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } @@ -9662,6 +10500,113 @@ func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) return UnmarshalBotCommands(result.Data) } +type SetMenuButtonRequest struct { + // Identifier of the user or 0 to set menu button for all users + UserId int64 `json:"user_id"` + // New menu button + MenuButton *BotMenuButton `json:"menu_button"` +} + +// Sets menu button for the given user or for all users; for bots only +func (client *Client) SetMenuButton(req *SetMenuButtonRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "menu_button": req.MenuButton, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMenuButtonRequest struct { + // Identifier of the user or 0 to get the default menu button + UserId int64 `json:"user_id"` +} + +// Returns menu button set by the bot for the given user; for bots only +func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMenuButton(result.Data) +} + +type SetDefaultGroupAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only +func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultGroupAdministratorRights", + }, + Data: map[string]interface{}{ + "default_group_administrator_rights": req.DefaultGroupAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetDefaultChannelAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to channel chats; for bots only +func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChannelAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultChannelAdministratorRights", + }, + Data: map[string]interface{}{ + "default_channel_administrator_rights": req.DefaultChannelAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -9729,7 +10674,7 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { type ToggleSessionCanAcceptCallsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming calls can be accepted by the session + // Pass true to allow accepting incoming calls by the session; pass false otherwise CanAcceptCalls bool `json:"can_accept_calls"` } @@ -9758,7 +10703,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming secret chats can be accepted by the session + // Pass true to allow accepring secret chats by the session; pass false otherwise CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -10019,11 +10964,11 @@ func (client *Client) ToggleSupergroupIsBroadcastGroup(req *ToggleSupergroupIsBr type ReportSupergroupSpamRequest struct { // Supergroup identifier SupergroupId int64 `json:"supergroup_id"` - // Identifiers of messages sent in the supergroup. All messages must be sent by the same sender. This list must be non-empty + // Identifiers of messages to report MessageIds []int64 `json:"message_ids"` } -// Reports some messages from a message sender in a supergroup as spam; requires administrator rights in the supergroup +// Reports messages in a supergroup as spam; requires administrator rights in the supergroup func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10153,7 +11098,7 @@ type GetPaymentFormRequest struct { // Message identifier MessageId int64 `json:"message_id"` // Preferred payment form theme; pass null to use the default theme - Theme *PaymentFormTheme `json:"theme"` + Theme *ThemeParameters `json:"theme"` } // Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy @@ -10186,7 +11131,7 @@ type ValidateOrderInfoRequest struct { MessageId int64 `json:"message_id"` // The order information, provided by the user; pass null if empty OrderInfo *OrderInfo `json:"order_info"` - // True, if the order information can be saved + // Pass true to save the order information AllowSave bool `json:"allow_save"` } @@ -10287,7 +11232,7 @@ func (client *Client) GetPaymentReceipt(req *GetPaymentReceiptRequest) (*Payment return UnmarshalPaymentReceipt(result.Data) } -// Returns saved order info, if any +// Returns saved order information. Returns a 404 error if there is no saved order information func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -10306,7 +11251,7 @@ func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { return UnmarshalOrderInfo(result.Data) } -// Deletes saved order info +// Deletes saved order information func (client *Client) DeleteSavedOrderInfo() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10364,7 +11309,7 @@ func (client *Client) GetSupportUser() (*User, error) { } type GetBackgroundsRequest struct { - // True, if the backgrounds must be ordered for dark theme + // Pass true to order returned backgrounds for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10449,7 +11394,7 @@ type SetBackgroundRequest struct { Background InputBackground `json:"background"` // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` - // True, if the background is chosen for dark theme + // Pass true if the background is changed for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10522,7 +11467,7 @@ func (client *Client) ResetBackgrounds() (*Ok, error) { } type GetLocalizationTargetInfoRequest struct { - // If true, returns only locally available information without sending network requests + // Pass true to get only locally available information without sending network requests OnlyLocal bool `json:"only_local"` } @@ -11096,7 +12041,7 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of reported messages, if any + // Identifiers of reported messages; may be empty to report the whole chat MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat Reason ChatReportReason `json:"reason"` @@ -11104,7 +12049,7 @@ type ReportChatRequest struct { Text string `json:"text"` } -// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators +// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11139,7 +12084,7 @@ type ReportChatPhotoRequest struct { Text string `json:"text"` } -// Reports a chat photo to the Telegram moderators. A chat photo can be reported only if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators +// Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported func (client *Client) ReportChatPhoto(req *ReportChatPhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11170,7 +12115,7 @@ type GetChatStatisticsRequest struct { IsDark bool `json:"is_dark"` } -// Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true +// Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true func (client *Client) GetChatStatistics(req *GetChatStatisticsRequest) (ChatStatistics, error) { result, err := client.Send(Request{ meta: meta{ @@ -11346,7 +12291,7 @@ type OptimizeStorageRequest struct { Size int64 `json:"size"` // Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit Ttl int32 `json:"ttl"` - // Limit on the total count of files after deletion. Pass -1 to use the default limit + // Limit on the total number of files after deletion. Pass -1 to use the default limit Count int32 `json:"count"` // The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value ImmunityDelay int32 `json:"immunity_delay"` @@ -11418,7 +12363,7 @@ func (client *Client) SetNetworkType(req *SetNetworkTypeRequest) (*Ok, error) { } type GetNetworkStatisticsRequest struct { - // If true, returns only data for the current library launch + // Pass true to get statistics only for the current library launch OnlyCurrent bool `json:"only_current"` } @@ -12159,10 +13104,10 @@ type UploadStickerFileRequest struct { // Sticker file owner; ignored for regular users UserId int64 `json:"user_id"` // Sticker file to upload - Sticker InputSticker `json:"sticker"` + Sticker *InputSticker `json:"sticker"` } -// Uploads a PNG image with a sticker; returns the uploaded file +// Uploads a file with a sticker; returns the uploaded file func (client *Client) UploadStickerFile(req *UploadStickerFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -12255,10 +13200,8 @@ type CreateNewStickerSetRequest struct { Title string `json:"title"` // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters Name string `json:"name"` - // True, if stickers are masks. Animated stickers can't be masks - IsMasks bool `json:"is_masks"` - // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown - Stickers []InputSticker `json:"stickers"` + // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown + Stickers []*InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` } @@ -12273,7 +13216,6 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti "user_id": req.UserId, "title": req.Title, "name": req.Name, - "is_masks": req.IsMasks, "stickers": req.Stickers, "source": req.Source, }, @@ -12295,7 +13237,7 @@ type AddStickerToSetRequest struct { // Sticker set name Name string `json:"name"` // Sticker to add to the set - Sticker InputSticker `json:"sticker"` + Sticker *InputSticker `json:"sticker"` } // Adds a new sticker to a set; for bots only. Returns the sticker set @@ -12326,7 +13268,7 @@ type SetStickerSetThumbnailRequest struct { UserId int64 `json:"user_id"` // Sticker set name Name string `json:"name"` - // Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them + // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set Thumbnail InputFile `json:"thumbnail"` } @@ -12419,7 +13361,7 @@ type GetMapThumbnailFileRequest struct { Height int32 `json:"height"` // Map scale; 1-3 Scale int32 `json:"scale"` - // Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown + // Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown ChatId int64 `json:"chat_id"` } @@ -12624,7 +13566,7 @@ func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*Phone } type GetPhoneNumberInfoSyncRequest struct { - // A two-letter ISO 639-1 country code for country information localization + // A two-letter ISO 639-1 language code for country information localization LanguageCode string `json:"language_code"` // The phone number prefix PhoneNumberPrefix string `json:"phone_number_prefix"` @@ -12774,7 +13716,7 @@ type AddProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -12811,7 +13753,7 @@ type EditProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -13416,7 +14358,7 @@ type TestProxyRequest struct { Port int32 `json:"port"` // Proxy type Type ProxyType `json:"type"` - // Identifier of a datacenter, with which to test connection + // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request Timeout float64 `json:"timeout"` @@ -13516,6 +14458,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(result.Data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(result.Data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(result.Data) @@ -13537,50 +14482,29 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(result.Data) - case TypeUpdateChatDefaultMessageSenderId: - return UnmarshalUpdateChatDefaultMessageSenderId(result.Data) - - case TypeUpdateChatHasProtectedContent: - return UnmarshalUpdateChatHasProtectedContent(result.Data) - - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(result.Data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(result.Data) - - case TypeUpdateChatVideoChat: - return UnmarshalUpdateChatVideoChat(result.Data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(result.Data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(result.Data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(result.Data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(result.Data) - - case TypeUpdateChatNotificationSettings: - return UnmarshalUpdateChatNotificationSettings(result.Data) - - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(result.Data) - - case TypeUpdateChatMessageTtlSetting: - return UnmarshalUpdateChatMessageTtlSetting(result.Data) - case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) - case TypeUpdateChatTheme: - return UnmarshalUpdateChatTheme(result.Data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(result.Data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(result.Data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(result.Data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(result.Data) + + case TypeUpdateChatNotificationSettings: + return UnmarshalUpdateChatNotificationSettings(result.Data) case TypeUpdateChatPendingJoinRequests: return UnmarshalUpdateChatPendingJoinRequests(result.Data) @@ -13588,8 +14512,32 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(result.Data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(result.Data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(result.Data) + + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(result.Data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(result.Data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(result.Data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(result.Data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(result.Data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(result.Data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(result.Data) @@ -13597,6 +14545,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(result.Data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(result.Data) @@ -13651,6 +14602,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(result.Data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(result.Data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(result.Data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(result.Data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(result.Data) + case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) @@ -13693,6 +14656,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(result.Data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(result.Data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(result.Data) @@ -13711,6 +14677,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(result.Data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(result.Data) + + case TypeUpdateReactions: + return UnmarshalUpdateReactions(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) diff --git a/client/tdjson.go b/client/tdjson.go index a91488e..a2860a9 100644 --- a/client/tdjson.go +++ b/client/tdjson.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package client diff --git a/client/tdjson_dynamic.go b/client/tdjson_dynamic.go index 84aaeac..4a88485 100644 --- a/client/tdjson_dynamic.go +++ b/client/tdjson_dynamic.go @@ -1,3 +1,4 @@ +//go:build libtdjson && (linux || darwin || windows) // +build libtdjson // +build linux darwin windows diff --git a/client/tdjson_static.go b/client/tdjson_static.go index dcbb662..a486de9 100644 --- a/client/tdjson_static.go +++ b/client/tdjson_static.go @@ -1,3 +1,4 @@ +//go:build !libtdjson && (linux || darwin) // +build !libtdjson // +build linux darwin diff --git a/client/type.go b/client/type.go index 5313ac0..16ce0f0 100755 --- a/client/type.go +++ b/client/type.go @@ -12,6 +12,7 @@ const ( ClassInputFile = "InputFile" ClassThumbnailFormat = "ThumbnailFormat" ClassMaskPoint = "MaskPoint" + ClassStickerType = "StickerType" ClassPollType = "PollType" ClassUserType = "UserType" ClassInputChatPhoto = "InputChatPhoto" @@ -87,7 +88,6 @@ const ( ClassSuggestedAction = "SuggestedAction" ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" - ClassInputSticker = "InputSticker" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" @@ -133,16 +133,19 @@ const ( ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" ClassBotCommands = "BotCommands" + ClassBotMenuButton = "BotMenuButton" ClassChatLocation = "ChatLocation" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" ClassChatPhotos = "ChatPhotos" + ClassChatPermissions = "ChatPermissions" + ClassChatAdministratorRights = "ChatAdministratorRights" ClassUser = "User" + ClassBotInfo = "BotInfo" ClassUserFullInfo = "UserFullInfo" ClassUsers = "Users" ClassChatAdministrator = "ChatAdministrator" ClassChatAdministrators = "ChatAdministrators" - ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" ClassChatInviteLink = "ChatInviteLink" @@ -163,7 +166,9 @@ const ( ClassMessageSenders = "MessageSenders" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageReplyInfo = "MessageReplyInfo" + ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" + ClassUnreadReaction = "UnreadReaction" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" @@ -172,7 +177,9 @@ const ( ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" ClassSponsoredMessage = "SponsoredMessage" - ClassSponsoredMessages = "SponsoredMessages" + ClassFileDownload = "FileDownload" + ClassDownloadedFileCounts = "DownloadedFileCounts" + ClassFoundFileDownloads = "FoundFileDownloads" ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" @@ -189,6 +196,7 @@ const ( ClassChatsNearby = "ChatsNearby" ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" + ClassWebAppInfo = "WebAppInfo" ClassMessageThreadInfo = "MessageThreadInfo" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" @@ -202,13 +210,13 @@ const ( ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" + ClassThemeParameters = "ThemeParameters" ClassLabeledPricePart = "LabeledPricePart" ClassInvoice = "Invoice" ClassOrderInfo = "OrderInfo" ClassShippingOption = "ShippingOption" ClassSavedCredentials = "SavedCredentials" ClassPaymentsProviderStripe = "PaymentsProviderStripe" - ClassPaymentFormTheme = "PaymentFormTheme" ClassPaymentForm = "PaymentForm" ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" @@ -241,6 +249,9 @@ const ( ClassCallServer = "CallServer" ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" + ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" @@ -248,8 +259,15 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" + ClassAddedReaction = "AddedReaction" + ClassAddedReactions = "AddedReactions" + ClassAvailableReactions = "AvailableReactions" + ClassReaction = "Reaction" ClassAnimations = "Animations" ClassImportedContacts = "ImportedContacts" + ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" + ClassAttachmentMenuBot = "AttachmentMenuBot" + ClassSentWebAppMessage = "SentWebAppMessage" ClassHttpUrl = "HttpUrl" ClassInlineQueryResults = "InlineQueryResults" ClassCallbackQueryAnswer = "CallbackQueryAnswer" @@ -269,6 +287,8 @@ const ( ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" + ClassNotificationSound = "NotificationSound" + ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" ClassJsonObjectMember = "JsonObjectMember" @@ -297,6 +317,7 @@ const ( ClassDeepLinkInfo = "DeepLinkInfo" ClassProxy = "Proxy" ClassProxies = "Proxies" + ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" @@ -356,17 +377,22 @@ const ( TypePhotoSize = "photoSize" TypeMinithumbnail = "minithumbnail" TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" - TypeThumbnailFormatPng = "thumbnailFormatPng" - TypeThumbnailFormatWebp = "thumbnailFormatWebp" TypeThumbnailFormatGif = "thumbnailFormatGif" - TypeThumbnailFormatTgs = "thumbnailFormatTgs" TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" + TypeThumbnailFormatPng = "thumbnailFormatPng" + TypeThumbnailFormatTgs = "thumbnailFormatTgs" + TypeThumbnailFormatWebm = "thumbnailFormatWebm" + TypeThumbnailFormatWebp = "thumbnailFormatWebp" TypeThumbnail = "thumbnail" TypeMaskPointForehead = "maskPointForehead" TypeMaskPointEyes = "maskPointEyes" TypeMaskPointMouth = "maskPointMouth" TypeMaskPointChin = "maskPointChin" TypeMaskPosition = "maskPosition" + TypeStickerTypeStatic = "stickerTypeStatic" + TypeStickerTypeAnimated = "stickerTypeAnimated" + TypeStickerTypeVideo = "stickerTypeVideo" + TypeStickerTypeMask = "stickerTypeMask" TypeClosedVectorPath = "closedVectorPath" TypePollOption = "pollOption" TypePollTypeRegular = "pollTypeRegular" @@ -393,6 +419,7 @@ const ( TypeUserTypeUnknown = "userTypeUnknown" TypeBotCommand = "botCommand" TypeBotCommands = "botCommands" + TypeBotMenuButton = "botMenuButton" TypeChatLocation = "chatLocation" TypeAnimatedChatPhoto = "animatedChatPhoto" TypeChatPhoto = "chatPhoto" @@ -400,12 +427,14 @@ const ( TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" TypeInputChatPhotoStatic = "inputChatPhotoStatic" TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" + TypeChatPermissions = "chatPermissions" + TypeChatAdministratorRights = "chatAdministratorRights" TypeUser = "user" + TypeBotInfo = "botInfo" TypeUserFullInfo = "userFullInfo" TypeUsers = "users" TypeChatAdministrator = "chatAdministrator" TypeChatAdministrators = "chatAdministrators" - TypeChatPermissions = "chatPermissions" TypeChatMemberStatusCreator = "chatMemberStatusCreator" TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" TypeChatMemberStatusMember = "chatMemberStatusMember" @@ -457,7 +486,9 @@ const ( TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageReplyInfo = "messageReplyInfo" + TypeMessageReaction = "messageReaction" TypeMessageInteractionInfo = "messageInteractionInfo" + TypeUnreadReaction = "unreadReaction" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" TypeMessage = "message" @@ -468,7 +499,9 @@ const ( TypeMessageCalendarDay = "messageCalendarDay" TypeMessageCalendar = "messageCalendar" TypeSponsoredMessage = "sponsoredMessage" - TypeSponsoredMessages = "sponsoredMessages" + TypeFileDownload = "fileDownload" + TypeDownloadedFileCounts = "downloadedFileCounts" + TypeFoundFileDownloads = "foundFileDownloads" TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" @@ -508,9 +541,11 @@ const ( TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" + TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" TypeKeyboardButton = "keyboardButton" TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" + TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" @@ -524,6 +559,7 @@ const ( TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" TypeLoginUrlInfoOpen = "loginUrlInfoOpen" TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" + TypeWebAppInfo = "webAppInfo" TypeMessageThreadInfo = "messageThreadInfo" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" @@ -589,6 +625,7 @@ const ( TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" TypeBankCardInfo = "bankCardInfo" TypeAddress = "address" + TypeThemeParameters = "themeParameters" TypeLabeledPricePart = "labeledPricePart" TypeInvoice = "invoice" TypeOrderInfo = "orderInfo" @@ -599,7 +636,6 @@ const ( TypeInputCredentialsApplePay = "inputCredentialsApplePay" TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" TypePaymentsProviderStripe = "paymentsProviderStripe" - TypePaymentFormTheme = "paymentFormTheme" TypePaymentForm = "paymentForm" TypeValidatedOrderInfo = "validatedOrderInfo" TypePaymentResult = "paymentResult" @@ -722,6 +758,8 @@ const ( TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageWebsiteConnected = "messageWebsiteConnected" + TypeMessageWebAppDataSent = "messageWebAppDataSent" + TypeMessageWebAppDataReceived = "messageWebAppDataReceived" TypeMessagePassportDataSent = "messagePassportDataSent" TypeMessagePassportDataReceived = "messagePassportDataReceived" TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" @@ -738,6 +776,7 @@ const ( TypeTextEntityTypeItalic = "textEntityTypeItalic" TypeTextEntityTypeUnderline = "textEntityTypeUnderline" TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" + TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler" TypeTextEntityTypeCode = "textEntityTypeCode" TypeTextEntityTypePre = "textEntityTypePre" TypeTextEntityTypePreCode = "textEntityTypePreCode" @@ -776,12 +815,11 @@ const ( TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" - TypeSearchMessagesFilterCall = "searchMessagesFilterCall" - TypeSearchMessagesFilterMissedCall = "searchMessagesFilterMissedCall" TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" TypeSearchMessagesFilterMention = "searchMessagesFilterMention" TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" + TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction" TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" TypeChatActionTyping = "chatActionTyping" @@ -830,6 +868,9 @@ const ( TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" + TypeRtmpUrl = "rtmpUrl" TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" TypeGroupCall = "groupCall" TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" @@ -846,10 +887,17 @@ const ( TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" TypeCall = "call" TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" + TypeAddedReaction = "addedReaction" + TypeAddedReactions = "addedReactions" + TypeAvailableReactions = "availableReactions" + TypeReaction = "reaction" TypeAnimations = "animations" TypeDiceStickersRegular = "diceStickersRegular" TypeDiceStickersSlotMachine = "diceStickersSlotMachine" TypeImportedContacts = "importedContacts" + TypeAttachmentMenuBotColor = "attachmentMenuBotColor" + TypeAttachmentMenuBot = "attachmentMenuBot" + TypeSentWebAppMessage = "sentWebAppMessage" TypeHttpUrl = "httpUrl" TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" @@ -885,38 +933,39 @@ const ( TypeGameHighScores = "gameHighScores" TypeChatEventMessageEdited = "chatEventMessageEdited" TypeChatEventMessageDeleted = "chatEventMessageDeleted" - TypeChatEventPollStopped = "chatEventPollStopped" TypeChatEventMessagePinned = "chatEventMessagePinned" TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" + TypeChatEventPollStopped = "chatEventPollStopped" TypeChatEventMemberJoined = "chatEventMemberJoined" TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" - TypeChatEventMemberLeft = "chatEventMemberLeft" TypeChatEventMemberInvited = "chatEventMemberInvited" + TypeChatEventMemberLeft = "chatEventMemberLeft" TypeChatEventMemberPromoted = "chatEventMemberPromoted" TypeChatEventMemberRestricted = "chatEventMemberRestricted" - TypeChatEventTitleChanged = "chatEventTitleChanged" - TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged" TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" - TypeChatEventUsernameChanged = "chatEventUsernameChanged" - TypeChatEventPhotoChanged = "chatEventPhotoChanged" - TypeChatEventInvitesToggled = "chatEventInvitesToggled" TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" - TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" - TypeChatEventMessageTtlSettingChanged = "chatEventMessageTtlSettingChanged" - TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" - TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" - TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" TypeChatEventLocationChanged = "chatEventLocationChanged" + TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" + TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventPhotoChanged = "chatEventPhotoChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventTitleChanged = "chatEventTitleChanged" + TypeChatEventUsernameChanged = "chatEventUsernameChanged" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventInvitesToggled = "chatEventInvitesToggled" TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" - TypeChatEventVideoChatDiscarded = "chatEventVideoChatDiscarded" + TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" - TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" TypeChatEvent = "chatEvent" TypeChatEvents = "chatEvents" TypeChatEventLogFilters = "chatEventLogFilters" @@ -1006,6 +1055,8 @@ const ( TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" + TypeNotificationSound = "notificationSound" + TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" TypeOptionValueBoolean = "optionValueBoolean" @@ -1048,21 +1099,27 @@ const ( TypeChatReportReasonCopyright = "chatReportReasonCopyright" TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" TypeChatReportReasonFake = "chatReportReasonFake" + TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs" + TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails" TypeChatReportReasonCustom = "chatReportReasonCustom" TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" TypeInternalLinkTypeBackground = "internalLinkTypeBackground" TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" + TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" @@ -1072,6 +1129,7 @@ const ( TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" + TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" @@ -1080,6 +1138,7 @@ const ( TypeFileTypeAnimation = "fileTypeAnimation" TypeFileTypeAudio = "fileTypeAudio" TypeFileTypeDocument = "fileTypeDocument" + TypeFileTypeNotificationSound = "fileTypeNotificationSound" TypeFileTypePhoto = "fileTypePhoto" TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" TypeFileTypeSecret = "fileTypeSecret" @@ -1128,7 +1187,7 @@ const ( TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" - TypeSuggestedActionSeeTicksHint = "suggestedActionSeeTicksHint" + TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" TypeSuggestedActionSetPassword = "suggestedActionSetPassword" TypeCount = "count" @@ -1142,8 +1201,7 @@ const ( TypeProxyTypeMtproto = "proxyTypeMtproto" TypeProxy = "proxy" TypeProxies = "proxies" - TypeInputStickerStatic = "inputStickerStatic" - TypeInputStickerAnimated = "inputStickerAnimated" + TypeInputSticker = "inputSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" TypeStatisticalGraphData = "statisticalGraphData" @@ -1177,6 +1235,7 @@ const ( TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" TypeUpdateMessageContentOpened = "updateMessageContentOpened" TypeUpdateMessageMentionRead = "updateMessageMentionRead" + TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions" TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" TypeUpdateNewChat = "updateNewChat" TypeUpdateChatTitle = "updateChatTitle" @@ -1184,26 +1243,28 @@ const ( TypeUpdateChatPermissions = "updateChatPermissions" TypeUpdateChatLastMessage = "updateChatLastMessage" TypeUpdateChatPosition = "updateChatPosition" - TypeUpdateChatDefaultMessageSenderId = "updateChatDefaultMessageSenderId" - TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" - TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatIsBlocked = "updateChatIsBlocked" - TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" - TypeUpdateChatVideoChat = "updateChatVideoChat" - TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatReadInbox = "updateChatReadInbox" TypeUpdateChatReadOutbox = "updateChatReadOutbox" - TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" - TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" - TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" - TypeUpdateChatMessageTtlSetting = "updateChatMessageTtlSetting" TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" + TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatMessageSender = "updateChatMessageSender" + TypeUpdateChatMessageTtl = "updateChatMessageTtl" + TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" - TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" + TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" + TypeUpdateChatVideoChat = "updateChatVideoChat" + TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" + TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatIsBlocked = "updateChatIsBlocked" + TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" TypeUpdateChatFilters = "updateChatFilters" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" + TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" TypeUpdateNotification = "updateNotification" TypeUpdateNotificationGroup = "updateNotificationGroup" TypeUpdateActiveNotifications = "updateActiveNotifications" @@ -1222,6 +1283,10 @@ const ( TypeUpdateFile = "updateFile" TypeUpdateFileGenerationStart = "updateFileGenerationStart" TypeUpdateFileGenerationStop = "updateFileGenerationStop" + TypeUpdateFileDownloads = "updateFileDownloads" + TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads" + TypeUpdateFileDownload = "updateFileDownload" + TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads" TypeUpdateCall = "updateCall" TypeUpdateGroupCall = "updateGroupCall" TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" @@ -1236,12 +1301,16 @@ const ( TypeUpdateRecentStickers = "updateRecentStickers" TypeUpdateFavoriteStickers = "updateFavoriteStickers" TypeUpdateSavedAnimations = "updateSavedAnimations" + TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" TypeUpdateSelectedBackground = "updateSelectedBackground" TypeUpdateChatThemes = "updateChatThemes" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUsersNearby = "updateUsersNearby" + TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" + TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" + TypeUpdateReactions = "updateReactions" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" @@ -1288,7 +1357,7 @@ type InputFile interface { InputFileType() string } -// Describes format of the thumbnail +// Describes format of a thumbnail type ThumbnailFormat interface { ThumbnailFormatType() string } @@ -1298,6 +1367,11 @@ type MaskPoint interface { MaskPointType() string } +// Describes type of a sticker +type StickerType interface { + StickerTypeType() string +} + // Describes the type of a poll type PollType interface { PollTypeType() string @@ -1673,11 +1747,6 @@ type ProxyType interface { ProxyTypeType() string } -// Describes a sticker that needs to be added to a sticker set -type InputSticker interface { - InputStickerType() string -} - // Describes a statistical graph type StatisticalGraph interface { StatisticalGraphType() string @@ -1886,7 +1955,7 @@ func (*AuthenticationCodeTypeCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeCall } -// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered automatically +// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically type AuthenticationCodeTypeFlashCall struct { meta // Pattern of the phone number from which the call will be made @@ -1913,7 +1982,7 @@ func (*AuthenticationCodeTypeFlashCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeFlashCall } -// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered manually by the user +// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user type AuthenticationCodeTypeMissedCall struct { meta // Prefix of the phone number from which the call will be made @@ -2097,7 +2166,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -2122,7 +2191,7 @@ type TermsOfService struct { meta // Text of the terms of service Text *FormattedText `json:"text"` - // The minimum age of a user to be able to accept the terms; 0 if any + // The minimum age of a user to be able to accept the terms; 0 if age isn't restricted MinUserAge int32 `json:"min_user_age"` // True, if a blocking popup with terms of service must be shown to the user ShowPopup bool `json:"show_popup"` @@ -2519,7 +2588,7 @@ type LocalFile struct { meta // Local path to the locally available file part; may be empty Path string `json:"path"` - // True, if it is possible to try to download or generate the file + // True, if it is possible to download or generate the file CanBeDownloaded bool `json:"can_be_downloaded"` // True, if the file can be deleted CanBeDeleted bool `json:"can_be_deleted"` @@ -2554,7 +2623,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location + // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location Id string `json:"id"` // Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time UniqueId string `json:"unique_id"` @@ -2808,56 +2877,6 @@ func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { return TypeThumbnailFormatJpeg } -// The thumbnail is in PNG format. It will be used only for background patterns -type ThumbnailFormatPng struct { - meta -} - -func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatPng - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatPng) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatPng) GetType() string { - return TypeThumbnailFormatPng -} - -func (*ThumbnailFormatPng) ThumbnailFormatType() string { - return TypeThumbnailFormatPng -} - -// The thumbnail is in WEBP format. It will be used only for some stickers -type ThumbnailFormatWebp struct { - meta -} - -func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatWebp - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatWebp) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatWebp) GetType() string { - return TypeThumbnailFormatWebp -} - -func (*ThumbnailFormatWebp) ThumbnailFormatType() string { - return TypeThumbnailFormatWebp -} - // The thumbnail is in static GIF format. It will be used only for some bot inline results type ThumbnailFormatGif struct { meta @@ -2883,7 +2902,57 @@ func (*ThumbnailFormatGif) ThumbnailFormatType() string { return TypeThumbnailFormatGif } -// The thumbnail is in TGS format. It will be used only for animated sticker sets +// The thumbnail is in MPEG4 format. It will be used only for some animations and videos +type ThumbnailFormatMpeg4 struct { + meta +} + +func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatMpeg4 + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatMpeg4) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatMpeg4) GetType() string { + return TypeThumbnailFormatMpeg4 +} + +func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { + return TypeThumbnailFormatMpeg4 +} + +// The thumbnail is in PNG format. It will be used only for background patterns +type ThumbnailFormatPng struct { + meta +} + +func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatPng + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatPng) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatPng) GetType() string { + return TypeThumbnailFormatPng +} + +func (*ThumbnailFormatPng) ThumbnailFormatType() string { + return TypeThumbnailFormatPng +} + +// The thumbnail is in TGS format. It will be used only for TGS sticker sets type ThumbnailFormatTgs struct { meta } @@ -2908,29 +2977,54 @@ func (*ThumbnailFormatTgs) ThumbnailFormatType() string { return TypeThumbnailFormatTgs } -// The thumbnail is in MPEG4 format. It will be used only for some animations and videos -type ThumbnailFormatMpeg4 struct { +// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +type ThumbnailFormatWebm struct { meta } -func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { +func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ThumbnailFormatMpeg4 + type stub ThumbnailFormatWebm return json.Marshal((*stub)(entity)) } -func (*ThumbnailFormatMpeg4) GetClass() string { +func (*ThumbnailFormatWebm) GetClass() string { return ClassThumbnailFormat } -func (*ThumbnailFormatMpeg4) GetType() string { - return TypeThumbnailFormatMpeg4 +func (*ThumbnailFormatWebm) GetType() string { + return TypeThumbnailFormatWebm } -func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { - return TypeThumbnailFormatMpeg4 +func (*ThumbnailFormatWebm) ThumbnailFormatType() string { + return TypeThumbnailFormatWebm +} + +// The thumbnail is in WEBP format. It will be used only for some stickers +type ThumbnailFormatWebp struct { + meta +} + +func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatWebp) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatWebp) GetType() string { + return TypeThumbnailFormatWebp +} + +func (*ThumbnailFormatWebp) ThumbnailFormatType() string { + return TypeThumbnailFormatWebp } // Represents a thumbnail @@ -3137,6 +3231,108 @@ func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { return nil } +// The sticker is an image in WEBP format +type StickerTypeStatic struct { + meta +} + +func (entity *StickerTypeStatic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeStatic + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeStatic) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeStatic) GetType() string { + return TypeStickerTypeStatic +} + +func (*StickerTypeStatic) StickerTypeType() string { + return TypeStickerTypeStatic +} + +// The sticker is an animation in TGS format +type StickerTypeAnimated struct { + meta +} + +func (entity *StickerTypeAnimated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeAnimated + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeAnimated) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeAnimated) GetType() string { + return TypeStickerTypeAnimated +} + +func (*StickerTypeAnimated) StickerTypeType() string { + return TypeStickerTypeAnimated +} + +// The sticker is a video in WEBM format +type StickerTypeVideo struct { + meta +} + +func (entity *StickerTypeVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeVideo) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeVideo) GetType() string { + return TypeStickerTypeVideo +} + +func (*StickerTypeVideo) StickerTypeType() string { + return TypeStickerTypeVideo +} + +// The sticker is a mask in WEBP format to be placed on photos or videos +type StickerTypeMask struct { + meta + // Position where the mask is placed; may be null + MaskPosition *MaskPosition `json:"mask_position"` +} + +func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeMask + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeMask) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeMask) GetType() string { + return TypeStickerTypeMask +} + +func (*StickerTypeMask) StickerTypeType() string { + return TypeStickerTypeMask +} + // Represents a closed vector path. The path begins at the end point of the last command type ClosedVectorPath struct { meta @@ -3408,12 +3604,8 @@ type Sticker struct { Height int32 `json:"height"` // Emoji corresponding to the sticker Emoji string `json:"emoji"` - // True, if the sticker is an animated sticker in TGS format - IsAnimated bool `json:"is_animated"` - // True, if the sticker is a mask - IsMask bool `json:"is_mask"` - // Position where the mask is placed; may be null - MaskPosition *MaskPosition `json:"mask_position"` + // Sticker type + Type StickerType `json:"type"` // Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner Outline []*ClosedVectorPath `json:"outline"` // Sticker thumbnail in WEBP or JPEG format; may be null @@ -3438,6 +3630,37 @@ func (*Sticker) GetType() string { return TypeSticker } +func (sticker *Sticker) UnmarshalJSON(data []byte) error { + var tmp struct { + SetId JsonInt64 `json:"set_id"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Emoji string `json:"emoji"` + Type json.RawMessage `json:"type"` + Outline []*ClosedVectorPath `json:"outline"` + Thumbnail *Thumbnail `json:"thumbnail"` + Sticker *File `json:"sticker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sticker.SetId = tmp.SetId + sticker.Width = tmp.Width + sticker.Height = tmp.Height + sticker.Emoji = tmp.Emoji + sticker.Outline = tmp.Outline + sticker.Thumbnail = tmp.Thumbnail + sticker.Sticker = tmp.Sticker + + fieldType, _ := UnmarshalStickerType(tmp.Type) + sticker.Type = fieldType + + return nil +} + // Describes a video file type Video struct { meta @@ -3546,7 +3769,7 @@ type AnimatedEmoji struct { Sticker *Sticker `json:"sticker"` // Emoji modifier fitzpatrick type; 0-6; 0 if none FitzpatrickType int32 `json:"fitzpatrick_type"` - // File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + // File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container Sound *File `json:"sound"` } @@ -3633,7 +3856,7 @@ type Venue struct { Title string `json:"title"` // Venue address; as defined by the sender Address string `json:"address"` - // Provider of the venue database; as defined by the sender. Currently only "foursquare" and "gplaces" (Google Places) need to be supported + // Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported Provider string `json:"provider"` // Identifier of the venue in the provider database; as defined by the sender Id string `json:"id"` @@ -3891,6 +4114,8 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // 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 can be added to attachment menu + CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` } func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { @@ -3988,6 +4213,31 @@ func (*BotCommands) GetType() string { return TypeBotCommands } +// Describes a button to be shown instead of bot commands menu button +type BotMenuButton struct { + meta + // Text of the button + Text string `json:"text"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMenuButton + + return json.Marshal((*stub)(entity)) +} + +func (*BotMenuButton) GetClass() string { + return ClassBotMenuButton +} + +func (*BotMenuButton) GetType() string { + return TypeBotMenuButton +} + // Represents a location to which a chat is connected type ChatLocation struct { meta @@ -4214,6 +4464,86 @@ func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byt return nil } +// 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, locations, and venues + CanSendMessages bool `json:"can_send_messages"` + // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions + CanSendMediaMessages bool `json:"can_send_media_messages"` + // True, if the user can send polls. Implies can_send_messages permissions + CanSendPolls bool `json:"can_send_polls"` + // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions + CanSendOtherMessages bool `json:"can_send_other_messages"` + // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions + CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` + // True, if the user can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the user can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the user can pin messages + CanPinMessages bool `json:"can_pin_messages"` +} + +func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPermissions) GetClass() string { + return ClassChatPermissions +} + +func (*ChatPermissions) GetType() string { + return TypeChatPermissions +} + +// Describes rights of the administrator +type ChatAdministratorRights struct { + meta + // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + CanManageChat bool `json:"can_manage_chat"` + // True, if the administrator can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the administrator can create channel posts; applicable to channels only + CanPostMessages bool `json:"can_post_messages"` + // True, if the administrator can edit messages of other users and pin messages; applicable to channels only + CanEditMessages bool `json:"can_edit_messages"` + // True, if the administrator can delete messages of other users + CanDeleteMessages bool `json:"can_delete_messages"` + // True, if the administrator can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the administrator can restrict, ban, or unban chat members; always true for channels + CanRestrictMembers bool `json:"can_restrict_members"` + // True, if the administrator can pin messages; applicable to basic groups and supergroups only + CanPinMessages bool `json:"can_pin_messages"` + // 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 manage video chats + CanManageVideoChats bool `json:"can_manage_video_chats"` + // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only + IsAnonymous bool `json:"is_anonymous"` +} + +func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministratorRights + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministratorRights) GetClass() string { + return ClassChatAdministratorRights +} + +func (*ChatAdministratorRights) GetType() string { + return TypeChatAdministratorRights +} + // Represents a user type User struct { meta @@ -4245,7 +4575,7 @@ type User struct { IsScam bool `json:"is_scam"` // True, if many users reported this user as a fake account IsFake bool `json:"is_fake"` - // If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser + // If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser HaveAccess bool `json:"have_access"` // Type of the user Type UserType `json:"type"` @@ -4320,6 +4650,39 @@ func (user *User) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a bot +type BotInfo struct { + meta + // The text that is shown on the bot's profile page and is sent together with the link when users share the bot + ShareText string `json:"share_text"` + // The text shown in the chat with the bot if the chat is empty + Description string `json:"description"` + // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown + MenuButton *BotMenuButton `json:"menu_button"` + // List of the bot commands + Commands []*BotCommand `json:"commands"` + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` +} + +func (entity *BotInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BotInfo) GetClass() string { + return ClassBotInfo +} + +func (*BotInfo) GetType() string { + return TypeBotInfo +} + // Contains full information about a user type UserFullInfo struct { meta @@ -4339,14 +4702,10 @@ type UserFullInfo struct { NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` // A short user bio Bio string `json:"bio"` - // For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot - ShareText string `json:"share_text"` - // For bots, the text shown in the chat with the bot if the chat is empty - Description string `json:"description"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // For bots, list of the bot commands - Commands []*BotCommand `json:"commands"` + // For bots, information about the bot; may be null + BotInfo *BotInfo `json:"bot_info"` } func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { @@ -4368,7 +4727,7 @@ func (*UserFullInfo) GetType() string { // Represents a list of users type Users struct { meta - // Approximate total count of users found + // Approximate total number of users found TotalCount int32 `json:"total_count"` // A list of user identifiers UserIds []int64 `json:"user_ids"` @@ -4440,43 +4799,6 @@ func (*ChatAdministrators) GetType() string { return TypeChatAdministrators } -// 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, locations, and venues - CanSendMessages bool `json:"can_send_messages"` - // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions - CanSendMediaMessages bool `json:"can_send_media_messages"` - // True, if the user can send polls. Implies can_send_messages permissions - CanSendPolls bool `json:"can_send_polls"` - // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions - CanSendOtherMessages bool `json:"can_send_other_messages"` - // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions - CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` - // True, if the user can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the user can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the user can pin messages - CanPinMessages bool `json:"can_pin_messages"` -} - -func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPermissions - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPermissions) GetClass() string { - return ClassChatPermissions -} - -func (*ChatPermissions) GetType() string { - return TypeChatPermissions -} - // The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta @@ -4515,28 +4837,8 @@ type ChatMemberStatusAdministrator struct { CustomTitle string `json:"custom_title"` // True, if the current user can edit the administrator privileges for the called user CanBeEdited bool `json:"can_be_edited"` - // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only - CanManageChat bool `json:"can_manage_chat"` - // True, if the administrator can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts; applicable to channels only - CanPostMessages bool `json:"can_post_messages"` - // True, if the administrator can edit messages of other users and pin messages; applicable to channels only - CanEditMessages bool `json:"can_edit_messages"` - // True, if the administrator can delete messages of other users - CanDeleteMessages bool `json:"can_delete_messages"` - // True, if the administrator can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members; always true for channels - CanRestrictMembers bool `json:"can_restrict_members"` - // True, if the administrator can pin messages; applicable to basic groups and supergroups only - CanPinMessages bool `json:"can_pin_messages"` - // 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 manage video chats - CanManageVideoChats bool `json:"can_manage_video_chats"` - // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only - IsAnonymous bool `json:"is_anonymous"` + // Rights of the administrator + Rights *ChatAdministratorRights `json:"rights"` } func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { @@ -4724,7 +5026,7 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { // Contains a list of chat members type ChatMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` // A list of chat members Members []*ChatMember `json:"members"` @@ -5149,7 +5451,7 @@ type ChatInviteLink struct { // Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown EditDate int32 `json:"edit_date"` // Point in time (Unix timestamp) when the link will expire; 0 if never - ExpireDate int32 `json:"expire_date"` + ExpirationDate int32 `json:"expiration_date"` // The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval MemberLimit int32 `json:"member_limit"` // Number of chat members, which joined the chat using the link @@ -5158,7 +5460,7 @@ type ChatInviteLink struct { PendingJoinRequestCount int32 `json:"pending_join_request_count"` // True, if the link only creates join request. If true, total number of joining members will be unlimited CreatesJoinRequest bool `json:"creates_join_request"` - // True, if the link is primary. Primary invite link can't have name, expire date or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time + // True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time IsPrimary bool `json:"is_primary"` // True, if the link was revoked IsRevoked bool `json:"is_revoked"` @@ -5183,7 +5485,7 @@ func (*ChatInviteLink) GetType() string { // Contains a list of chat invite links type ChatInviteLinks struct { meta - // Approximate total count of chat invite links found + // Approximate total number of chat invite links found TotalCount int32 `json:"total_count"` // List of invite links InviteLinks []*ChatInviteLink `json:"invite_links"` @@ -5255,7 +5557,7 @@ func (*ChatInviteLinkCounts) GetType() string { return TypeChatInviteLinkCounts } -// Describes a chat member joined a chat by an invite link +// Describes a chat member joined a chat via an invite link type ChatInviteLinkMember struct { meta // User identifier @@ -5282,12 +5584,12 @@ func (*ChatInviteLinkMember) GetType() string { return TypeChatInviteLinkMember } -// Contains a list of chat members joined a chat by an invite link +// Contains a list of chat members joined a chat via an invite link type ChatInviteLinkMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` - // List of chat members, joined a chat by an invite link + // List of chat members, joined a chat via an invite link Members []*ChatInviteLinkMember `json:"members"` } @@ -5410,10 +5712,10 @@ func (*ChatJoinRequest) GetType() string { return TypeChatJoinRequest } -// Contains a list of chat join requests +// Contains a list of requests to join a chat type ChatJoinRequests struct { meta - // Approximate total count of requests found + // Approximate total number of requests found TotalCount int32 `json:"total_count"` // List of the requests Requests []*ChatJoinRequest `json:"requests"` @@ -5435,12 +5737,12 @@ func (*ChatJoinRequests) GetType() string { return TypeChatJoinRequests } -// Contains information about pending chat join requests +// Contains information about pending join requests for a chat type ChatJoinRequestsInfo struct { meta // Total number of pending join requests TotalCount int32 `json:"total_count"` - // Identifiers of users sent the newest pending join requests + // Identifiers of at most 3 users sent the newest pending join requests UserIds []int64 `json:"user_ids"` } @@ -5560,7 +5862,7 @@ type Supergroup struct { Date int32 `json:"date"` // Status of the current user in the supergroup or channel; custom title will be always empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules MemberCount int32 `json:"member_count"` // True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel HasLinkedChat bool `json:"has_linked_chat"` @@ -5572,7 +5874,7 @@ type Supergroup struct { IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` // True, if the supergroup is a channel 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 number of members + // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members IsBroadcastGroup bool `json:"is_broadcast_group"` // True, if the supergroup or channel is verified IsVerified bool `json:"is_verified"` @@ -5682,7 +5984,7 @@ type SupergroupFullInfo struct { StickerSetId JsonInt64 `json:"sticker_set_id"` // Location to which the supergroup is connected; may be null Location *ChatLocation `json:"location"` - // Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only + // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group BotCommands []*BotCommands `json:"bot_commands"` @@ -5900,7 +6202,7 @@ func (*MessageSenderChat) MessageSenderType() string { // Represents a list of message senders type MessageSenders struct { meta - // Approximate total count of messages senders found + // Approximate total number of messages senders found TotalCount int32 `json:"total_count"` // List of message senders Senders []MessageSender `json:"senders"` @@ -5968,12 +6270,12 @@ func (*MessageForwardOriginUser) MessageForwardOriginType() string { return TypeMessageForwardOriginUser } -// The message was originally sent by an anonymous chat administrator on behalf of the chat +// The message was originally sent on behalf of a chat type MessageForwardOriginChat struct { meta // Identifier of the chat that originally sent the message SenderChatId int64 `json:"sender_chat_id"` - // Original message author signature + // For messages originally sent by an anonymous chat administrator, original message author signature AuthorSignature string `json:"author_signature"` } @@ -6143,7 +6445,7 @@ type MessageReplyInfo struct { meta // Number of times the message was directly or indirectly replied ReplyCount int32 `json:"reply_count"` - // Identifiers of recent repliers to the message; available in channels with a discussion supergroup + // Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available RecentReplierIds []MessageSender `json:"recent_replier_ids"` // Identifier of the last read incoming reply to the message LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` @@ -6194,6 +6496,58 @@ func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a reaction to a message +type MessageReaction struct { + meta + // Text representation of the reaction + Reaction string `json:"reaction"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if the reaction is chosen by the current user + IsChosen bool `json:"is_chosen"` + // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats + RecentSenderIds []MessageSender `json:"recent_sender_ids"` +} + +func (entity *MessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReaction) GetClass() string { + return ClassMessageReaction +} + +func (*MessageReaction) GetType() string { + return TypeMessageReaction +} + +func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Reaction string `json:"reaction"` + TotalCount int32 `json:"total_count"` + IsChosen bool `json:"is_chosen"` + RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReaction.Reaction = tmp.Reaction + messageReaction.TotalCount = tmp.TotalCount + messageReaction.IsChosen = tmp.IsChosen + + fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) + messageReaction.RecentSenderIds = fieldRecentSenderIds + + return nil +} + // Contains information about interactions with a message type MessageInteractionInfo struct { meta @@ -6203,6 +6557,8 @@ type MessageInteractionInfo struct { ForwardCount int32 `json:"forward_count"` // Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself ReplyInfo *MessageReplyInfo `json:"reply_info"` + // The list of reactions added to the message + Reactions []*MessageReaction `json:"reactions"` } func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { @@ -6221,6 +6577,54 @@ func (*MessageInteractionInfo) GetType() string { return TypeMessageInteractionInfo } +// Contains information about an unread reaction to a message +type UnreadReaction struct { + meta + // Text representation of the reaction + Reaction string `json:"reaction"` + // Identifier of the sender, added the reaction + SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added with a big animation + IsBig bool `json:"is_big"` +} + +func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UnreadReaction) GetClass() string { + return ClassUnreadReaction +} + +func (*UnreadReaction) GetType() string { + return TypeUnreadReaction +} + +func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Reaction string `json:"reaction"` + SenderId json.RawMessage `json:"sender_id"` + IsBig bool `json:"is_big"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + unreadReaction.Reaction = tmp.Reaction + unreadReaction.IsBig = tmp.IsBig + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + unreadReaction.SenderId = fieldSenderId + + return nil +} + // The message is being sent now, but has not yet been delivered to the server type MessageSendingStatePending struct { meta @@ -6308,13 +6712,15 @@ type Message struct { CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the message statistics are available + // True, if the list of added reactions is available through getMessageAddedReactions + CanGetAddedReactions bool `json:"can_get_added_reactions"` + // True, if the message statistics are available through getMessageStatistics CanGetStatistics bool `json:"can_get_statistics"` - // True, if the message thread info is available + // True, if information about the message thread is available through getMessageThread CanGetMessageThread bool `json:"can_get_message_thread"` // True, if chat members already viewed the message can be received through getMessageViewers CanGetViewers bool `json:"can_get_viewers"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` @@ -6330,6 +6736,8 @@ type Message struct { ForwardInfo *MessageForwardInfo `json:"forward_info"` // Information about interactions with the message; may be null InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + // Information about unread reactions added to the message + UnreadReactions []*UnreadReaction `json:"unread_reactions"` // If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id ReplyInChatId int64 `json:"reply_in_chat_id"` // If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message @@ -6384,6 +6792,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { CanBeSaved bool `json:"can_be_saved"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` + CanGetAddedReactions bool `json:"can_get_added_reactions"` CanGetStatistics bool `json:"can_get_statistics"` CanGetMessageThread bool `json:"can_get_message_thread"` CanGetViewers bool `json:"can_get_viewers"` @@ -6395,6 +6804,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { EditDate int32 `json:"edit_date"` ForwardInfo *MessageForwardInfo `json:"forward_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + UnreadReactions []*UnreadReaction `json:"unread_reactions"` ReplyInChatId int64 `json:"reply_in_chat_id"` ReplyToMessageId int64 `json:"reply_to_message_id"` MessageThreadId int64 `json:"message_thread_id"` @@ -6422,6 +6832,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers + message.CanGetAddedReactions = tmp.CanGetAddedReactions message.CanGetStatistics = tmp.CanGetStatistics message.CanGetMessageThread = tmp.CanGetMessageThread message.CanGetViewers = tmp.CanGetViewers @@ -6433,6 +6844,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo message.InteractionInfo = tmp.InteractionInfo + message.UnreadReactions = tmp.UnreadReactions message.ReplyInChatId = tmp.ReplyInChatId message.ReplyToMessageId = tmp.ReplyToMessageId message.MessageThreadId = tmp.MessageThreadId @@ -6464,7 +6876,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { // Contains a list of messages type Messages struct { meta - // Approximate total count of messages found + // Approximate total number of messages found TotalCount int32 `json:"total_count"` // List of messages; messages may be null Messages []*Message `json:"messages"` @@ -6489,7 +6901,7 @@ func (*Messages) GetType() string { // Contains a list of messages found by a search type FoundMessages struct { meta - // Approximate total count of messages found; -1 if unknown + // Approximate total number of messages found; -1 if unknown TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` @@ -6543,7 +6955,7 @@ func (*MessagePosition) GetType() string { // Contains a list of message positions type MessagePositions struct { meta - // Total count of messages found + // Total number of messages found TotalCount int32 `json:"total_count"` // List of message positions Positions []*MessagePosition `json:"positions"` @@ -6565,12 +6977,12 @@ func (*MessagePositions) GetType() string { return TypeMessagePositions } -// Contains information about found messages sent in a specific day +// Contains information about found messages sent on a specific day type MessageCalendarDay struct { meta - // Total number of found messages sent in the day + // Total number of found messages sent on the day TotalCount int32 `json:"total_count"` - // First message sent in the day + // First message sent on the day Message *Message `json:"message"` } @@ -6590,7 +7002,7 @@ func (*MessageCalendarDay) GetType() string { return TypeMessageCalendarDay } -// Contains information about found messages, splitted by days according to the option "utc_time_offset" +// Contains information about found messages, split by days according to the option "utc_time_offset" type MessageCalendar struct { meta // Total number of found messages @@ -6618,13 +7030,15 @@ func (*MessageCalendar) GetType() string { // Describes a sponsored message type SponsoredMessage struct { meta - // Unique sponsored message identifier - Id int32 `json:"id"` - // Chat identifier + // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages + MessageId int64 `json:"message_id"` + // Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link SponsorChatId int64 `json:"sponsor_chat_id"` - // An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead + // Information about the sponsor chat; may be null unless sponsor_chat_id == 0 + SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` + // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead Link InternalLinkType `json:"link"` - // Content of the message + // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` } @@ -6646,10 +7060,11 @@ func (*SponsoredMessage) GetType() string { func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` - SponsorChatId int64 `json:"sponsor_chat_id"` - Link json.RawMessage `json:"link"` - Content json.RawMessage `json:"content"` + MessageId int64 `json:"message_id"` + SponsorChatId int64 `json:"sponsor_chat_id"` + SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` + Link json.RawMessage `json:"link"` + Content json.RawMessage `json:"content"` } err := json.Unmarshal(data, &tmp) @@ -6657,8 +7072,9 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { return err } - sponsoredMessage.Id = tmp.Id + sponsoredMessage.MessageId = tmp.MessageId sponsoredMessage.SponsorChatId = tmp.SponsorChatId + sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) sponsoredMessage.Link = fieldLink @@ -6669,27 +7085,89 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { return nil } -// Contains a list of sponsored messages -type SponsoredMessages struct { +// Describes a file added to file download list +type FileDownload struct { meta - // List of sponsored messages - Messages []*SponsoredMessage `json:"messages"` + // File identifier + FileId int32 `json:"file_id"` + // The message with the file + Message *Message `json:"message"` + // Point in time (Unix timestamp) when the file was added to the download list + AddDate int32 `json:"add_date"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` } -func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) { +func (entity *FileDownload) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SponsoredMessages + type stub FileDownload return json.Marshal((*stub)(entity)) } -func (*SponsoredMessages) GetClass() string { - return ClassSponsoredMessages +func (*FileDownload) GetClass() string { + return ClassFileDownload } -func (*SponsoredMessages) GetType() string { - return TypeSponsoredMessages +func (*FileDownload) GetType() string { + return TypeFileDownload +} + +// Contains number of being downloaded and recently downloaded files found +type DownloadedFileCounts struct { + meta + // Number of active file downloads found, including paused + ActiveCount int32 `json:"active_count"` + // Number of paused file downloads found + PausedCount int32 `json:"paused_count"` + // Number of completed file downloads found + CompletedCount int32 `json:"completed_count"` +} + +func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DownloadedFileCounts + + return json.Marshal((*stub)(entity)) +} + +func (*DownloadedFileCounts) GetClass() string { + return ClassDownloadedFileCounts +} + +func (*DownloadedFileCounts) GetType() string { + return TypeDownloadedFileCounts +} + +// Contains a list of downloaded files, found by a search +type FoundFileDownloads struct { + meta + // Total number of suitable files, ignoring offset + TotalCounts *DownloadedFileCounts `json:"total_counts"` + // The list of files + Files []*FileDownload `json:"files"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*FoundFileDownloads) GetClass() string { + return ClassFoundFileDownloads +} + +func (*FoundFileDownloads) GetType() string { + return TypeFoundFileDownloads } // Notification settings applied to all private and secret chats when the corresponding chat setting has a default value @@ -6717,7 +7195,7 @@ func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopePrivateChats } -// Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value type NotificationSettingsScopeGroupChats struct { meta } @@ -6742,7 +7220,7 @@ func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() stri return TypeNotificationSettingsScopeGroupChats } -// Notification settings applied to all channels when the corresponding chat setting has a default value +// Notification settings applied to all channel chats when the corresponding chat setting has a default value type NotificationSettingsScopeChannelChats struct { meta } @@ -6774,10 +7252,10 @@ type ChatNotificationSettings struct { UseDefaultMuteFor bool `json:"use_default_mute_for"` // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // If true, sound is ignored and the value for the relevant type of chat is used instead + // If true, the value for the relevant type of chat is used instead of sound_id UseDefaultSound bool `json:"use_default_sound"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` // If true, show_preview is ignored and the value for the relevant type of chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications @@ -6813,8 +7291,8 @@ type ScopeNotificationSettings struct { meta // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message @@ -6842,7 +7320,7 @@ func (*ScopeNotificationSettings) GetType() string { // Contains information about a message draft type DraftMessage struct { meta - // Identifier of the message to reply to; 0 if none + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` @@ -7004,7 +7482,7 @@ type ChatFilter struct { meta // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter + // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter IconName string `json:"icon_name"` // The chat identifiers of pinned chats in the filtered chat list PinnedChatIds []int64 `json:"pinned_chat_ids"` @@ -7053,7 +7531,7 @@ type ChatFilterInfo struct { Id int32 `json:"id"` // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" + // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" IconName string `json:"icon_name"` } @@ -7410,8 +7888,8 @@ type Chat struct { LastMessage *Message `json:"last_message"` // Positions of the chat in chat lists Positions []*ChatPosition `json:"positions"` - // Default identifier of a user or chat that is chosen to send messages in the chat; may be null if the user can't change message sender - DefaultMessageSenderId MessageSender `json:"default_message_sender_id"` + // Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender + MessageSenderId MessageSender `json:"message_sender_id"` // True, if chat content can't be saved locally, forwarded, or copied HasProtectedContent bool `json:"has_protected_content"` // True, if the chat is marked as unread @@ -7436,10 +7914,14 @@ type Chat struct { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` // Number of unread messages with a mention/reply in the chat UnreadMentionCount int32 `json:"unread_mention_count"` - // Notification settings for this chat + // Number of messages with unread reactions in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // List of reactions, available in the chat + AvailableReactions []string `json:"available_reactions"` // Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats - MessageTtlSetting int32 `json:"message_ttl_setting"` + MessageTtl int32 `json:"message_ttl"` // If non-empty, name of a theme, set for the chat ThemeName string `json:"theme_name"` // Information about actions which must be possible to do through the chat action bar; may be null @@ -7481,7 +7963,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Permissions *ChatPermissions `json:"permissions"` LastMessage *Message `json:"last_message"` Positions []*ChatPosition `json:"positions"` - DefaultMessageSenderId json.RawMessage `json:"default_message_sender_id"` + MessageSenderId json.RawMessage `json:"message_sender_id"` HasProtectedContent bool `json:"has_protected_content"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` IsBlocked bool `json:"is_blocked"` @@ -7494,8 +7976,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` + UnreadReactionCount int32 `json:"unread_reaction_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - MessageTtlSetting int32 `json:"message_ttl_setting"` + AvailableReactions []string `json:"available_reactions"` + MessageTtl int32 `json:"message_ttl"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -7528,8 +8012,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount + chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings - chat.MessageTtlSetting = tmp.MessageTtlSetting + chat.AvailableReactions = tmp.AvailableReactions + chat.MessageTtl = tmp.MessageTtl chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -7540,8 +8026,8 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldType, _ := UnmarshalChatType(tmp.Type) chat.Type = fieldType - fieldDefaultMessageSenderId, _ := UnmarshalMessageSender(tmp.DefaultMessageSenderId) - chat.DefaultMessageSenderId = fieldDefaultMessageSenderId + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + chat.MessageSenderId = fieldMessageSenderId fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -7552,7 +8038,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { // Represents a list of chats type Chats struct { meta - // Approximate total count of chats found + // Approximate total number of chats found TotalCount int32 `json:"total_count"` // List of chat identifiers ChatIds []int64 `json:"chat_ids"` @@ -7965,6 +8451,33 @@ func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestPoll } +// A button that opens a web app by calling getWebAppUrl +type KeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeWebApp) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeWebApp) GetType() string { + return TypeKeyboardButtonTypeWebApp +} + +func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeWebApp +} + // Represents a single button in a bot keyboard type KeyboardButton struct { meta @@ -8036,10 +8549,10 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically authorize the current user if allowed to do so +// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo type InlineKeyboardButtonTypeLoginUrl struct { meta - // An HTTP URL to open + // An HTTP URL to pass to getLoginUrlInfo Url string `json:"url"` // Unique button identifier Id int64 `json:"id"` @@ -8067,6 +8580,33 @@ func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeLoginUrl } +// A button that opens a web app by calling openWebApp +type InlineKeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to openWebApp + Url string `json:"url"` +} + +func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeWebApp) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeWebApp) GetType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + +func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + // A button that sends a callback query to a bot type InlineKeyboardButtonTypeCallback struct { meta @@ -8200,7 +8740,7 @@ func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeBuy } -// A button to open a chat with a user +// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities type InlineKeyboardButtonTypeUser struct { meta // User identifier @@ -8451,6 +8991,31 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { return TypeLoginUrlInfoRequestConfirmation } +// 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 a message thread type MessageThreadInfo struct { meta @@ -10522,7 +11087,7 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` - // Chat username, by which all other information about the chat can be resolved + // Chat username by which all other information about the chat can be resolved Username string `json:"username"` } @@ -10746,7 +11311,7 @@ type WebPageInstantView struct { PageBlocks []PageBlock `json:"page_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 + // Version of the instant view; currently, can be 1 or 2 Version int32 `json:"version"` // True, if the instant view must be shown from right to left IsRtl bool `json:"is_rtl"` @@ -10834,7 +11399,7 @@ type WebPage struct { Animation *Animation `json:"animation"` // Preview of the content as an audio file, if available; may be null Audio *Audio `json:"audio"` - // Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null + // Preview of the content as a document, if available; may be null Document *Document `json:"document"` // Preview of the content as a sticker for small WEBP files, if available; may be null Sticker *Sticker `json:"sticker"` @@ -10844,7 +11409,7 @@ type WebPage struct { VideoNote *VideoNote `json:"video_note"` // Preview of the content as a voice note, if available; may be null VoiceNote *VoiceNote `json:"voice_note"` - // Version of instant view, available for the web page (currently can be 1 or 2), 0 if none + // Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none InstantViewVersion int32 `json:"instant_view_version"` } @@ -11028,6 +11593,39 @@ func (*Address) GetType() string { return TypeAddress } +// Contains parameters of the app theme +type ThemeParameters struct { + meta + // A color of the background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // A color of hints in the RGB24 format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB24 format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB24 format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB24 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 +} + // Portion of the price of a product (e.g., "delivery cost", "tax amount") type LabeledPricePart struct { meta @@ -11318,39 +11916,6 @@ func (*PaymentsProviderStripe) GetType() string { return TypePaymentsProviderStripe } -// Theme colors for a payment form -type PaymentFormTheme struct { - meta - // A color of the payment form background in the RGB24 format - BackgroundColor int32 `json:"background_color"` - // A color of text in the RGB24 format - TextColor int32 `json:"text_color"` - // A color of hints in the RGB24 format - HintColor int32 `json:"hint_color"` - // A color of links in the RGB24 format - LinkColor int32 `json:"link_color"` - // A color of the buttons in the RGB24 format - ButtonColor int32 `json:"button_color"` - // A color of text on the buttons in the RGB24 format - ButtonTextColor int32 `json:"button_text_color"` -} - -func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentFormTheme - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentFormTheme) GetClass() string { - return ClassPaymentFormTheme -} - -func (*PaymentFormTheme) GetType() string { - return TypePaymentFormTheme -} - // Contains information about an invoice payment form type PaymentForm struct { meta @@ -14556,7 +15121,7 @@ func (*MessageChatAddMembers) MessageContentType() string { return TypeMessageChatAddMembers } -// A new member joined the chat by invite link +// A new member joined the chat via an invite link type MessageChatJoinByLink struct { meta } @@ -14771,7 +15336,7 @@ func (*MessageChatSetTheme) MessageContentType() string { // The TTL (Time To Live) setting for messages in the chat has been changed type MessageChatSetTtl struct { meta - // New message TTL setting + // New message TTL Ttl int32 `json:"ttl"` } @@ -14977,7 +15542,63 @@ func (*MessageWebsiteConnected) MessageContentType() string { return TypeMessageWebsiteConnected } -// Telegram Passport data has been sent +// Data from a web app has been sent to a bot +type MessageWebAppDataSent struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the web app + ButtonText string `json:"button_text"` +} + +func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataSent + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataSent) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataSent) GetType() string { + return TypeMessageWebAppDataSent +} + +func (*MessageWebAppDataSent) MessageContentType() string { + return TypeMessageWebAppDataSent +} + +// Data from a web app has been received; for bots only +type MessageWebAppDataReceived struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the web app + ButtonText string `json:"button_text"` + // Received data + Data string `json:"data"` +} + +func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataReceived + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataReceived) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataReceived) GetType() string { + return TypeMessageWebAppDataReceived +} + +func (*MessageWebAppDataReceived) MessageContentType() string { + return TypeMessageWebAppDataReceived +} + +// Telegram Passport data has been sent to a bot type MessagePassportDataSent struct { meta // List of Telegram Passport element types sent @@ -15428,6 +16049,31 @@ func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { return TypeTextEntityTypeStrikethrough } +// A spoiler text. Not supported in secret chats +type TextEntityTypeSpoiler struct { + meta +} + +func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeSpoiler + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeSpoiler) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeSpoiler) GetType() string { + return TypeTextEntityTypeSpoiler +} + +func (*TextEntityTypeSpoiler) TextEntityTypeType() string { + return TypeTextEntityTypeSpoiler +} + // Text that must be formatted as if inside a code HTML tag type TextEntityTypeCode struct { meta @@ -15693,6 +16339,8 @@ type MessageSendOptions struct { DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` + // Pass true if the content of the message must be protected from forwarding and saving; for bots only + ProtectContent bool `json:"protect_content"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` } @@ -15717,6 +16365,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { DisableNotification bool `json:"disable_notification"` FromBackground bool `json:"from_background"` + ProtectContent bool `json:"protect_content"` SchedulingState json.RawMessage `json:"scheduling_state"` } @@ -15727,6 +16376,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground + messageSendOptions.ProtectContent = tmp.ProtectContent fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) messageSendOptions.SchedulingState = fieldSchedulingState @@ -15764,7 +16414,7 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` // True, if rich web page previews for URLs in the message text must be disabled DisableWebPagePreview bool `json:"disable_web_page_preview"` @@ -16565,7 +17215,7 @@ type InputMessageForwarded struct { MessageId int64 `json:"message_id"` // True, if a game message is being shared from a launched game; applies only to game messages InGameShare bool `json:"in_game_share"` - // Options to be used to copy content of the message without reference to the original sender; pass null to try to forward the message as usual + // Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual CopyOptions *MessageCopyOptions `json:"copy_options"` } @@ -16839,56 +17489,6 @@ func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string { return TypeSearchMessagesFilterChatPhoto } -// Returns only call messages -type SearchMessagesFilterCall struct { - meta -} - -func (entity *SearchMessagesFilterCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterCall - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterCall) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterCall) GetType() string { - return TypeSearchMessagesFilterCall -} - -func (*SearchMessagesFilterCall) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterCall -} - -// Returns only incoming call messages with missed/declined discard reasons -type SearchMessagesFilterMissedCall struct { - meta -} - -func (entity *SearchMessagesFilterMissedCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterMissedCall - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterMissedCall) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterMissedCall) GetType() string { - return TypeSearchMessagesFilterMissedCall -} - -func (*SearchMessagesFilterMissedCall) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterMissedCall -} - // Returns only video note messages type SearchMessagesFilterVideoNote struct { meta @@ -16989,6 +17589,31 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } +// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +type SearchMessagesFilterUnreadReaction struct { + meta +} + +func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadReaction) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadReaction) GetType() string { + return TypeSearchMessagesFilterUnreadReaction +} + +func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadReaction +} + // Returns only failed to send messages. This filter can be used only if the message database is used type SearchMessagesFilterFailedToSend struct { meta @@ -17635,7 +18260,7 @@ type StickerSet struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17645,10 +18270,8 @@ type StickerSet struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -17673,6 +18296,45 @@ func (*StickerSet) GetType() string { return TypeStickerSet } +func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerType json.RawMessage `json:"sticker_type"` + IsViewed bool `json:"is_viewed"` + Stickers []*Sticker `json:"stickers"` + Emojis []*Emojis `json:"emojis"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSet.Id = tmp.Id + stickerSet.Title = tmp.Title + stickerSet.Name = tmp.Name + stickerSet.Thumbnail = tmp.Thumbnail + stickerSet.ThumbnailOutline = tmp.ThumbnailOutline + stickerSet.IsInstalled = tmp.IsInstalled + stickerSet.IsArchived = tmp.IsArchived + stickerSet.IsOfficial = tmp.IsOfficial + stickerSet.IsViewed = tmp.IsViewed + stickerSet.Stickers = tmp.Stickers + stickerSet.Emojis = tmp.Emojis + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSet.StickerType = fieldStickerType + + return nil +} + // Represents short information about a sticker set type StickerSetInfo struct { meta @@ -17682,7 +18344,7 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17692,10 +18354,8 @@ type StickerSetInfo struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -17720,6 +18380,45 @@ func (*StickerSetInfo) GetType() string { return TypeStickerSetInfo } +func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerType json.RawMessage `json:"sticker_type"` + IsViewed bool `json:"is_viewed"` + Size int32 `json:"size"` + Covers []*Sticker `json:"covers"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSetInfo.Id = tmp.Id + stickerSetInfo.Title = tmp.Title + stickerSetInfo.Name = tmp.Name + stickerSetInfo.Thumbnail = tmp.Thumbnail + stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline + stickerSetInfo.IsInstalled = tmp.IsInstalled + stickerSetInfo.IsArchived = tmp.IsArchived + stickerSetInfo.IsOfficial = tmp.IsOfficial + stickerSetInfo.IsViewed = tmp.IsViewed + stickerSetInfo.Size = tmp.Size + stickerSetInfo.Covers = tmp.Covers + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSetInfo.StickerType = fieldStickerType + + return nil +} + // Represents a list of sticker sets type StickerSets struct { meta @@ -18333,6 +19032,81 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } +// Describes an available stream in a group call +type GroupCallStream struct { + meta + // Identifier of an audio/video channel + ChannelId int32 `json:"channel_id"` + // Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds + Scale int32 `json:"scale"` + // Point in time when the stream currently ends; Unix timestamp in milliseconds + TimeOffset int64 `json:"time_offset"` +} + +func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStream + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStream) GetClass() string { + return ClassGroupCallStream +} + +func (*GroupCallStream) GetType() string { + return TypeGroupCallStream +} + +// Represents a list of group call streams +type GroupCallStreams struct { + meta + // A list of group call streams + Streams []*GroupCallStream `json:"streams"` +} + +func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStreams + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStreams) GetClass() string { + return ClassGroupCallStreams +} + +func (*GroupCallStreams) GetType() string { + return TypeGroupCallStreams +} + +// Represents an RTMP url +type RtmpUrl struct { + meta + // The URL + Url string `json:"url"` + // Stream key + StreamKey string `json:"stream_key"` +} + +func (entity *RtmpUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RtmpUrl + + return json.Marshal((*stub)(entity)) +} + +func (*RtmpUrl) GetClass() string { + return ClassRtmpUrl +} + +func (*RtmpUrl) GetType() string { + return TypeRtmpUrl +} + // Describes a recently speaking participant in a group call type GroupCallRecentSpeaker struct { meta @@ -18390,6 +19164,8 @@ type GroupCall struct { EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active IsActive bool `json:"is_active"` + // True, if the chat is an RTMP stream instead of an ordinary video chat + IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` // True, if user was kicked from the call because of network loss and the call needs to be rejoined @@ -18398,9 +19174,11 @@ type GroupCall struct { CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` + // True, if group call participants, which are muted, aren't returned in participant list + HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` - // Recently speaking users in the group call + // At most 3 recently speaking users in the group call RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` // True, if the current user's video is enabled IsMyVideoEnabled bool `json:"is_my_video_enabled"` @@ -18888,7 +19666,7 @@ type PhoneNumberAuthenticationSettings struct { IsCurrentPhoneNumber bool `json:"is_current_phone_number"` // For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` - // List of authentication tokens, received in updateOption("authentication_token") in previously logged out sessions + // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions AuthenticationTokens []string `json:"authentication_tokens"` } @@ -18908,6 +19686,141 @@ func (*PhoneNumberAuthenticationSettings) GetType() string { return TypePhoneNumberAuthenticationSettings } +// Represents a reaction applied to a message +type AddedReaction struct { + meta + // Text representation of the reaction + Reaction string `json:"reaction"` + // Identifier of the chat member, applied the reaction + SenderId MessageSender `json:"sender_id"` +} + +func (entity *AddedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReaction) GetClass() string { + return ClassAddedReaction +} + +func (*AddedReaction) GetType() string { + return TypeAddedReaction +} + +func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Reaction string `json:"reaction"` + SenderId json.RawMessage `json:"sender_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + addedReaction.Reaction = tmp.Reaction + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + addedReaction.SenderId = fieldSenderId + + return nil +} + +// Represents a list of reactions added to a message +type AddedReactions struct { + meta + // The total number of found reactions + TotalCount int32 `json:"total_count"` + // The list of added reactions + Reactions []*AddedReaction `json:"reactions"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *AddedReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReactions) GetClass() string { + return ClassAddedReactions +} + +func (*AddedReactions) GetType() string { + return TypeAddedReactions +} + +// Represents a list of available reactions +type AvailableReactions struct { + meta + // List of reactions + Reactions []string `json:"reactions"` +} + +func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReactions) GetClass() string { + return ClassAvailableReactions +} + +func (*AvailableReactions) GetType() string { + return TypeAvailableReactions +} + +// Contains stickers which must be used for reaction animation rendering +type Reaction struct { + meta + // Text representation of the reaction + Reaction string `json:"reaction"` + // Reaction title + Title string `json:"title"` + // True, if the reaction can be added to new messages and enabled in chats + IsActive bool `json:"is_active"` + // Static icon for the reaction + StaticIcon *Sticker `json:"static_icon"` + // Appear animation for the reaction + AppearAnimation *Sticker `json:"appear_animation"` + // Select animation for the reaction + SelectAnimation *Sticker `json:"select_animation"` + // Activate animation for the reaction + ActivateAnimation *Sticker `json:"activate_animation"` + // Effect animation for the reaction + EffectAnimation *Sticker `json:"effect_animation"` + // Around animation for the reaction; may be null + AroundAnimation *Sticker `json:"around_animation"` + // Center animation for the reaction; may be null + CenterAnimation *Sticker `json:"center_animation"` +} + +func (entity *Reaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Reaction + + return json.Marshal((*stub)(entity)) +} + +func (*Reaction) GetClass() string { + return ClassReaction +} + +func (*Reaction) GetType() string { + return TypeReaction +} + // Represents a list of animations type Animations struct { meta @@ -19018,6 +19931,93 @@ func (*ImportedContacts) GetType() string { return TypeImportedContacts } +// Describes a color to highlight a bot added to attachment menu +type AttachmentMenuBotColor struct { + meta + // Color in the RGB24 format for light themes + LightColor int32 `json:"light_color"` + // Color in the RGB24 format for dark themes + DarkColor int32 `json:"dark_color"` +} + +func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBotColor + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBotColor) GetClass() string { + return ClassAttachmentMenuBotColor +} + +func (*AttachmentMenuBotColor) GetType() string { + return TypeAttachmentMenuBotColor +} + +// Represents a bot added to attachment menu +type AttachmentMenuBot struct { + meta + // User identifier of the bot added to attachment menu + BotUserId int64 `json:"bot_user_id"` + // Name for the bot in attachment menu + Name string `json:"name"` + // Color to highlight selected name of the bot if appropriate; may be null + NameColor *AttachmentMenuBotColor `json:"name_color"` + // Default attachment menu icon for the bot in SVG format; may be null + DefaultIcon *File `json:"default_icon"` + // Attachment menu icon for the bot in SVG format for the official iOS app; may be null + IosStaticIcon *File `json:"ios_static_icon"` + // Attachment menu icon for the bot in TGS format for the official iOS app; may be null + IosAnimatedIcon *File `json:"ios_animated_icon"` + // Attachment menu icon for the bot in TGS format for the official Android app; may be null + AndroidIcon *File `json:"android_icon"` + // Attachment menu icon for the bot in TGS format for the official native macOS app; may be null + MacosIcon *File `json:"macos_icon"` + // Color to highlight selected icon of the bot if appropriate; may be null + IconColor *AttachmentMenuBotColor `json:"icon_color"` +} + +func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBot) GetClass() string { + return ClassAttachmentMenuBot +} + +func (*AttachmentMenuBot) GetType() string { + return TypeAttachmentMenuBot +} + +// Information about the message sent by answerWebAppQuery +type SentWebAppMessage struct { + meta + // Identifier of the sent inline message, if known + InlineMessageId string `json:"inline_message_id"` +} + +func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SentWebAppMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SentWebAppMessage) GetClass() string { + return ClassSentWebAppMessage +} + +func (*SentWebAppMessage) GetType() string { + return TypeSentWebAppMessage +} + // Contains an HTTP URL type HttpUrl struct { meta @@ -19639,14 +20639,14 @@ func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(da return nil } -// Represents a link to a WEBP or TGS sticker +// Represents a link to a WEBP, TGS, or WEBM sticker type InputInlineQueryResultSticker struct { meta // Unique identifier of the query result Id string `json:"id"` // URL of the sticker thumbnail, if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) + // The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) StickerUrl string `json:"sticker_url"` // Width of the sticker StickerWidth int32 `json:"sticker_width"` @@ -20606,33 +21606,6 @@ func (*ChatEventMessageDeleted) ChatEventActionType() string { return TypeChatEventMessageDeleted } -// A poll in a message was stopped -type ChatEventPollStopped struct { - meta - // The message with the poll - Message *Message `json:"message"` -} - -func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPollStopped - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPollStopped) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPollStopped) GetType() string { - return TypeChatEventPollStopped -} - -func (*ChatEventPollStopped) ChatEventActionType() string { - return TypeChatEventPollStopped -} - // A message was pinned type ChatEventMessagePinned struct { meta @@ -20687,6 +21660,33 @@ func (*ChatEventMessageUnpinned) ChatEventActionType() string { return TypeChatEventMessageUnpinned } +// A poll in a message was stopped +type ChatEventPollStopped struct { + meta + // The message with the poll + Message *Message `json:"message"` +} + +func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPollStopped + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPollStopped) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPollStopped) GetType() string { + return TypeChatEventPollStopped +} + +func (*ChatEventPollStopped) ChatEventActionType() string { + return TypeChatEventPollStopped +} + // A new member joined the chat type ChatEventMemberJoined struct { meta @@ -20712,7 +21712,7 @@ func (*ChatEventMemberJoined) ChatEventActionType() string { return TypeChatEventMemberJoined } -// A new member joined the chat by an invite link +// A new member joined the chat via an invite link type ChatEventMemberJoinedByInviteLink struct { meta // Invite link used to join the chat @@ -20768,31 +21768,6 @@ func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { return TypeChatEventMemberJoinedByRequest } -// A member left the chat -type ChatEventMemberLeft struct { - meta -} - -func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberLeft) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberLeft) GetType() string { - return TypeChatEventMemberLeft -} - -func (*ChatEventMemberLeft) ChatEventActionType() string { - return TypeChatEventMemberLeft -} - // A new chat member was invited type ChatEventMemberInvited struct { meta @@ -20841,6 +21816,31 @@ func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) return nil } +// A member left the chat +type ChatEventMemberLeft struct { + meta +} + +func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberLeft) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberLeft) GetType() string { + return TypeChatEventMemberLeft +} + +func (*ChatEventMemberLeft) ChatEventActionType() string { + return TypeChatEventMemberLeft +} + // A chat member has gained/lost administrator status, or the list of their administrator privileges has changed type ChatEventMemberPromoted struct { meta @@ -20950,62 +21950,33 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [ return nil } -// The chat title was changed -type ChatEventTitleChanged struct { +// The chat available reactions were changed +type ChatEventAvailableReactionsChanged struct { meta - // Previous chat title - OldTitle string `json:"old_title"` - // New chat title - NewTitle string `json:"new_title"` + // Previous chat available reactions + OldAvailableReactions []string `json:"old_available_reactions"` + // New chat available reactions + NewAvailableReactions []string `json:"new_available_reactions"` } -func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventTitleChanged + type stub ChatEventAvailableReactionsChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventTitleChanged) GetClass() string { +func (*ChatEventAvailableReactionsChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventTitleChanged) GetType() string { - return TypeChatEventTitleChanged +func (*ChatEventAvailableReactionsChanged) GetType() string { + return TypeChatEventAvailableReactionsChanged } -func (*ChatEventTitleChanged) ChatEventActionType() string { - return TypeChatEventTitleChanged -} - -// The chat permissions was changed -type ChatEventPermissionsChanged struct { - meta - // Previous chat permissions - OldPermissions *ChatPermissions `json:"old_permissions"` - // New chat permissions - NewPermissions *ChatPermissions `json:"new_permissions"` -} - -func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPermissionsChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPermissionsChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPermissionsChanged) GetType() string { - return TypeChatEventPermissionsChanged -} - -func (*ChatEventPermissionsChanged) ChatEventActionType() string { - return TypeChatEventPermissionsChanged +func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { + return TypeChatEventAvailableReactionsChanged } // The chat description was changed @@ -21037,91 +22008,6 @@ func (*ChatEventDescriptionChanged) ChatEventActionType() string { return TypeChatEventDescriptionChanged } -// The chat username was changed -type ChatEventUsernameChanged struct { - meta - // Previous chat username - OldUsername string `json:"old_username"` - // New chat username - NewUsername string `json:"new_username"` -} - -func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventUsernameChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventUsernameChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventUsernameChanged) GetType() string { - return TypeChatEventUsernameChanged -} - -func (*ChatEventUsernameChanged) ChatEventActionType() string { - return TypeChatEventUsernameChanged -} - -// The chat photo was changed -type ChatEventPhotoChanged struct { - meta - // Previous chat photo value; may be null - OldPhoto *ChatPhoto `json:"old_photo"` - // New chat photo value; may be null - NewPhoto *ChatPhoto `json:"new_photo"` -} - -func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPhotoChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPhotoChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPhotoChanged) GetType() string { - return TypeChatEventPhotoChanged -} - -func (*ChatEventPhotoChanged) ChatEventActionType() string { - return TypeChatEventPhotoChanged -} - -// The can_invite_users permission of a supergroup chat was toggled -type ChatEventInvitesToggled struct { - meta - // New value of can_invite_users permission - CanInviteUsers bool `json:"can_invite_users"` -} - -func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInvitesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInvitesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInvitesToggled) GetType() string { - return TypeChatEventInvitesToggled -} - -func (*ChatEventInvitesToggled) ChatEventActionType() string { - return TypeChatEventInvitesToggled -} - // The linked chat of a supergroup was changed type ChatEventLinkedChatChanged struct { meta @@ -21151,147 +22037,6 @@ func (*ChatEventLinkedChatChanged) ChatEventActionType() string { return TypeChatEventLinkedChatChanged } -// The slow_mode_delay setting of a supergroup was changed -type ChatEventSlowModeDelayChanged struct { - meta - // Previous value of slow_mode_delay, in seconds - OldSlowModeDelay int32 `json:"old_slow_mode_delay"` - // New value of slow_mode_delay, in seconds - NewSlowModeDelay int32 `json:"new_slow_mode_delay"` -} - -func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSlowModeDelayChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSlowModeDelayChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSlowModeDelayChanged) GetType() string { - return TypeChatEventSlowModeDelayChanged -} - -func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { - return TypeChatEventSlowModeDelayChanged -} - -// The message TTL setting was changed -type ChatEventMessageTtlSettingChanged struct { - meta - // Previous value of message_ttl_setting - OldMessageTtlSetting int32 `json:"old_message_ttl_setting"` - // New value of message_ttl_setting - NewMessageTtlSetting int32 `json:"new_message_ttl_setting"` -} - -func (entity *ChatEventMessageTtlSettingChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageTtlSettingChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageTtlSettingChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageTtlSettingChanged) GetType() string { - return TypeChatEventMessageTtlSettingChanged -} - -func (*ChatEventMessageTtlSettingChanged) ChatEventActionType() string { - return TypeChatEventMessageTtlSettingChanged -} - -// The sign_messages setting of a channel was toggled -type ChatEventSignMessagesToggled struct { - meta - // New value of sign_messages - SignMessages bool `json:"sign_messages"` -} - -func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSignMessagesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSignMessagesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSignMessagesToggled) GetType() string { - return TypeChatEventSignMessagesToggled -} - -func (*ChatEventSignMessagesToggled) ChatEventActionType() string { - return TypeChatEventSignMessagesToggled -} - -// The has_protected_content setting of a channel was toggled -type ChatEventHasProtectedContentToggled struct { - meta - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` -} - -func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventHasProtectedContentToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventHasProtectedContentToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventHasProtectedContentToggled) GetType() string { - return TypeChatEventHasProtectedContentToggled -} - -func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { - return TypeChatEventHasProtectedContentToggled -} - -// The supergroup sticker set was changed -type ChatEventStickerSetChanged struct { - meta - // Previous identifier of the chat sticker set; 0 if none - OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` - // New identifier of the chat sticker set; 0 if none - NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` -} - -func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventStickerSetChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventStickerSetChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventStickerSetChanged) GetType() string { - return TypeChatEventStickerSetChanged -} - -func (*ChatEventStickerSetChanged) ChatEventActionType() string { - return TypeChatEventStickerSetChanged -} - // The supergroup location was changed type ChatEventLocationChanged struct { meta @@ -21321,6 +22066,263 @@ func (*ChatEventLocationChanged) ChatEventActionType() string { return TypeChatEventLocationChanged } +// The message TTL was changed +type ChatEventMessageTtlChanged struct { + meta + // Previous value of message_ttl + OldMessageTtl int32 `json:"old_message_ttl"` + // New value of message_ttl + NewMessageTtl int32 `json:"new_message_ttl"` +} + +func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageTtlChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageTtlChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageTtlChanged) GetType() string { + return TypeChatEventMessageTtlChanged +} + +func (*ChatEventMessageTtlChanged) ChatEventActionType() string { + return TypeChatEventMessageTtlChanged +} + +// The chat permissions was changed +type ChatEventPermissionsChanged struct { + meta + // Previous chat permissions + OldPermissions *ChatPermissions `json:"old_permissions"` + // New chat permissions + NewPermissions *ChatPermissions `json:"new_permissions"` +} + +func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPermissionsChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPermissionsChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPermissionsChanged) GetType() string { + return TypeChatEventPermissionsChanged +} + +func (*ChatEventPermissionsChanged) ChatEventActionType() string { + return TypeChatEventPermissionsChanged +} + +// The chat photo was changed +type ChatEventPhotoChanged struct { + meta + // Previous chat photo value; may be null + OldPhoto *ChatPhoto `json:"old_photo"` + // New chat photo value; may be null + NewPhoto *ChatPhoto `json:"new_photo"` +} + +func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPhotoChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPhotoChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPhotoChanged) GetType() string { + return TypeChatEventPhotoChanged +} + +func (*ChatEventPhotoChanged) ChatEventActionType() string { + return TypeChatEventPhotoChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + meta + // Previous value of slow_mode_delay, in seconds + OldSlowModeDelay int32 `json:"old_slow_mode_delay"` + // New value of slow_mode_delay, in seconds + NewSlowModeDelay int32 `json:"new_slow_mode_delay"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + +// The supergroup sticker set was changed +type ChatEventStickerSetChanged struct { + meta + // Previous identifier of the chat sticker set; 0 if none + OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` + // New identifier of the chat sticker set; 0 if none + NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` +} + +func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventStickerSetChanged) GetType() string { + return TypeChatEventStickerSetChanged +} + +func (*ChatEventStickerSetChanged) ChatEventActionType() string { + return TypeChatEventStickerSetChanged +} + +// The chat title was changed +type ChatEventTitleChanged struct { + meta + // Previous chat title + OldTitle string `json:"old_title"` + // New chat title + NewTitle string `json:"new_title"` +} + +func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventTitleChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventTitleChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventTitleChanged) GetType() string { + return TypeChatEventTitleChanged +} + +func (*ChatEventTitleChanged) ChatEventActionType() string { + return TypeChatEventTitleChanged +} + +// The chat username was changed +type ChatEventUsernameChanged struct { + meta + // Previous chat username + OldUsername string `json:"old_username"` + // New chat username + NewUsername string `json:"new_username"` +} + +func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventUsernameChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventUsernameChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventUsernameChanged) GetType() string { + return TypeChatEventUsernameChanged +} + +func (*ChatEventUsernameChanged) ChatEventActionType() string { + return TypeChatEventUsernameChanged +} + +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + +// The can_invite_users permission of a supergroup chat was toggled +type ChatEventInvitesToggled struct { + meta + // New value of can_invite_users permission + CanInviteUsers bool `json:"can_invite_users"` +} + +func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInvitesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInvitesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInvitesToggled) GetType() string { + return TypeChatEventInvitesToggled +} + +func (*ChatEventInvitesToggled) ChatEventActionType() string { + return TypeChatEventInvitesToggled +} + // The is_all_history_available setting of a supergroup was toggled type ChatEventIsAllHistoryAvailableToggled struct { meta @@ -21348,6 +22350,33 @@ func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { return TypeChatEventIsAllHistoryAvailableToggled } +// The sign_messages setting of a channel was toggled +type ChatEventSignMessagesToggled struct { + meta + // New value of sign_messages + SignMessages bool `json:"sign_messages"` +} + +func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSignMessagesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSignMessagesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSignMessagesToggled) GetType() string { + return TypeChatEventSignMessagesToggled +} + +func (*ChatEventSignMessagesToggled) ChatEventActionType() string { + return TypeChatEventSignMessagesToggled +} + // A chat invite link was edited type ChatEventInviteLinkEdited struct { meta @@ -21458,31 +22487,58 @@ func (*ChatEventVideoChatCreated) ChatEventActionType() string { return TypeChatEventVideoChatCreated } -// A video chat was discarded -type ChatEventVideoChatDiscarded struct { +// A video chat was ended +type ChatEventVideoChatEnded struct { meta // Identifier of the video chat. The video chat can be received through the method getGroupCall GroupCallId int32 `json:"group_call_id"` } -func (entity *ChatEventVideoChatDiscarded) MarshalJSON() ([]byte, error) { +func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventVideoChatDiscarded + type stub ChatEventVideoChatEnded return json.Marshal((*stub)(entity)) } -func (*ChatEventVideoChatDiscarded) GetClass() string { +func (*ChatEventVideoChatEnded) GetClass() string { return ClassChatEventAction } -func (*ChatEventVideoChatDiscarded) GetType() string { - return TypeChatEventVideoChatDiscarded +func (*ChatEventVideoChatEnded) GetType() string { + return TypeChatEventVideoChatEnded } -func (*ChatEventVideoChatDiscarded) ChatEventActionType() string { - return TypeChatEventVideoChatDiscarded +func (*ChatEventVideoChatEnded) ChatEventActionType() string { + return TypeChatEventVideoChatEnded +} + +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled } // A video chat participant was muted or unmuted @@ -21581,33 +22637,6 @@ func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatPartici return nil } -// The mute_new_participants setting of a video chat was toggled -type ChatEventVideoChatMuteNewParticipantsToggled struct { - meta - // New value of the mute_new_participants setting - MuteNewParticipants bool `json:"mute_new_participants"` -} - -func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatMuteNewParticipantsToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - // Represents a chat event type ChatEvent struct { meta @@ -21615,9 +22644,9 @@ type ChatEvent struct { Id JsonInt64 `json:"id"` // Point in time (Unix timestamp) when the event happened Date int32 `json:"date"` - // Identifier of the user who performed the action that triggered the event - UserId int64 `json:"user_id"` - // Action performed by the user + // Identifier of the user or chat who performed the action + MemberId MessageSender `json:"member_id"` + // The action Action ChatEventAction `json:"action"` } @@ -21639,10 +22668,10 @@ func (*ChatEvent) GetType() string { func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { var tmp struct { - Id JsonInt64 `json:"id"` - Date int32 `json:"date"` - UserId int64 `json:"user_id"` - Action json.RawMessage `json:"action"` + Id JsonInt64 `json:"id"` + Date int32 `json:"date"` + MemberId json.RawMessage `json:"member_id"` + Action json.RawMessage `json:"action"` } err := json.Unmarshal(data, &tmp) @@ -21652,7 +22681,9 @@ func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { chatEvent.Id = tmp.Id chatEvent.Date = tmp.Date - chatEvent.UserId = tmp.UserId + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatEvent.MemberId = fieldMemberId fieldAction, _ := UnmarshalChatEventAction(tmp.Action) chatEvent.Action = fieldAction @@ -21755,7 +22786,7 @@ func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { return TypeLanguagePackStringValueOrdinary } -// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info +// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information type LanguagePackStringValuePluralized struct { meta // Value for zero objects @@ -21895,7 +22926,7 @@ type LanguagePackInfo struct { Name string `json:"name"` // Name of the language in that language NativeName string `json:"native_name"` - // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info + // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information PluralCode string `json:"plural_code"` // True, if the language pack is official IsOfficial bool `json:"is_official"` @@ -21957,7 +22988,7 @@ func (*LocalizationTargetInfo) GetType() string { // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta - // Device registration token; may be empty to de-register a device + // Device registration token; may be empty to deregister a device Token string `json:"token"` // True, if push notifications must be additionally encrypted Encrypt bool `json:"encrypt"` @@ -21986,7 +23017,7 @@ func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string { // A token for Apple Push Notification service type DeviceTokenApplePush struct { meta - // Device token; may be empty to de-register a device + // Device token; may be empty to deregister a device DeviceToken string `json:"device_token"` // True, if App Sandbox is enabled IsAppSandbox bool `json:"is_app_sandbox"` @@ -22015,7 +23046,7 @@ func (*DeviceTokenApplePush) DeviceTokenType() string { // A token for Apple Push Notification service VoIP notifications type DeviceTokenApplePushVoIP struct { meta - // Device token; may be empty to de-register a device + // Device token; may be empty to deregister a device DeviceToken string `json:"device_token"` // True, if App Sandbox is enabled IsAppSandbox bool `json:"is_app_sandbox"` @@ -22046,7 +23077,7 @@ func (*DeviceTokenApplePushVoIP) DeviceTokenType() string { // A token for Windows Push Notification Services type DeviceTokenWindowsPush struct { meta - // The access token that will be used to send notifications; may be empty to de-register a device + // The access token that will be used to send notifications; may be empty to deregister a device AccessToken string `json:"access_token"` } @@ -22073,7 +23104,7 @@ func (*DeviceTokenWindowsPush) DeviceTokenType() string { // A token for Microsoft Push Notification Service type DeviceTokenMicrosoftPush struct { meta - // Push notification channel URI; may be empty to de-register a device + // Push notification channel URI; may be empty to deregister a device ChannelUri string `json:"channel_uri"` } @@ -22100,7 +23131,7 @@ func (*DeviceTokenMicrosoftPush) DeviceTokenType() string { // A token for Microsoft Push Notification Service VoIP channel type DeviceTokenMicrosoftPushVoIP struct { meta - // Push notification channel URI; may be empty to de-register a device + // Push notification channel URI; may be empty to deregister a device ChannelUri string `json:"channel_uri"` } @@ -22127,7 +23158,7 @@ func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string { // A token for web Push API type DeviceTokenWebPush struct { meta - // Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device + // Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device Endpoint string `json:"endpoint"` // Base64url-encoded P-256 elliptic curve Diffie-Hellman public key P256dhBase64url string `json:"p256dh_base64url"` @@ -22158,7 +23189,7 @@ func (*DeviceTokenWebPush) DeviceTokenType() string { // A token for Simple Push API for Firefox OS type DeviceTokenSimplePush struct { meta - // Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device + // Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device Endpoint string `json:"endpoint"` } @@ -22185,7 +23216,7 @@ func (*DeviceTokenSimplePush) DeviceTokenType() string { // A token for Ubuntu Push Client service type DeviceTokenUbuntuPush struct { meta - // Token; may be empty to de-register a device + // Token; may be empty to deregister a device Token string `json:"token"` } @@ -22212,7 +23243,7 @@ func (*DeviceTokenUbuntuPush) DeviceTokenType() string { // A token for BlackBerry Push Service type DeviceTokenBlackBerryPush struct { meta - // Token; may be empty to de-register a device + // Token; may be empty to deregister a device Token string `json:"token"` } @@ -22239,7 +23270,7 @@ func (*DeviceTokenBlackBerryPush) DeviceTokenType() string { // A token for Tizen Push Service type DeviceTokenTizenPush struct { meta - // Push service registration identifier; may be empty to de-register a device + // Push service registration identifier; may be empty to deregister a device RegId string `json:"reg_id"` } @@ -22937,7 +23968,7 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The user has too much chats with username, one of them must be made private first +// The user has too many chats with username, one of them must be made private first type CheckChatUsernameResultPublicChatsTooMuch struct { meta } @@ -23914,7 +24945,7 @@ func (*PushMessageContentChatDeleteMember) PushMessageContentType() string { return TypePushMessageContentChatDeleteMember } -// A new member joined the chat by invite link +// A new member joined the chat via an invite link type PushMessageContentChatJoinByLink struct { meta } @@ -24267,6 +25298,62 @@ func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string { return TypeNotificationGroupTypeCalls } +// Describes a notification sound in MP3 format +type NotificationSound struct { + meta + // Unique identifier of the notification sound + Id JsonInt64 `json:"id"` + // Duration of the sound, in seconds + Duration int32 `json:"duration"` + // Point in time (Unix timestamp) when the sound was created + Date int32 `json:"date"` + // Title of the notification sound + Title string `json:"title"` + // Arbitrary data, defined while the sound was uploaded + Data string `json:"data"` + // File containing the sound + Sound *File `json:"sound"` +} + +func (entity *NotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSound) GetClass() string { + return ClassNotificationSound +} + +func (*NotificationSound) GetType() string { + return TypeNotificationSound +} + +// Contains a list of notification sounds +type NotificationSounds struct { + meta + // A list of notification sounds + NotificationSounds []*NotificationSound `json:"notification_sounds"` +} + +func (entity *NotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSounds) GetClass() string { + return ClassNotificationSounds +} + +func (*NotificationSounds) GetType() string { + return TypeNotificationSounds +} + // Contains information about a notification type Notification struct { meta @@ -24274,8 +25361,8 @@ type Notification struct { Id int32 `json:"id"` // Notification date Date int32 `json:"date"` - // True, if the notification was initially silent - IsSilent bool `json:"is_silent"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` // Notification type Type NotificationType `json:"type"` } @@ -24298,10 +25385,10 @@ func (*Notification) GetType() string { func (notification *Notification) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` - Date int32 `json:"date"` - IsSilent bool `json:"is_silent"` - Type json.RawMessage `json:"type"` + Id int32 `json:"id"` + Date int32 `json:"date"` + SoundId JsonInt64 `json:"sound_id"` + Type json.RawMessage `json:"type"` } err := json.Unmarshal(data, &tmp) @@ -24311,7 +25398,7 @@ func (notification *Notification) UnmarshalJSON(data []byte) error { notification.Id = tmp.Id notification.Date = tmp.Date - notification.IsSilent = tmp.IsSilent + notification.SoundId = tmp.SoundId fieldType, _ := UnmarshalNotificationType(tmp.Type) notification.Type = fieldType @@ -25270,7 +26357,7 @@ type ConnectedWebsite struct { LastActiveDate int32 `json:"last_active_date"` // IP address from which the user was logged in, in human-readable format Ip string `json:"ip"` - // Human-readable description of a country and a region, from which the user was logged in, based on the IP address + // Human-readable description of a country and a region from which the user was logged in, based on the IP address Location string `json:"location"` } @@ -25488,6 +26575,56 @@ func (*ChatReportReasonFake) ChatReportReasonType() string { return TypeChatReportReasonFake } +// The chat has illegal drugs related content +type ChatReportReasonIllegalDrugs struct { + meta +} + +func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonIllegalDrugs + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonIllegalDrugs) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonIllegalDrugs) GetType() string { + return TypeChatReportReasonIllegalDrugs +} + +func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string { + return TypeChatReportReasonIllegalDrugs +} + +// The chat contains messages with personal details +type ChatReportReasonPersonalDetails struct { + meta +} + +func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonPersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonPersonalDetails) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonPersonalDetails) GetType() string { + return TypeChatReportReasonPersonalDetails +} + +func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string { + return TypeChatReportReasonPersonalDetails +} + // A custom reason provided by the user type ChatReportReasonCustom struct { meta @@ -25538,6 +26675,58 @@ func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { return TypeInternalLinkTypeActiveSessions } +// The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL +type InternalLinkTypeAttachmentMenuBot struct { + meta + // An internal link pointing to a chat; may be null if the current chat needs to be kept + ChatLink InternalLinkType `json:"chat_link"` + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeAttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeAttachmentMenuBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeAttachmentMenuBot) GetType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatLink json.RawMessage `json:"chat_link"` + BotUsername string `json:"bot_username"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername + internalLinkTypeAttachmentMenuBot.Url = tmp.Url + + fieldChatLink, _ := UnmarshalInternalLinkType(tmp.ChatLink) + internalLinkTypeAttachmentMenuBot.ChatLink = fieldChatLink + + return nil +} + // The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode type InternalLinkTypeAuthenticationCode struct { meta @@ -25621,13 +26810,15 @@ func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStart } -// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. type InternalLinkTypeBotStartInGroup struct { meta // Username of the bot BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` + // Expected administrator rights for the bot; may be null + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` } func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { @@ -25650,6 +26841,35 @@ func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStartInGroup } +// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights +type InternalLinkTypeBotAddToChannel struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // Expected administrator rights for the bot + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` +} + +func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotAddToChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotAddToChannel) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotAddToChannel) GetType() string { + return TypeInternalLinkTypeBotAddToChannel +} + +func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotAddToChannel +} + // The link is a link to the change phone number section of the app type InternalLinkTypeChangePhoneNumber struct { meta @@ -25783,6 +27003,31 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } +// The link is a link to the language settings section of the app +type InternalLinkTypeLanguageSettings struct { + meta +} + +func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeLanguageSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeLanguageSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeLanguageSettings) GetType() string { + return TypeInternalLinkTypeLanguageSettings +} + +func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeLanguageSettings +} + // The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link type InternalLinkTypeMessage struct { meta @@ -25903,6 +27148,31 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { return TypeInternalLinkTypePhoneNumberConfirmation } +// The link is a link to the privacy and security settings section of the app +type InternalLinkTypePrivacyAndSecuritySettings struct { + meta +} + +func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePrivacyAndSecuritySettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta @@ -26163,7 +27433,34 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link +type InternalLinkTypeUserPhoneNumber struct { + meta + // Phone number of the user + PhoneNumber string `json:"phone_number"` +} + +func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUserPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUserPhoneNumber) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUserPhoneNumber) GetType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link type InternalLinkTypeVideoChat struct { meta // Username of the chat with the video chat @@ -26375,6 +27672,31 @@ func (*FileTypeDocument) FileTypeType() string { return TypeFileTypeDocument } +// The file is a notification sound +type FileTypeNotificationSound struct { + meta +} + +func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeNotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeNotificationSound) GetClass() string { + return ClassFileType +} + +func (*FileTypeNotificationSound) GetType() string { + return TypeFileTypeNotificationSound +} + +func (*FileTypeNotificationSound) FileTypeType() string { + return TypeFileTypeNotificationSound +} + // The file is a photo type FileTypePhoto struct { meta @@ -27537,7 +28859,7 @@ func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string { // A chat invite link type TMeUrlTypeChatInvite struct { meta - // Chat invite link info + // Information about the chat invite link Info *ChatInviteLinkInfo `json:"info"` } @@ -27680,7 +29002,7 @@ func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string return TypeSuggestedActionEnableArchiveAndMuteNewChats } -// Suggests the user to check whether 2-step verification password is still remembered +// Suggests the user to check whether they still remember their 2-step verification password type SuggestedActionCheckPassword struct { meta } @@ -27730,29 +29052,29 @@ func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string { return TypeSuggestedActionCheckPhoneNumber } -// Suggests the user to see a hint about meaning of one and two ticks on sent message -type SuggestedActionSeeTicksHint struct { +// Suggests the user to view a hint about the meaning of one and two check marks on sent messages +type SuggestedActionViewChecksHint struct { meta } -func (entity *SuggestedActionSeeTicksHint) MarshalJSON() ([]byte, error) { +func (entity *SuggestedActionViewChecksHint) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SuggestedActionSeeTicksHint + type stub SuggestedActionViewChecksHint return json.Marshal((*stub)(entity)) } -func (*SuggestedActionSeeTicksHint) GetClass() string { +func (*SuggestedActionViewChecksHint) GetClass() string { return ClassSuggestedAction } -func (*SuggestedActionSeeTicksHint) GetType() string { - return TypeSuggestedActionSeeTicksHint +func (*SuggestedActionViewChecksHint) GetType() string { + return TypeSuggestedActionViewChecksHint } -func (*SuggestedActionSeeTicksHint) SuggestedActionType() string { - return TypeSuggestedActionSeeTicksHint +func (*SuggestedActionViewChecksHint) SuggestedActionType() string { + return TypeSuggestedActionViewChecksHint } // Suggests the user to convert specified supergroup to a broadcast group @@ -28125,91 +29447,38 @@ func (*Proxies) GetType() string { return TypeProxies } -// A static sticker in PNG format, which will be converted to WEBP server-side -type InputStickerStatic struct { +// A sticker to be added to a sticker set +type InputSticker struct { meta - // PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square + // File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` // Emojis corresponding to the sticker Emojis string `json:"emojis"` - // For masks, position where the mask is placed; pass null if unspecified - MaskPosition *MaskPosition `json:"mask_position"` + // Sticker type + Type StickerType `json:"type"` } -func (entity *InputStickerStatic) MarshalJSON() ([]byte, error) { +func (entity *InputSticker) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputStickerStatic + type stub InputSticker return json.Marshal((*stub)(entity)) } -func (*InputStickerStatic) GetClass() string { +func (*InputSticker) GetClass() string { return ClassInputSticker } -func (*InputStickerStatic) GetType() string { - return TypeInputStickerStatic +func (*InputSticker) GetType() string { + return TypeInputSticker } -func (*InputStickerStatic) InputStickerType() string { - return TypeInputStickerStatic -} - -func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Emojis string `json:"emojis"` - MaskPosition *MaskPosition `json:"mask_position"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputStickerStatic.Emojis = tmp.Emojis - inputStickerStatic.MaskPosition = tmp.MaskPosition - - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerStatic.Sticker = fieldSticker - - return nil -} - -// An animated sticker in TGS format -type InputStickerAnimated struct { - meta - // File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements - Sticker InputFile `json:"sticker"` - // Emojis corresponding to the sticker - Emojis string `json:"emojis"` -} - -func (entity *InputStickerAnimated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputStickerAnimated - - return json.Marshal((*stub)(entity)) -} - -func (*InputStickerAnimated) GetClass() string { - return ClassInputSticker -} - -func (*InputStickerAnimated) GetType() string { - return TypeInputStickerAnimated -} - -func (*InputStickerAnimated) InputStickerType() string { - return TypeInputStickerAnimated -} - -func (inputStickerAnimated *InputStickerAnimated) UnmarshalJSON(data []byte) error { +func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { var tmp struct { Sticker json.RawMessage `json:"sticker"` Emojis string `json:"emojis"` + Type json.RawMessage `json:"type"` } err := json.Unmarshal(data, &tmp) @@ -28217,10 +29486,13 @@ func (inputStickerAnimated *InputStickerAnimated) UnmarshalJSON(data []byte) err return err } - inputStickerAnimated.Emojis = tmp.Emojis + inputSticker.Emojis = tmp.Emojis fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerAnimated.Sticker = fieldSticker + inputSticker.Sticker = fieldSticker + + fieldType, _ := UnmarshalStickerType(tmp.Type) + inputSticker.Type = fieldType return nil } @@ -29398,6 +30670,39 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } +// The list of unread reactions added to a message was changed +type UpdateMessageUnreadReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // The new list of unread reactions + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + // The new number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageUnreadReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageUnreadReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageUnreadReactions) GetType() string { + return TypeUpdateMessageUnreadReactions +} + +func (*UpdateMessageUnreadReactions) UpdateType() string { + return TypeUpdateMessageUnreadReactions +} + // A message with a live location was viewed. When the update is received, the application is supposed to update the live location type UpdateMessageLiveLocationViewed struct { meta @@ -29601,228 +30906,6 @@ func (*UpdateChatPosition) UpdateType() string { return TypeUpdateChatPosition } -// The default message sender that is chosen to send messages in a chat has changed -type UpdateChatDefaultMessageSenderId struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of default_message_sender_id; may be null if the user can't change message sender - DefaultMessageSenderId MessageSender `json:"default_message_sender_id"` -} - -func (entity *UpdateChatDefaultMessageSenderId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatDefaultMessageSenderId - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatDefaultMessageSenderId) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatDefaultMessageSenderId) GetType() string { - return TypeUpdateChatDefaultMessageSenderId -} - -func (*UpdateChatDefaultMessageSenderId) UpdateType() string { - return TypeUpdateChatDefaultMessageSenderId -} - -func (updateChatDefaultMessageSenderId *UpdateChatDefaultMessageSenderId) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - DefaultMessageSenderId json.RawMessage `json:"default_message_sender_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateChatDefaultMessageSenderId.ChatId = tmp.ChatId - - fieldDefaultMessageSenderId, _ := UnmarshalMessageSender(tmp.DefaultMessageSenderId) - updateChatDefaultMessageSenderId.DefaultMessageSenderId = fieldDefaultMessageSenderId - - return nil -} - -// A chat content was allowed or restricted for saving -type UpdateChatHasProtectedContent struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` -} - -func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatHasProtectedContent - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatHasProtectedContent) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatHasProtectedContent) GetType() string { - return TypeUpdateChatHasProtectedContent -} - -func (*UpdateChatHasProtectedContent) UpdateType() string { - return TypeUpdateChatHasProtectedContent -} - -// A chat was marked as unread or was read -type UpdateChatIsMarkedAsUnread struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_marked_as_unread - IsMarkedAsUnread bool `json:"is_marked_as_unread"` -} - -func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsMarkedAsUnread - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsMarkedAsUnread) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsMarkedAsUnread) GetType() string { - return TypeUpdateChatIsMarkedAsUnread -} - -func (*UpdateChatIsMarkedAsUnread) UpdateType() string { - return TypeUpdateChatIsMarkedAsUnread -} - -// A chat was blocked or unblocked -type UpdateChatIsBlocked struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` -} - -func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsBlocked - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsBlocked) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsBlocked) GetType() string { - return TypeUpdateChatIsBlocked -} - -func (*UpdateChatIsBlocked) UpdateType() string { - return TypeUpdateChatIsBlocked -} - -// A chat's has_scheduled_messages field has changed -type UpdateChatHasScheduledMessages struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of has_scheduled_messages - HasScheduledMessages bool `json:"has_scheduled_messages"` -} - -func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatHasScheduledMessages - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatHasScheduledMessages) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatHasScheduledMessages) GetType() string { - return TypeUpdateChatHasScheduledMessages -} - -func (*UpdateChatHasScheduledMessages) UpdateType() string { - return TypeUpdateChatHasScheduledMessages -} - -// A chat video chat state has changed -type UpdateChatVideoChat struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of video_chat - VideoChat *VideoChat `json:"video_chat"` -} - -func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatVideoChat - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatVideoChat) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatVideoChat) GetType() string { - return TypeUpdateChatVideoChat -} - -func (*UpdateChatVideoChat) UpdateType() string { - return TypeUpdateChatVideoChat -} - -// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed -type UpdateChatDefaultDisableNotification struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new default_disable_notification value - DefaultDisableNotification bool `json:"default_disable_notification"` -} - -func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatDefaultDisableNotification - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatDefaultDisableNotification) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatDefaultDisableNotification) GetType() string { - return TypeUpdateChatDefaultDisableNotification -} - -func (*UpdateChatDefaultDisableNotification) UpdateType() string { - return TypeUpdateChatDefaultDisableNotification -} - // Incoming messages were read or the number of unread messages has been changed type UpdateChatReadInbox struct { meta @@ -29883,141 +30966,6 @@ func (*UpdateChatReadOutbox) UpdateType() string { return TypeUpdateChatReadOutbox } -// The chat unread_mention_count has changed -type UpdateChatUnreadMentionCount struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The number of unread mention messages left in the chat - UnreadMentionCount int32 `json:"unread_mention_count"` -} - -func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatUnreadMentionCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatUnreadMentionCount) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatUnreadMentionCount) GetType() string { - return TypeUpdateChatUnreadMentionCount -} - -func (*UpdateChatUnreadMentionCount) UpdateType() string { - return TypeUpdateChatUnreadMentionCount -} - -// Notification settings for a chat were changed -type UpdateChatNotificationSettings struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new notification settings - NotificationSettings *ChatNotificationSettings `json:"notification_settings"` -} - -func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatNotificationSettings) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatNotificationSettings) GetType() string { - return TypeUpdateChatNotificationSettings -} - -func (*UpdateChatNotificationSettings) UpdateType() string { - return TypeUpdateChatNotificationSettings -} - -// Notification settings for some type of chats were updated -type UpdateScopeNotificationSettings struct { - meta - // Types of chats for which notification settings were updated - Scope NotificationSettingsScope `json:"scope"` - // The new notification settings - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` -} - -func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateScopeNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateScopeNotificationSettings) GetClass() string { - return ClassUpdate -} - -func (*UpdateScopeNotificationSettings) GetType() string { - return TypeUpdateScopeNotificationSettings -} - -func (*UpdateScopeNotificationSettings) UpdateType() string { - return TypeUpdateScopeNotificationSettings -} - -func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - Scope json.RawMessage `json:"scope"` - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings - - fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) - updateScopeNotificationSettings.Scope = fieldScope - - return nil -} - -// The message Time To Live setting for a chat was changed -type UpdateChatMessageTtlSetting struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of message_ttl_setting - MessageTtlSetting int32 `json:"message_ttl_setting"` -} - -func (entity *UpdateChatMessageTtlSetting) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatMessageTtlSetting - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatMessageTtlSetting) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatMessageTtlSetting) GetType() string { - return TypeUpdateChatMessageTtlSetting -} - -func (*UpdateChatMessageTtlSetting) UpdateType() string { - return TypeUpdateChatMessageTtlSetting -} - // The chat action bar was changed type UpdateChatActionBar struct { meta @@ -30066,33 +31014,170 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } -// The chat theme was changed -type UpdateChatTheme struct { +// The chat available reactions were changed +type UpdateChatAvailableReactions struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new name of the chat theme; may be empty if theme was reset to default - ThemeName string `json:"theme_name"` + // The new list of reactions, available in the chat + AvailableReactions []string `json:"available_reactions"` } -func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatTheme + type stub UpdateChatAvailableReactions return json.Marshal((*stub)(entity)) } -func (*UpdateChatTheme) GetClass() string { +func (*UpdateChatAvailableReactions) GetClass() string { return ClassUpdate } -func (*UpdateChatTheme) GetType() string { - return TypeUpdateChatTheme +func (*UpdateChatAvailableReactions) GetType() string { + return TypeUpdateChatAvailableReactions } -func (*UpdateChatTheme) UpdateType() string { - return TypeUpdateChatTheme +func (*UpdateChatAvailableReactions) UpdateType() string { + return TypeUpdateChatAvailableReactions +} + +// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied +type UpdateChatDraftMessage struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new draft message; may be null + DraftMessage *DraftMessage `json:"draft_message"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` +} + +func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatDraftMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatDraftMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatDraftMessage) GetType() string { + return TypeUpdateChatDraftMessage +} + +func (*UpdateChatDraftMessage) UpdateType() string { + return TypeUpdateChatDraftMessage +} + +// The message sender that is selected to send messages in a chat has changed +type UpdateChatMessageSender struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of message_sender_id; may be null if the user can't change message sender + MessageSenderId MessageSender `json:"message_sender_id"` +} + +func (entity *UpdateChatMessageSender) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatMessageSender + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatMessageSender) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatMessageSender) GetType() string { + return TypeUpdateChatMessageSender +} + +func (*UpdateChatMessageSender) UpdateType() string { + return TypeUpdateChatMessageSender +} + +func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatMessageSender.ChatId = tmp.ChatId + + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + updateChatMessageSender.MessageSenderId = fieldMessageSenderId + + return nil +} + +// The message Time To Live setting for a chat was changed +type UpdateChatMessageTtl struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of message_ttl + MessageTtl int32 `json:"message_ttl"` +} + +func (entity *UpdateChatMessageTtl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatMessageTtl + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatMessageTtl) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatMessageTtl) GetType() string { + return TypeUpdateChatMessageTtl +} + +func (*UpdateChatMessageTtl) UpdateType() string { + return TypeUpdateChatMessageTtl +} + +// Notification settings for a chat were changed +type UpdateChatNotificationSettings struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new notification settings + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` +} + +func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatNotificationSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatNotificationSettings) GetType() string { + return TypeUpdateChatNotificationSettings +} + +func (*UpdateChatNotificationSettings) UpdateType() string { + return TypeUpdateChatNotificationSettings } // The chat pending join requests were changed @@ -30153,35 +31238,265 @@ func (*UpdateChatReplyMarkup) UpdateType() string { return TypeUpdateChatReplyMarkup } -// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied -type UpdateChatDraftMessage struct { +// The chat theme was changed +type UpdateChatTheme struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new draft message; may be null - DraftMessage *DraftMessage `json:"draft_message"` - // The new chat positions in the chat lists - Positions []*ChatPosition `json:"positions"` + // The new name of the chat theme; may be empty if theme was reset to default + ThemeName string `json:"theme_name"` } -func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatDraftMessage + type stub UpdateChatTheme return json.Marshal((*stub)(entity)) } -func (*UpdateChatDraftMessage) GetClass() string { +func (*UpdateChatTheme) GetClass() string { return ClassUpdate } -func (*UpdateChatDraftMessage) GetType() string { - return TypeUpdateChatDraftMessage +func (*UpdateChatTheme) GetType() string { + return TypeUpdateChatTheme } -func (*UpdateChatDraftMessage) UpdateType() string { - return TypeUpdateChatDraftMessage +func (*UpdateChatTheme) UpdateType() string { + return TypeUpdateChatTheme +} + +// The chat unread_mention_count has changed +type UpdateChatUnreadMentionCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of unread mention messages left in the chat + UnreadMentionCount int32 `json:"unread_mention_count"` +} + +func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadMentionCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadMentionCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadMentionCount) GetType() string { + return TypeUpdateChatUnreadMentionCount +} + +func (*UpdateChatUnreadMentionCount) UpdateType() string { + return TypeUpdateChatUnreadMentionCount +} + +// The chat unread_reaction_count has changed +type UpdateChatUnreadReactionCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadReactionCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadReactionCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadReactionCount) GetType() string { + return TypeUpdateChatUnreadReactionCount +} + +func (*UpdateChatUnreadReactionCount) UpdateType() string { + return TypeUpdateChatUnreadReactionCount +} + +// A chat video chat state has changed +type UpdateChatVideoChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of video_chat + VideoChat *VideoChat `json:"video_chat"` +} + +func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatVideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatVideoChat) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatVideoChat) GetType() string { + return TypeUpdateChatVideoChat +} + +func (*UpdateChatVideoChat) UpdateType() string { + return TypeUpdateChatVideoChat +} + +// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed +type UpdateChatDefaultDisableNotification struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new default_disable_notification value + DefaultDisableNotification bool `json:"default_disable_notification"` +} + +func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatDefaultDisableNotification + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatDefaultDisableNotification) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatDefaultDisableNotification) GetType() string { + return TypeUpdateChatDefaultDisableNotification +} + +func (*UpdateChatDefaultDisableNotification) UpdateType() string { + return TypeUpdateChatDefaultDisableNotification +} + +// A chat content was allowed or restricted for saving +type UpdateChatHasProtectedContent struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasProtectedContent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasProtectedContent) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasProtectedContent) GetType() string { + return TypeUpdateChatHasProtectedContent +} + +func (*UpdateChatHasProtectedContent) UpdateType() string { + return TypeUpdateChatHasProtectedContent +} + +// A chat's has_scheduled_messages field has changed +type UpdateChatHasScheduledMessages struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_scheduled_messages + HasScheduledMessages bool `json:"has_scheduled_messages"` +} + +func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasScheduledMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasScheduledMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasScheduledMessages) GetType() string { + return TypeUpdateChatHasScheduledMessages +} + +func (*UpdateChatHasScheduledMessages) UpdateType() string { + return TypeUpdateChatHasScheduledMessages +} + +// A chat was blocked or unblocked +type UpdateChatIsBlocked struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_blocked + IsBlocked bool `json:"is_blocked"` +} + +func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatIsBlocked + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatIsBlocked) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatIsBlocked) GetType() string { + return TypeUpdateChatIsBlocked +} + +func (*UpdateChatIsBlocked) UpdateType() string { + return TypeUpdateChatIsBlocked +} + +// A chat was marked as unread or was read +type UpdateChatIsMarkedAsUnread struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_marked_as_unread + IsMarkedAsUnread bool `json:"is_marked_as_unread"` +} + +func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatIsMarkedAsUnread + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatIsMarkedAsUnread) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatIsMarkedAsUnread) GetType() string { + return TypeUpdateChatIsMarkedAsUnread +} + +func (*UpdateChatIsMarkedAsUnread) UpdateType() string { + return TypeUpdateChatIsMarkedAsUnread } // The list of chat filters or a chat filter has changed @@ -30211,7 +31526,7 @@ func (*UpdateChatFilters) UpdateType() string { return TypeUpdateChatFilters } -// The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed +// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed type UpdateChatOnlineMemberCount struct { meta // Identifier of the chat @@ -30240,6 +31555,54 @@ func (*UpdateChatOnlineMemberCount) UpdateType() string { return TypeUpdateChatOnlineMemberCount } +// Notification settings for some type of chats were updated +type UpdateScopeNotificationSettings struct { + meta + // Types of chats for which notification settings were updated + Scope NotificationSettingsScope `json:"scope"` + // The new notification settings + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` +} + +func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateScopeNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateScopeNotificationSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateScopeNotificationSettings) GetType() string { + return TypeUpdateScopeNotificationSettings +} + +func (*UpdateScopeNotificationSettings) UpdateType() string { + return TypeUpdateScopeNotificationSettings +} + +func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Scope json.RawMessage `json:"scope"` + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings + + fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) + updateScopeNotificationSettings.Scope = fieldScope + + return nil +} + // A notification was changed type UpdateNotification struct { meta @@ -30280,8 +31643,8 @@ type UpdateNotificationGroup struct { ChatId int64 `json:"chat_id"` // Chat identifier, which notification settings must be applied to the added notifications NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - // True, if the notifications must be shown without sound - IsSilent bool `json:"is_silent"` + // Identifier of the notification sound to be played; 0 if sound is disabled + NotificationSoundId JsonInt64 `json:"notification_sound_id"` // Total number of unread notifications in the group, can be bigger than number of active notifications TotalCount int32 `json:"total_count"` // List of added group notifications, sorted by notification ID @@ -30316,7 +31679,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt Type json.RawMessage `json:"type"` ChatId int64 `json:"chat_id"` NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - IsSilent bool `json:"is_silent"` + NotificationSoundId JsonInt64 `json:"notification_sound_id"` TotalCount int32 `json:"total_count"` AddedNotifications []*Notification `json:"added_notifications"` RemovedNotificationIds []int32 `json:"removed_notification_ids"` @@ -30330,7 +31693,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId updateNotificationGroup.ChatId = tmp.ChatId updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId - updateNotificationGroup.IsSilent = tmp.IsSilent + updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId updateNotificationGroup.TotalCount = tmp.TotalCount updateNotificationGroup.AddedNotifications = tmp.AddedNotifications updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds @@ -30866,6 +32229,128 @@ func (*UpdateFileGenerationStop) UpdateType() string { return TypeUpdateFileGenerationStop } +// The state of the file download list has changed +type UpdateFileDownloads struct { + meta + // Total size of files in the file download list, in bytes + TotalSize int64 `json:"total_size"` + // Total number of files in the file download list + TotalCount int32 `json:"total_count"` + // Total downloaded size of files in the file download list, in bytes + DownloadedSize int64 `json:"downloaded_size"` +} + +func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownloads) GetType() string { + return TypeUpdateFileDownloads +} + +func (*UpdateFileDownloads) UpdateType() string { + return TypeUpdateFileDownloads +} + +// A file was added to the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileAddedToDownloads struct { + meta + // The added file download + FileDownload *FileDownload `json:"file_download"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileAddedToDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileAddedToDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileAddedToDownloads) GetType() string { + return TypeUpdateFileAddedToDownloads +} + +func (*UpdateFileAddedToDownloads) UpdateType() string { + return TypeUpdateFileAddedToDownloads +} + +// A file download was changed. This update is sent only after file download list is loaded for the first time +type UpdateFileDownload struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownload + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownload) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownload) GetType() string { + return TypeUpdateFileDownload +} + +func (*UpdateFileDownload) UpdateType() string { + return TypeUpdateFileDownload +} + +// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileRemovedFromDownloads struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileRemovedFromDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileRemovedFromDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileRemovedFromDownloads) GetType() string { + return TypeUpdateFileRemovedFromDownloads +} + +func (*UpdateFileRemovedFromDownloads) UpdateType() string { + return TypeUpdateFileRemovedFromDownloads +} + // New call was created or information about a call was updated type UpdateCall struct { meta @@ -31356,6 +32841,33 @@ func (*UpdateSavedAnimations) UpdateType() string { return TypeUpdateSavedAnimations } +// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time +type UpdateSavedNotificationSounds struct { + meta + // The new list of identifiers of saved notification sounds + NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` +} + +func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedNotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedNotificationSounds) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedNotificationSounds) GetType() string { + return TypeUpdateSavedNotificationSounds +} + +func (*UpdateSavedNotificationSounds) UpdateType() string { + return TypeUpdateSavedNotificationSounds +} + // The selected background has changed type UpdateSelectedBackground struct { meta @@ -31542,6 +33054,87 @@ func (*UpdateUsersNearby) UpdateType() string { return TypeUpdateUsersNearby } +// The list of bots added to attachment menu has changed +type UpdateAttachmentMenuBots struct { + meta + // The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen + Bots []*AttachmentMenuBot `json:"bots"` +} + +func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAttachmentMenuBots + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAttachmentMenuBots) GetClass() string { + return ClassUpdate +} + +func (*UpdateAttachmentMenuBots) GetType() string { + return TypeUpdateAttachmentMenuBots +} + +func (*UpdateAttachmentMenuBots) UpdateType() string { + return TypeUpdateAttachmentMenuBots +} + +// A message was sent by an opened web app, so the web app needs to be closed +type UpdateWebAppMessageSent struct { + meta + // Identifier of web app launch + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebAppMessageSent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebAppMessageSent) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebAppMessageSent) GetType() string { + return TypeUpdateWebAppMessageSent +} + +func (*UpdateWebAppMessageSent) UpdateType() string { + return TypeUpdateWebAppMessageSent +} + +// The list of supported reactions has changed +type UpdateReactions struct { + meta + // The new list of supported reactions + Reactions []*Reaction `json:"reactions"` +} + +func (entity *UpdateReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateReactions) GetType() string { + return TypeUpdateReactions +} + +func (*UpdateReactions) UpdateType() string { + return TypeUpdateReactions +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -31687,7 +33280,7 @@ type UpdateNewInlineQuery struct { SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` - // The type of the chat, from which the query originated; may be null if unknown + // The type of the chat from which the query originated; may be null if unknown ChatType ChatType `json:"chat_type"` // Text of the query Query string `json:"query"` @@ -31786,7 +33379,7 @@ type UpdateNewCallbackQuery struct { SenderUserId int64 `json:"sender_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` - // Identifier of the message, from which the query originated + // Identifier of the message from which the query originated MessageId int64 `json:"message_id"` // Identifier that uniquely corresponds to the chat to which the message was sent ChatInstance JsonInt64 `json:"chat_instance"` @@ -31848,7 +33441,7 @@ type UpdateNewInlineCallbackQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int64 `json:"sender_user_id"` - // Identifier of the inline message, from which the query originated + // Identifier of the inline message from which the query originated InlineMessageId string `json:"inline_message_id"` // An identifier uniquely corresponding to the chat a message was sent to ChatInstance JsonInt64 `json:"chat_instance"` diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 74154a4..bfefaa5 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -163,20 +163,23 @@ func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -237,6 +240,46 @@ func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) { return list, nil } +func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerTypeStatic: + return UnmarshalStickerTypeStatic(data) + + case TypeStickerTypeAnimated: + return UnmarshalStickerTypeAnimated(data) + + case TypeStickerTypeVideo: + return UnmarshalStickerTypeVideo(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerType(dataList []json.RawMessage) ([]StickerType, error) { + list := []StickerType{} + + for _, data := range dataList { + entity, err := UnmarshalStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPollType(data json.RawMessage) (PollType, error) { var meta meta @@ -895,6 +938,9 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -929,6 +975,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -1803,6 +1852,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) + case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -1879,6 +1934,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -2068,12 +2126,6 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterChatPhoto: return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeSearchMessagesFilterCall: - return UnmarshalSearchMessagesFilterCall(data) - - case TypeSearchMessagesFilterMissedCall: - return UnmarshalSearchMessagesFilterMissedCall(data) - case TypeSearchMessagesFilterVideoNote: return UnmarshalSearchMessagesFilterVideoNote(data) @@ -2086,6 +2138,9 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -2659,15 +2714,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -2677,60 +2732,63 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlSettingChanged: - return UnmarshalChatEventMessageTtlSettingChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -2743,8 +2801,11 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventVideoChatCreated: return UnmarshalChatEventVideoChatCreated(data) - case TypeChatEventVideoChatDiscarded: - return UnmarshalChatEventVideoChatDiscarded(data) + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) + + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) @@ -2752,9 +2813,6 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3586,6 +3644,12 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonIllegalDrugs: + return UnmarshalChatReportReasonIllegalDrugs(data) + + case TypeChatReportReasonPersonalDetails: + return UnmarshalChatReportReasonPersonalDetails(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -3620,6 +3684,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -3632,6 +3699,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -3647,6 +3717,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -3659,6 +3732,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -3686,6 +3762,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -3729,6 +3808,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -4011,8 +4093,8 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionCheckPhoneNumber: return UnmarshalSuggestedActionCheckPhoneNumber(data) - case TypeSuggestedActionSeeTicksHint: - return UnmarshalSuggestedActionSeeTicksHint(data) + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) case TypeSuggestedActionConvertToBroadcastGroup: return UnmarshalSuggestedActionConvertToBroadcastGroup(data) @@ -4110,40 +4192,6 @@ func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { return list, nil } -func UnmarshalInputSticker(data json.RawMessage) (InputSticker, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInputSticker(dataList []json.RawMessage) ([]InputSticker, error) { - list := []InputSticker{} - - for _, data := range dataList { - entity, err := UnmarshalInputSticker(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { var meta meta @@ -4340,6 +4388,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -4361,50 +4412,29 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(data) - case TypeUpdateChatDefaultMessageSenderId: - return UnmarshalUpdateChatDefaultMessageSenderId(data) - - case TypeUpdateChatHasProtectedContent: - return UnmarshalUpdateChatHasProtectedContent(data) - - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatVideoChat: - return UnmarshalUpdateChatVideoChat(data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) - - case TypeUpdateChatNotificationSettings: - return UnmarshalUpdateChatNotificationSettings(data) - - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) - - case TypeUpdateChatMessageTtlSetting: - return UnmarshalUpdateChatMessageTtlSetting(data) - case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatTheme: - return UnmarshalUpdateChatTheme(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(data) + + case TypeUpdateChatNotificationSettings: + return UnmarshalUpdateChatNotificationSettings(data) case TypeUpdateChatPendingJoinRequests: return UnmarshalUpdateChatPendingJoinRequests(data) @@ -4412,8 +4442,32 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) + + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(data) @@ -4421,6 +4475,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(data) @@ -4475,6 +4532,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -4517,6 +4586,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -4535,6 +4607,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateReactions: + return UnmarshalUpdateReactions(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -4943,22 +5024,6 @@ func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, e return &resp, err } -func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { - var resp ThumbnailFormatPng - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { - var resp ThumbnailFormatWebp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { var resp ThumbnailFormatGif @@ -4967,6 +5032,22 @@ func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, err return &resp, err } +func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { + var resp ThumbnailFormatMpeg4 + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { + var resp ThumbnailFormatPng + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, error) { var resp ThumbnailFormatTgs @@ -4975,8 +5056,16 @@ func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, err return &resp, err } -func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { - var resp ThumbnailFormatMpeg4 +func UnmarshalThumbnailFormatWebm(data json.RawMessage) (*ThumbnailFormatWebm, error) { + var resp ThumbnailFormatWebm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { + var resp ThumbnailFormatWebp err := json.Unmarshal(data, &resp) @@ -5031,6 +5120,38 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { return &resp, err } +func UnmarshalStickerTypeStatic(data json.RawMessage) (*StickerTypeStatic, error) { + var resp StickerTypeStatic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeAnimated(data json.RawMessage) (*StickerTypeAnimated, error) { + var resp StickerTypeAnimated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeVideo(data json.RawMessage) (*StickerTypeVideo, error) { + var resp StickerTypeVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) { + var resp StickerTypeMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { var resp ClosedVectorPath @@ -5239,6 +5360,14 @@ func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { return &resp, err } +func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { + var resp BotMenuButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { var resp ChatLocation @@ -5295,6 +5424,22 @@ func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnim return &resp, err } +func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { + var resp ChatPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { + var resp ChatAdministratorRights + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -5303,6 +5448,14 @@ func UnmarshalUser(data json.RawMessage) (*User, error) { return &resp, err } +func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { + var resp BotInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { var resp UserFullInfo @@ -5335,14 +5488,6 @@ func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, err return &resp, err } -func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { - var resp ChatPermissions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { var resp ChatMemberStatusCreator @@ -5751,6 +5896,14 @@ func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) return &resp, err } +func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { + var resp MessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { var resp MessageInteractionInfo @@ -5759,6 +5912,14 @@ func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionI return &resp, err } +func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { + var resp UnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { var resp MessageSendingStatePending @@ -5839,8 +6000,24 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) return &resp, err } -func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) { - var resp SponsoredMessages +func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { + var resp FileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { + var resp DownloadedFileCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { + var resp FoundFileDownloads err := json.Unmarshal(data, &resp) @@ -6159,6 +6336,14 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt return &resp, err } +func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { + var resp KeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { var resp KeyboardButton @@ -6183,6 +6368,14 @@ func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { + var resp InlineKeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { var resp InlineKeyboardButtonTypeCallback @@ -6287,6 +6480,14 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn return &resp, err } +func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { + var resp WebAppInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -6807,6 +7008,14 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) { return &resp, err } +func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { + var resp ThemeParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { var resp LabeledPricePart @@ -6887,14 +7096,6 @@ func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStr return &resp, err } -func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) { - var resp PaymentFormTheme - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { var resp PaymentForm @@ -7871,6 +8072,22 @@ func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConn return &resp, err } +func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { + var resp MessageWebAppDataSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { + var resp MessageWebAppDataReceived + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) { var resp MessagePassportDataSent @@ -7999,6 +8216,14 @@ func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityType return &resp, err } +func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { + var resp TextEntityTypeSpoiler + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { var resp TextEntityTypeCode @@ -8303,22 +8528,6 @@ func UnmarshalSearchMessagesFilterChatPhoto(data json.RawMessage) (*SearchMessag return &resp, err } -func UnmarshalSearchMessagesFilterCall(data json.RawMessage) (*SearchMessagesFilterCall, error) { - var resp SearchMessagesFilterCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterMissedCall(data json.RawMessage) (*SearchMessagesFilterMissedCall, error) { - var resp SearchMessagesFilterMissedCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSearchMessagesFilterVideoNote(data json.RawMessage) (*SearchMessagesFilterVideoNote, error) { var resp SearchMessagesFilterVideoNote @@ -8351,6 +8560,14 @@ func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMe return &resp, err } +func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { + var resp SearchMessagesFilterUnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { var resp SearchMessagesFilterFailedToSend @@ -8735,6 +8952,30 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { + var resp RtmpUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { var resp GroupCallRecentSpeaker @@ -8863,6 +9104,38 @@ func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNum return &resp, err } +func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { + var resp AddedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { + var resp AddedReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { + var resp AvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReaction(data json.RawMessage) (*Reaction, error) { + var resp Reaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { var resp Animations @@ -8895,6 +9168,30 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) return &resp, err } +func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { + var resp AttachmentMenuBotColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { + var resp AttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { + var resp SentWebAppMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { var resp HttpUrl @@ -9175,14 +9472,6 @@ func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDe return &resp, err } -func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { - var resp ChatEventPollStopped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { var resp ChatEventMessagePinned @@ -9199,6 +9488,14 @@ func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageU return &resp, err } +func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { + var resp ChatEventPollStopped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { var resp ChatEventMemberJoined @@ -9223,16 +9520,16 @@ func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMe return &resp, err } -func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { - var resp ChatEventMemberLeft +func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { + var resp ChatEventMemberInvited err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { - var resp ChatEventMemberInvited +func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { + var resp ChatEventMemberLeft err := json.Unmarshal(data, &resp) @@ -9255,16 +9552,8 @@ func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberR return &resp, err } -func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { - var resp ChatEventTitleChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { - var resp ChatEventPermissionsChanged +func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { + var resp ChatEventAvailableReactionsChanged err := json.Unmarshal(data, &resp) @@ -9279,30 +9568,6 @@ func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescr return &resp, err } -func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { - var resp ChatEventUsernameChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { - var resp ChatEventPhotoChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { - var resp ChatEventInvitesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { var resp ChatEventLinkedChatChanged @@ -9311,46 +9576,6 @@ func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinked return &resp, err } -func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { - var resp ChatEventSlowModeDelayChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageTtlSettingChanged(data json.RawMessage) (*ChatEventMessageTtlSettingChanged, error) { - var resp ChatEventMessageTtlSettingChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { - var resp ChatEventSignMessagesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { - var resp ChatEventHasProtectedContentToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { - var resp ChatEventStickerSetChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { var resp ChatEventLocationChanged @@ -9359,6 +9584,78 @@ func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocation return &resp, err } +func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { + var resp ChatEventMessageTtlChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { + var resp ChatEventPermissionsChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { + var resp ChatEventPhotoChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { + var resp ChatEventStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { + var resp ChatEventTitleChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { + var resp ChatEventUsernameChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { + var resp ChatEventInvitesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { var resp ChatEventIsAllHistoryAvailableToggled @@ -9367,6 +9664,14 @@ func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*Chat return &resp, err } +func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { + var resp ChatEventSignMessagesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { var resp ChatEventInviteLinkEdited @@ -9399,8 +9704,16 @@ func UnmarshalChatEventVideoChatCreated(data json.RawMessage) (*ChatEventVideoCh return &resp, err } -func UnmarshalChatEventVideoChatDiscarded(data json.RawMessage) (*ChatEventVideoChatDiscarded, error) { - var resp ChatEventVideoChatDiscarded +func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChatEnded, error) { + var resp ChatEventVideoChatEnded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled err := json.Unmarshal(data, &resp) @@ -9423,14 +9736,6 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa return &resp, err } -func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { - var resp ChatEventVideoChatMuteNewParticipantsToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { var resp ChatEvent @@ -10143,6 +10448,22 @@ func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGro return &resp, err } +func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) { + var resp NotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) { + var resp NotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotification(data json.RawMessage) (*Notification, error) { var resp Notification @@ -10479,6 +10800,22 @@ func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, return &resp, err } +func UnmarshalChatReportReasonIllegalDrugs(data json.RawMessage) (*ChatReportReasonIllegalDrugs, error) { + var resp ChatReportReasonIllegalDrugs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatReportReasonPersonalDetails(data json.RawMessage) (*ChatReportReasonPersonalDetails, error) { + var resp ChatReportReasonPersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { var resp ChatReportReasonCustom @@ -10495,6 +10832,14 @@ func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLin return &resp, err } +func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) { + var resp InternalLinkTypeAttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { var resp InternalLinkTypeAuthenticationCode @@ -10527,6 +10872,14 @@ func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) { + var resp InternalLinkTypeBotAddToChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { var resp InternalLinkTypeChangePhoneNumber @@ -10567,6 +10920,14 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } +func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { + var resp InternalLinkTypeLanguageSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { var resp InternalLinkTypeMessage @@ -10599,6 +10960,14 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } +func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { + var resp InternalLinkTypePrivacyAndSecuritySettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { var resp InternalLinkTypeProxy @@ -10671,6 +11040,14 @@ func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { + var resp InternalLinkTypeUserPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { var resp InternalLinkTypeVideoChat @@ -10735,6 +11112,14 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) return &resp, err } +func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { + var resp FileTypeNotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { var resp FileTypePhoto @@ -11119,8 +11504,8 @@ func UnmarshalSuggestedActionCheckPhoneNumber(data json.RawMessage) (*SuggestedA return &resp, err } -func UnmarshalSuggestedActionSeeTicksHint(data json.RawMessage) (*SuggestedActionSeeTicksHint, error) { - var resp SuggestedActionSeeTicksHint +func UnmarshalSuggestedActionViewChecksHint(data json.RawMessage) (*SuggestedActionViewChecksHint, error) { + var resp SuggestedActionViewChecksHint err := json.Unmarshal(data, &resp) @@ -11231,16 +11616,8 @@ func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { return &resp, err } -func UnmarshalInputStickerStatic(data json.RawMessage) (*InputStickerStatic, error) { - var resp InputStickerStatic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputStickerAnimated(data json.RawMessage) (*InputStickerAnimated, error) { - var resp InputStickerAnimated +func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { + var resp InputSticker err := json.Unmarshal(data, &resp) @@ -11511,6 +11888,14 @@ func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMent return &resp, err } +func UnmarshalUpdateMessageUnreadReactions(data json.RawMessage) (*UpdateMessageUnreadReactions, error) { + var resp UpdateMessageUnreadReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { var resp UpdateMessageLiveLocationViewed @@ -11567,62 +11952,6 @@ func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, err return &resp, err } -func UnmarshalUpdateChatDefaultMessageSenderId(data json.RawMessage) (*UpdateChatDefaultMessageSenderId, error) { - var resp UpdateChatDefaultMessageSenderId - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatHasProtectedContent(data json.RawMessage) (*UpdateChatHasProtectedContent, error) { - var resp UpdateChatHasProtectedContent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMarkedAsUnread, error) { - var resp UpdateChatIsMarkedAsUnread - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { - var resp UpdateChatIsBlocked - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { - var resp UpdateChatHasScheduledMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { - var resp UpdateChatVideoChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatDefaultDisableNotification(data json.RawMessage) (*UpdateChatDefaultDisableNotification, error) { - var resp UpdateChatDefaultDisableNotification - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatReadInbox(data json.RawMessage) (*UpdateChatReadInbox, error) { var resp UpdateChatReadInbox @@ -11639,38 +11968,6 @@ func UnmarshalUpdateChatReadOutbox(data json.RawMessage) (*UpdateChatReadOutbox, return &resp, err } -func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnreadMentionCount, error) { - var resp UpdateChatUnreadMentionCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatNotificationSettings(data json.RawMessage) (*UpdateChatNotificationSettings, error) { - var resp UpdateChatNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { - var resp UpdateScopeNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatMessageTtlSetting(data json.RawMessage) (*UpdateChatMessageTtlSetting, error) { - var resp UpdateChatMessageTtlSetting - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, error) { var resp UpdateChatActionBar @@ -11679,8 +11976,40 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } -func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { - var resp UpdateChatTheme +func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { + var resp UpdateChatAvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { + var resp UpdateChatDraftMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageSender, error) { + var resp UpdateChatMessageSender + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatMessageTtl(data json.RawMessage) (*UpdateChatMessageTtl, error) { + var resp UpdateChatMessageTtl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatNotificationSettings(data json.RawMessage) (*UpdateChatNotificationSettings, error) { + var resp UpdateChatNotificationSettings err := json.Unmarshal(data, &resp) @@ -11703,8 +12032,72 @@ func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarku return &resp, err } -func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { - var resp UpdateChatDraftMessage +func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { + var resp UpdateChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnreadMentionCount, error) { + var resp UpdateChatUnreadMentionCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUnreadReactionCount, error) { + var resp UpdateChatUnreadReactionCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { + var resp UpdateChatVideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatDefaultDisableNotification(data json.RawMessage) (*UpdateChatDefaultDisableNotification, error) { + var resp UpdateChatDefaultDisableNotification + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasProtectedContent(data json.RawMessage) (*UpdateChatHasProtectedContent, error) { + var resp UpdateChatHasProtectedContent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { + var resp UpdateChatHasScheduledMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { + var resp UpdateChatIsBlocked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMarkedAsUnread, error) { + var resp UpdateChatIsMarkedAsUnread err := json.Unmarshal(data, &resp) @@ -11727,6 +12120,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli return &resp, err } +func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { + var resp UpdateScopeNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNotification(data json.RawMessage) (*UpdateNotification, error) { var resp UpdateNotification @@ -11871,6 +12272,38 @@ func UnmarshalUpdateFileGenerationStop(data json.RawMessage) (*UpdateFileGenerat return &resp, err } +func UnmarshalUpdateFileDownloads(data json.RawMessage) (*UpdateFileDownloads, error) { + var resp UpdateFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileAddedToDownloads(data json.RawMessage) (*UpdateFileAddedToDownloads, error) { + var resp UpdateFileAddedToDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileDownload(data json.RawMessage) (*UpdateFileDownload, error) { + var resp UpdateFileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileRemovedFromDownloads(data json.RawMessage) (*UpdateFileRemovedFromDownloads, error) { + var resp UpdateFileRemovedFromDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { var resp UpdateCall @@ -11983,6 +12416,14 @@ func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimation return &resp, err } +func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) { + var resp UpdateSavedNotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { var resp UpdateSelectedBackground @@ -12031,6 +12472,30 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error return &resp, err } +func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) { + var resp UpdateAttachmentMenuBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) { + var resp UpdateWebAppMessageSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateReactions(data json.RawMessage) (*UpdateReactions, error) { + var resp UpdateReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -12386,20 +12851,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) case TypeThumbnail: return UnmarshalThumbnail(data) @@ -12419,6 +12887,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMaskPosition: return UnmarshalMaskPosition(data) + case TypeStickerTypeStatic: + return UnmarshalStickerTypeStatic(data) + + case TypeStickerTypeAnimated: + return UnmarshalStickerTypeAnimated(data) + + case TypeStickerTypeVideo: + return UnmarshalStickerTypeVideo(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + case TypeClosedVectorPath: return UnmarshalClosedVectorPath(data) @@ -12497,6 +12977,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommands: return UnmarshalBotCommands(data) + case TypeBotMenuButton: + return UnmarshalBotMenuButton(data) + case TypeChatLocation: return UnmarshalChatLocation(data) @@ -12518,9 +13001,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputChatPhotoAnimation: return UnmarshalInputChatPhotoAnimation(data) + case TypeChatPermissions: + return UnmarshalChatPermissions(data) + + case TypeChatAdministratorRights: + return UnmarshalChatAdministratorRights(data) + case TypeUser: return UnmarshalUser(data) + case TypeBotInfo: + return UnmarshalBotInfo(data) + case TypeUserFullInfo: return UnmarshalUserFullInfo(data) @@ -12533,9 +13025,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministrators: return UnmarshalChatAdministrators(data) - case TypeChatPermissions: - return UnmarshalChatPermissions(data) - case TypeChatMemberStatusCreator: return UnmarshalChatMemberStatusCreator(data) @@ -12689,9 +13178,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageReplyInfo: return UnmarshalMessageReplyInfo(data) + case TypeMessageReaction: + return UnmarshalMessageReaction(data) + case TypeMessageInteractionInfo: return UnmarshalMessageInteractionInfo(data) + case TypeUnreadReaction: + return UnmarshalUnreadReaction(data) + case TypeMessageSendingStatePending: return UnmarshalMessageSendingStatePending(data) @@ -12722,8 +13217,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) - case TypeSponsoredMessages: - return UnmarshalSponsoredMessages(data) + case TypeFileDownload: + return UnmarshalFileDownload(data) + + case TypeDownloadedFileCounts: + return UnmarshalDownloadedFileCounts(data) + + case TypeFoundFileDownloads: + return UnmarshalFoundFileDownloads(data) case TypeNotificationSettingsScopePrivateChats: return UnmarshalNotificationSettingsScopePrivateChats(data) @@ -12842,6 +13343,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + case TypeKeyboardButton: return UnmarshalKeyboardButton(data) @@ -12851,6 +13355,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -12890,6 +13397,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLoginUrlInfoRequestConfirmation: return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeWebAppInfo: + return UnmarshalWebAppInfo(data) + case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) @@ -13085,6 +13595,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddress: return UnmarshalAddress(data) + case TypeThemeParameters: + return UnmarshalThemeParameters(data) + case TypeLabeledPricePart: return UnmarshalLabeledPricePart(data) @@ -13115,9 +13628,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaymentsProviderStripe: return UnmarshalPaymentsProviderStripe(data) - case TypePaymentFormTheme: - return UnmarshalPaymentFormTheme(data) - case TypePaymentForm: return UnmarshalPaymentForm(data) @@ -13484,6 +13994,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) + case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -13532,6 +14048,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -13646,12 +14165,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterChatPhoto: return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeSearchMessagesFilterCall: - return UnmarshalSearchMessagesFilterCall(data) - - case TypeSearchMessagesFilterMissedCall: - return UnmarshalSearchMessagesFilterMissedCall(data) - case TypeSearchMessagesFilterVideoNote: return UnmarshalSearchMessagesFilterVideoNote(data) @@ -13664,6 +14177,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -13808,6 +14324,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) + + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) + + case TypeRtmpUrl: + return UnmarshalRtmpUrl(data) + case TypeGroupCallRecentSpeaker: return UnmarshalGroupCallRecentSpeaker(data) @@ -13856,6 +14381,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePhoneNumberAuthenticationSettings: return UnmarshalPhoneNumberAuthenticationSettings(data) + case TypeAddedReaction: + return UnmarshalAddedReaction(data) + + case TypeAddedReactions: + return UnmarshalAddedReactions(data) + + case TypeAvailableReactions: + return UnmarshalAvailableReactions(data) + + case TypeReaction: + return UnmarshalReaction(data) + case TypeAnimations: return UnmarshalAnimations(data) @@ -13868,6 +14405,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeImportedContacts: return UnmarshalImportedContacts(data) + case TypeAttachmentMenuBotColor: + return UnmarshalAttachmentMenuBotColor(data) + + case TypeAttachmentMenuBot: + return UnmarshalAttachmentMenuBot(data) + + case TypeSentWebAppMessage: + return UnmarshalSentWebAppMessage(data) + case TypeHttpUrl: return UnmarshalHttpUrl(data) @@ -13973,15 +14519,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -13991,60 +14537,63 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlSettingChanged: - return UnmarshalChatEventMessageTtlSettingChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -14057,8 +14606,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventVideoChatCreated: return UnmarshalChatEventVideoChatCreated(data) - case TypeChatEventVideoChatDiscarded: - return UnmarshalChatEventVideoChatDiscarded(data) + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) + + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) @@ -14066,9 +14618,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - case TypeChatEvent: return UnmarshalChatEvent(data) @@ -14336,6 +14885,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroupTypeCalls: return UnmarshalNotificationGroupTypeCalls(data) + case TypeNotificationSound: + return UnmarshalNotificationSound(data) + + case TypeNotificationSounds: + return UnmarshalNotificationSounds(data) + case TypeNotification: return UnmarshalNotification(data) @@ -14462,12 +15017,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonIllegalDrugs: + return UnmarshalChatReportReasonIllegalDrugs(data) + + case TypeChatReportReasonPersonalDetails: + return UnmarshalChatReportReasonPersonalDetails(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -14480,6 +15044,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -14495,6 +15062,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -14507,6 +15077,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -14534,6 +15107,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -14558,6 +15134,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -14702,8 +15281,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionCheckPhoneNumber: return UnmarshalSuggestedActionCheckPhoneNumber(data) - case TypeSuggestedActionSeeTicksHint: - return UnmarshalSuggestedActionSeeTicksHint(data) + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) case TypeSuggestedActionConvertToBroadcastGroup: return UnmarshalSuggestedActionConvertToBroadcastGroup(data) @@ -14744,11 +15323,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxies: return UnmarshalProxies(data) - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) + case TypeInputSticker: + return UnmarshalInputSticker(data) case TypeDateRange: return UnmarshalDateRange(data) @@ -14849,6 +15425,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -14870,50 +15449,29 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(data) - case TypeUpdateChatDefaultMessageSenderId: - return UnmarshalUpdateChatDefaultMessageSenderId(data) - - case TypeUpdateChatHasProtectedContent: - return UnmarshalUpdateChatHasProtectedContent(data) - - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatVideoChat: - return UnmarshalUpdateChatVideoChat(data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) - - case TypeUpdateChatNotificationSettings: - return UnmarshalUpdateChatNotificationSettings(data) - - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) - - case TypeUpdateChatMessageTtlSetting: - return UnmarshalUpdateChatMessageTtlSetting(data) - case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatTheme: - return UnmarshalUpdateChatTheme(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(data) + + case TypeUpdateChatNotificationSettings: + return UnmarshalUpdateChatNotificationSettings(data) case TypeUpdateChatPendingJoinRequests: return UnmarshalUpdateChatPendingJoinRequests(data) @@ -14921,8 +15479,32 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) + + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(data) @@ -14930,6 +15512,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(data) @@ -14984,6 +15569,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -15026,6 +15623,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -15044,6 +15644,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateReactions: + return UnmarshalUpdateReactions(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) diff --git a/data/td_api.json b/data/td_api.json index 1e27587..2d04387 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -197,7 +197,7 @@ }, { "name": "authenticationCodeTypeFlashCall", - "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered automatically", + "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically", "class": "AuthenticationCodeType", "properties": [ { @@ -209,7 +209,7 @@ }, { "name": "authenticationCodeTypeMissedCall", - "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered manually by the user", + "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user", "class": "AuthenticationCodeType", "properties": [ { @@ -315,7 +315,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other" + "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other" } ] }, @@ -332,7 +332,7 @@ { "name": "min_user_age", "type": "int32", - "description": "The minimum age of a user to be able to accept the terms; 0 if any" + "description": "The minimum age of a user to be able to accept the terms; 0 if age isn't restricted" }, { "name": "show_popup", @@ -526,7 +526,7 @@ { "name": "can_be_downloaded", "type": "Bool", - "description": "True, if it is possible to try to download or generate the file" + "description": "True, if it is possible to download or generate the file" }, { "name": "can_be_deleted", @@ -568,7 +568,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" + "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -742,18 +742,6 @@ "class": "ThumbnailFormat", "properties": [] }, - { - "name": "thumbnailFormatPng", - "description": "The thumbnail is in PNG format. It will be used only for background patterns", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatWebp", - "description": "The thumbnail is in WEBP format. It will be used only for some stickers", - "class": "ThumbnailFormat", - "properties": [] - }, { "name": "thumbnailFormatGif", "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", @@ -761,14 +749,32 @@ "properties": [] }, { - "name": "thumbnailFormatTgs", - "description": "The thumbnail is in TGS format. It will be used only for animated sticker sets", + "name": "thumbnailFormatMpeg4", + "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", "class": "ThumbnailFormat", "properties": [] }, { - "name": "thumbnailFormatMpeg4", - "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", + "name": "thumbnailFormatPng", + "description": "The thumbnail is in PNG format. It will be used only for background patterns", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatTgs", + "description": "The thumbnail is in TGS format. It will be used only for TGS sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebm", + "description": "The thumbnail is in WEBM format. It will be used only for WEBM sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebp", + "description": "The thumbnail is in WEBP format. It will be used only for some stickers", "class": "ThumbnailFormat", "properties": [] }, @@ -850,6 +856,36 @@ } ] }, + { + "name": "stickerTypeStatic", + "description": "The sticker is an image in WEBP format", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeAnimated", + "description": "The sticker is an animation in TGS format", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeVideo", + "description": "The sticker is a video in WEBM format", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeMask", + "description": "The sticker is a mask in WEBP format to be placed on photos or videos", + "class": "StickerType", + "properties": [ + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; may be null" + } + ] + }, { "name": "closedVectorPath", "description": "Represents a closed vector path. The path begins at the end point of the last command", @@ -1102,19 +1138,9 @@ "description": "Emoji corresponding to the sticker" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, if the sticker is an animated sticker in TGS format" - }, - { - "name": "is_mask", - "type": "Bool", - "description": "True, if the sticker is a mask" - }, - { - "name": "mask_position", - "type": "maskPosition", - "description": "Position where the mask is placed; may be null" + "name": "type", + "type": "StickerType", + "description": "Sticker type" }, { "name": "outline", @@ -1267,7 +1293,7 @@ { "name": "sound", "type": "file", - "description": "File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" + "description": "File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" } ] }, @@ -1348,7 +1374,7 @@ { "name": "provider", "type": "string", - "description": "Provider of the venue database; as defined by the sender. Currently only \"foursquare\" and \"gplaces\" (Google Places) need to be supported" + "description": "Provider of the venue database; as defined by the sender. Currently, only \"foursquare\" and \"gplaces\" (Google Places) need to be supported" }, { "name": "id", @@ -1561,6 +1587,11 @@ "name": "need_location", "type": "Bool", "description": "True, if the location of the user is expected to be sent with every inline query to this bot" + }, + { + "name": "can_be_added_to_attachment_menu", + "type": "Bool", + "description": "True, if the bot can be added to attachment menu" } ] }, @@ -1604,6 +1635,23 @@ } ] }, + { + "name": "botMenuButton", + "description": "Describes a button to be shown instead of bot commands menu button", + "class": "BotMenuButton", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text of the button" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "chatLocation", "description": "Represents a location to which a chat is connected", @@ -1733,6 +1781,115 @@ } ] }, + { + "name": "chatPermissions", + "description": "Describes actions that a user is allowed to take in a chat", + "class": "ChatPermissions", + "properties": [ + { + "name": "can_send_messages", + "type": "Bool", + "description": "True, if the user can send text messages, contacts, locations, and venues" + }, + { + "name": "can_send_media_messages", + "type": "Bool", + "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" + }, + { + "name": "can_send_polls", + "type": "Bool", + "description": "True, if the user can send polls. Implies can_send_messages permissions" + }, + { + "name": "can_send_other_messages", + "type": "Bool", + "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" + }, + { + "name": "can_add_web_page_previews", + "type": "Bool", + "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the user can change the chat title, photo, and other settings" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the user can invite new users to the chat" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the user can pin messages" + } + ] + }, + { + "name": "chatAdministratorRights", + "description": "Describes rights of the administrator", + "class": "ChatAdministratorRights", + "properties": [ + { + "name": "can_manage_chat", + "type": "Bool", + "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the administrator can change the chat title, photo, and other settings" + }, + { + "name": "can_post_messages", + "type": "Bool", + "description": "True, if the administrator can create channel posts; applicable to channels only" + }, + { + "name": "can_edit_messages", + "type": "Bool", + "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" + }, + { + "name": "can_delete_messages", + "type": "Bool", + "description": "True, if the administrator can delete messages of other users" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the administrator can invite new users to the chat" + }, + { + "name": "can_restrict_members", + "type": "Bool", + "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" + }, + { + "name": "can_promote_members", + "type": "Bool", + "description": "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" + }, + { + "name": "can_manage_video_chats", + "type": "Bool", + "description": "True, if the administrator can manage video chats" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" + } + ] + }, { "name": "user", "description": "Represents a user", @@ -1811,7 +1968,7 @@ { "name": "have_access", "type": "Bool", - "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser" + "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser" }, { "name": "type", @@ -1825,6 +1982,43 @@ } ] }, + { + "name": "botInfo", + "description": "Contains information about a bot", + "class": "BotInfo", + "properties": [ + { + "name": "share_text", + "type": "string", + "description": "The text that is shown on the bot's profile page and is sent together with the link when users share the bot" + }, + { + "name": "description", + "type": "string", + "description": "The text shown in the chat with the bot if the chat is empty" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown" + }, + { + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "List of the bot commands" + }, + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + }, + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; may be null" + } + ] + }, { "name": "userFullInfo", "description": "Contains full information about a user", @@ -1870,25 +2064,15 @@ "type": "string", "description": "A short user bio" }, - { - "name": "share_text", - "type": "string", - "description": "For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot" - }, - { - "name": "description", - "type": "string", - "description": "For bots, the text shown in the chat with the bot if the chat is empty" - }, { "name": "group_in_common_count", "type": "int32", "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" }, { - "name": "commands", - "type": "vector\u003cbotCommand\u003e", - "description": "For bots, list of the bot commands" + "name": "bot_info", + "type": "botInfo", + "description": "For bots, information about the bot; may be null" } ] }, @@ -1900,7 +2084,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of users found" + "description": "Approximate total number of users found" }, { "name": "user_ids", @@ -1943,53 +2127,6 @@ } ] }, - { - "name": "chatPermissions", - "description": "Describes actions that a user is allowed to take in a chat", - "class": "ChatPermissions", - "properties": [ - { - "name": "can_send_messages", - "type": "Bool", - "description": "True, if the user can send text messages, contacts, locations, and venues" - }, - { - "name": "can_send_media_messages", - "type": "Bool", - "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" - }, - { - "name": "can_send_polls", - "type": "Bool", - "description": "True, if the user can send polls. Implies can_send_messages permissions" - }, - { - "name": "can_send_other_messages", - "type": "Bool", - "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" - }, - { - "name": "can_add_web_page_previews", - "type": "Bool", - "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the user can change the chat title, photo, and other settings" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the user can invite new users to the chat" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the user can pin messages" - } - ] - }, { "name": "chatMemberStatusCreator", "description": "The user is the owner of the chat and has all the administrator privileges", @@ -2028,59 +2165,9 @@ "description": "True, if the current user can edit the administrator privileges for the called user" }, { - "name": "can_manage_chat", - "type": "Bool", - "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the administrator can change the chat title, photo, and other settings" - }, - { - "name": "can_post_messages", - "type": "Bool", - "description": "True, if the administrator can create channel posts; applicable to channels only" - }, - { - "name": "can_edit_messages", - "type": "Bool", - "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" - }, - { - "name": "can_delete_messages", - "type": "Bool", - "description": "True, if the administrator can delete messages of other users" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the administrator can invite new users to the chat" - }, - { - "name": "can_restrict_members", - "type": "Bool", - "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" - }, - { - "name": "can_promote_members", - "type": "Bool", - "description": "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" - }, - { - "name": "can_manage_video_chats", - "type": "Bool", - "description": "True, if the administrator can manage video chats" - }, - { - "name": "is_anonymous", - "type": "Bool", - "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" + "name": "rights", + "type": "chatAdministratorRights", + "description": "Rights of the administrator" } ] }, @@ -2165,7 +2252,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", @@ -2336,7 +2423,7 @@ "description": "Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown" }, { - "name": "expire_date", + "name": "expiration_date", "type": "int32", "description": "Point in time (Unix timestamp) when the link will expire; 0 if never" }, @@ -2363,7 +2450,7 @@ { "name": "is_primary", "type": "Bool", - "description": "True, if the link is primary. Primary invite link can't have name, expire date or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time" + "description": "True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time" }, { "name": "is_revoked", @@ -2380,7 +2467,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat invite links found" + "description": "Approximate total number of chat invite links found" }, { "name": "invite_links", @@ -2425,7 +2512,7 @@ }, { "name": "chatInviteLinkMember", - "description": "Describes a chat member joined a chat by an invite link", + "description": "Describes a chat member joined a chat via an invite link", "class": "ChatInviteLinkMember", "properties": [ { @@ -2447,18 +2534,18 @@ }, { "name": "chatInviteLinkMembers", - "description": "Contains a list of chat members joined a chat by an invite link", + "description": "Contains a list of chat members joined a chat via an invite link", "class": "ChatInviteLinkMembers", "properties": [ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", "type": "vector\u003cchatInviteLinkMember\u003e", - "description": "List of chat members, joined a chat by an invite link" + "description": "List of chat members, joined a chat via an invite link" } ] }, @@ -2543,13 +2630,13 @@ }, { "name": "chatJoinRequests", - "description": "Contains a list of chat join requests", + "description": "Contains a list of requests to join a chat", "class": "ChatJoinRequests", "properties": [ { "name": "total_count", "type": "int32", - "description": "Approximate total count of requests found" + "description": "Approximate total number of requests found" }, { "name": "requests", @@ -2560,7 +2647,7 @@ }, { "name": "chatJoinRequestsInfo", - "description": "Contains information about pending chat join requests", + "description": "Contains information about pending join requests for a chat", "class": "ChatJoinRequestsInfo", "properties": [ { @@ -2571,7 +2658,7 @@ { "name": "user_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of users sent the newest pending join requests" + "description": "Identifiers of at most 3 users sent the newest pending join requests" } ] }, @@ -2672,7 +2759,7 @@ { "name": "member_count", "type": "int32", - "description": "Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules" + "description": "Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules" }, { "name": "has_linked_chat", @@ -2702,7 +2789,7 @@ { "name": "is_broadcast_group", "type": "Bool", - "description": "True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on number of members" + "description": "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" }, { "name": "is_verified", @@ -2819,7 +2906,7 @@ { "name": "invite_link", "type": "chatInviteLink", - "description": "Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only" + "description": "Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only" }, { "name": "bot_commands", @@ -2925,7 +3012,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages senders found" + "description": "Approximate total number of messages senders found" }, { "name": "senders", @@ -2948,7 +3035,7 @@ }, { "name": "messageForwardOriginChat", - "description": "The message was originally sent by an anonymous chat administrator on behalf of the chat", + "description": "The message was originally sent on behalf of a chat", "class": "MessageForwardOrigin", "properties": [ { @@ -2959,7 +3046,7 @@ { "name": "author_signature", "type": "string", - "description": "Original message author signature" + "description": "For messages originally sent by an anonymous chat administrator, original message author signature" } ] }, @@ -3054,7 +3141,7 @@ { "name": "recent_replier_ids", "type": "vector\u003cMessageSender\u003e", - "description": "Identifiers of recent repliers to the message; available in channels with a discussion supergroup" + "description": "Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available" }, { "name": "last_read_inbox_message_id", @@ -3073,6 +3160,33 @@ } ] }, + { + "name": "messageReaction", + "description": "Contains information about a reaction to a message", + "class": "MessageReaction", + "properties": [ + { + "name": "reaction", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "total_count", + "type": "int32", + "description": "Number of times the reaction was added" + }, + { + "name": "is_chosen", + "type": "Bool", + "description": "True, if the reaction is chosen by the current user" + }, + { + "name": "recent_sender_ids", + "type": "vector\u003cMessageSender\u003e", + "description": "Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats" + } + ] + }, { "name": "messageInteractionInfo", "description": "Contains information about interactions with a message", @@ -3092,6 +3206,33 @@ "name": "reply_info", "type": "messageReplyInfo", "description": "Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself" + }, + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "The list of reactions added to the message" + } + ] + }, + { + "name": "unreadReaction", + "description": "Contains information about an unread reaction to a message", + "class": "UnreadReaction", + "properties": [ + { + "name": "reaction", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender, added the reaction" + }, + { + "name": "is_big", + "type": "Bool", + "description": "True, if the reaction was added with a big animation" } ] }, @@ -3198,15 +3339,20 @@ "type": "Bool", "description": "True, if the message can be deleted for all users" }, + { + "name": "can_get_added_reactions", + "type": "Bool", + "description": "True, if the list of added reactions is available through getMessageAddedReactions" + }, { "name": "can_get_statistics", "type": "Bool", - "description": "True, if the message statistics are available" + "description": "True, if the message statistics are available through getMessageStatistics" }, { "name": "can_get_message_thread", "type": "Bool", - "description": "True, if the message thread info is available" + "description": "True, if information about the message thread is available through getMessageThread" }, { "name": "can_get_viewers", @@ -3216,7 +3362,7 @@ { "name": "can_get_media_timestamp_links", "type": "Bool", - "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description" + "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink" }, { "name": "has_timestamped_media", @@ -3253,6 +3399,11 @@ "type": "messageInteractionInfo", "description": "Information about interactions with the message; may be null" }, + { + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "Information about unread reactions added to the message" + }, { "name": "reply_in_chat_id", "type": "int53", @@ -3318,7 +3469,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found" + "description": "Approximate total number of messages found" }, { "name": "messages", @@ -3335,7 +3486,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found; -1 if unknown" + "description": "Approximate total number of messages found; -1 if unknown" }, { "name": "messages", @@ -3379,7 +3530,7 @@ { "name": "total_count", "type": "int32", - "description": "Total count of messages found" + "description": "Total number of messages found" }, { "name": "positions", @@ -3390,24 +3541,24 @@ }, { "name": "messageCalendarDay", - "description": "Contains information about found messages sent in a specific day", + "description": "Contains information about found messages sent on a specific day", "class": "MessageCalendarDay", "properties": [ { "name": "total_count", "type": "int32", - "description": "Total number of found messages sent in the day" + "description": "Total number of found messages sent on the day" }, { "name": "message", "type": "message", - "description": "First message sent in the day" + "description": "First message sent on the day" } ] }, { "name": "messageCalendar", - "description": "Contains information about found messages, splitted by days according to the option \"utc_time_offset\"", + "description": "Contains information about found messages, split by days according to the option \"utc_time_offset\"", "class": "MessageCalendar", "properties": [ { @@ -3428,36 +3579,105 @@ "class": "SponsoredMessage", "properties": [ { - "name": "id", - "type": "int32", - "description": "Unique sponsored message identifier" + "name": "message_id", + "type": "int53", + "description": "Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages" }, { "name": "sponsor_chat_id", "type": "int53", - "description": "Chat identifier" + "description": "Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link" + }, + { + "name": "sponsor_chat_info", + "type": "chatInviteLinkInfo", + "description": "Information about the sponsor chat; may be null unless sponsor_chat_id == 0" }, { "name": "link", "type": "InternalLinkType", - "description": "An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead" + "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" }, { "name": "content", "type": "MessageContent", - "description": "Content of the message" + "description": "Content of the message. Currently, can be only of the type messageText" } ] }, { - "name": "sponsoredMessages", - "description": "Contains a list of sponsored messages", - "class": "SponsoredMessages", + "name": "fileDownload", + "description": "Describes a file added to file download list", + "class": "FileDownload", "properties": [ { - "name": "messages", - "type": "vector\u003csponsoredMessage\u003e", - "description": "List of sponsored messages" + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "message", + "type": "message", + "description": "The message with the file" + }, + { + "name": "add_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file was added to the download list" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + } + ] + }, + { + "name": "downloadedFileCounts", + "description": "Contains number of being downloaded and recently downloaded files found", + "class": "DownloadedFileCounts", + "properties": [ + { + "name": "active_count", + "type": "int32", + "description": "Number of active file downloads found, including paused" + }, + { + "name": "paused_count", + "type": "int32", + "description": "Number of paused file downloads found" + }, + { + "name": "completed_count", + "type": "int32", + "description": "Number of completed file downloads found" + } + ] + }, + { + "name": "foundFileDownloads", + "description": "Contains a list of downloaded files, found by a search", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "total_counts", + "type": "downloadedFileCounts", + "description": "Total number of suitable files, ignoring offset" + }, + { + "name": "files", + "type": "vector\u003cfileDownload\u003e", + "description": "The list of files" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" } ] }, @@ -3469,13 +3689,13 @@ }, { "name": "notificationSettingsScopeGroupChats", - "description": "Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value", + "description": "Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "notificationSettingsScopeChannelChats", - "description": "Notification settings applied to all channels when the corresponding chat setting has a default value", + "description": "Notification settings applied to all channel chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, @@ -3497,12 +3717,12 @@ { "name": "use_default_sound", "type": "Bool", - "description": "If true, sound is ignored and the value for the relevant type of chat is used instead" + "description": "If true, the value for the relevant type of chat is used instead of sound_id" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "use_default_show_preview", @@ -3547,9 +3767,9 @@ "description": "Time left before notifications will be unmuted, in seconds" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "show_preview", @@ -3576,7 +3796,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to; 0 if none" + "description": "Identifier of the replied message; 0 if none" }, { "name": "date", @@ -3661,7 +3881,7 @@ { "name": "icon_name", "type": "string", - "description": "The icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" + "description": "The chosen icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" }, { "name": "pinned_chat_ids", @@ -3738,7 +3958,7 @@ { "name": "icon_name", "type": "string", - "description": "The icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" + "description": "The chosen or default icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" } ] }, @@ -3920,9 +4140,9 @@ "description": "Positions of the chat in chat lists" }, { - "name": "default_message_sender_id", + "name": "message_sender_id", "type": "MessageSender", - "description": "Default identifier of a user or chat that is chosen to send messages in the chat; may be null if the user can't change message sender" + "description": "Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender" }, { "name": "has_protected_content", @@ -3985,12 +4205,22 @@ "description": "Number of unread messages with a mention/reply in the chat" }, { - "name": "notification_settings", - "type": "chatNotificationSettings", - "description": "Notification settings for this chat" + "name": "unread_reaction_count", + "type": "int32", + "description": "Number of messages with unread reactions in the chat" }, { - "name": "message_ttl_setting", + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "Notification settings for the chat" + }, + { + "name": "available_reactions", + "type": "vector\u003cstring\u003e", + "description": "List of reactions, available in the chat" + }, + { + "name": "message_ttl", "type": "int32", "description": "Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats" }, @@ -4039,7 +4269,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chats found" + "description": "Approximate total number of chats found" }, { "name": "chat_ids", @@ -4204,6 +4434,18 @@ } ] }, + { + "name": "keyboardButtonTypeWebApp", + "description": "A button that opens a web app by calling getWebAppUrl", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to getWebAppUrl" + } + ] + }, { "name": "keyboardButton", "description": "Represents a single button in a bot keyboard", @@ -4235,13 +4477,13 @@ }, { "name": "inlineKeyboardButtonTypeLoginUrl", - "description": "A button that opens a specified URL and automatically authorize the current user if allowed to do so", + "description": "A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo", "class": "InlineKeyboardButtonType", "properties": [ { "name": "url", "type": "string", - "description": "An HTTP URL to open" + "description": "An HTTP URL to pass to getLoginUrlInfo" }, { "name": "id", @@ -4255,6 +4497,18 @@ } ] }, + { + "name": "inlineKeyboardButtonTypeWebApp", + "description": "A button that opens a web app by calling openWebApp", + "class": "InlineKeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to openWebApp" + } + ] + }, { "name": "inlineKeyboardButtonTypeCallback", "description": "A button that sends a callback query to a bot", @@ -4310,7 +4564,7 @@ }, { "name": "inlineKeyboardButtonTypeUser", - "description": "A button to open a chat with a user", + "description": "A button with a user reference to be handled in the same way as textEntityTypeMentionName entities", "class": "InlineKeyboardButtonType", "properties": [ { @@ -4454,6 +4708,23 @@ } ] }, + { + "name": "webAppInfo", + "description": "Contains information about a web app", + "class": "WebAppInfo", + "properties": [ + { + "name": "launch_id", + "type": "int64", + "description": "Unique identifier for the web app launch" + }, + { + "name": "url", + "type": "string", + "description": "A web app URL to open in a web view" + } + ] + }, { "name": "messageThreadInfo", "description": "Contains information about a message thread", @@ -5324,7 +5595,7 @@ { "name": "username", "type": "string", - "description": "Chat username, by which all other information about the chat can be resolved" + "description": "Chat username by which all other information about the chat can be resolved" } ] }, @@ -5444,7 +5715,7 @@ { "name": "version", "type": "int32", - "description": "Version of the instant view, currently can be 1 or 2" + "description": "Version of the instant view; currently, can be 1 or 2" }, { "name": "is_rtl", @@ -5546,7 +5817,7 @@ { "name": "document", "type": "document", - "description": "Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null" + "description": "Preview of the content as a document, if available; may be null" }, { "name": "sticker", @@ -5571,7 +5842,7 @@ { "name": "instant_view_version", "type": "int32", - "description": "Version of instant view, available for the web page (currently can be 1 or 2), 0 if none" + "description": "Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none" } ] }, @@ -5712,6 +5983,43 @@ } ] }, + { + "name": "themeParameters", + "description": "Contains parameters of the app theme", + "class": "ThemeParameters", + "properties": [ + { + "name": "background_color", + "type": "int32", + "description": "A color of the background in the RGB24 format" + }, + { + "name": "text_color", + "type": "int32", + "description": "A color of text in the RGB24 format" + }, + { + "name": "hint_color", + "type": "int32", + "description": "A color of hints in the RGB24 format" + }, + { + "name": "link_color", + "type": "int32", + "description": "A color of links in the RGB24 format" + }, + { + "name": "button_color", + "type": "int32", + "description": "A color of the buttons in the RGB24 format" + }, + { + "name": "button_text_color", + "type": "int32", + "description": "A color of text on the buttons in the RGB24 format" + } + ] + }, { "name": "labeledPricePart", "description": "Portion of the price of a product (e.g., \"delivery cost\", \"tax amount\")", @@ -5942,43 +6250,6 @@ } ] }, - { - "name": "paymentFormTheme", - "description": "Theme colors for a payment form", - "class": "PaymentFormTheme", - "properties": [ - { - "name": "background_color", - "type": "int32", - "description": "A color of the payment form background in the RGB24 format" - }, - { - "name": "text_color", - "type": "int32", - "description": "A color of text in the RGB24 format" - }, - { - "name": "hint_color", - "type": "int32", - "description": "A color of hints in the RGB24 format" - }, - { - "name": "link_color", - "type": "int32", - "description": "A color of links in the RGB24 format" - }, - { - "name": "button_color", - "type": "int32", - "description": "A color of the buttons in the RGB24 format" - }, - { - "name": "button_text_color", - "type": "int32", - "description": "A color of text on the buttons in the RGB24 format" - } - ] - }, { "name": "paymentForm", "description": "Contains information about an invoice payment form", @@ -7638,7 +7909,7 @@ }, { "name": "messageChatJoinByLink", - "description": "A new member joined the chat by invite link", + "description": "A new member joined the chat via an invite link", "class": "MessageContent", "properties": [] }, @@ -7727,7 +7998,7 @@ { "name": "ttl", "type": "int32", - "description": "New message TTL setting" + "description": "New message TTL" } ] }, @@ -7852,9 +8123,38 @@ } ] }, + { + "name": "messageWebAppDataSent", + "description": "Data from a web app has been sent to a bot", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" + } + ] + }, + { + "name": "messageWebAppDataReceived", + "description": "Data from a web app has been received; for bots only", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" + }, + { + "name": "data", + "type": "string", + "description": "Received data" + } + ] + }, { "name": "messagePassportDataSent", - "description": "Telegram Passport data has been sent", + "description": "Telegram Passport data has been sent to a bot", "class": "MessageContent", "properties": [ { @@ -7981,6 +8281,12 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypeSpoiler", + "description": "A spoiler text. Not supported in secret chats", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeCode", "description": "Text that must be formatted as if inside a code HTML tag", @@ -8096,6 +8402,11 @@ "type": "Bool", "description": "Pass true if the message is sent from the background" }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the message must be protected from forwarding and saving; for bots only" + }, { "name": "scheduling_state", "type": "MessageSchedulingState", @@ -8133,7 +8444,7 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" + "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { "name": "disable_web_page_preview", @@ -8645,7 +8956,7 @@ { "name": "copy_options", "type": "messageCopyOptions", - "description": "Options to be used to copy content of the message without reference to the original sender; pass null to try to forward the message as usual" + "description": "Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual" } ] }, @@ -8709,18 +9020,6 @@ "class": "SearchMessagesFilter", "properties": [] }, - { - "name": "searchMessagesFilterCall", - "description": "Returns only call messages", - "class": "SearchMessagesFilter", - "properties": [] - }, - { - "name": "searchMessagesFilterMissedCall", - "description": "Returns only incoming call messages with missed/declined discard reasons", - "class": "SearchMessagesFilter", - "properties": [] - }, { "name": "searchMessagesFilterVideoNote", "description": "Returns only video note messages", @@ -8745,6 +9044,12 @@ "class": "SearchMessagesFilter", "properties": [] }, + { + "name": "searchMessagesFilterUnreadReaction", + "description": "Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user", + "class": "SearchMessagesFilter", + "properties": [] + }, { "name": "searchMessagesFilterFailedToSend", "description": "Returns only failed to send messages. This filter can be used only if the message database is used", @@ -8978,7 +9283,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" }, { "name": "thumbnail_outline", @@ -9001,14 +9306,9 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" - }, - { - "name": "is_masks", - "type": "Bool", - "description": "True, if the stickers in the set are masks" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" }, { "name": "is_viewed", @@ -9050,7 +9350,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" }, { "name": "thumbnail_outline", @@ -9073,14 +9373,9 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" - }, - { - "name": "is_masks", - "type": "Bool", - "description": "True, if the stickers in the set are masks" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" }, { "name": "is_viewed", @@ -9391,6 +9686,57 @@ "class": "GroupCallVideoQuality", "properties": [] }, + { + "name": "groupCallStream", + "description": "Describes an available stream in a group call", + "class": "GroupCallStream", + "properties": [ + { + "name": "channel_id", + "type": "int32", + "description": "Identifier of an audio/video channel" + }, + { + "name": "scale", + "type": "int32", + "description": "Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds" + }, + { + "name": "time_offset", + "type": "int53", + "description": "Point in time when the stream currently ends; Unix timestamp in milliseconds" + } + ] + }, + { + "name": "groupCallStreams", + "description": "Represents a list of group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "streams", + "type": "vector\u003cgroupCallStream\u003e", + "description": "A list of group call streams" + } + ] + }, + { + "name": "rtmpUrl", + "description": "Represents an RTMP url", + "class": "RtmpUrl", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL" + }, + { + "name": "stream_key", + "type": "string", + "description": "Stream key" + } + ] + }, { "name": "groupCallRecentSpeaker", "description": "Describes a recently speaking participant in a group call", @@ -9438,6 +9784,11 @@ "type": "Bool", "description": "True, if the call is active" }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "True, if the chat is an RTMP stream instead of an ordinary video chat" + }, { "name": "is_joined", "type": "Bool", @@ -9458,6 +9809,11 @@ "type": "int32", "description": "Number of participants in the group call" }, + { + "name": "has_hidden_listeners", + "type": "Bool", + "description": "True, if group call participants, which are muted, aren't returned in participant list" + }, { "name": "loaded_all_participants", "type": "Bool", @@ -9466,7 +9822,7 @@ { "name": "recent_speakers", "type": "vector\u003cgroupCallRecentSpeaker\u003e", - "description": "Recently speaking users in the group call" + "description": "At most 3 recently speaking users in the group call" }, { "name": "is_my_video_enabled", @@ -9760,7 +10116,115 @@ { "name": "authentication_tokens", "type": "vector\u003cstring\u003e", - "description": "List of authentication tokens, received in updateOption(\"authentication_token\") in previously logged out sessions" + "description": "List of up to 20 authentication tokens, recently received in updateOption(\"authentication_token\") in previously logged out sessions" + } + ] + }, + { + "name": "addedReaction", + "description": "Represents a reaction applied to a message", + "class": "AddedReaction", + "properties": [ + { + "name": "reaction", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the chat member, applied the reaction" + } + ] + }, + { + "name": "addedReactions", + "description": "Represents a list of reactions added to a message", + "class": "AddedReactions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "The total number of found reactions" + }, + { + "name": "reactions", + "type": "vector\u003caddedReaction\u003e", + "description": "The list of added reactions" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, + { + "name": "availableReactions", + "description": "Represents a list of available reactions", + "class": "AvailableReactions", + "properties": [ + { + "name": "reactions", + "type": "vector\u003cstring\u003e", + "description": "List of reactions" + } + ] + }, + { + "name": "reaction", + "description": "Contains stickers which must be used for reaction animation rendering", + "class": "Reaction", + "properties": [ + { + "name": "reaction", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "title", + "type": "string", + "description": "Reaction title" + }, + { + "name": "is_active", + "type": "Bool", + "description": "True, if the reaction can be added to new messages and enabled in chats" + }, + { + "name": "static_icon", + "type": "sticker", + "description": "Static icon for the reaction" + }, + { + "name": "appear_animation", + "type": "sticker", + "description": "Appear animation for the reaction" + }, + { + "name": "select_animation", + "type": "sticker", + "description": "Select animation for the reaction" + }, + { + "name": "activate_animation", + "type": "sticker", + "description": "Activate animation for the reaction" + }, + { + "name": "effect_animation", + "type": "sticker", + "description": "Effect animation for the reaction" + }, + { + "name": "around_animation", + "type": "sticker", + "description": "Around animation for the reaction; may be null" + }, + { + "name": "center_animation", + "type": "sticker", + "description": "Center animation for the reaction; may be null" } ] }, @@ -9837,6 +10301,87 @@ } ] }, + { + "name": "attachmentMenuBotColor", + "description": "Describes a color to highlight a bot added to attachment menu", + "class": "AttachmentMenuBotColor", + "properties": [ + { + "name": "light_color", + "type": "int32", + "description": "Color in the RGB24 format for light themes" + }, + { + "name": "dark_color", + "type": "int32", + "description": "Color in the RGB24 format for dark themes" + } + ] + }, + { + "name": "attachmentMenuBot", + "description": "Represents a bot added to attachment menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot added to attachment menu" + }, + { + "name": "name", + "type": "string", + "description": "Name for the bot in attachment menu" + }, + { + "name": "name_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected name of the bot if appropriate; may be null" + }, + { + "name": "default_icon", + "type": "file", + "description": "Default attachment menu icon for the bot in SVG format; may be null" + }, + { + "name": "ios_static_icon", + "type": "file", + "description": "Attachment menu icon for the bot in SVG format for the official iOS app; may be null" + }, + { + "name": "ios_animated_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official iOS app; may be null" + }, + { + "name": "android_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official Android app; may be null" + }, + { + "name": "macos_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official native macOS app; may be null" + }, + { + "name": "icon_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected icon of the bot if appropriate; may be null" + } + ] + }, + { + "name": "sentWebAppMessage", + "description": "Information about the message sent by answerWebAppQuery", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "inline_message_id", + "type": "string", + "description": "Identifier of the sent inline message, if known" + } + ] + }, { "name": "httpUrl", "description": "Contains an HTTP URL", @@ -10237,7 +10782,7 @@ }, { "name": "inputInlineQueryResultSticker", - "description": "Represents a link to a WEBP or TGS sticker", + "description": "Represents a link to a WEBP, TGS, or WEBM sticker", "class": "InputInlineQueryResult", "properties": [ { @@ -10253,7 +10798,7 @@ { "name": "sticker_url", "type": "string", - "description": "The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)" + "description": "The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)" }, { "name": "sticker_width", @@ -10872,18 +11417,6 @@ } ] }, - { - "name": "chatEventPollStopped", - "description": "A poll in a message was stopped", - "class": "ChatEventAction", - "properties": [ - { - "name": "message", - "type": "message", - "description": "The message with the poll" - } - ] - }, { "name": "chatEventMessagePinned", "description": "A message was pinned", @@ -10908,6 +11441,18 @@ } ] }, + { + "name": "chatEventPollStopped", + "description": "A poll in a message was stopped", + "class": "ChatEventAction", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with the poll" + } + ] + }, { "name": "chatEventMemberJoined", "description": "A new member joined the chat", @@ -10916,7 +11461,7 @@ }, { "name": "chatEventMemberJoinedByInviteLink", - "description": "A new member joined the chat by an invite link", + "description": "A new member joined the chat via an invite link", "class": "ChatEventAction", "properties": [ { @@ -10943,12 +11488,6 @@ } ] }, - { - "name": "chatEventMemberLeft", - "description": "A member left the chat", - "class": "ChatEventAction", - "properties": [] - }, { "name": "chatEventMemberInvited", "description": "A new chat member was invited", @@ -10966,6 +11505,12 @@ } ] }, + { + "name": "chatEventMemberLeft", + "description": "A member left the chat", + "class": "ChatEventAction", + "properties": [] + }, { "name": "chatEventMemberPromoted", "description": "A chat member has gained/lost administrator status, or the list of their administrator privileges has changed", @@ -11011,36 +11556,19 @@ ] }, { - "name": "chatEventTitleChanged", - "description": "The chat title was changed", + "name": "chatEventAvailableReactionsChanged", + "description": "The chat available reactions were changed", "class": "ChatEventAction", "properties": [ { - "name": "old_title", - "type": "string", - "description": "Previous chat title" + "name": "old_available_reactions", + "type": "vector\u003cstring\u003e", + "description": "Previous chat available reactions" }, { - "name": "new_title", - "type": "string", - "description": "New chat title" - } - ] - }, - { - "name": "chatEventPermissionsChanged", - "description": "The chat permissions was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_permissions", - "type": "chatPermissions", - "description": "Previous chat permissions" - }, - { - "name": "new_permissions", - "type": "chatPermissions", - "description": "New chat permissions" + "name": "new_available_reactions", + "type": "vector\u003cstring\u003e", + "description": "New chat available reactions" } ] }, @@ -11061,52 +11589,6 @@ } ] }, - { - "name": "chatEventUsernameChanged", - "description": "The chat username was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_username", - "type": "string", - "description": "Previous chat username" - }, - { - "name": "new_username", - "type": "string", - "description": "New chat username" - } - ] - }, - { - "name": "chatEventPhotoChanged", - "description": "The chat photo was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_photo", - "type": "chatPhoto", - "description": "Previous chat photo value; may be null" - }, - { - "name": "new_photo", - "type": "chatPhoto", - "description": "New chat photo value; may be null" - } - ] - }, - { - "name": "chatEventInvitesToggled", - "description": "The can_invite_users permission of a supergroup chat was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "can_invite_users", - "type": "Bool", - "description": "New value of can_invite_users permission" - } - ] - }, { "name": "chatEventLinkedChatChanged", "description": "The linked chat of a supergroup was changed", @@ -11124,81 +11606,6 @@ } ] }, - { - "name": "chatEventSlowModeDelayChanged", - "description": "The slow_mode_delay setting of a supergroup was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_slow_mode_delay", - "type": "int32", - "description": "Previous value of slow_mode_delay, in seconds" - }, - { - "name": "new_slow_mode_delay", - "type": "int32", - "description": "New value of slow_mode_delay, in seconds" - } - ] - }, - { - "name": "chatEventMessageTtlSettingChanged", - "description": "The message TTL setting was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_message_ttl_setting", - "type": "int32", - "description": "Previous value of message_ttl_setting" - }, - { - "name": "new_message_ttl_setting", - "type": "int32", - "description": "New value of message_ttl_setting" - } - ] - }, - { - "name": "chatEventSignMessagesToggled", - "description": "The sign_messages setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "sign_messages", - "type": "Bool", - "description": "New value of sign_messages" - } - ] - }, - { - "name": "chatEventHasProtectedContentToggled", - "description": "The has_protected_content setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "has_protected_content", - "type": "Bool", - "description": "New value of has_protected_content" - } - ] - }, - { - "name": "chatEventStickerSetChanged", - "description": "The supergroup sticker set was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_sticker_set_id", - "type": "int64", - "description": "Previous identifier of the chat sticker set; 0 if none" - }, - { - "name": "new_sticker_set_id", - "type": "int64", - "description": "New identifier of the chat sticker set; 0 if none" - } - ] - }, { "name": "chatEventLocationChanged", "description": "The supergroup location was changed", @@ -11216,6 +11623,149 @@ } ] }, + { + "name": "chatEventMessageTtlChanged", + "description": "The message TTL was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_message_ttl", + "type": "int32", + "description": "Previous value of message_ttl" + }, + { + "name": "new_message_ttl", + "type": "int32", + "description": "New value of message_ttl" + } + ] + }, + { + "name": "chatEventPermissionsChanged", + "description": "The chat permissions was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_permissions", + "type": "chatPermissions", + "description": "Previous chat permissions" + }, + { + "name": "new_permissions", + "type": "chatPermissions", + "description": "New chat permissions" + } + ] + }, + { + "name": "chatEventPhotoChanged", + "description": "The chat photo was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_photo", + "type": "chatPhoto", + "description": "Previous chat photo value; may be null" + }, + { + "name": "new_photo", + "type": "chatPhoto", + "description": "New chat photo value; may be null" + } + ] + }, + { + "name": "chatEventSlowModeDelayChanged", + "description": "The slow_mode_delay setting of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_slow_mode_delay", + "type": "int32", + "description": "Previous value of slow_mode_delay, in seconds" + }, + { + "name": "new_slow_mode_delay", + "type": "int32", + "description": "New value of slow_mode_delay, in seconds" + } + ] + }, + { + "name": "chatEventStickerSetChanged", + "description": "The supergroup sticker set was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_sticker_set_id", + "type": "int64", + "description": "Previous identifier of the chat sticker set; 0 if none" + }, + { + "name": "new_sticker_set_id", + "type": "int64", + "description": "New identifier of the chat sticker set; 0 if none" + } + ] + }, + { + "name": "chatEventTitleChanged", + "description": "The chat title was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_title", + "type": "string", + "description": "Previous chat title" + }, + { + "name": "new_title", + "type": "string", + "description": "New chat title" + } + ] + }, + { + "name": "chatEventUsernameChanged", + "description": "The chat username was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_username", + "type": "string", + "description": "Previous chat username" + }, + { + "name": "new_username", + "type": "string", + "description": "New chat username" + } + ] + }, + { + "name": "chatEventHasProtectedContentToggled", + "description": "The has_protected_content setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "chatEventInvitesToggled", + "description": "The can_invite_users permission of a supergroup chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "can_invite_users", + "type": "Bool", + "description": "New value of can_invite_users permission" + } + ] + }, { "name": "chatEventIsAllHistoryAvailableToggled", "description": "The is_all_history_available setting of a supergroup was toggled", @@ -11228,6 +11778,18 @@ } ] }, + { + "name": "chatEventSignMessagesToggled", + "description": "The sign_messages setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "sign_messages", + "type": "Bool", + "description": "New value of sign_messages" + } + ] + }, { "name": "chatEventInviteLinkEdited", "description": "A chat invite link was edited", @@ -11282,8 +11844,8 @@ ] }, { - "name": "chatEventVideoChatDiscarded", - "description": "A video chat was discarded", + "name": "chatEventVideoChatEnded", + "description": "A video chat was ended", "class": "ChatEventAction", "properties": [ { @@ -11293,6 +11855,18 @@ } ] }, + { + "name": "chatEventVideoChatMuteNewParticipantsToggled", + "description": "The mute_new_participants setting of a video chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ] + }, { "name": "chatEventVideoChatParticipantIsMutedToggled", "description": "A video chat participant was muted or unmuted", @@ -11327,18 +11901,6 @@ } ] }, - { - "name": "chatEventVideoChatMuteNewParticipantsToggled", - "description": "The mute_new_participants setting of a video chat was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "mute_new_participants", - "type": "Bool", - "description": "New value of the mute_new_participants setting" - } - ] - }, { "name": "chatEvent", "description": "Represents a chat event", @@ -11355,14 +11917,14 @@ "description": "Point in time (Unix timestamp) when the event happened" }, { - "name": "user_id", - "type": "int53", - "description": "Identifier of the user who performed the action that triggered the event" + "name": "member_id", + "type": "MessageSender", + "description": "Identifier of the user or chat who performed the action" }, { "name": "action", "type": "ChatEventAction", - "description": "Action performed by the user" + "description": "The action" } ] }, @@ -11459,7 +12021,7 @@ }, { "name": "languagePackStringValuePluralized", - "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info", + "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information", "class": "LanguagePackStringValue", "properties": [ { @@ -11557,7 +12119,7 @@ { "name": "plural_code", "type": "string", - "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info" + "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information" }, { "name": "is_official", @@ -11621,7 +12183,7 @@ { "name": "token", "type": "string", - "description": "Device registration token; may be empty to de-register a device" + "description": "Device registration token; may be empty to deregister a device" }, { "name": "encrypt", @@ -11638,7 +12200,7 @@ { "name": "device_token", "type": "string", - "description": "Device token; may be empty to de-register a device" + "description": "Device token; may be empty to deregister a device" }, { "name": "is_app_sandbox", @@ -11655,7 +12217,7 @@ { "name": "device_token", "type": "string", - "description": "Device token; may be empty to de-register a device" + "description": "Device token; may be empty to deregister a device" }, { "name": "is_app_sandbox", @@ -11677,7 +12239,7 @@ { "name": "access_token", "type": "string", - "description": "The access token that will be used to send notifications; may be empty to de-register a device" + "description": "The access token that will be used to send notifications; may be empty to deregister a device" } ] }, @@ -11689,7 +12251,7 @@ { "name": "channel_uri", "type": "string", - "description": "Push notification channel URI; may be empty to de-register a device" + "description": "Push notification channel URI; may be empty to deregister a device" } ] }, @@ -11701,7 +12263,7 @@ { "name": "channel_uri", "type": "string", - "description": "Push notification channel URI; may be empty to de-register a device" + "description": "Push notification channel URI; may be empty to deregister a device" } ] }, @@ -11713,7 +12275,7 @@ { "name": "endpoint", "type": "string", - "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device" + "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device" }, { "name": "p256dh_base64url", @@ -11735,7 +12297,7 @@ { "name": "endpoint", "type": "string", - "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device" + "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device" } ] }, @@ -11747,7 +12309,7 @@ { "name": "token", "type": "string", - "description": "Token; may be empty to de-register a device" + "description": "Token; may be empty to deregister a device" } ] }, @@ -11759,7 +12321,7 @@ { "name": "token", "type": "string", - "description": "Token; may be empty to de-register a device" + "description": "Token; may be empty to deregister a device" } ] }, @@ -11771,7 +12333,7 @@ { "name": "reg_id", "type": "string", - "description": "Push service registration identifier; may be empty to de-register a device" + "description": "Push service registration identifier; may be empty to deregister a device" } ] }, @@ -12084,7 +12646,7 @@ }, { "name": "checkChatUsernameResultPublicChatsTooMuch", - "description": "The user has too much chats with username, one of them must be made private first", + "description": "The user has too many chats with username, one of them must be made private first", "class": "CheckChatUsernameResult", "properties": [] }, @@ -12573,7 +13135,7 @@ }, { "name": "pushMessageContentChatJoinByLink", - "description": "A new member joined the chat by invite link", + "description": "A new member joined the chat via an invite link", "class": "PushMessageContent", "properties": [] }, @@ -12713,6 +13275,55 @@ "class": "NotificationGroupType", "properties": [] }, + { + "name": "notificationSound", + "description": "Describes a notification sound in MP3 format", + "class": "NotificationSound", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique identifier of the notification sound" + }, + { + "name": "duration", + "type": "int32", + "description": "Duration of the sound, in seconds" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the sound was created" + }, + { + "name": "title", + "type": "string", + "description": "Title of the notification sound" + }, + { + "name": "data", + "type": "string", + "description": "Arbitrary data, defined while the sound was uploaded" + }, + { + "name": "sound", + "type": "file", + "description": "File containing the sound" + } + ] + }, + { + "name": "notificationSounds", + "description": "Contains a list of notification sounds", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sounds", + "type": "vector\u003cnotificationSound\u003e", + "description": "A list of notification sounds" + } + ] + }, { "name": "notification", "description": "Contains information about a notification", @@ -12729,9 +13340,9 @@ "description": "Notification date" }, { - "name": "is_silent", - "type": "Bool", - "description": "True, if the notification was initially silent" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "type", @@ -13198,7 +13809,7 @@ { "name": "location", "type": "string", - "description": "Human-readable description of a country and a region, from which the user was logged in, based on the IP address" + "description": "Human-readable description of a country and a region from which the user was logged in, based on the IP address" } ] }, @@ -13256,6 +13867,18 @@ "class": "ChatReportReason", "properties": [] }, + { + "name": "chatReportReasonIllegalDrugs", + "description": "The chat has illegal drugs related content", + "class": "ChatReportReason", + "properties": [] + }, + { + "name": "chatReportReasonPersonalDetails", + "description": "The chat contains messages with personal details", + "class": "ChatReportReason", + "properties": [] + }, { "name": "chatReportReasonCustom", "description": "A custom reason provided by the user", @@ -13268,6 +13891,28 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeAttachmentMenuBot", + "description": "The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL", + "class": "InternalLinkType", + "properties": [ + { + "name": "chat_link", + "type": "InternalLinkType", + "description": "An internal link pointing to a chat; may be null if the current chat needs to be kept" + }, + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "internalLinkTypeAuthenticationCode", "description": "The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode", @@ -13311,7 +13956,7 @@ }, { "name": "internalLinkTypeBotStartInGroup", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat.", "class": "InternalLinkType", "properties": [ { @@ -13323,6 +13968,28 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot; may be null" + } + ] + }, + { + "name": "internalLinkTypeBotAddToChannel", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot" } ] }, @@ -13379,6 +14046,12 @@ } ] }, + { + "name": "internalLinkTypeLanguageSettings", + "description": "The link is a link to the language settings section of the app", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeMessage", "description": "The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link", @@ -13457,6 +14130,12 @@ } ] }, + { + "name": "internalLinkTypePrivacyAndSecuritySettings", + "description": "The link is a link to the privacy and security settings section of the app", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeProxy", "description": "The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy", @@ -13551,9 +14230,21 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeUserPhoneNumber", + "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number of the user" + } + ] + }, { "name": "internalLinkTypeVideoChat", - "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link", + "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link", "class": "InternalLinkType", "properties": [ { @@ -13663,6 +14354,12 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypeNotificationSound", + "description": "The file is a notification sound", + "class": "FileType", + "properties": [] + }, { "name": "fileTypePhoto", "description": "The file is a photo", @@ -14124,7 +14821,7 @@ { "name": "info", "type": "chatInviteLinkInfo", - "description": "Chat invite link info" + "description": "Information about the chat invite link" } ] }, @@ -14177,7 +14874,7 @@ }, { "name": "suggestedActionCheckPassword", - "description": "Suggests the user to check whether 2-step verification password is still remembered", + "description": "Suggests the user to check whether they still remember their 2-step verification password", "class": "SuggestedAction", "properties": [] }, @@ -14188,8 +14885,8 @@ "properties": [] }, { - "name": "suggestedActionSeeTicksHint", - "description": "Suggests the user to see a hint about meaning of one and two ticks on sent message", + "name": "suggestedActionViewChecksHint", + "description": "Suggests the user to view a hint about the meaning of one and two check marks on sent messages", "class": "SuggestedAction", "properties": [] }, @@ -14389,14 +15086,14 @@ ] }, { - "name": "inputStickerStatic", - "description": "A static sticker in PNG format, which will be converted to WEBP server-side", + "name": "inputSticker", + "description": "A sticker to be added to a sticker set", "class": "InputSticker", "properties": [ { "name": "sticker", "type": "InputFile", - "description": "PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square" + "description": "File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" }, { "name": "emojis", @@ -14404,26 +15101,9 @@ "description": "Emojis corresponding to the sticker" }, { - "name": "mask_position", - "type": "maskPosition", - "description": "For masks, position where the mask is placed; pass null if unspecified" - } - ] - }, - { - "name": "inputStickerAnimated", - "description": "An animated sticker in TGS format", - "class": "InputSticker", - "properties": [ - { - "name": "sticker", - "type": "InputFile", - "description": "File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" - }, - { - "name": "emojis", - "type": "string", - "description": "Emojis corresponding to the sticker" + "name": "type", + "type": "StickerType", + "description": "Sticker type" } ] }, @@ -15109,6 +15789,33 @@ } ] }, + { + "name": "updateMessageUnreadReactions", + "description": "The list of unread reactions added to a message was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "The new list of unread reactions" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The new number of messages with unread reactions left in the chat" + } + ] + }, { "name": "updateMessageLiveLocationViewed", "description": "A message with a live location was viewed. When the update is received, the application is supposed to update the live location", @@ -15228,125 +15935,6 @@ } ] }, - { - "name": "updateChatDefaultMessageSenderId", - "description": "The default message sender that is chosen to send messages in a chat has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "default_message_sender_id", - "type": "MessageSender", - "description": "New value of default_message_sender_id; may be null if the user can't change message sender" - } - ] - }, - { - "name": "updateChatHasProtectedContent", - "description": "A chat content was allowed or restricted for saving", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "has_protected_content", - "type": "Bool", - "description": "New value of has_protected_content" - } - ] - }, - { - "name": "updateChatIsMarkedAsUnread", - "description": "A chat was marked as unread or was read", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_marked_as_unread", - "type": "Bool", - "description": "New value of is_marked_as_unread" - } - ] - }, - { - "name": "updateChatIsBlocked", - "description": "A chat was blocked or unblocked", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" - } - ] - }, - { - "name": "updateChatHasScheduledMessages", - "description": "A chat's has_scheduled_messages field has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "has_scheduled_messages", - "type": "Bool", - "description": "New value of has_scheduled_messages" - } - ] - }, - { - "name": "updateChatVideoChat", - "description": "A chat video chat state has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "video_chat", - "type": "videoChat", - "description": "New value of video_chat" - } - ] - }, - { - "name": "updateChatDefaultDisableNotification", - "description": "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "default_disable_notification", - "type": "Bool", - "description": "The new default_disable_notification value" - } - ] - }, { "name": "updateChatReadInbox", "description": "Incoming messages were read or the number of unread messages has been changed", @@ -15386,74 +15974,6 @@ } ] }, - { - "name": "updateChatUnreadMentionCount", - "description": "The chat unread_mention_count has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "unread_mention_count", - "type": "int32", - "description": "The number of unread mention messages left in the chat" - } - ] - }, - { - "name": "updateChatNotificationSettings", - "description": "Notification settings for a chat were changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "notification_settings", - "type": "chatNotificationSettings", - "description": "The new notification settings" - } - ] - }, - { - "name": "updateScopeNotificationSettings", - "description": "Notification settings for some type of chats were updated", - "class": "Update", - "properties": [ - { - "name": "scope", - "type": "NotificationSettingsScope", - "description": "Types of chats for which notification settings were updated" - }, - { - "name": "notification_settings", - "type": "scopeNotificationSettings", - "description": "The new notification settings" - } - ] - }, - { - "name": "updateChatMessageTtlSetting", - "description": "The message Time To Live setting for a chat was changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "message_ttl_setting", - "type": "int32", - "description": "New value of message_ttl_setting" - } - ] - }, { "name": "updateChatActionBar", "description": "The chat action bar was changed", @@ -15472,8 +15992,8 @@ ] }, { - "name": "updateChatTheme", - "description": "The chat theme was changed", + "name": "updateChatAvailableReactions", + "description": "The chat available reactions were changed", "class": "Update", "properties": [ { @@ -15482,9 +16002,82 @@ "description": "Chat identifier" }, { - "name": "theme_name", - "type": "string", - "description": "The new name of the chat theme; may be empty if theme was reset to default" + "name": "available_reactions", + "type": "vector\u003cstring\u003e", + "description": "The new list of reactions, available in the chat" + } + ] + }, + { + "name": "updateChatDraftMessage", + "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "The new draft message; may be null" + }, + { + "name": "positions", + "type": "vector\u003cchatPosition\u003e", + "description": "The new chat positions in the chat lists" + } + ] + }, + { + "name": "updateChatMessageSender", + "description": "The message sender that is selected to send messages in a chat has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_sender_id", + "type": "MessageSender", + "description": "New value of message_sender_id; may be null if the user can't change message sender" + } + ] + }, + { + "name": "updateChatMessageTtl", + "description": "The message Time To Live setting for a chat was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_ttl", + "type": "int32", + "description": "New value of message_ttl" + } + ] + }, + { + "name": "updateChatNotificationSettings", + "description": "Notification settings for a chat were changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "The new notification settings" } ] }, @@ -15523,8 +16116,8 @@ ] }, { - "name": "updateChatDraftMessage", - "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", + "name": "updateChatTheme", + "description": "The chat theme was changed", "class": "Update", "properties": [ { @@ -15533,14 +16126,145 @@ "description": "Chat identifier" }, { - "name": "draft_message", - "type": "draftMessage", - "description": "The new draft message; may be null" + "name": "theme_name", + "type": "string", + "description": "The new name of the chat theme; may be empty if theme was reset to default" + } + ] + }, + { + "name": "updateChatUnreadMentionCount", + "description": "The chat unread_mention_count has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" }, { - "name": "positions", - "type": "vector\u003cchatPosition\u003e", - "description": "The new chat positions in the chat lists" + "name": "unread_mention_count", + "type": "int32", + "description": "The number of unread mention messages left in the chat" + } + ] + }, + { + "name": "updateChatUnreadReactionCount", + "description": "The chat unread_reaction_count has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The number of messages with unread reactions left in the chat" + } + ] + }, + { + "name": "updateChatVideoChat", + "description": "A chat video chat state has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "video_chat", + "type": "videoChat", + "description": "New value of video_chat" + } + ] + }, + { + "name": "updateChatDefaultDisableNotification", + "description": "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "default_disable_notification", + "type": "Bool", + "description": "The new default_disable_notification value" + } + ] + }, + { + "name": "updateChatHasProtectedContent", + "description": "A chat content was allowed or restricted for saving", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "updateChatHasScheduledMessages", + "description": "A chat's has_scheduled_messages field has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_scheduled_messages", + "type": "Bool", + "description": "New value of has_scheduled_messages" + } + ] + }, + { + "name": "updateChatIsBlocked", + "description": "A chat was blocked or unblocked", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_blocked", + "type": "Bool", + "description": "New value of is_blocked" + } + ] + }, + { + "name": "updateChatIsMarkedAsUnread", + "description": "A chat was marked as unread or was read", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_marked_as_unread", + "type": "Bool", + "description": "New value of is_marked_as_unread" } ] }, @@ -15558,7 +16282,7 @@ }, { "name": "updateChatOnlineMemberCount", - "description": "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed", + "description": "The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed", "class": "Update", "properties": [ { @@ -15573,6 +16297,23 @@ } ] }, + { + "name": "updateScopeNotificationSettings", + "description": "Notification settings for some type of chats were updated", + "class": "Update", + "properties": [ + { + "name": "scope", + "type": "NotificationSettingsScope", + "description": "Types of chats for which notification settings were updated" + }, + { + "name": "notification_settings", + "type": "scopeNotificationSettings", + "description": "The new notification settings" + } + ] + }, { "name": "updateNotification", "description": "A notification was changed", @@ -15616,9 +16357,9 @@ "description": "Chat identifier, which notification settings must be applied to the added notifications" }, { - "name": "is_silent", - "type": "Bool", - "description": "True, if the notifications must be shown without sound" + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "total_count", @@ -15904,6 +16645,89 @@ } ] }, + { + "name": "updateFileDownloads", + "description": "The state of the file download list has changed", + "class": "Update", + "properties": [ + { + "name": "total_size", + "type": "int53", + "description": "Total size of files in the file download list, in bytes" + }, + { + "name": "total_count", + "type": "int32", + "description": "Total number of files in the file download list" + }, + { + "name": "downloaded_size", + "type": "int53", + "description": "Total downloaded size of files in the file download list, in bytes" + } + ] + }, + { + "name": "updateFileAddedToDownloads", + "description": "A file was added to the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_download", + "type": "fileDownload", + "description": "The added file download" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileDownload", + "description": "A file download was changed. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileRemovedFromDownloads", + "description": "A file was removed from the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, { "name": "updateCall", "description": "New call was created or information about a call was updated", @@ -16137,6 +16961,18 @@ } ] }, + { + "name": "updateSavedNotificationSounds", + "description": "The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", + "class": "Update", + "properties": [ + { + "name": "notification_sound_ids", + "type": "vector\u003cint64\u003e", + "description": "The new list of identifiers of saved notification sounds" + } + ] + }, { "name": "updateSelectedBackground", "description": "The selected background has changed", @@ -16229,6 +17065,42 @@ } ] }, + { + "name": "updateAttachmentMenuBots", + "description": "The list of bots added to attachment menu has changed", + "class": "Update", + "properties": [ + { + "name": "bots", + "type": "vector\u003cattachmentMenuBot\u003e", + "description": "The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen" + } + ] + }, + { + "name": "updateWebAppMessageSent", + "description": "A message was sent by an opened web app, so the web app needs to be closed", + "class": "Update", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of web app launch" + } + ] + }, + { + "name": "updateReactions", + "description": "The list of supported reactions has changed", + "class": "Update", + "properties": [ + { + "name": "reactions", + "type": "vector\u003creaction\u003e", + "description": "The new list of supported reactions" + } + ] + }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -16320,7 +17192,7 @@ { "name": "chat_type", "type": "ChatType", - "description": "The type of the chat, from which the query originated; may be null if unknown" + "description": "The type of the chat from which the query originated; may be null if unknown" }, { "name": "query", @@ -16389,7 +17261,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message, from which the query originated" + "description": "Identifier of the message from which the query originated" }, { "name": "chat_instance", @@ -16421,7 +17293,7 @@ { "name": "inline_message_id", "type": "string", - "description": "Identifier of the inline message, from which the query originated" + "description": "Identifier of the inline message from which the query originated" }, { "name": "chat_instance", @@ -16801,12 +17673,16 @@ }, { "name": "ThumbnailFormat", - "description": "Describes format of the thumbnail" + "description": "Describes format of a thumbnail" }, { "name": "MaskPoint", "description": "Part of the face, relative to which a mask is placed" }, + { + "name": "StickerType", + "description": "Describes type of a sticker" + }, { "name": "PollType", "description": "Describes the type of a poll" @@ -17107,10 +17983,6 @@ "name": "ProxyType", "description": "Describes the type of a proxy server" }, - { - "name": "InputSticker", - "description": "Describes a sticker that needs to be added to a sticker set" - }, { "name": "StatisticalGraph", "description": "Describes a statistical graph" @@ -17412,7 +18284,7 @@ { "name": "set_recovery_email_address", "type": "Bool", - "description": "Pass true if the recovery email address must be changed" + "description": "Pass true to change also the recovery email address" }, { "name": "new_recovery_email_address", @@ -17708,7 +18580,7 @@ }, { "name": "getMessageLocally", - "description": "Returns information about a message, if it is available locally without sending network request. This is an offline request", + "description": "Returns information about a message, if it is available without sending network request. This is an offline request", "class": "Message", "properties": [ { @@ -17912,7 +18784,7 @@ }, { "name": "searchPublicChat", - "description": "Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", + "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", "class": "Chat", "properties": [ { @@ -17926,7 +18798,7 @@ }, { "name": "searchPublicChats", - "description": "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", + "description": "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", "class": "Chats", "properties": [ { @@ -18193,7 +19065,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only messages that are available locally without sending network requests" + "description": "Pass true to get only messages that are available without sending network requests" } ], "is_synchronous": false, @@ -18246,12 +19118,12 @@ { "name": "remove_from_chat_list", "type": "Bool", - "description": "Pass true if the chat needs to be removed from the chat list" + "description": "Pass true to remove the chat from all chat lists" }, { "name": "revoke", "type": "Bool", - "description": "Pass true to try to delete chat history for all users" + "description": "Pass true to delete chat history for all users" } ], "is_synchronous": false, @@ -18259,7 +19131,7 @@ }, { "name": "deleteChat", - "description": "Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method", + "description": "Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat", "class": "Ok", "properties": [ { @@ -18358,7 +19230,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" + "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function" }, { "name": "min_date", @@ -18392,7 +19264,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18426,7 +19298,26 @@ { "name": "only_missed", "type": "Bool", - "description": "If true, returns only messages with missed calls" + "description": "Pass true to search only for messages with missed/declined calls" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchOutgoingDocumentMessages", + "description": "Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order", + "class": "FoundMessages", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for in document file name and message caption" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; up to 100" } ], "is_synchronous": false, @@ -18505,7 +19396,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18523,7 +19414,7 @@ }, { "name": "getChatMessageCalendar", - "description": "Returns information about the next messages of the specified type in the chat splitted by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option \"utc_time_offset\"", + "description": "Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option \"utc_time_offset\"", "class": "MessageCalendar", "properties": [ { @@ -18534,7 +19425,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18563,7 +19454,7 @@ { "name": "return_local", "type": "Bool", - "description": "If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown" + "description": "Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally" } ], "is_synchronous": false, @@ -18601,7 +19492,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18613,9 +19504,9 @@ "type": 2 }, { - "name": "getChatSponsoredMessages", - "description": "Returns sponsored messages to be shown in a chat; for channel chats only", - "class": "SponsoredMessages", + "name": "getChatSponsoredMessage", + "description": "Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat", + "class": "SponsoredMessage", "properties": [ { "name": "chat_id", @@ -18626,25 +19517,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "viewSponsoredMessage", - "description": "Informs TDLib that a sponsored message was viewed by the user", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat with the sponsored message" - }, - { - "name": "sponsored_message_id", - "type": "int32", - "description": "The identifier of the sponsored message being viewed" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "removeNotification", "description": "Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user", @@ -18755,6 +19627,30 @@ "is_synchronous": false, "type": 1 }, + { + "name": "translateText", + "description": "Translates a text to the given language. Returns a 404 error if the translation can't be performed", + "class": "Text", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text to translate" + }, + { + "name": "from_language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically" + }, + { + "name": "to_language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code of the language to which the message is translated" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatAvailableMessageSenders", "description": "Returns list of message sender identifiers, which can be used to send messages in a chat", @@ -18770,8 +19666,8 @@ "type": 2 }, { - "name": "setChatDefaultMessageSender", - "description": "Changes default message sender that is chosen in a chat", + "name": "setChatMessageSender", + "description": "Selects a message sender to send messages in a chat", "class": "Ok", "properties": [ { @@ -18780,9 +19676,9 @@ "description": "Chat identifier" }, { - "name": "default_message_sender_id", + "name": "message_sender_id", "type": "MessageSender", - "description": "New default message sender in the chat" + "description": "New message sender for the chat" } ], "is_synchronous": false, @@ -18806,7 +19702,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to or 0" + "description": "Identifier of the replied message; 0 if none" }, { "name": "options", @@ -18829,7 +19725,7 @@ }, { "name": "sendMessageAlbum", - "description": "Sends 2-10 messages grouped together into an album. Currently only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages", + "description": "Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages", "class": "Messages", "properties": [ { @@ -18845,7 +19741,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a message to reply to or 0" + "description": "Identifier of a replied message; 0 if none" }, { "name": "options", @@ -18856,6 +19752,11 @@ "name": "input_message_contents", "type": "vector\u003cInputMessageContent\u003e", "description": "Contents of messages to be sent. At most 10 messages can be added to an album" + }, + { + "name": "only_preview", + "type": "Bool", + "description": "Pass true to get fake messages instead of actually sending them" } ], "is_synchronous": false, @@ -18903,7 +19804,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a message to reply to or 0" + "description": "Identifier of a replied message; 0 if none" }, { "name": "options", @@ -18923,7 +19824,7 @@ { "name": "hide_via_bot", "type": "Bool", - "description": "If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\") and GetOption(\"venue_search_bot_username\")" + "description": "Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\"), and GetOption(\"venue_search_bot_username\")" } ], "is_synchronous": false, @@ -18957,17 +19858,17 @@ { "name": "send_copy", "type": "Bool", - "description": "If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" + "description": "Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" }, { "name": "remove_caption", "type": "Bool", - "description": "If true, media caption of message copies will be removed. Ignored if send_copy is false" + "description": "Pass true to remove media captions of message copies. Ignored if send_copy is false" }, { "name": "only_preview", "type": "Bool", - "description": "If true, messages will not be forwarded and instead fake messages will be returned" + "description": "Pass true to get fake messages instead of actually forwarding them" } ], "is_synchronous": false, @@ -19024,7 +19925,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to or 0" + "description": "Identifier of the replied message; 0 if none" }, { "name": "disable_notification", @@ -19058,7 +19959,7 @@ { "name": "revoke", "type": "Bool", - "description": "Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats" + "description": "Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats" } ], "is_synchronous": false, @@ -19106,7 +20007,7 @@ { "name": "revoke", "type": "Bool", - "description": "Pass true to try to delete chat messages for all users; private chats only" + "description": "Pass true to delete chat messages for all users; private chats only" } ], "is_synchronous": false, @@ -19411,6 +20312,88 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessageAvailableReactions", + "description": "Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message", + "class": "AvailableReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setMessageReaction", + "description": "Changes chosen reaction for a message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction", + "type": "string", + "description": "Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction" + }, + { + "name": "is_big", + "type": "Bool", + "description": "Pass true if the reaction is added with a big animation" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageAddedReactions", + "description": "Returns reactions added for a message, along with their sender", + "class": "AddedReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction", + "type": "string", + "description": "If non-empty, only added reactions with the specified text representation will be returned" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of reactions to be returned; must be positive and can't be greater than 100" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getTextEntities", "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously", @@ -19427,7 +20410,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -19452,7 +20435,7 @@ { "name": "text", "type": "formattedText", - "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" + "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" } ], "is_synchronous": true, @@ -19571,6 +20554,20 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getThemeParametersJsonString", + "description": "Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously", + "class": "Text", + "properties": [ + { + "name": "theme", + "type": "themeParameters", + "description": "Theme parameters to convert to JSON" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "setPollAnswer", "description": "Changes the user answer to a poll. A poll in quiz mode can be answered only once", @@ -19714,7 +20711,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the user allowed the bot to send them messages" + "description": "Pass true to allow the bot to send messages to the current user" } ], "is_synchronous": false, @@ -19767,7 +20764,7 @@ { "name": "is_personal", "type": "Bool", - "description": "True, if the result of the query can be cached for the specified user" + "description": "Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query" }, { "name": "results", @@ -19798,6 +20795,121 @@ "is_synchronous": false, "type": 3 }, + { + "name": "getWebAppUrl", + "description": "Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed", + "class": "HttpUrl", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "url", + "type": "string", + "description": "The URL from the keyboardButtonTypeWebApp button" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred web app theme; pass null to use the default theme" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendWebAppData", + "description": "Sends data received from a keyboardButtonTypeWebApp web app to a bot", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" + }, + { + "name": "data", + "type": "string", + "description": "Received data" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openWebApp", + "description": "Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", + "class": "WebAppInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now" + }, + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the bot, providing the web app" + }, + { + "name": "url", + "type": "string", + "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred web app theme; pass null to use the default theme" + }, + { + "name": "reply_to_message_id", + "type": "int53", + "description": "Identifier of the replied message for the message sent by the web app; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "closeWebApp", + "description": "Informs TDLib that a previously opened web app was closed", + "class": "Ok", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of web app launch, received from openWebApp" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "answerWebAppQuery", + "description": "Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "web_app_query_id", + "type": "string", + "description": "Identifier of the web app query" + }, + { + "name": "result", + "type": "InputInlineQueryResult", + "description": "The result of the query" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getCallbackQueryAnswer", "description": "Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires", @@ -19840,7 +20952,7 @@ { "name": "show_alert", "type": "Bool", - "description": "If true, an alert must be shown to the user instead of a toast notification" + "description": "Pass true to show an alert to the user instead of a toast notification" }, { "name": "url", @@ -19917,7 +21029,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -19951,7 +21063,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -20088,7 +21200,7 @@ }, { "name": "viewMessages", - "description": "Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)", + "description": "Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)", "class": "Ok", "properties": [ { @@ -20109,7 +21221,7 @@ { "name": "force_read", "type": "Bool", - "description": "True, if messages in closed chats must be marked as read by the request" + "description": "Pass true to mark as read the specified messages even the chat is closed" } ], "is_synchronous": false, @@ -20194,7 +21306,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" + "description": "Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" } ], "is_synchronous": false, @@ -20214,6 +21326,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "readAllChatReactions", + "description": "Marks all reactions in a chat as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "createPrivateChat", "description": "Returns an existing chat corresponding to a given user", @@ -20227,7 +21353,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20246,7 +21372,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20265,7 +21391,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20317,7 +21443,7 @@ { "name": "is_channel", "type": "Bool", - "description": "True, if a channel chat needs to be created" + "description": "Pass true to create a channel chat" }, { "name": "description", @@ -20332,7 +21458,7 @@ { "name": "for_import", "type": "Bool", - "description": "True, if the supergroup is created for importing messages using importMessage" + "description": "Pass true to create a supergroup for importing messages using importMessage" } ], "is_synchronous": false, @@ -20535,8 +21661,8 @@ "type": 1 }, { - "name": "setChatMessageTtlSetting", - "description": "Changes the message TTL setting (sets a new self-destruct timer) in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL setting of a chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed", + "name": "setChatMessageTtl", + "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).", "class": "Ok", "properties": [ { @@ -20547,7 +21673,7 @@ { "name": "ttl", "type": "int32", - "description": "New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret" + "description": "New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400" } ], "is_synchronous": false, @@ -20647,7 +21773,7 @@ { "name": "has_protected_content", "type": "Bool", - "description": "True, if chat content can't be saved locally, forwarded, or copied" + "description": "New value of has_protected_content" } ], "is_synchronous": false, @@ -20691,6 +21817,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setChatAvailableReactions", + "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "available_reactions", + "type": "vector\u003cstring\u003e", + "description": "New list of reactions, available in the chat. All reactions must be active" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "setChatClientData", "description": "Changes application-specific data associated with a chat", @@ -20804,12 +21949,12 @@ { "name": "disable_notification", "type": "Bool", - "description": "True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats" + "description": "Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats" }, { "name": "only_for_self", "type": "Bool", - "description": "True, if the message needs to be pinned for one side only; private chats only" + "description": "Pass true to pin the message only for self; private chats only" } ], "is_synchronous": false, @@ -20902,7 +22047,7 @@ }, { "name": "addChatMembers", - "description": "Adds multiple new members to a chat. Currently this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members", + "description": "Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members", "class": "Ok", "properties": [ { @@ -20961,7 +22106,7 @@ { "name": "banned_until_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups" + "description": "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned" }, { "name": "revoke_messages", @@ -21068,13 +22213,63 @@ }, { "name": "clearAllDraftMessages", - "description": "Clears draft messages in all chats", + "description": "Clears message drafts in all chats", "class": "Ok", "properties": [ { "name": "exclude_secret_chats", "type": "Bool", - "description": "If true, local draft messages in secret chats will not be cleared" + "description": "Pass true to keep local message drafts in secret chats" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSound", + "description": "Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSounds", + "description": "Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used", + "class": "NotificationSounds", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addSavedNotificationSound", + "description": "Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed", + "class": "NotificationSound", + "properties": [ + { + "name": "sound", + "type": "InputFile", + "description": "Notification sound file to add" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeSavedNotificationSound", + "description": "Removes a notification sound from the list of saved notification sounds", + "class": "Ok", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" } ], "is_synchronous": false, @@ -21093,7 +22288,7 @@ { "name": "compare_sound", "type": "Bool", - "description": "If true, also chats with non-default sound will be returned" + "description": "Pass true to include in the response chats with only non-default sound" } ], "is_synchronous": false, @@ -21134,7 +22329,7 @@ }, { "name": "resetAllNotificationSettings", - "description": "Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to \"default\" and message previews are shown", + "description": "Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown", "class": "Ok", "properties": [], "is_synchronous": false, @@ -21142,7 +22337,7 @@ }, { "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/arhive chat list", + "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/archive chat list", "class": "Ok", "properties": [ { @@ -21158,7 +22353,7 @@ { "name": "is_pinned", "type": "Bool", - "description": "True, if the chat is pinned" + "description": "Pass true to pin the chat; pass false to unpin it" } ], "is_synchronous": false, @@ -21183,6 +22378,39 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAttachmentMenuBot", + "description": "Returns information about a bot that can be added to attachment menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleBotIsAddedToAttachmentMenu", + "description": "Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + }, + { + "name": "is_added", + "type": "Bool", + "description": "Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -21196,7 +22424,7 @@ { "name": "priority", "type": "int32", - "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first" + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" }, { "name": "offset", @@ -21211,7 +22439,7 @@ { "name": "synchronous", "type": "Bool", - "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent" + "description": "Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started" } ], "is_synchronous": false, @@ -21417,6 +22645,145 @@ "is_synchronous": false, "type": 1 }, + { + "name": "addFileToDownloads", + "description": "Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file", + "class": "File", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the file to download" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message with the file" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "priority", + "type": "int32", + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleDownloadIsPaused", + "description": "Changes pause state of a file in the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "Pass true if the download is paused" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleAllDownloadsArePaused", + "description": "Changes pause state of all files in the file download list", + "class": "Ok", + "properties": [ + { + "name": "are_paused", + "type": "Bool", + "description": "Pass true to pause all downloads; pass false to unpause them" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeFileFromDownloads", + "description": "Removes a file from the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeAllFilesFromDownloads", + "description": "Removes all files from the file download list", + "class": "Ok", + "properties": [ + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to remove only active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to remove only completed downloads" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "searchFileDownloads", + "description": "Searches for files in the file download list or recently downloaded files from the list", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for; may be empty to return all downloaded files" + }, + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to search only for active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to search only for completed downloads" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of files to be returned" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getMessageFileType", "description": "Returns information about a file with messages exported from another app", @@ -21499,19 +22866,19 @@ "description": "Invite link name; 0-32 characters" }, { - "name": "expire_date", + "name": "expiration_date", "type": "int32", "description": "Point in time (Unix timestamp) when the link will expire; pass 0 if never" }, { "name": "member_limit", "type": "int32", - "description": "The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited" + "description": "The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited" }, { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21538,19 +22905,19 @@ "description": "Invite link name; 0-32 characters" }, { - "name": "expire_date", + "name": "expiration_date", "type": "int32", "description": "Point in time (Unix timestamp) when the link will expire; pass 0 if never" }, { "name": "member_limit", "type": "int32", - "description": "The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited" + "description": "The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited" }, { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21630,7 +22997,7 @@ }, { "name": "getChatInviteLinkMembers", - "description": "Returns chat members joined a chat by an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", + "description": "Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", "class": "ChatInviteLinkMembers", "properties": [ { @@ -21770,7 +23137,7 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of chat join requests to return" + "description": "The maximum number of requests to join the chat to return" } ], "is_synchronous": false, @@ -21794,7 +23161,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the request is approved. Otherwise the request is declived" + "description": "Pass true to approve the request; pass false to decline it" } ], "is_synchronous": false, @@ -21818,7 +23185,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the requests are approved. Otherwise the requests are declived" + "description": "Pass true to approve all requests; pass false to decline them" } ], "is_synchronous": false, @@ -21842,7 +23209,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if a video call needs to be created" + "description": "Pass true to create a video call" } ], "is_synchronous": false, @@ -21899,7 +23266,7 @@ { "name": "is_disconnected", "type": "Bool", - "description": "True, if the user was disconnected" + "description": "Pass true if the user was disconnected" }, { "name": "duration", @@ -21909,7 +23276,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if the call was a video call" + "description": "Pass true if the call was a video call" }, { "name": "connection_id", @@ -21970,7 +23337,7 @@ }, { "name": "getVideoChatAvailableParticipants", - "description": "Returns list of participant identifiers, which can be used to join video chats in a chat", + "description": "Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined", "class": "MessageSenders", "properties": [ { @@ -21984,7 +23351,7 @@ }, { "name": "setVideoChatDefaultParticipant", - "description": "Changes default participant identifier, which can be used to join video chats in a chat", + "description": "Changes default participant identifier, on whose behalf a video chat in the chat will be joined", "class": "Ok", "properties": [ { @@ -22009,7 +23376,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier, in which the video chat will be created" + "description": "Identifier of a chat in which the video chat will be created" }, { "name": "title", @@ -22020,6 +23387,39 @@ "name": "start_date", "type": "int32", "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future" + }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getVideoChatRtmpUrl", + "description": "Returns RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "replaceVideoChatRtmpUrl", + "description": "Replaces the current RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" } ], "is_synchronous": false, @@ -22100,12 +23500,12 @@ { "name": "is_muted", "type": "Bool", - "description": "True, if the user's microphone is muted" + "description": "Pass true to join the call with muted microphone" }, { "name": "is_my_video_enabled", "type": "Bool", - "description": "True, if the user's video is enabled" + "description": "Pass true if the user's video is enabled" }, { "name": "invite_hash", @@ -22211,20 +23611,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "revokeGroupCallInviteLink", - "description": "Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag", - "class": "Ok", - "properties": [ - { - "name": "group_call_id", - "type": "int32", - "description": "Group call identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "inviteGroupCallParticipants", "description": "Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats", @@ -22263,6 +23649,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "revokeGroupCallInviteLink", + "description": "Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "startGroupCallRecording", "description": "Starts recording of an active group call. Requires groupCall.can_be_managed group call flag", @@ -22362,7 +23762,7 @@ { "name": "is_speaking", "type": "Bool", - "description": "True, if the user is speaking" + "description": "Pass true if the user is speaking" } ], "is_synchronous": false, @@ -22386,7 +23786,7 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true if the user must be muted and false otherwise" + "description": "Pass true to mute the user; pass false to unmute the them" } ], "is_synchronous": false, @@ -22474,8 +23874,8 @@ "type": 2 }, { - "name": "discardGroupCall", - "description": "Discards a group call. Requires groupCall.can_be_managed", + "name": "endGroupCall", + "description": "Ends a group call. Requires groupCall.can_be_managed", "class": "Ok", "properties": [ { @@ -22487,6 +23887,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getGroupCallStreams", + "description": "Returns information about available group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getGroupCallStreamSegment", "description": "Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video", @@ -22553,17 +23967,17 @@ { "name": "delete_message", "type": "Bool", - "description": "Pass true if the message must be deleted" + "description": "Pass true to delete the message" }, { "name": "delete_all_messages", "type": "Bool", - "description": "Pass true if all messages from the same sender must be deleted" + "description": "Pass true to delete all messages from the same sender" }, { "name": "report_spam", "type": "Bool", - "description": "Pass true if the sender must be reported to the Telegram moderators" + "description": "Pass true to report the sender to the Telegram moderators" } ], "is_synchronous": false, @@ -22596,12 +24010,12 @@ { "name": "contact", "type": "contact", - "description": "The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored" + "description": "The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored" }, { "name": "share_phone_number", "type": "Bool", - "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" + "description": "Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" } ], "is_synchronous": false, @@ -22692,6 +24106,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchUserByPhoneNumber", + "description": "Searches a user by their phone number", + "class": "User", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number to search for" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "sharePhoneNumber", "description": "Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber", @@ -22827,7 +24255,7 @@ }, { "name": "getAttachedStickerSets", - "description": "Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets", + "description": "Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets", "class": "StickerSets", "properties": [ { @@ -23091,7 +24519,7 @@ { "name": "exact_match", "type": "Bool", - "description": "True, if only emojis, which exactly match text needs to be returned" + "description": "Pass true if only emojis, which exactly match the text, needs to be returned" }, { "name": "input_language_codes", @@ -23234,7 +24662,7 @@ { "name": "force_full", "type": "Bool", - "description": "If true, the full instant view for the web page will be returned" + "description": "Pass true to get full instant view for the web page" } ], "is_synchronous": false, @@ -23383,7 +24811,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" + "description": "A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" }, { "name": "commands", @@ -23407,7 +24835,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" } ], "is_synchronous": false, @@ -23426,7 +24854,68 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setMenuButton", + "description": "Sets menu button for the given user or for all users; for bots only", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to set menu button for all users" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "New menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "getMenuButton", + "description": "Returns menu button set by the bot for the given user; for bots only", + "class": "BotMenuButton", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to get the default menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultGroupAdministratorRights", + "description": "Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultChannelAdministratorRights", + "description": "Sets default administrator rights for adding the bot to channel chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; may be null" } ], "is_synchronous": false, @@ -23475,7 +24964,7 @@ { "name": "can_accept_calls", "type": "Bool", - "description": "True, if incoming calls can be accepted by the session" + "description": "Pass true to allow accepting incoming calls by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23494,7 +24983,7 @@ { "name": "can_accept_secret_chats", "type": "Bool", - "description": "True, if incoming secret chats can be accepted by the session" + "description": "Pass true to allow accepring secret chats by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23636,7 +25125,7 @@ }, { "name": "reportSupergroupSpam", - "description": "Reports some messages from a message sender in a supergroup as spam; requires administrator rights in the supergroup", + "description": "Reports messages in a supergroup as spam; requires administrator rights in the supergroup", "class": "Ok", "properties": [ { @@ -23647,7 +25136,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of messages sent in the supergroup. All messages must be sent by the same sender. This list must be non-empty" + "description": "Identifiers of messages to report" } ], "is_synchronous": false, @@ -23752,7 +25241,7 @@ }, { "name": "theme", - "type": "paymentFormTheme", + "type": "themeParameters", "description": "Preferred payment form theme; pass null to use the default theme" } ], @@ -23782,7 +25271,7 @@ { "name": "allow_save", "type": "Bool", - "description": "True, if the order information can be saved" + "description": "Pass true to save the order information" } ], "is_synchronous": false, @@ -23853,7 +25342,7 @@ }, { "name": "getSavedOrderInfo", - "description": "Returns saved order info, if any", + "description": "Returns saved order information. Returns a 404 error if there is no saved order information", "class": "OrderInfo", "properties": [], "is_synchronous": false, @@ -23861,7 +25350,7 @@ }, { "name": "deleteSavedOrderInfo", - "description": "Deletes saved order info", + "description": "Deletes saved order information", "class": "Ok", "properties": [], "is_synchronous": false, @@ -23891,7 +25380,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the backgrounds must be ordered for dark theme" + "description": "Pass true to order returned backgrounds for a dark theme" } ], "is_synchronous": false, @@ -23948,7 +25437,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the background is chosen for dark theme" + "description": "Pass true if the background is changed for a dark theme" } ], "is_synchronous": false, @@ -23984,7 +25473,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only locally available information without sending network requests" + "description": "Pass true to get only locally available information without sending network requests" } ], "is_synchronous": false, @@ -24296,7 +25785,7 @@ }, { "name": "reportChat", - "description": "Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators", + "description": "Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported", "class": "Ok", "properties": [ { @@ -24307,7 +25796,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of reported messages, if any" + "description": "Identifiers of reported messages; may be empty to report the whole chat" }, { "name": "reason", @@ -24325,7 +25814,7 @@ }, { "name": "reportChatPhoto", - "description": "Reports a chat photo to the Telegram moderators. A chat photo can be reported only if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators", + "description": "Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported", "class": "Ok", "properties": [ { @@ -24354,7 +25843,7 @@ }, { "name": "getChatStatistics", - "description": "Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true", + "description": "Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true", "class": "ChatStatistics", "properties": [ { @@ -24467,7 +25956,7 @@ { "name": "count", "type": "int32", - "description": "Limit on the total count of files after deletion. Pass -1 to use the default limit" + "description": "Limit on the total number of files after deletion. Pass -1 to use the default limit" }, { "name": "immunity_delay", @@ -24525,7 +26014,7 @@ { "name": "only_current", "type": "Bool", - "description": "If true, returns only data for the current library launch" + "description": "Pass true to get statistics only for the current library launch" } ], "is_synchronous": false, @@ -24904,7 +26393,7 @@ }, { "name": "uploadStickerFile", - "description": "Uploads a PNG image with a sticker; returns the uploaded file", + "description": "Uploads a file with a sticker; returns the uploaded file", "class": "File", "properties": [ { @@ -24914,7 +26403,7 @@ }, { "name": "sticker", - "type": "InputSticker", + "type": "inputSticker", "description": "Sticker file to upload" } ], @@ -24969,15 +26458,10 @@ "type": "string", "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" }, - { - "name": "is_masks", - "type": "Bool", - "description": "True, if stickers are masks. Animated stickers can't be masks" - }, { "name": "stickers", - "type": "vector\u003cInputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown" + "type": "vector\u003cinputSticker\u003e", + "description": "List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown" }, { "name": "source", @@ -25005,7 +26489,7 @@ }, { "name": "sticker", - "type": "InputSticker", + "type": "inputSticker", "description": "Sticker to add to the set" } ], @@ -25030,7 +26514,7 @@ { "name": "thumbnail", "type": "InputFile", - "description": "Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them" + "description": "Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set" } ], "is_synchronous": false, @@ -25102,7 +26586,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown" + "description": "Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown" } ], "is_synchronous": false, @@ -25212,7 +26696,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code for country information localization" + "description": "A two-letter ISO 639-1 language code for country information localization" }, { "name": "phone_number_prefix", @@ -25295,7 +26779,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25329,7 +26813,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25653,7 +27137,7 @@ { "name": "dc_id", "type": "int32", - "description": "Identifier of a datacenter, with which to test connection" + "description": "Identifier of a datacenter with which to test connection" }, { "name": "timeout", diff --git a/data/td_api.tl b/data/td_api.tl index 370e193..0621bb6 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -52,10 +52,10 @@ authenticationCodeTypeSms length:int32 = AuthenticationCodeType; //@description An authentication code is delivered via a phone call to the specified phone number @length Length of the code authenticationCodeTypeCall length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered automatically @pattern Pattern of the phone number from which the call will be made +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically @pattern Pattern of the phone number from which the call will be made authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number from which the call was made is the code that should be entered manually by the user @phone_number_prefix Prefix of the phone number from which the call will be made @length Number of digits in the code, excluding the prefix +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user @phone_number_prefix Prefix of the phone number from which the call will be made @length Number of digits in the code, excluding the prefix authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType; @@ -73,11 +73,11 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; -//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user +//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; @@ -135,7 +135,7 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat //@description Represents a local file //@path Local path to the locally available file part; may be empty -//@can_be_downloaded True, if it is possible to try to download or generate the file +//@can_be_downloaded True, if it is possible to download or generate the file //@can_be_deleted True, if the file can be deleted //@is_downloading_active True, if the file is currently being downloaded (or a local copy is being generated by some other means) //@is_downloading_completed True, if the local copy is fully available @@ -147,7 +147,7 @@ localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_ //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. //-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location +//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) //@is_uploading_completed True, if a remote copy is fully available @@ -191,26 +191,29 @@ photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vect minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; -//@class ThumbnailFormat @description Describes format of the thumbnail +//@class ThumbnailFormat @description Describes format of a thumbnail //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in PNG format. It will be used only for background patterns -thumbnailFormatPng = ThumbnailFormat; - -//@description The thumbnail is in WEBP format. It will be used only for some stickers -thumbnailFormatWebp = ThumbnailFormat; - //@description The thumbnail is in static GIF format. It will be used only for some bot inline results thumbnailFormatGif = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for animated sticker sets -thumbnailFormatTgs = ThumbnailFormat; - //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos thumbnailFormatMpeg4 = ThumbnailFormat; +//@description The thumbnail is in PNG format. It will be used only for background patterns +thumbnailFormatPng = ThumbnailFormat; + +//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets +thumbnailFormatTgs = ThumbnailFormat; + +//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +thumbnailFormatWebm = ThumbnailFormat; + +//@description The thumbnail is in WEBP format. It will be used only for some stickers +thumbnailFormatWebp = ThumbnailFormat; + //@description Represents a thumbnail @format Thumbnail format @width Thumbnail width @height Thumbnail height @file The thumbnail thumbnail format:ThumbnailFormat width:int32 height:int32 file:file = Thumbnail; @@ -237,6 +240,21 @@ maskPointChin = MaskPoint; maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; +//@class StickerType @description Describes type of a sticker + +//@description The sticker is an image in WEBP format +stickerTypeStatic = StickerType; + +//@description The sticker is an animation in TGS format +stickerTypeAnimated = StickerType; + +//@description The sticker is a video in WEBM format +stickerTypeVideo = StickerType; + +//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null +stickerTypeMask mask_position:maskPosition = StickerType; + + //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands closedVectorPath commands:vector = ClosedVectorPath; @@ -277,9 +295,9 @@ document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Photo; //@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask is placed; may be null -//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker -sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition outline:vector thumbnail:thumbnail sticker:file = Sticker; +//@emoji Emoji corresponding to the sticker @type Sticker type @outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker +sticker set_id:int64 width:int32 height:int32 emoji:string type:StickerType outline:vector thumbnail:thumbnail sticker:file = Sticker; //@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender @@ -300,7 +318,7 @@ voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; //@description Describes an animated representation of an emoji //@sticker Animated sticker for the emoji //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none -//@sound File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container +//@sound File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 @@ -310,7 +328,7 @@ 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 Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently only "foursquare" and "gplaces" (Google Places) need to be supported +//@description Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported //@id Identifier of the venue in the provider database; as defined by the sender @type Type of the venue in the provider database; as defined by the sender venue location:location title:string address:string provider:string id:string type:string = Venue; @@ -348,10 +366,14 @@ userTypeRegular = UserType; //@description A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user userTypeDeleted = UserType; -//@description A bot (see https://core.telegram.org/bots) @can_join_groups True, if the bot can be invited to basic group and supergroup chats +//@description A bot (see https://core.telegram.org/bots) +//@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages -//@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the application input field) @need_location True, if the location of the user is expected to be sent with every inline query to this bot -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = UserType; +//@is_inline True, if the bot supports inline queries +//@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) +//@need_location True, if the location of the user is expected to be sent with every inline query to this bot +//@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu +userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = 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; @@ -363,6 +385,9 @@ botCommand command:string description:string = 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; +//@description Describes a button to be shown instead of bot commands menu button @text Text of the button @url URL to be passed to openWebApp +botMenuButton text:string url:string = BotMenuButton; + //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner chatLocation location:location address:string = ChatLocation; @@ -401,6 +426,32 @@ inputChatPhotoStatic photo:InputFile = InputChatPhoto; inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputChatPhoto; +//@description Describes actions that a user is allowed to take in a chat +//@can_send_messages True, if the user can send text messages, contacts, locations, and venues +//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions +//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions +//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions +//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions +//@can_change_info True, if the user can change the chat title, photo, and other settings +//@can_invite_users True, if the user can invite new users to the chat +//@can_pin_messages True, if the user can pin messages +chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; + +//@description Describes rights of the administrator +//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_change_info True, if the administrator can change the chat title, photo, and other settings +//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only +//@can_delete_messages True, if the administrator can delete messages of other users +//@can_invite_users True, if the administrator can invite new users to the chat +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only +//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +//@can_manage_video_chats True, if the administrator can manage video chats +//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; + + //@description Represents a user //@id User identifier //@first_name First name of the user @@ -416,11 +467,20 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account -//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser +//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User; +//@description Contains information about a bot +//@share_text The text that is shown on the bot's profile page and is sent together with the link when users share the bot +//@param_description The text shown in the chat with the bot if the chat is empty +//@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown +//@commands List of the bot commands +//@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +botInfo share_text:string description:string menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; + //@description Contains full information about a user //@photo User profile photo; may be null //@is_blocked True, if the user is blocked by the current user @@ -430,13 +490,11 @@ user id:int53 first_name:string last_name:string username:string phone_number:st //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@bio A short user bio -//@share_text For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot -//@param_description For bots, the text shown in the chat with the bot if the chat is empty //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@commands For bots, list of the bot commands -userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector = UserFullInfo; +//@bot_info For bots, information about the bot; may be null +userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo; -//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers +//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -447,18 +505,6 @@ chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdminist chatAdministrators administrators:vector = ChatAdministrators; -//@description Describes actions that a user is allowed to take in a chat -//@can_send_messages True, if the user can send text messages, contacts, locations, and venues -//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions -//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions -//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions -//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions -//@can_change_info True, if the user can change the chat title, photo, and other settings -//@can_invite_users True, if the user can invite new users to the chat -//@can_pin_messages True, if the user can pin messages -chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; - - //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges @@ -470,18 +516,8 @@ chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = C //@description 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 //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only -//@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only -//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only -//@can_delete_messages True, if the administrator can delete messages of other users -//@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels -//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only -//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them -//@can_manage_video_chats True, if the administrator can manage video chats -//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; +//@rights Rights of the administrator +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -507,7 +543,7 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; -//@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members +//@description Contains a list of chat members @total_count Approximate total number of chat members found @members A list of chat members chatMembers total_count:int32 members:vector = ChatMembers; @@ -568,16 +604,16 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@creator_user_id User identifier of an administrator created the link //@date Point in time (Unix timestamp) when the link was created //@edit_date Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown -//@expire_date Point in time (Unix timestamp) when the link will expire; 0 if never +//@expiration_date Point in time (Unix timestamp) when the link will expire; 0 if never //@member_limit The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval //@member_count Number of chat members, which joined the chat using the link //@pending_join_request_count Number of pending join requests created using this link //@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited -//@is_primary True, if the link is primary. Primary invite link can't have name, expire date or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time +//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time //@is_revoked True, if the link was revoked -chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expire_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; +chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; -//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links +//@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; //@description Describes a chat administrator with a number of active and revoked chat invite links @@ -589,10 +625,10 @@ chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_co //@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts chatInviteLinkCounts invite_link_counts:vector = ChatInviteLinkCounts; -//@description Describes a chat member joined a chat by an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request +//@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; -//@description Contains a list of chat members joined a chat by an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat by an invite link +//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; //@description Contains information about a chat invite link @@ -611,10 +647,10 @@ chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; -//@description Contains a list of chat join requests @total_count Approximate total count of requests found @requests List of the requests +//@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; -//@description Contains information about pending chat join requests @total_count Total number of pending join requests @user_ids Identifiers of users sent the newest pending join requests +//@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequestsInfo; @@ -641,13 +677,13 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@username Username of the supergroup or channel; empty for private supergroups or channels //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will be always empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel -//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on number of members +//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members //@is_verified True, if the supergroup or channel is verified //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam @@ -672,7 +708,7 @@ supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_co //@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators //@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@location Location to which the supergroup is connected; may be null -//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only +//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none @@ -711,7 +747,7 @@ messageSenderUser user_id:int53 = MessageSender; messageSenderChat chat_id:int53 = MessageSender; -//@description Represents a list of message senders @total_count Approximate total count of messages senders found @senders List of message senders +//@description Represents a list of message senders @total_count Approximate total number of messages senders found @senders List of message senders messageSenders total_count:int32 senders:vector = MessageSenders; @@ -720,9 +756,9 @@ messageSenders total_count:int32 senders:vector = MessageSenders; //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; -//@description The message was originally sent by an anonymous chat administrator on behalf of the chat +//@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message -//@author_signature Original message author signature +//@author_signature For messages originally sent by an anonymous chat administrator, original message author signature messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; //@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender @@ -748,17 +784,31 @@ messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announc //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied -//@recent_replier_ids Identifiers of recent repliers to the message; available in channels with a discussion supergroup +//@recent_replier_ids Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available //@last_read_inbox_message_id Identifier of the last read incoming reply to the message //@last_read_outbox_message_id Identifier of the last read outgoing reply to the message //@last_message_id Identifier of the last reply to the message messageReplyInfo reply_count:int32 recent_replier_ids:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; +//@description Contains information about a reaction to a message +//@reaction Text representation of the reaction +//@total_count Number of times the reaction was added +//@is_chosen True, if the reaction is chosen by the current user +//@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats +messageReaction reaction:string total_count:int32 is_chosen:Bool recent_sender_ids:vector = MessageReaction; + //@description Contains information about interactions with a message //@view_count Number of times the message was viewed //@forward_count Number of times the message was forwarded //@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself -messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo; +//@reactions The list of reactions added to the message +messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector = MessageInteractionInfo; + +//@description Contains information about an unread reaction to a message +//@reaction Text representation of the reaction +//@sender_id Identifier of the sender, added the reaction +//@is_big True, if the reaction was added with a big animation +unreadReaction reaction:string sender_id:MessageSender is_big:Bool = UnreadReaction; //@class MessageSendingState @description Contains information about the sending state of the message @@ -786,10 +836,11 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_statistics True, if the message statistics are available -//@can_get_message_thread True, if the message thread info is available +//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions +//@can_get_statistics True, if the message statistics are available through getMessageStatistics +//@can_get_message_thread True, if information about the message thread is available through getMessageThread //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@contains_unread_mention True, if the message contains an unread mention for the current user @@ -797,6 +848,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@edit_date Point in time (Unix timestamp) when the message was last edited //@forward_info Information about the initial message sender; may be null //@interaction_info Information about interactions with the message; may be null +//@unread_reactions Information about unread reactions added to the message //@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id //@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs @@ -808,33 +860,55 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; -//@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null +//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total count of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; //@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; -//@description Contains a list of message positions @total_count Total count of messages found @positions List of message positions +//@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions messagePositions total_count:int32 positions:vector = MessagePositions; -//@description Contains information about found messages sent in a specific day @total_count Total number of found messages sent in the day @message First message sent in the day +//@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day messageCalendarDay total_count:int32 message:message = MessageCalendarDay; -//@description Contains information about found messages, splitted by days according to the option "utc_time_offset" @total_count Total number of found messages @days Information about messages sent +//@description Contains information about found messages, split by days according to the option "utc_time_offset" @total_count Total number of found messages @days Information about messages sent messageCalendar total_count:int32 days:vector = MessageCalendar; -//@description Describes a sponsored message @id Unique sponsored message identifier @sponsor_chat_id Chat identifier -//@link An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead @content Content of the message -sponsoredMessage id:int32 sponsor_chat_id:int53 link:InternalLinkType content:MessageContent = SponsoredMessage; +//@description Describes a sponsored message +//@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages +//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link +//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 +//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead +//@content Content of the message. Currently, can be only of the type messageText +sponsoredMessage message_id:int53 sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo link:InternalLinkType content:MessageContent = SponsoredMessage; -//@description Contains a list of sponsored messages @messages List of sponsored messages -sponsoredMessages messages:vector = SponsoredMessages; + +//@description Describes a file added to file download list +//@file_id File identifier +//@message The message with the file +//@add_date Point in time (Unix timestamp) when the file was added to the download list +//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed +//@is_paused True, if downloading of the file is paused +fileDownload file_id:int32 message:message add_date:int32 complete_date:int32 is_paused:Bool = FileDownload; + +//@description Contains number of being downloaded and recently downloaded files found +//@active_count Number of active file downloads found, including paused +//@paused_count Number of paused file downloads found +//@completed_count Number of completed file downloads found +downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 = DownloadedFileCounts; + +//@description Contains a list of downloaded files, found by a search +//@total_counts Total number of suitable files, ignoring offset +//@files The list of files +//@next_offset The offset for the next request. If empty, there are no more results +foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; //@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant @@ -842,32 +916,32 @@ sponsoredMessages messages:vector = SponsoredMessages; //@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value notificationSettingsScopePrivateChats = NotificationSettingsScope; -//@description Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value notificationSettingsScopeGroupChats = NotificationSettingsScope; -//@description Notification settings applied to all channels when the corresponding chat setting has a default value +//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value notificationSettingsScopeChannelChats = NotificationSettingsScope; //@description Contains information about notification settings for a chat //@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat is used instead @mute_for Time left before notifications will be unmuted, in seconds -//@use_default_sound If true, sound is ignored and the value for the relevant type of chat is used instead @sound The name of an audio file to be used for notification sounds; only applies to iOS applications +//@use_default_sound If true, the value for the relevant type of chat is used instead of sound_id @sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content must be displayed in notifications //@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead @disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message //@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead @disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound:string use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds -//@sound The name of an audio file to be used for notification sounds; only applies to iOS applications +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the message to reply to; 0 if none +//@reply_to_message_id Identifier of the replied message; 0 if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; @@ -890,7 +964,7 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@description Represents a filter of user chats //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". +//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". //-If empty, use getChatFilterDefaultIconName to get default icon name for the filter //@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list //@included_chat_ids The chat identifiers of always included chats in the filtered chat list @@ -908,7 +982,7 @@ chatFilter title:string icon_name:string pinned_chat_ids:vector included_ //@description Contains basic information about a chat filter //@id Unique chat filter identifier //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" +//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; //@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description @@ -965,7 +1039,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null //@positions Positions of the chat in chat lists -//@default_message_sender_id Default identifier of a user or chat that is chosen to send messages in the chat; may be null if the user can't change message sender +//@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender //@has_protected_content True, if chat content can't be saved locally, forwarded, or copied //@is_marked_as_unread True, if the chat is marked as unread //@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received @@ -978,8 +1052,10 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the chat -//@notification_settings Notification settings for this chat -//@message_ttl_setting Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats +//@unread_reaction_count Number of messages with unread reactions in the chat +//@notification_settings Notification settings for the chat +//@available_reactions List of reactions, available in the chat +//@message_ttl Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null //@video_chat Information about video chat of the chat @@ -987,9 +1063,9 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector default_message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl_setting:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:vector message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; -//@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers +//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1053,6 +1129,9 @@ keyboardButtonTypeRequestLocation = KeyboardButtonType; //@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; +//@description A button that opens a web app by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl +keyboardButtonTypeWebApp url:string = KeyboardButtonType; + //@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button keyboardButton text:string type:KeyboardButtonType = KeyboardButton; @@ -1063,9 +1142,12 @@ keyboardButton text:string type:KeyboardButtonType = KeyboardButton; //@description A button that opens a specified URL @url HTTP or tg:// URL to open inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; -//@description A button that opens a specified URL and automatically authorize the current user if allowed to do so @url An HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages +//@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @url An HTTP URL to pass to getLoginUrlInfo @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType; +//@description A button that opens a web app by calling openWebApp @url An HTTP URL to pass to openWebApp +inlineKeyboardButtonTypeWebApp url:string = InlineKeyboardButtonType; + //@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; @@ -1081,7 +1163,7 @@ inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineK //@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType; -//@description A button to open a chat with a user @user_id User identifier +//@description A button with a user reference to be handled in the same way as textEntityTypeMentionName entities @user_id User identifier inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; @@ -1123,6 +1205,10 @@ loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo; loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo; +//@description Contains information about a web app @launch_id Unique identifier for the web app launch @url A web app URL to open in a web view +webAppInfo launch_id:int64 url:string = WebAppInfo; + + //@description Contains information about a message thread //@chat_id Identifier of the chat to which the message thread belongs //@message_thread_id Message thread identifier, unique within the chat @@ -1301,7 +1387,7 @@ pageBlockCollage page_blocks:vector caption:pageBlockCaption = PageBl //@description A slideshow @page_blocks Slideshow item contents @caption Block caption pageBlockSlideshow page_blocks:vector caption:pageBlockCaption = PageBlock; -//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username, by which all other information about the chat can be resolved +//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username by which all other information about the chat can be resolved pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; //@description A table @caption Table caption @cells Table cells @is_bordered True, if the table is bordered @is_striped True, if the table is striped @@ -1320,7 +1406,7 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB //@description Describes an instant view page for a web page //@page_blocks Content of the web page //@view_count Number of the instant view views; 0 if unknown -//@version Version of the instant view, currently can be 1 or 2 +//@version Version of the instant view; currently, can be 1 or 2 //@is_rtl True, if the instant view must be shown from right to left //@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view //@feedback_link An internal link to be opened to leave feedback about the instant view @@ -1343,12 +1429,12 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@author Author of the content //@animation Preview of the content as an animation, if available; may be null //@audio Preview of the content as an audio file, if available; may be null -//@document Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null +//@document Preview of the content as a document, if available; may be null //@sticker Preview of the content as a sticker for small WEBP files, if available; may be null //@video Preview of the content as a video, if available; may be null //@video_note Preview of the content as a video note, if available; may be null //@voice_note Preview of the content as a voice note, if available; may be null -//@instant_view_version Version of instant view, available for the web page (currently can be 1 or 2), 0 if none +//@instant_view_version Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage; @@ -1381,6 +1467,12 @@ bankCardInfo title:string actions:vector = BankCardInfo; address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address; +//@description Contains parameters of the app theme @background_color A color of the background in the RGB24 format @text_color A color of text in the RGB24 format +//@hint_color A color of hints in the RGB24 format @link_color A color of links in the RGB24 format @button_color A color of the buttons in the RGB24 format +//@button_text_color A color of text on the buttons in the RGB24 format +themeParameters background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; + + //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency labeledPricePart label:string amount:int53 = LabeledPricePart; @@ -1424,11 +1516,6 @@ inputCredentialsGooglePay data:string = InputCredentials; //@description Stripe payment provider @publishable_key Stripe API publishable key @need_country True, if the user country must be provided @need_postal_code True, if the user ZIP/postal code must be provided @need_cardholder_name True, if the cardholder name must be provided paymentsProviderStripe publishable_key:string need_country:Bool need_postal_code:Bool need_cardholder_name:Bool = PaymentsProviderStripe; -//@description Theme colors for a payment form @background_color A color of the payment form background in the RGB24 format @text_color A color of text in the RGB24 format -//@hint_color A color of hints in the RGB24 format @link_color A color of links in the RGB24 format @button_color A color of the buttons in the RGB24 format -//@button_text_color A color of text on the buttons in the RGB24 format -paymentFormTheme background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = PaymentFormTheme; - //@description Contains information about an invoice payment form //@id The payment form identifier //@invoice Full information of the invoice @@ -1815,7 +1902,7 @@ messageChatDeletePhoto = MessageContent; //@description New chat members were added @member_user_ids User identifiers of the new members messageChatAddMembers member_user_ids:vector = MessageContent; -//@description A new member joined the chat by invite link +//@description A new member joined the chat via an invite link messageChatJoinByLink = MessageContent; //@description A new member was accepted to the chat by an administrator @@ -1839,7 +1926,7 @@ messageScreenshotTaken = MessageContent; //@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one messageChatSetTheme theme_name:string = MessageContent; -//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL setting +//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL messageChatSetTtl ttl:int32 = MessageContent; //@description A non-standard action has happened in the chat @text Message text to be shown in the chat @@ -1862,7 +1949,13 @@ messageContactRegistered = MessageContent; //@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website messageWebsiteConnected domain_name:string = MessageContent; -//@description Telegram Passport data has been sent @types List of Telegram Passport element types sent +//@description Data from a web app has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app +messageWebAppDataSent button_text:string = MessageContent; + +//@description Data from a web app has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app @data Received data +messageWebAppDataReceived button_text:string data:string = MessageContent; + +//@description Telegram Passport data has been sent to a bot @types List of Telegram Passport element types sent messagePassportDataSent types:vector = MessageContent; //@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials @@ -1913,6 +2006,9 @@ textEntityTypeUnderline = TextEntityType; //@description A strikethrough text textEntityTypeStrikethrough = TextEntityType; +//@description A spoiler text. Not supported in secret chats +textEntityTypeSpoiler = TextEntityType; + //@description Text that must be formatted as if inside a code HTML tag textEntityTypeCode = TextEntityType; @@ -1951,8 +2047,9 @@ messageSchedulingStateSendWhenOnline = MessageSchedulingState; //@description Options to be used when a message is sent //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background +//@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled -messageSendOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; +messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; //@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local @@ -1963,7 +2060,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@class InputMessageContent @description The content of a message to send -//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled @clear_draft True, if a chat message draft must be deleted inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; @@ -2028,7 +2125,7 @@ inputMessagePoll question:string options:vector is_anonymous:Bool type:P //@description A forwarded message @from_chat_id Identifier for the chat this forwarded message came from @message_id Identifier of the message to forward //@in_game_share True, if a game message is being shared from a launched game; applies only to game messages -//@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to try to forward the message as usual +//@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; @@ -2064,12 +2161,6 @@ searchMessagesFilterUrl = SearchMessagesFilter; //@description Returns only messages containing chat photos searchMessagesFilterChatPhoto = SearchMessagesFilter; -//@description Returns only call messages -searchMessagesFilterCall = SearchMessagesFilter; - -//@description Returns only incoming call messages with missed/declined discard reasons -searchMessagesFilterMissedCall = SearchMessagesFilter; - //@description Returns only video note messages searchMessagesFilterVideoNote = SearchMessagesFilter; @@ -2082,6 +2173,9 @@ searchMessagesFilterMention = SearchMessagesFilter; //@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user searchMessagesFilterUnreadMention = SearchMessagesFilter; +//@description Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +searchMessagesFilterUnreadReaction = SearchMessagesFilter; + //@description Returns only failed to send messages. This filter can be used only if the message database is used searchMessagesFilterFailedToSend = SearchMessagesFilter; @@ -2165,20 +2259,20 @@ stickers stickers:vector = Stickers; emojis emojis:vector = Emojis; //@description Represents a sticker set -//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed +//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously -//@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets +//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set @emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set -//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null +//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously -//@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets +//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set @covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -2264,6 +2358,19 @@ groupCallVideoQualityMedium = GroupCallVideoQuality; groupCallVideoQualityFull = GroupCallVideoQuality; +//@description Describes an available stream in a group call +//@channel_id Identifier of an audio/video channel +//@scale Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds +//@time_offset Point in time when the stream currently ends; Unix timestamp in milliseconds +groupCallStream channel_id:int32 scale:int32 time_offset:int53 = GroupCallStream; + +//@description Represents a list of group call streams @streams A list of group call streams +groupCallStreams streams:vector = GroupCallStreams; + +//@description Represents an RTMP url @url The URL @stream_key Stream key +rtmpUrl url:string stream_key:string = RtmpUrl; + + //@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, is the user has spoken recently groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCallRecentSpeaker; @@ -2273,12 +2380,14 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended //@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start //@is_active True, if the call is active +//@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat //@is_joined True, if the call is joined //@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined //@can_be_managed True, if the current user can manage the group call //@participant_count Number of participants in the group call +//@has_hidden_listeners True, if group call participants, which are muted, aren't returned in participant list //@loaded_all_participants True, if all group call participants are loaded -//@recent_speakers Recently speaking users in the group call +//@recent_speakers At most 3 recently speaking users in the group call //@is_my_video_enabled True, if the current user's video is enabled //@is_my_video_paused True, if the current user's video is paused //@can_enable_video True, if the current user can broadcast video or share screen @@ -2287,7 +2396,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on //@is_video_recorded True, if a video file is being recorded for the call //@duration Call duration, in seconds; for ended calls only -groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; +groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; //@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers groupCallVideoSourceGroup semantics:string source_ids:vector = GroupCallVideoSourceGroup; @@ -2357,10 +2466,34 @@ call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Cal //@allow_missed_call Pass true if the authentication code may be sent via a missed call to the specified phone number //@is_current_phone_number Pass true if the authenticated phone number is used on the current device //@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details -//@authentication_tokens List of authentication tokens, received in updateOption("authentication_token") in previously logged out sessions +//@authentication_tokens List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool authentication_tokens:vector = PhoneNumberAuthenticationSettings; +//@description Represents a reaction applied to a message @reaction Text representation of the reaction @sender_id Identifier of the chat member, applied the reaction +addedReaction reaction:string sender_id:MessageSender = AddedReaction; + +//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results +addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; + +//@description Represents a list of available reactions @reactions List of reactions +availableReactions reactions:vector = AvailableReactions; + + +//@description Contains stickers which must be used for reaction animation rendering +//@reaction Text representation of the reaction +//@title Reaction title +//@is_active True, if the reaction can be added to new messages and enabled in chats +//@static_icon Static icon for the reaction +//@appear_animation Appear animation for the reaction +//@select_animation Select animation for the reaction +//@activate_animation Activate animation for the reaction +//@effect_animation Effect animation for the reaction +//@around_animation Around animation for the reaction; may be null +//@center_animation Center animation for the reaction; may be null +reaction reaction:string title:string is_active:Bool static_icon:sticker appear_animation:sticker select_animation:sticker activate_animation:sticker effect_animation:sticker around_animation:sticker center_animation:sticker = Reaction; + + //@description Represents a list of animations @animations List of animations animations animations:vector = Animations; @@ -2384,6 +2517,25 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente importedContacts user_ids:vector importer_count:vector = ImportedContacts; +//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes +attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; + +//@description Represents a bot added to attachment menu +//@bot_user_id User identifier of the bot added to attachment menu +//@name Name for the bot in attachment menu +//@name_color Color to highlight selected name of the bot if appropriate; may be null +//@default_icon Default attachment menu icon for the bot in SVG format; may be null +//@ios_static_icon Attachment menu icon for the bot in SVG format for the official iOS app; may be null +//@ios_animated_icon Attachment menu icon for the bot in TGS format for the official iOS app; may be null +//@android_icon Attachment menu icon for the bot in TGS format for the official Android app; may be null +//@macos_icon Attachment menu icon for the bot in TGS format for the official native macOS app; may be null +//@icon_color Color to highlight selected icon of the bot if appropriate; may be null +attachmentMenuBot bot_user_id:int53 name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file android_icon:file macos_icon:file icon_color:attachmentMenuBotColor = AttachmentMenuBot; + +//@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known +sentWebAppMessage inline_message_id:string = SentWebAppMessage; + + //@description Contains an HTTP URL @url The URL httpUrl url:string = HttpUrl; @@ -2438,8 +2590,8 @@ inputInlineQueryResultLocation id:string location:location live_period:int32 tit //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultPhoto id:string title:string description:string thumbnail_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; -//@description Represents a link to a WEBP or TGS sticker @id Unique identifier of the query result @thumbnail_url URL of the sticker thumbnail, if it exists -//@sticker_url The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker +//@description Represents a link to a WEBP, TGS, or WEBM sticker @id Unique identifier of the query result @thumbnail_url URL of the sticker thumbnail, if it exists +//@sticker_url The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -2543,78 +2695,81 @@ chatEventMessageEdited old_message:message new_message:message = ChatEventAction //@description A message was deleted @message Deleted message chatEventMessageDeleted message:message = ChatEventAction; -//@description A poll in a message was stopped @message The message with the poll -chatEventPollStopped message:message = ChatEventAction; - //@description A message was pinned @message Pinned message chatEventMessagePinned message:message = ChatEventAction; //@description A message was unpinned @message Unpinned message chatEventMessageUnpinned message:message = ChatEventAction; +//@description A poll in a message was stopped @message The message with the poll +chatEventPollStopped message:message = ChatEventAction; + //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; -//@description A new member joined the chat by an invite link @invite_link Invite link used to join the chat +//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction; //@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; -//@description A member left the chat -chatEventMemberLeft = ChatEventAction; - //@description A new chat member was invited @user_id New member user identifier @status New member status chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction; +//@description A member left the chat +chatEventMemberLeft = ChatEventAction; + //@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; //@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; -//@description The chat title was changed @old_title Previous chat title @new_title New chat title -chatEventTitleChanged old_title:string new_title:string = ChatEventAction; - -//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions -chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; +//@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions +chatEventAvailableReactionsChanged old_available_reactions:vector new_available_reactions:vector = ChatEventAction; //@description The chat description was changed @old_description Previous chat description @new_description New chat description chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; -//@description The chat username was changed @old_username Previous chat username @new_username New chat username -chatEventUsernameChanged old_username:string new_username:string = ChatEventAction; - -//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null -chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; - -//@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission -chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; - //@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; -//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds -chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; - -//@description The message TTL setting was changed @old_message_ttl_setting Previous value of message_ttl_setting @new_message_ttl_setting New value of message_ttl_setting -chatEventMessageTtlSettingChanged old_message_ttl_setting:int32 new_message_ttl_setting:int32 = ChatEventAction; - -//@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages -chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; - -//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content -chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; - -//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none -chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; - //@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction; +//@description The message TTL was changed @old_message_ttl Previous value of message_ttl @new_message_ttl New value of message_ttl +chatEventMessageTtlChanged old_message_ttl:int32 new_message_ttl:int32 = ChatEventAction; + +//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions +chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; + +//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null +chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; + +//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds +chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; + +//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; + +//@description The chat title was changed @old_title Previous chat title @new_title New chat title +chatEventTitleChanged old_title:string new_title:string = ChatEventAction; + +//@description The chat username was changed @old_username Previous chat username @new_username New chat username +chatEventUsernameChanged old_username:string new_username:string = ChatEventAction; + +//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content +chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; + +//@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission +chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; + //@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; +//@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages +chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; + //@description A chat invite link was edited @old_invite_link Previous information about the invite link @new_invite_link New information about the invite link chatEventInviteLinkEdited old_invite_link:chatInviteLink new_invite_link:chatInviteLink = ChatEventAction; @@ -2627,8 +2782,11 @@ chatEventInviteLinkDeleted invite_link:chatInviteLink = ChatEventAction; //@description A video chat was created @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall chatEventVideoChatCreated group_call_id:int32 = ChatEventAction; -//@description A video chat was discarded @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall -chatEventVideoChatDiscarded group_call_id:int32 = ChatEventAction; +//@description A video chat was ended @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +chatEventVideoChatEnded group_call_id:int32 = ChatEventAction; + +//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting +chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; //@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; @@ -2636,11 +2794,8 @@ chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_mute //@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; -//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting -chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; - -//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @user_id Identifier of the user who performed the action that triggered the event @action Action performed by the user -chatEvent id:int64 date:int32 user_id:int53 action:ChatEventAction = ChatEvent; +//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action +chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent; //@description Contains a list of chat events @events List of events chatEvents events:vector = ChatEvents; @@ -2666,7 +2821,7 @@ chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool //@description An ordinary language pack string @value String value languagePackStringValueOrdinary value:string = LanguagePackStringValue; -//@description A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info +//@description A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information //@zero_value Value for zero objects @one_value Value for one object @two_value Value for two objects //@few_value Value for few objects @many_value Value for many objects @other_value Default value languagePackStringValuePluralized zero_value:string one_value:string two_value:string few_value:string many_value:string other_value:string = LanguagePackStringValue; @@ -2684,7 +2839,7 @@ languagePackStrings strings:vector = LanguagePackStrings; //@description Contains information about a language pack @id Unique language pack identifier //@base_language_pack_id Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs //@name Language name @native_name Name of the language in that language -//@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info +//@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information //@is_official True, if the language pack is official @is_rtl True, if the language pack strings are RTL @is_beta True, if the language pack is a beta language pack //@is_installed True, if the language pack is installed by the current user //@total_string_count Total number of non-deleted strings from the language pack @translated_string_count Total number of translated strings from the language pack @@ -2697,38 +2852,38 @@ localizationTargetInfo language_packs:vector = LocalizationTar //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org -//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to de-register a device @encrypt True, if push notifications must be additionally encrypted +//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted deviceTokenFirebaseCloudMessaging token:string encrypt:Bool = DeviceToken; -//@description A token for Apple Push Notification service @device_token Device token; may be empty to de-register a device @is_app_sandbox True, if App Sandbox is enabled +//@description A token for Apple Push Notification service @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled deviceTokenApplePush device_token:string is_app_sandbox:Bool = DeviceToken; -//@description A token for Apple Push Notification service VoIP notifications @device_token Device token; may be empty to de-register a device @is_app_sandbox True, if App Sandbox is enabled @encrypt True, if push notifications must be additionally encrypted +//@description A token for Apple Push Notification service VoIP notifications @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled @encrypt True, if push notifications must be additionally encrypted deviceTokenApplePushVoIP device_token:string is_app_sandbox:Bool encrypt:Bool = DeviceToken; -//@description A token for Windows Push Notification Services @access_token The access token that will be used to send notifications; may be empty to de-register a device +//@description A token for Windows Push Notification Services @access_token The access token that will be used to send notifications; may be empty to deregister a device deviceTokenWindowsPush access_token:string = DeviceToken; -//@description A token for Microsoft Push Notification Service @channel_uri Push notification channel URI; may be empty to de-register a device +//@description A token for Microsoft Push Notification Service @channel_uri Push notification channel URI; may be empty to deregister a device deviceTokenMicrosoftPush channel_uri:string = DeviceToken; -//@description A token for Microsoft Push Notification Service VoIP channel @channel_uri Push notification channel URI; may be empty to de-register a device +//@description A token for Microsoft Push Notification Service VoIP channel @channel_uri Push notification channel URI; may be empty to deregister a device deviceTokenMicrosoftPushVoIP channel_uri:string = DeviceToken; -//@description A token for web Push API @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device +//@description A token for web Push API @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device //@p256dh_base64url Base64url-encoded P-256 elliptic curve Diffie-Hellman public key @auth_base64url Base64url-encoded authentication secret deviceTokenWebPush endpoint:string p256dh_base64url:string auth_base64url:string = DeviceToken; -//@description A token for Simple Push API for Firefox OS @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device +//@description A token for Simple Push API for Firefox OS @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device deviceTokenSimplePush endpoint:string = DeviceToken; -//@description A token for Ubuntu Push Client service @token Token; may be empty to de-register a device +//@description A token for Ubuntu Push Client service @token Token; may be empty to deregister a device deviceTokenUbuntuPush token:string = DeviceToken; -//@description A token for BlackBerry Push Service @token Token; may be empty to de-register a device +//@description A token for BlackBerry Push Service @token Token; may be empty to deregister a device deviceTokenBlackBerryPush token:string = DeviceToken; -//@description A token for Tizen Push Service @reg_id Push service registration identifier; may be empty to de-register a device +//@description A token for Tizen Push Service @reg_id Push service registration identifier; may be empty to deregister a device deviceTokenTizenPush reg_id:string = DeviceToken; @@ -2836,7 +2991,7 @@ checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult; //@description The username is occupied checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult; -//@description The user has too much chats with username, one of them must be made private first +//@description The user has too many chats with username, one of them must be made private first checkChatUsernameResultPublicChatsTooMuch = CheckChatUsernameResult; //@description The user can't be a member of a public supergroup @@ -2955,7 +3110,7 @@ pushMessageContentChatSetTheme theme_name:string = PushMessageContent; //@is_left True, if the user has left the group themselves pushMessageContentChatDeleteMember member_name:string is_current_user:Bool is_left:Bool = PushMessageContent; -//@description A new member joined the chat by invite link +//@description A new member joined the chat via an invite link pushMessageContentChatJoinByLink = PushMessageContent; //@description A new member was accepted to the chat by an administrator @@ -3004,9 +3159,22 @@ notificationGroupTypeSecretChat = NotificationGroupType; notificationGroupTypeCalls = NotificationGroupType; +//@description Describes a notification sound in MP3 format +//@id Unique identifier of the notification sound +//@duration Duration of the sound, in seconds +//@date Point in time (Unix timestamp) when the sound was created +//@title Title of the notification sound +//@data Arbitrary data, defined while the sound was uploaded +//@sound File containing the sound +notificationSound id:int64 duration:int32 date:int32 title:string data:string sound:file = NotificationSound; + +//@description Contains a list of notification sounds @notification_sounds A list of notification sounds +notificationSounds notification_sounds:vector = NotificationSounds; + + //@description Contains information about a notification @id Unique persistent identifier of this notification @date Notification date -//@is_silent True, if the notification was initially silent @type Notification type -notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notification; +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled @type Notification type +notification id:int32 date:int32 sound_id:int64 type:NotificationType = Notification; //@description Describes a group of notifications @id Unique persistent auto-incremented from 1 identifier of the notification group @type Type of the group //@chat_id Identifier of a chat to which all notifications in the group belong @@ -3139,7 +3307,7 @@ sessions sessions:vector inactive_session_ttl_days:int32 = Sessions; //@log_in_date Point in time (Unix timestamp) when the user was logged in //@last_active_date Point in time (Unix timestamp) when obtained authorization was last used //@ip IP address from which the user was logged in, in human-readable format -//@location Human-readable description of a country and a region, from which the user was logged in, based on the IP address +//@location Human-readable description of a country and a region from which the user was logged in, based on the IP address connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; //@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites @@ -3169,6 +3337,12 @@ chatReportReasonUnrelatedLocation = ChatReportReason; //@description The chat represents a fake account chatReportReasonFake = ChatReportReason; +//@description The chat has illegal drugs related content +chatReportReasonIllegalDrugs = ChatReportReason; + +//@description The chat contains messages with personal details +chatReportReasonPersonalDetails = ChatReportReason; + //@description A custom reason provided by the user chatReportReasonCustom = ChatReportReason; @@ -3178,6 +3352,13 @@ chatReportReasonCustom = ChatReportReason; //@description The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link internalLinkTypeActiveSessions = InternalLinkType; +//@description The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. +//-Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. +//-If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. +//-If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL +//@chat_link An internal link pointing to a chat; may be null if the current chat needs to be kept @bot_username Username of the bot @url URL to be passed to openWebApp +internalLinkTypeAttachmentMenuBot chat_link:InternalLinkType bot_username:string url:string = InternalLinkType; + //@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code internalLinkTypeAuthenticationCode code:string = InternalLinkType; @@ -3190,9 +3371,19 @@ internalLinkTypeBackground background_name:string = InternalLinkType; internalLinkTypeBotStart bot_username:string start_parameter:string = InternalLinkType; //@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, -//-ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group -//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage -internalLinkTypeBotStartInGroup bot_username:string start_parameter:string = InternalLinkType; +//-ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. +//-If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, +//-check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, +//-and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. +//-Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. +//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage @administrator_rights Expected administrator rights for the bot; may be null +internalLinkTypeBotStartInGroup bot_username:string start_parameter:string administrator_rights:chatAdministratorRights = InternalLinkType; + +//@description The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, +//-ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, +//-check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights +//@bot_username Username of the bot @administrator_rights Expected administrator rights for the bot +internalLinkTypeBotAddToChannel bot_username:string administrator_rights:chatAdministratorRights = InternalLinkType; //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; @@ -3210,6 +3401,9 @@ internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkTy //@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; +//@description The link is a link to the language settings section of the app +internalLinkTypeLanguageSettings = InternalLinkType; + //@description The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo internalLinkTypeMessage url:string = InternalLinkType; @@ -3226,6 +3420,9 @@ internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:st //@hash Hash value from the link @phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; +//@description The link is a link to the privacy and security settings section of the app +internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; + //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy //@server Proxy server IP address @port Proxy server port @type Type of the proxy internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; @@ -3255,7 +3452,10 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; //@description The link is a link to an unsupported proxy. An alert can be shown to the user internalLinkTypeUnsupportedProxy = InternalLinkType; -//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link @phone_number Phone number of the user +internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType; + +//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link //@chat_username Username of the chat with the video chat @invite_hash If non-empty, invite hash to be used to join the video chat without being muted by administrators //@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; @@ -3292,6 +3492,9 @@ fileTypeAudio = FileType; //@description The file is a document fileTypeDocument = FileType; +//@description The file is a notification sound +fileTypeNotificationSound = FileType; + //@description The file is a photo fileTypePhoto = FileType; @@ -3452,7 +3655,7 @@ tMeUrlTypeUser user_id:int53 = TMeUrlType; //@description A URL linking to a public supergroup or channel @supergroup_id Identifier of the supergroup or channel tMeUrlTypeSupergroup supergroup_id:int53 = TMeUrlType; -//@description A chat invite link @info Chat invite link info +//@description A chat invite link @info Information about the chat invite link tMeUrlTypeChatInvite info:chatInviteLinkInfo = TMeUrlType; //@description A URL linking to a sticker set @sticker_set_id Identifier of the sticker set @@ -3470,14 +3673,14 @@ tMeUrls urls:vector = TMeUrls; //@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; -//@description Suggests the user to check whether 2-step verification password is still remembered +//@description Suggests the user to check whether they still remember their 2-step verification password suggestedActionCheckPassword = SuggestedAction; //@description Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible suggestedActionCheckPhoneNumber = SuggestedAction; -//@description Suggests the user to see a hint about meaning of one and two ticks on sent message -suggestedActionSeeTicksHint = SuggestedAction; +//@description Suggests the user to view a hint about the meaning of one and two check marks on sent messages +suggestedActionViewChecksHint = SuggestedAction; //@description Suggests the user to convert specified supergroup to a broadcast group @supergroup_id Supergroup identifier suggestedActionConvertToBroadcastGroup supergroup_id:int53 = SuggestedAction; @@ -3529,18 +3732,11 @@ proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool typ proxies proxies:vector = Proxies; -//@class InputSticker @description Describes a sticker that needs to be added to a sticker set - -//@description A static sticker in PNG format, which will be converted to WEBP server-side -//@sticker PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square +//@description A sticker to be added to a sticker set +//@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements //@emojis Emojis corresponding to the sticker -//@mask_position For masks, position where the mask is placed; pass null if unspecified -inputStickerStatic sticker:InputFile emojis:string mask_position:maskPosition = InputSticker; - -//@description An animated sticker in TGS format -//@sticker File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements -//@emojis Emojis corresponding to the sticker -inputStickerAnimated sticker:InputFile emojis:string = InputSticker; +//@type Sticker type +inputSticker sticker:InputFile emojis:string type:StickerType = InputSticker; //@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends @@ -3706,6 +3902,9 @@ updateMessageContentOpened chat_id:int53 message_id:int53 = Update; //@description A message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count The new number of unread mention messages left in the chat updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update; +//@description The list of unread reactions added to a message was changed @chat_id Chat identifier @message_id Message identifier @unread_reactions The new list of unread reactions @unread_reaction_count The new number of messages with unread reactions left in the chat +updateMessageUnreadReactions chat_id:int53 message_id:int53 unread_reactions:vector unread_reaction_count:int32 = Update; + //@description A message with a live location was viewed. When the update is received, the application is supposed to update the live location //@chat_id Identifier of the chat with the live location message @message_id Identifier of the message with live location updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update; @@ -3728,50 +3927,29 @@ updateChatLastMessage chat_id:int53 last_message:message positions:vector = Update; + +//@description A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied @chat_id Chat identifier @draft_message The new draft message; may be null @positions The new chat positions in the chat lists +updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector = Update; + +//@description The message sender that is selected to send messages in a chat has changed @chat_id Chat identifier @message_sender_id New value of message_sender_id; may be null if the user can't change message sender +updateChatMessageSender chat_id:int53 message_sender_id:MessageSender = Update; + +//@description The message Time To Live setting for a chat was changed @chat_id Chat identifier @message_ttl New value of message_ttl +updateChatMessageTtl chat_id:int53 message_ttl:int32 = Update; + +//@description Notification settings for a chat were changed @chat_id Chat identifier @notification_settings The new notification settings +updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Update; //@description The chat pending join requests were changed @chat_id Chat identifier @pending_join_requests The new data about pending join requests; may be null updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinRequestsInfo = Update; @@ -3780,15 +3958,42 @@ updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinReques //@chat_id Chat identifier @reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update; -//@description A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied @chat_id Chat identifier @draft_message The new draft message; may be null @positions The new chat positions in the chat lists -updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector = Update; +//@description The chat theme was changed @chat_id Chat identifier @theme_name The new name of the chat theme; may be empty if theme was reset to default +updateChatTheme chat_id:int53 theme_name:string = Update; + +//@description The chat unread_mention_count has changed @chat_id Chat identifier @unread_mention_count The number of unread mention messages left in the chat +updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update; + +//@description The chat unread_reaction_count has changed @chat_id Chat identifier @unread_reaction_count The number of messages with unread reactions left in the chat +updateChatUnreadReactionCount chat_id:int53 unread_reaction_count:int32 = Update; + +//@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat +updateChatVideoChat chat_id:int53 video_chat:videoChat = Update; + +//@description The value of the default disable_notification parameter, used when a message is sent to the chat, was changed @chat_id Chat identifier @default_disable_notification The new default_disable_notification value +updateChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Update; + +//@description A chat content was allowed or restricted for saving @chat_id Chat identifier @has_protected_content New value of has_protected_content +updateChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Update; + +//@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages +updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; + +//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked +updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; + +//@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread +updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; //@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters updateChatFilters chat_filters:vector = Update; -//@description The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown +//@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; +//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings +updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; + //@description A notification was changed @notification_group_id Unique notification group identifier @notification Changed notification updateNotification notification_group_id:int32 notification:notification = Update; @@ -3797,10 +4002,10 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@type New type of the notification group //@chat_id Identifier of a chat to which all notifications in the group belong //@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications -//@is_silent True, if the notifications must be shown without sound +//@notification_sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@total_count Total number of unread notifications in the group, can be bigger than number of active notifications //@added_notifications List of added group notifications, sorted by notification ID @removed_notification_ids Identifiers of removed group notifications, sorted by notification ID -updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 is_silent:Bool total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; +updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; //@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector = Update; @@ -3860,6 +4065,24 @@ updateFileGenerationStart generation_id:int64 original_path:string destination_p //@description File generation is no longer needed @generation_id Unique identifier for the generation process updateFileGenerationStop generation_id:int64 = Update; +//@description The state of the file download list has changed +//@total_size Total size of files in the file download list, in bytes +//@total_count Total number of files in the file download list +//@downloaded_size Total downloaded size of files in the file download list, in bytes +updateFileDownloads total_size:int53 total_count:int32 downloaded_size:int53 = Update; + +//@description A file was added to the file download list. This update is sent only after file download list is loaded for the first time @file_download The added file download @counts New number of being downloaded and recently downloaded files found +updateFileAddedToDownloads file_download:fileDownload counts:downloadedFileCounts = Update; + +//@description A file download was changed. This update is sent only after file download list is loaded for the first time @file_id File identifier +//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed +//@is_paused True, if downloading of the file is paused +//@counts New number of being downloaded and recently downloaded files found +updateFileDownload file_id:int32 complete_date:int32 is_paused:Bool counts:downloadedFileCounts = Update; + +//@description A file was removed from the file download list. This update is sent only after file download list is loaded for the first time @file_id File identifier @counts New number of being downloaded and recently downloaded files found +updateFileRemovedFromDownloads file_id:int32 counts:downloadedFileCounts = Update; + //@description New call was created or information about a call was updated @call New data about a call updateCall call:call = Update; @@ -3908,6 +4131,9 @@ updateFavoriteStickers sticker_ids:vector = Update; //@description The list of saved animations was updated @animation_ids The new list of file identifiers of saved animations updateSavedAnimations animation_ids:vector = Update; +//@description The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds +updateSavedNotificationSounds notification_sound_ids:vector = Update; + //@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null updateSelectedBackground for_dark_theme:Bool background:background = Update; @@ -3926,6 +4152,15 @@ updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService //@description The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby updateUsersNearby users_nearby:vector = Update; +//@description The list of bots added to attachment menu has changed @bots The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen +updateAttachmentMenuBots bots:vector = Update; + +//@description A message was sent by an opened web app, so the web app needs to be closed @web_app_launch_id Identifier of web app launch +updateWebAppMessageSent web_app_launch_id:int64 = Update; + +//@description The list of supported reactions has changed @reactions The new list of supported reactions +updateReactions reactions:vector = Update; + //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; @@ -3940,7 +4175,7 @@ updateAnimationSearchParameters provider:string emojis:vector = Update; updateSuggestedActions added_actions:vector removed_actions:vector = Update; //@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location; may be null -//@chat_type The type of the chat, from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return +//@chat_type The type of the chat from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_type:ChatType query:string offset:string = Update; //@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location; may be null @@ -3948,11 +4183,11 @@ updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_t updateNewChosenInlineResult sender_user_id:int53 user_location:location query:string result_id:string inline_message_id:string = Update; //@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query -//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message, from which the query originated +//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message from which the query originated //@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update; -//@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message, from which the query originated +//@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message from which the query originated //@chat_instance An identifier uniquely corresponding to the chat a message was sent to @payload Query payload updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; @@ -4099,7 +4334,7 @@ setDatabaseEncryptionKey new_encryption_key:bytes = Ok; getPasswordState = PasswordState; //@description Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed -//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true if the recovery email address must be changed @new_recovery_email_address New recovery email address; may be empty +//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true to change also the recovery email address @new_recovery_email_address New recovery email address; may be empty setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; //@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The password for the current user @@ -4168,7 +4403,7 @@ getChat chat_id:int53 = Chat; //@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessage chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message, if it is available locally without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get +//@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessageLocally chat_id:int53 message_id:int53 = Message; //@description Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively @@ -4207,10 +4442,10 @@ loadChats chat_list:ChatList limit:int32 = Ok; //@chat_list The chat list in which to return chats; pass null to get chats from the main chat list @limit The maximum number of chats to be returned getChats chat_list:ChatList limit:int32 = Chats; -//@description Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned @username Username to be resolved +//@description Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned @username Username to be resolved searchPublicChat username:string = Chat; -//@description 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. +//@description 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 @query Query to search for searchPublicChats query:string = Chats; @@ -4267,7 +4502,7 @@ getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message //@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@only_local If true, returns only messages that are available locally without sending network requests +//@only_local Pass true to get only messages that are available without sending network requests getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages; //@description Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. @@ -4280,10 +4515,10 @@ getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages; //@description Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat -//@chat_id Chat identifier @remove_from_chat_list Pass true if the chat needs to be removed from the chat list @revoke Pass true to try to delete chat history for all users +//@chat_id Chat identifier @remove_from_chat_list Pass true to remove the chat from all chat lists @revoke Pass true to delete chat history for all users deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; -//@description Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method @chat_id Chat identifier +//@description Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @chat_id Chat identifier deleteChat chat_id:int53 = Ok; //@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query @@ -4306,7 +4541,7 @@ searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_messa //@offset_chat_id The chat identifier of the last found message, or 0 for the first request //@offset_message_id The message identifier of the last found message, or 0 for the first request //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function +//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function //@min_date If not 0, the minimum date of the messages to return //@max_date If not 0, the maximum date of the messages to return searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = Messages; @@ -4314,16 +4549,22 @@ searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id: //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats //@query Query to search for. If empty, searchChatMessages must be used instead -//@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@filter Additional filter for messages to search; pass null to search for all messages searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages; //@description Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@from_message_id Identifier of the message from which to search; use 0 to get results from the last message -//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit @only_missed If true, returns only messages with missed calls +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@only_missed Pass true to search only for messages with missed/declined calls searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages; +//@description Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order +//@query Query to search for in document file name and message caption +//@limit The maximum number of messages to be returned; up to 100 +searchOutgoingDocumentMessages query:string limit:int32 = FoundMessages; + //@description Deletes all call messages @revoke Pass true to delete the messages for all users deleteAllCallMessages revoke:Bool = Ok; @@ -4339,18 +4580,18 @@ getChatMessageByDate chat_id:int53 date:int32 = Message; //@description 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 //@chat_id Identifier of the chat in which to return information about message positions -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function //@from_message_id The message identifier from which to return information about message positions //@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions; -//@description Returns information about the next messages of the specified type in the chat splitted by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" +//@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" //@chat_id Identifier of the chat in which to return information about messages -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function //@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; -//@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown +//@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier @@ -4359,15 +4600,12 @@ getChatScheduledMessages chat_id:int53 = Messages; //@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier -//@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; -//@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat -getChatSponsoredMessages chat_id:int53 = SponsoredMessages; - -//@description Informs TDLib that a sponsored message was viewed by the user @chat_id Identifier of the chat with the sponsored message @sponsored_message_id The identifier of the sponsored message being viewed -viewSponsoredMessage chat_id:int53 sponsored_message_id:int32 = Ok; +//@description Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat @chat_id Identifier of the chat +getChatSponsoredMessage chat_id:int53 = SponsoredMessage; //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification @@ -4395,28 +4633,36 @@ getMessageEmbeddingCode chat_id:int53 message_id:int53 for_album:Bool = Text; getMessageLinkInfo url:string = MessageLinkInfo; +//@description Translates a text to the given language. Returns a 404 error if the translation can't be performed +//@text Text to translate +//@from_language_code A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically +//@to_language_code A two-letter ISO 639-1 language code of the language to which the message is translated +translateText text:string from_language_code:string to_language_code:string = Text; + + //@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier getChatAvailableMessageSenders chat_id:int53 = MessageSenders; -//@description Changes default message sender that is chosen in a chat @chat_id Chat identifier @default_message_sender_id New default message sender in the chat -setChatDefaultMessageSender chat_id:int53 default_message_sender_id:MessageSender = Ok; +//@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat +setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the message to reply to or 0 +//@reply_to_message_id Identifier of the replied message; 0 if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Sends 2-10 messages grouped together into an album. Currently only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to_message_id Identifier of a message to reply to or 0 +//@reply_to_message_id Identifier of a replied message; 0 if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector = Messages; +//@only_preview Pass true to get fake messages instead of actually sending them +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @chat_id Identifier of the target chat @parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking) @@ -4425,11 +4671,11 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of a message to reply to or 0 +//@reply_to_message_id Identifier of a replied message; 0 if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline result -//@hide_via_bot If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") +//@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username"), and GetOption("venue_search_bot_username") sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message @@ -4437,9 +4683,9 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_mess //@from_chat_id Identifier of the chat from which to forward messages //@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously //@options Options to be used to send the messages; pass null to use default options -//@send_copy If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local -//@remove_caption If true, media caption of message copies will be removed. Ignored if send_copy is false -//@only_preview If true, messages will not be forwarded and instead fake messages will be returned +//@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local +//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false +//@only_preview Pass true to get fake messages instead of actually forwarding them forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. @@ -4453,19 +4699,19 @@ sendChatScreenshotTakenNotification chat_id:int53 = Ok; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to_message_id Identifier of the message to reply to or 0 +//@reply_to_message_id Identifier of the replied message; 0 if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; -//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats +//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; //@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok; //@description Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted -//@chat_id Chat identifier @min_date The minimum date of the messages to delete @max_date The maximum date of the messages to delete @revoke Pass true to try to delete chat messages for all users; private chats only +//@chat_id Chat identifier @min_date The minimum date of the messages to delete @max_date The maximum date of the messages to delete @revoke Pass true to delete chat messages for all users; private chats only deleteChatMessagesByDate chat_id:int53 min_date:int32 max_date:int32 revoke:Bool = Ok; @@ -4544,14 +4790,35 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; +//@description Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +getMessageAvailableReactions chat_id:int53 message_id:int53 = AvailableReactions; + +//@description Changes chosen reaction for a message +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@reaction Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction +//@is_big Pass true if the reaction is added with a big animation +setMessageReaction chat_id:int53 message_id:int53 reaction:string is_big:Bool = Ok; + +//@description Returns reactions added for a message, along with their sender +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@reaction If non-empty, only added reactions with the specified text representation will be returned +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of reactions to be returned; must be positive and can't be greater than 100 +getMessageAddedReactions chat_id:int53 message_id:int53 reaction:string offset:string limit:int32 = AddedReactions; + + //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously -//@text The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" +//@text The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" parseMarkdown text:formattedText = FormattedText; //@description Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously @text The text @@ -4576,14 +4843,19 @@ getJsonValue json:string = JsonValue; //@description Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously @json_value The JsonValue object getJsonString json_value:JsonValue = Text; +//@description Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously @theme Theme parameters to convert to JSON +getThemeParametersJsonString theme:themeParameters = Text; + //@description Changes the user answer to a poll. A poll in quiz mode can be answered only once -//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll +//@chat_id Identifier of the chat to which the poll belongs +//@message_id Identifier of the message containing the poll //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector = Ok; //@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib -//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll +//@chat_id Identifier of the chat to which the poll belongs +//@message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option //@offset Number of users to skip in the result; must be non-negative //@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached @@ -4607,7 +4879,7 @@ getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. //-Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button //@chat_id Chat identifier of the message with the button @message_id Message identifier of the message with the button @button_id Button identifier -//@allow_write_access True, if the user allowed the bot to send them messages +//@allow_write_access Pass true to allow the bot to send messages to the current user getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; @@ -4621,7 +4893,7 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que //@description Sets the result of an inline query; for bots only //@inline_query_id Identifier of the inline query -//@is_personal True, if the result of the query can be cached for the specified user +//@is_personal Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query //@results The results of the query //@cache_time Allowed time to cache the results of the query, in seconds //@next_offset Offset for the next inline query; pass an empty string if there are no more results @@ -4630,10 +4902,38 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que answerInlineQuery inline_query_id:int64 is_personal:Bool results:vector cache_time:int32 next_offset:string switch_pm_text:string switch_pm_parameter:string = Ok; +//@description Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed +//@bot_user_id Identifier of the target bot +//@url The URL from the keyboardButtonTypeWebApp button +//@theme Preferred web app theme; pass null to use the default theme +getWebAppUrl bot_user_id:int53 url:string theme:themeParameters = HttpUrl; + +//@description Sends data received from a keyboardButtonTypeWebApp web app to a bot +//@bot_user_id Identifier of the target bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app @data Received data +sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; + +//@description Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. +//-For each bot, a confirmation alert about data sent to the bot must be shown once +//@chat_id Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now +//@bot_user_id Identifier of the bot, providing the web app +//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise +//@theme Preferred web app theme; pass null to use the default theme +//@reply_to_message_id Identifier of the replied message for the message sent by the web app; 0 if none +openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters reply_to_message_id:int53 = WebAppInfo; + +//@description Informs TDLib that a previously opened web app was closed @web_app_launch_id Identifier of web app launch, received from openWebApp +closeWebApp web_app_launch_id:int64 = Ok; + +//@description Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only +//@web_app_query_id Identifier of the web app query +//@result The result of the query +answerWebAppQuery web_app_query_id:string result:InputInlineQueryResult = SentWebAppMessage; + + //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires @chat_id Identifier of the chat with the message @message_id Identifier of the message from which the query originated @payload Query payload getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer; -//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert If true, an alert must be shown to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds +//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert Pass true to show an alert to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds answerCallbackQuery callback_query_id:int64 text:string show_alert:Bool url:string cache_time:int32 = Ok; @@ -4644,11 +4944,12 @@ answerShippingQuery shipping_query_id:int64 shipping_options:vector force_read:Bool = Ok; //@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed @chat_id Chat identifier of the message @message_id Identifier of the message with the opened content @@ -4695,21 +4996,24 @@ getInternalLinkType link:string = InternalLinkType; getExternalLinkInfo link:string = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed -//@link The HTTP link @allow_write_access True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages +//@link The HTTP link @allow_write_access Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages getExternalLink link:string allow_write_access:Bool = HttpUrl; //@description Marks all mentions in a chat as read @chat_id Chat identifier readAllChatMentions chat_id:int53 = Ok; +//@description Marks all reactions in a chat as read @chat_id Chat identifier +readAllChatReactions chat_id:int53 = Ok; -//@description Returns an existing chat corresponding to a given user @user_id User identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + +//@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createPrivateChat user_id:int53 force:Bool = Chat; -//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect +//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createBasicGroupChat basic_group_id:int53 force:Bool = Chat; -//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect +//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createSupergroupChat supergroup_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier @@ -4720,10 +5024,10 @@ createNewBasicGroupChat user_ids:vector title:string = Chat; //@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat //@title Title of the new chat; 1-128 characters -//@is_channel True, if a channel chat needs to be created +//@is_channel Pass true to create a channel chat //@param_description Chat description; 0-255 characters //@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat -//@for_import True, if the supergroup is created for importing messages using importMessage +//@for_import Pass true to create a supergroup for importing messages using importMessage createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user @@ -4770,10 +5074,10 @@ setChatTitle chat_id:int53 title:string = Ok; //@chat_id Chat identifier @photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; -//@description Changes the message TTL setting (sets a new self-destruct timer) in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels -//-Message TTL setting of a chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed -//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret -setChatMessageTtlSetting chat_id:int53 ttl:int32 = Ok; +//@description Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels +//-Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +//@chat_id Chat identifier @ttl New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400 +setChatMessageTtl chat_id:int53 ttl:int32 = Ok; //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right //@chat_id Chat identifier @permissions New non-administrator members permissions in the chat @@ -4790,7 +5094,7 @@ setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMes setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; //@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges -//@chat_id Chat identifier @has_protected_content True, if chat content can't be saved locally, forwarded, or copied +//@chat_id Chat identifier @has_protected_content New value of has_protected_content toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -4799,6 +5103,9 @@ toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok; //@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok; +//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions New list of reactions, available in the chat. All reactions must be active +setChatAvailableReactions chat_id:int53 available_reactions:vector = Ok; + //@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data setChatClientData chat_id:int53 client_data:string = Ok; @@ -4818,8 +5125,8 @@ setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; //@description Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel //@chat_id Identifier of the chat //@message_id Identifier of the new pinned message -//@disable_notification True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats -//@only_for_self True, if the message needs to be pinned for one side only; private chats only +//@disable_notification Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats +//@only_for_self Pass true to pin the message only for self; private chats only pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool only_for_self:Bool = Ok; //@description Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat @message_id Identifier of the removed pinned message @@ -4839,7 +5146,7 @@ leaveChat chat_id:int53 = Ok; //@chat_id Chat identifier @user_id Identifier of the user @forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok; -//@description Adds multiple new members to a chat. Currently this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +//@description Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members //@chat_id Chat identifier @user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels addChatMembers chat_id:int53 user_ids:vector = Ok; @@ -4850,7 +5157,7 @@ setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatu //@description Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first //@chat_id Chat identifier //@member_id Member identifier -//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups +//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned //@revoke_messages Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revoke_messages:Bool = Ok; @@ -4875,13 +5182,26 @@ searchChatMembers chat_id:int53 query:string limit:int32 filter:ChatMembersFilte getChatAdministrators chat_id:int53 = ChatAdministrators; -//@description Clears draft messages in all chats @exclude_secret_chats If true, local draft messages in secret chats will not be cleared +//@description Clears message drafts in all chats @exclude_secret_chats Pass true to keep local message drafts in secret chats clearAllDraftMessages exclude_secret_chats:Bool = Ok; +//@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound +getSavedNotificationSound notification_sound_id:int64 = NotificationSounds; + +//@description Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used +getSavedNotificationSounds = NotificationSounds; + +//@description Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed @sound Notification sound file to add +addSavedNotificationSound sound:InputFile = NotificationSound; + +//@description Removes a notification sound from the list of saved notification sounds @notification_sound_id Identifier of the notification sound +removeSavedNotificationSound notification_sound_id:int64 = Ok; + + //@description Returns list of chats with non-default notification settings //@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes -//@compare_sound If true, also chats with non-default sound will be returned +//@compare_sound Pass true to include in the response chats with only non-default sound getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; //@description Returns the notification settings for chats of a given type @scope Types of chats for which to return the notification settings information @@ -4890,25 +5210,31 @@ getScopeNotificationSettings scope:NotificationSettingsScope = ScopeNotification //@description Changes notification settings for chats of a given type @scope Types of chats for which to change the notification settings @notification_settings The new notification settings for the given scope setScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Ok; -//@description Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown +//@description Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown resetAllNotificationSettings = Ok; -//@description Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list -//@chat_list Chat list in which to change the pinned state of the chat @chat_id Chat identifier @is_pinned True, if the chat is pinned +//@description Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list +//@chat_list Chat list in which to change the pinned state of the chat @chat_id Chat identifier @is_pinned Pass true to pin the chat; pass false to unpin it toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; +//@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier +getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; + +//@description Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true @bot_user_id Bot's user identifier @is_added Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu +toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool = Ok; + + //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download -//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first +//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first //@offset The starting position from which the file needs to be downloaded //@limit Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit -//@synchronous If false, this request returns file state just after the download has been started. If true, this request returns file state only after -//-the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent +//@synchronous Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started downloadFile file_id:int32 priority:int32 offset:int32 limit:int32 synchronous:Bool = File; //@description Returns file downloaded prefix size from a given offset, in bytes @file_id Identifier of the file @offset Offset from which downloaded prefix size needs to be calculated @@ -4953,6 +5279,39 @@ readFilePart file_id:int32 offset:int32 count:int32 = FilePart; //@description Deletes a file from the TDLib file cache @file_id Identifier of the file to delete deleteFile file_id:int32 = Ok; +//@description Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. +//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +//@file_id Identifier of the file to download +//@chat_id Chat identifier of the message with the file +//@message_id Message identifier +//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first +addFileToDownloads file_id:int32 chat_id:int53 message_id:int53 priority:int32 = File; + +//@description Changes pause state of a file in the file download list +//@file_id Identifier of the downloaded file +//@is_paused Pass true if the download is paused +toggleDownloadIsPaused file_id:int32 is_paused:Bool = Ok; + +//@description Changes pause state of all files in the file download list @are_paused Pass true to pause all downloads; pass false to unpause them +toggleAllDownloadsArePaused are_paused:Bool = Ok; + +//@description Removes a file from the file download list @file_id Identifier of the downloaded file @delete_from_cache Pass true to delete the file from the TDLib file cache +removeFileFromDownloads file_id:int32 delete_from_cache:Bool = Ok; + +//@description Removes all files from the file download list +//@only_active Pass true to remove only active downloads, including paused +//@only_completed Pass true to remove only completed downloads +//@delete_from_cache Pass true to delete the file from the TDLib file cache +removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cache:Bool = Ok; + +//@description Searches for files in the file download list or recently downloaded files from the list +//@query Query to search for; may be empty to return all downloaded files +//@only_active Pass true to search only for active downloads, including paused +//@only_completed Pass true to search only for completed downloads +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of files to be returned +searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads; + //@description Returns information about a file with messages exported from another app @message_file_head Beginning of the message file; up to 100 first lines getMessageFileType message_file_head:string = MessageFileType; @@ -4974,19 +5333,19 @@ replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink; //@description Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat //@chat_id Chat identifier //@name Invite link name; 0-32 characters -//@expire_date Point in time (Unix timestamp) when the link will expire; pass 0 if never -//@member_limit The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited -//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified -createChatInviteLink chat_id:int53 name:string expire_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; +//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never +//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited +//@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 +createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; //@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links //@chat_id Chat identifier //@invite_link Invite link to be edited //@name Invite link name; 0-32 characters -//@expire_date Point in time (Unix timestamp) when the link will expire; pass 0 if never -//@member_limit The maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited -//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified -editChatInviteLink chat_id:int53 invite_link:string name:string expire_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; +//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never +//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited +//@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 +editChatInviteLink chat_id:int53 invite_link:string name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; //@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links //@chat_id Chat identifier @@ -5005,7 +5364,7 @@ getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts; //@limit The maximum number of invite links to return; up to 100 getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_date:int32 offset_invite_link:string limit:int32 = ChatInviteLinks; -//@description Returns chat members joined a chat by an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link for which to return chat members +//@description Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link for which to return chat members //@offset_member A chat member from which to return next chat members; pass null to get results from the beginning @limit The maximum number of chat members to return; up to 100 getChatInviteLinkMembers chat_id:int53 invite_link:string offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers; @@ -5034,20 +5393,20 @@ joinChatByInviteLink invite_link:string = Chat; //@invite_link Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links //@query A query to search for in the first names, last names and usernames of the users to return //@offset_request A chat join request from which to return next requests; pass null to get results from the beginning -//@limit The maximum number of chat join requests to return +//@limit The maximum number of requests to join the chat to return getChatJoinRequests chat_id:int53 invite_link:string query:string offset_request:chatJoinRequest limit:int32 = ChatJoinRequests; -//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve True, if the request is approved. Otherwise the request is declived +//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve Pass true to approve the request; pass false to decline it processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok; //@description Handles all pending join requests for a given link in a chat //@chat_id Chat identifier //@invite_link Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links -//@approve True, if the requests are approved. Otherwise the requests are declived +//@approve Pass true to approve all requests; pass false to decline them processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok; -//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video True, if a video call needs to be created +//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video Pass true to create a video call createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId; //@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application @@ -5056,7 +5415,7 @@ acceptCall call_id:int32 protocol:callProtocol = Ok; //@description Sends call signaling data @call_id Call identifier @data The data sendCallSignalingData call_id:int32 data:bytes = Ok; -//@description Discards a call @call_id Call identifier @is_disconnected True, if the user was disconnected @duration The call duration, in seconds @is_video True, if the call was a video call @connection_id Identifier of the connection used during the call +//@description Discards a call @call_id Call identifier @is_disconnected Pass true if the user was disconnected @duration The call duration, in seconds @is_video Pass true if the call was a video call @connection_id Identifier of the connection used during the call discardCall call_id:int32 is_disconnected:Bool duration:int32 is_video:Bool connection_id:int64 = Ok; //@description Sends a call rating @call_id Call identifier @rating Call rating; 1-5 @comment An optional user comment if the rating is less than 5 @problems List of the exact types of problems with the call, specified by the user @@ -5066,17 +5425,24 @@ sendCallRating call_id:int32 rating:int32 comment:string problems:vector = Ok; @@ -5129,6 +5492,9 @@ inviteGroupCallParticipants group_call_id:int32 user_ids:vector = Ok; //@can_self_unmute Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag getGroupCallInviteLink group_call_id:int32 can_self_unmute:Bool = HttpUrl; +//@description Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier +revokeGroupCallInviteLink group_call_id:int32 = Ok; + //@description Starts recording of an active group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier @title Group call recording title; 0-64 characters //@record_video Pass true to record a video file instead of an audio file @use_portrait_orientation Pass true to use portrait orientation for video instead of landscape one startGroupCallRecording group_call_id:int32 title:string record_video:Bool use_portrait_orientation:Bool = Ok; @@ -5143,11 +5509,11 @@ toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok; toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok; //@description Informs TDLib that speaking state of a participant of an active group has changed @group_call_id Group call identifier -//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking True, if the user is speaking +//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking Pass true if the user is speaking setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = Ok; //@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves -//@group_call_id Group call identifier @participant_id Participant identifier @is_muted Pass true if the user must be muted and false otherwise +//@group_call_id Group call identifier @participant_id Participant identifier @is_muted Pass true to mute the user; pass false to unmute the them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; //@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level @@ -5167,8 +5533,11 @@ loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; //@description Leaves a group call @group_call_id Group call identifier leaveGroupCall group_call_id:int32 = Ok; -//@description Discards a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier -discardGroupCall group_call_id:int32 = Ok; +//@description Ends a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier +endGroupCall group_call_id:int32 = Ok; + +//@description Returns information about available group call streams @group_call_id Group call identifier +getGroupCallStreams group_call_id:int32 = GroupCallStreams; //@description Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video //@group_call_id Group call identifier @@ -5184,17 +5553,17 @@ toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat -//@delete_message Pass true if the message must be deleted -//@delete_all_messages Pass true if all messages from the same sender must be deleted -//@report_spam Pass true if the sender must be reported to the Telegram moderators +//@delete_message Pass true to delete the message +//@delete_all_messages Pass true to delete all messages from the same sender +//@report_spam Pass true to report the sender to the Telegram moderators blockMessageSenderFromReplies message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok; //@description Returns users and chats that were blocked by the current user @offset Number of users and chats to skip in the result; must be non-negative @limit The maximum number of users and chats to return; up to 100 getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders; -//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored -//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number +//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored +//@share_phone_number Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported @@ -5220,6 +5589,9 @@ changeImportedContacts contacts:vector = ImportedContacts; clearImportedContacts = Ok; +//@description Searches a user by their phone number @phone_number Phone number to search for +searchUserByPhoneNumber phone_number:string = User; + //@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact sharePhoneNumber user_id:int53 = Ok; @@ -5245,7 +5617,7 @@ getArchivedStickerSets is_masks:Bool offset_sticker_set_id:int64 limit:int32 = S //@limit The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached getTrendingStickerSets offset:int32 limit:int32 = StickerSets; -//@description Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets @file_id File identifier +//@description Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets @file_id File identifier getAttachedStickerSets file_id:int32 = StickerSets; //@description Returns information about a sticker set by its identifier @set_id Identifier of the sticker set @@ -5295,7 +5667,7 @@ removeFavoriteSticker sticker:InputFile = Ok; //@description Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object @sticker Sticker file identifier getStickerEmojis sticker:InputFile = Emojis; -//@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match True, if only emojis, which exactly match text needs to be returned @input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown +//@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match Pass true if only emojis, which exactly match the text, needs to be returned @input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown searchEmojis text:string exact_match:Bool input_language_codes:vector = Emojis; //@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji @@ -5330,7 +5702,7 @@ removeRecentHashtag hashtag:string = Ok; //@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview @text Message text with formatting getWebPagePreview text:formattedText = WebPage; -//@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full If true, the full instant view for the web page will be returned +//@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page getWebPageInstantView url:string force_full:Bool = WebPageInstantView; @@ -5365,20 +5737,34 @@ checkChangePhoneNumberCode code:string = Ok; //@description Sets the list of commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to change commands in the default bot command scope -//@language_code A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands +//@language_code A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands //@commands List of the bot's commands setCommands scope:BotCommandScope language_code:string commands:vector = Ok; //@description Deletes commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to delete commands in the default bot command scope -//@language_code A two-letter ISO 639-1 country code or an empty string +//@language_code A two-letter ISO 639-1 language code or an empty string deleteCommands scope:BotCommandScope language_code:string = Ok; //@description Returns the list of commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to get commands in the default bot command scope -//@language_code A two-letter ISO 639-1 country code or an empty string +//@language_code A two-letter ISO 639-1 language code or an empty string getCommands scope:BotCommandScope language_code:string = BotCommands; +//@description Sets menu button for the given user or for all users; for bots only +//@user_id Identifier of the user or 0 to set menu button for all users +//@menu_button New menu button +setMenuButton user_id:int53 menu_button:botMenuButton = Ok; + +//@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button +getMenuButton user_id:int53 = BotMenuButton; + +//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok; + +//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok; + //@description Returns all active sessions of the current user getActiveSessions = Sessions; @@ -5389,10 +5775,10 @@ terminateSession session_id:int64 = Ok; //@description Terminates all other sessions of the current user terminateAllOtherSessions = Ok; -//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls True, if incoming calls can be accepted by the session +//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; -//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats True, if incoming secret chats can be accepted by the session +//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepring secret chats by the session; pass false otherwise toggleSessionCanAcceptSecretChats session_id:int64 can_accept_secret_chats:Bool = Ok; //@description Changes the period of inactivity after which sessions will automatically be terminated @inactive_session_ttl_days New number of days of inactivity before sessions will be automatically terminated; 1-366 days @@ -5424,7 +5810,7 @@ toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_availab //@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; -//@description Reports some messages from a message sender in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages sent in the supergroup. All messages must be sent by the same sender. This list must be non-empty +//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages to report reportSupergroupSpam supergroup_id:int53 message_ids:vector = Ok; //@description Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters @supergroup_id Identifier of the supergroup or channel @@ -5446,13 +5832,13 @@ getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filte //@chat_id Chat identifier of the Invoice message //@message_id Message identifier //@theme Preferred payment form theme; pass null to use the default theme -getPaymentForm chat_id:int53 message_id:int53 theme:paymentFormTheme = PaymentForm; +getPaymentForm chat_id:int53 message_id:int53 theme:themeParameters = PaymentForm; //@description Validates the order information provided by a user and returns the available shipping options for a flexible invoice //@chat_id Chat identifier of the Invoice message //@message_id Message identifier //@order_info The order information, provided by the user; pass null if empty -//@allow_save True, if the order information can be saved +//@allow_save Pass true to save the order information validateOrderInfo chat_id:int53 message_id:int53 order_info:orderInfo allow_save:Bool = ValidatedOrderInfo; //@description Sends a filled-out payment form to the bot for final verification @chat_id Chat identifier of the Invoice message @message_id Message identifier @@ -5463,10 +5849,10 @@ sendPaymentForm chat_id:int53 message_id:int53 payment_form_id:int64 order_info_ //@description Returns information about a successful payment @chat_id Chat identifier of the PaymentSuccessful message @message_id Message identifier getPaymentReceipt chat_id:int53 message_id:int53 = PaymentReceipt; -//@description Returns saved order info, if any +//@description Returns saved order information. Returns a 404 error if there is no saved order information getSavedOrderInfo = OrderInfo; -//@description Deletes saved order info +//@description Deletes saved order information deleteSavedOrderInfo = Ok; //@description Deletes saved credentials for all payment provider bots @@ -5477,7 +5863,7 @@ deleteSavedCredentials = Ok; getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme True, if the backgrounds must be ordered for dark theme +//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme getBackgrounds for_dark_theme:Bool = Backgrounds; //@description Constructs a persistent HTTP URL for a background @name Background name @type Background type @@ -5489,7 +5875,7 @@ searchBackground name:string = Background; //@description Changes the background selected by the user; adds background to the list of installed backgrounds //@background The input background to use; pass null to create a new filled backgrounds or to remove the current background //@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme True, if the background is chosen for dark theme +//@for_dark_theme Pass true if the background is changed for a dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; //@description Removes background from the list of installed backgrounds @background_id The background identifier @@ -5499,7 +5885,7 @@ removeBackground background_id:int64 = Ok; resetBackgrounds = Ok; -//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local If true, returns only locally available information without sending network requests +//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests getLocalizationTargetInfo only_local:Bool = LocalizationTargetInfo; //@description Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization @language_pack_id Language pack identifier @@ -5571,15 +5957,15 @@ deleteAccount reason:string = Ok; //@description Removes a chat action bar without any other action @chat_id Chat identifier removeChatActionBar chat_id:int53 = Ok; -//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators -//@chat_id Chat identifier @message_ids Identifiers of reported messages, if any @reason The reason for reporting the chat @text Additional report details; 0-1024 characters +//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported +//@chat_id Chat identifier @message_ids Identifiers of reported messages; may be empty to report the whole chat @reason The reason for reporting the chat @text Additional report details; 0-1024 characters reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; -//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators +//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported //@chat_id Chat identifier @file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported @reason The reason for reporting the chat photo @text Additional report details; 0-1024 characters reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; -//@description Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application +//@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; //@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application @@ -5601,7 +5987,7 @@ getDatabaseStatistics = DatabaseStatistics; //@description Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted //@size Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit //@ttl Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit -//@count Limit on the total count of files after deletion. Pass -1 to use the default limit +//@count Limit on the total number of files after deletion. Pass -1 to use the default limit //@immunity_delay The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value //@file_types If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted //@chat_ids If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos) @@ -5615,7 +6001,7 @@ optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types //-Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics @type The new network type; pass null to set network type to networkTypeOther setNetworkType type:NetworkType = Ok; -//@description Returns network data usage statistics. Can be called before authorization @only_current If true, returns only data for the current library launch +//@description Returns network data usage statistics. Can be called before authorization @only_current Pass true to get statistics only for the current library launch getNetworkStatistics only_current:Bool = NetworkStatistics; //@description Adds the specified data to data usage statistics. Can be called before authorization @entry The network statistics entry with the data to be added to statistics @@ -5701,8 +6087,8 @@ checkPhoneNumberConfirmationCode code:string = Ok; setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok; -//@description Uploads a PNG image with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload -uploadStickerFile user_id:int53 sticker:InputSticker = File; +//@description Uploads a file with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload +uploadStickerFile user_id:int53 sticker:inputSticker = File; //@description Returns a suggested name for a new sticker set with a given title @title Sticker set title; 1-64 characters getSuggestedStickerSetName title:string = Text; @@ -5714,18 +6100,17 @@ checkStickerSetName name:string = CheckStickerSetNameResult; //@user_id Sticker set owner; ignored for regular users //@title Sticker set title; 1-64 characters //@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters -//@is_masks True, if stickers are masks. Animated stickers can't be masks -//@stickers List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown +//@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown //@source Source of the sticker set; may be empty if unknown -createNewStickerSet user_id:int53 title:string name:string is_masks:Bool stickers:vector source:string = StickerSet; +createNewStickerSet user_id:int53 title:string name:string stickers:vector source:string = StickerSet; //@description Adds a new sticker to a set; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set -addStickerToSet user_id:int53 name:string sticker:InputSticker = StickerSet; +addStickerToSet user_id:int53 name:string sticker:inputSticker = StickerSet; //@description Sets a sticker set thumbnail; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name -//@thumbnail Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them +//@thumbnail Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet; //@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot @@ -5736,7 +6121,7 @@ setStickerPositionInSet sticker:InputFile position:int32 = Ok; removeStickerFromSet sticker:InputFile = Ok; -//@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded @location Location of the map center @zoom Map zoom level; 13-20 @width Map width in pixels before applying scale; 16-1024 @height Map height in pixels before applying scale; 16-1024 @scale Map scale; 1-3 @chat_id Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown +//@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded @location Location of the map center @zoom Map zoom level; 13-20 @width Map width in pixels before applying scale; 16-1024 @height Map height in pixels before applying scale; 16-1024 @scale Map scale; 1-3 @chat_id Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown getMapThumbnailFile location:location zoom:int32 width:int32 height:int32 scale:int32 chat_id:int53 = File; @@ -5765,7 +6150,7 @@ getCountryCode = Text; getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo; //@description Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously -//@language_code A two-letter ISO 639-1 country code for country information localization @phone_number_prefix The phone number prefix +//@language_code A two-letter ISO 639-1 language code for country information localization @phone_number_prefix The phone number prefix getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo; //@description Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram @@ -5782,10 +6167,10 @@ getApplicationConfig = JsonValue; saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok; -//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type +//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable Pass true to immediately enable the proxy @type Proxy type addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; -//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type +//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable Pass true to immediately enable the proxy @type Proxy type editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy; //@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier @@ -5854,7 +6239,7 @@ testSquareInt x:int32 = TestInt; //@description Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization @server Proxy server IP address @port Proxy server port @type Proxy type -//@dc_id Identifier of a datacenter, with which to test connection @timeout The maximum overall timeout for the request +//@dc_id Identifier of a datacenter with which to test connection @timeout The maximum overall timeout for the request testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok; //@description Forces an updates.getDifference call to the Telegram servers; for testing only testGetDifference = Ok; From ac75624c636c5a1dd4a8ec6241fac87e14e14307 Mon Sep 17 00:00:00 2001 From: astra Date: Sun, 4 Jun 2023 20:50:28 +0000 Subject: [PATCH 4/7] Update to v1.8.14 --- Makefile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b207c64..4cedd91 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := 054a823c1a812ee3e038f702c6d8ba3e6974be9c +TAG := 8517026415e75a8eec567774072cbbbbb52376c1 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/README.md b/README.md index de9f9e3..9cf7ce2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-tdlib -Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.7.0 +Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.8.0 ## TDLib installation From 6a7433c67cb1f2b1d196e5eed7da3963fbfd6588 Mon Sep 17 00:00:00 2001 From: astra Date: Sun, 4 Jun 2023 20:53:18 +0000 Subject: [PATCH 5/7] Update to v1.8.0 --- Makefile | 2 +- client/function.go | 1198 ++--------------- client/type.go | 2938 +++++++++-------------------------------- client/unmarshaler.go | 1150 ++++------------ data/td_api.json | 2593 ++++++++---------------------------- data/td_api.tl | 902 ++++--------- 6 files changed, 1771 insertions(+), 7012 deletions(-) diff --git a/Makefile b/Makefile index 4cedd91..8d6428e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := 8517026415e75a8eec567774072cbbbbb52376c1 +TAG := v1.8.0 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 01d6d02..927f3da 100755 --- a/client/function.go +++ b/client/function.go @@ -525,7 +525,7 @@ type SetPasswordRequest struct { NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` - // Pass true to change also the recovery email address + // Pass true if the recovery email address must be changed SetRecoveryEmailAddress bool `json:"set_recovery_email_address"` // New recovery email address; may be empty NewRecoveryEmailAddress string `json:"new_recovery_email_address"` @@ -1094,7 +1094,7 @@ type GetMessageLocallyRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message, if it is available without sending network request. This is an offline request +// Returns information about a message, if it is available locally without sending network request. This is an offline request func (client *Client) GetMessageLocally(req *GetMessageLocallyRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1872,7 +1872,7 @@ type GetChatHistoryRequest struct { Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Pass true to get only messages that are available without sending network requests + // If true, returns only messages that are available locally without sending network requests OnlyLocal bool `json:"only_local"` } @@ -1942,7 +1942,7 @@ func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryReques type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true to remove the chat from all chat lists + // Pass true if the chat needs to be removed from the chat list RemoveFromChatList bool `json:"remove_from_chat_list"` // Pass true to delete chat history for all users Revoke bool `json:"revoke"` @@ -1976,7 +1976,7 @@ type DeleteChatRequest struct { ChatId int64 `json:"chat_id"` } -// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat +// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2057,7 +2057,7 @@ type SearchMessagesRequest struct { OffsetMessageId int64 `json:"offset_message_id"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // If not 0, the minimum date of the messages to return MinDate int32 `json:"min_date"` @@ -2099,7 +2099,7 @@ type SearchSecretMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for. If empty, searchChatMessages must be used instead Query string `json:"query"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2137,7 +2137,7 @@ type SearchCallMessagesRequest struct { FromMessageId int64 `json:"from_message_id"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Pass true to search only for messages with missed/declined calls + // If true, returns only messages with missed/declined calls OnlyMissed bool `json:"only_missed"` } @@ -2164,35 +2164,6 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa return UnmarshalMessages(result.Data) } -type SearchOutgoingDocumentMessagesRequest struct { - // Query to search for in document file name and message caption - Query string `json:"query"` - // The maximum number of messages to be returned; up to 100 - Limit int32 `json:"limit"` -} - -// Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order -func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocumentMessagesRequest) (*FoundMessages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "searchOutgoingDocumentMessages", - }, - Data: map[string]interface{}{ - "query": req.Query, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundMessages(result.Data) -} - type DeleteAllCallMessagesRequest struct { // Pass true to delete the messages for all users Revoke bool `json:"revoke"` @@ -2299,7 +2270,7 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M type GetChatSparseMessagePositionsRequest struct { // Identifier of the chat in which to return information about message positions ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about message positions FromMessageId int64 `json:"from_message_id"` @@ -2334,7 +2305,7 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` @@ -2368,7 +2339,7 @@ type GetChatMessageCountRequest struct { ChatId int64 `json:"chat_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` - // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally + // If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown ReturnLocal bool `json:"return_local"` } @@ -2426,7 +2397,7 @@ type GetMessagePublicForwardsRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2636,38 +2607,6 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa return UnmarshalMessageLinkInfo(result.Data) } -type TranslateTextRequest struct { - // Text to translate - Text string `json:"text"` - // A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically - FromLanguageCode string `json:"from_language_code"` - // A two-letter ISO 639-1 language code of the language to which the message is translated - ToLanguageCode string `json:"to_language_code"` -} - -// Translates a text to the given language. Returns a 404 error if the translation can't be performed -func (client *Client) TranslateText(req *TranslateTextRequest) (*Text, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "translateText", - }, - Data: map[string]interface{}{ - "text": req.Text, - "from_language_code": req.FromLanguageCode, - "to_language_code": req.ToLanguageCode, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalText(result.Data) -} - type GetChatAvailableMessageSendersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -2728,7 +2667,7 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message; 0 if none + // Identifier of the message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2769,14 +2708,12 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none + // Identifier of a message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` - // Pass true to get fake messages instead of actually sending them - OnlyPreview bool `json:"only_preview"` } // Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages @@ -2791,7 +2728,6 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "input_message_contents": req.InputMessageContents, - "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -2842,7 +2778,7 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none + // Identifier of a message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2850,7 +2786,7 @@ type SendInlineQueryResultMessageRequest struct { QueryId JsonInt64 `json:"query_id"` // Identifier of the inline result ResultId string `json:"result_id"` - // Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username"), and GetOption("venue_search_bot_username") + // If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -2890,11 +2826,11 @@ type ForwardMessagesRequest struct { MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local + // If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local SendCopy bool `json:"send_copy"` - // Pass true to remove media captions of message copies. Ignored if send_copy is false + // If true, media caption of message copies will be removed. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // Pass true to get fake messages instead of actually forwarding them + // If true, messages will not be forwarded and instead fake messages will be returned OnlyPreview bool `json:"only_preview"` } @@ -2985,7 +2921,7 @@ type AddLocalMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the replied message; 0 if none + // Identifier of the message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` @@ -3487,108 +3423,6 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } -type GetMessageAvailableReactionsRequest struct { - // Identifier of the chat to which the message belongs - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` -} - -// Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message -func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessageAvailableReactions", - }, - 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 UnmarshalAvailableReactions(result.Data) -} - -type SetMessageReactionRequest struct { - // Identifier of the chat to which the message belongs - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` - // Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction - Reaction string `json:"reaction"` - // Pass true if the reaction is added with a big animation - IsBig bool `json:"is_big"` -} - -// Changes chosen reaction for a message -func (client *Client) SetMessageReaction(req *SetMessageReactionRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setMessageReaction", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "reaction": req.Reaction, - "is_big": req.IsBig, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type GetMessageAddedReactionsRequest struct { - // Identifier of the chat to which the message belongs - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` - // If non-empty, only added reactions with the specified text representation will be returned - Reaction string `json:"reaction"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of reactions to be returned; must be positive and can't be greater than 100 - Limit int32 `json:"limit"` -} - -// Returns reactions added for a message, along with their sender -func (client *Client) GetMessageAddedReactions(req *GetMessageAddedReactionsRequest) (*AddedReactions, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessageAddedReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "reaction": req.Reaction, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAddedReactions(result.Data) -} - type GetTextEntitiesRequest struct { // The text in which to look for entites Text string `json:"text"` @@ -3622,7 +3456,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3645,7 +3479,7 @@ func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*Formatt } type ParseMarkdownRequest struct { - // The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" + // The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" Text *FormattedText `json:"text"` } @@ -3894,32 +3728,6 @@ func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { return UnmarshalText(result.Data) } -type GetThemeParametersJsonStringRequest struct { - // Theme parameters to convert to JSON - Theme *ThemeParameters `json:"theme"` -} - -// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously -func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { - result, err := client.jsonClient.Execute(Request{ - meta: meta{ - Type: "getThemeParametersJsonString", - }, - Data: map[string]interface{}{ - "theme": req.Theme, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalText(result.Data) -} - type SetPollAnswerRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -4096,7 +3904,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // Pass true to allow the bot to send messages to the current user + // True, if the user allowed the bot to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -4165,7 +3973,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query + // True, if the result of the query can be cached for the specified user IsPersonal bool `json:"is_personal"` // The results of the query Results []InputInlineQueryResult `json:"results"` @@ -4206,163 +4014,6 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } -type GetWebAppUrlRequest struct { - // Identifier of the target bot - BotUserId int64 `json:"bot_user_id"` - // The URL from the keyboardButtonTypeWebApp button - Url string `json:"url"` - // Preferred web app theme; pass null to use the default theme - Theme *ThemeParameters `json:"theme"` -} - -// Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed -func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getWebAppUrl", - }, - Data: map[string]interface{}{ - "bot_user_id": req.BotUserId, - "url": req.Url, - "theme": req.Theme, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalHttpUrl(result.Data) -} - -type SendWebAppDataRequest struct { - // Identifier of the target bot - BotUserId int64 `json:"bot_user_id"` - // Text of the keyboardButtonTypeWebApp button, which opened the web app - ButtonText string `json:"button_text"` - // Received data - Data string `json:"data"` -} - -// Sends data received from a keyboardButtonTypeWebApp web app to a bot -func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendWebAppData", - }, - Data: map[string]interface{}{ - "bot_user_id": req.BotUserId, - "button_text": req.ButtonText, - "data": req.Data, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type OpenWebAppRequest struct { - // Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now - ChatId int64 `json:"chat_id"` - // Identifier of the bot, providing the web app - BotUserId int64 `json:"bot_user_id"` - // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise - Url string `json:"url"` - // Preferred web app theme; pass null to use the default theme - Theme *ThemeParameters `json:"theme"` - // Identifier of the replied message for the message sent by the web app; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` -} - -// Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once -func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "openWebApp", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "bot_user_id": req.BotUserId, - "url": req.Url, - "theme": req.Theme, - "reply_to_message_id": req.ReplyToMessageId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalWebAppInfo(result.Data) -} - -type CloseWebAppRequest struct { - // Identifier of web app launch, received from openWebApp - WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` -} - -// Informs TDLib that a previously opened web app was closed -func (client *Client) CloseWebApp(req *CloseWebAppRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "closeWebApp", - }, - Data: map[string]interface{}{ - "web_app_launch_id": req.WebAppLaunchId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type AnswerWebAppQueryRequest struct { - // Identifier of the web app query - WebAppQueryId string `json:"web_app_query_id"` - // The result of the query - Result InputInlineQueryResult `json:"result"` -} - -// Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only -func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "answerWebAppQuery", - }, - Data: map[string]interface{}{ - "web_app_query_id": req.WebAppQueryId, - "result": req.Result, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalSentWebAppMessage(result.Data) -} - type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` @@ -4400,7 +4051,7 @@ type AnswerCallbackQueryRequest struct { CallbackQueryId JsonInt64 `json:"callback_query_id"` // Text of the answer Text string `json:"text"` - // Pass true to show an alert to the user instead of a toast notification + // If true, an alert must be shown to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -4499,7 +4150,7 @@ type SetGameScoreRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // Pass true to edit the game message to include the current scoreboard + // True, if the message needs to be edited EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4538,7 +4189,7 @@ func (client *Client) SetGameScore(req *SetGameScoreRequest) (*Message, error) { type SetInlineGameScoreRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // Pass true to edit the game message to include the current scoreboard + // True, if the message needs to be edited EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4754,7 +4405,7 @@ type ViewMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // Pass true to mark as read the specified messages even the chat is closed + // True, if messages in closed chats must be marked as read by the request ForceRead bool `json:"force_read"` } @@ -4867,9 +4518,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(result.Data) - case TypeInternalLinkTypeAttachmentMenuBot: - return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) - case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(result.Data) @@ -4882,9 +4530,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) - case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) @@ -4900,9 +4545,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(result.Data) - case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(result.Data) @@ -4915,9 +4557,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) - case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -4945,9 +4584,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) - case TypeInternalLinkTypeUserPhoneNumber: - return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data) - case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(result.Data) @@ -4994,7 +4630,7 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -5046,36 +4682,10 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } -type ReadAllChatReactionsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Marks all reactions in a chat as read -func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllChatReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` - // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect + // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -5104,7 +4714,7 @@ func (client *Client) CreatePrivateChat(req *CreatePrivateChatRequest) (*Chat, e type CreateBasicGroupChatRequest struct { // Basic group identifier BasicGroupId int64 `json:"basic_group_id"` - // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect + // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -5133,7 +4743,7 @@ func (client *Client) CreateBasicGroupChat(req *CreateBasicGroupChatRequest) (*C type CreateSupergroupChatRequest struct { // Supergroup or channel identifier SupergroupId int64 `json:"supergroup_id"` - // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect + // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -5217,13 +4827,13 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // Pass true to create a channel chat + // True, if a channel chat needs to be created IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` // Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat Location *ChatLocation `json:"location"` - // Pass true to create a supergroup for importing messages using importMessage + // True, if the supergroup is created for importing messages using importMessage ForImport bool `json:"for_import"` } @@ -5598,11 +5208,11 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { type SetChatMessageTtlRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400 + // New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret Ttl int32 `json:"ttl"` } -// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5746,7 +5356,7 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin type ToggleChatHasProtectedContentRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New value of has_protected_content + // True, if chat content can't be saved locally, forwarded, or copied HasProtectedContent bool `json:"has_protected_content"` } @@ -5830,35 +5440,6 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul return UnmarshalOk(result.Data) } -type SetChatAvailableReactionsRequest struct { - // Identifier of the chat - ChatId int64 `json:"chat_id"` - // New list of reactions, available in the chat. All reactions must be active - AvailableReactions []string `json:"available_reactions"` -} - -// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right -func (client *Client) SetChatAvailableReactions(req *SetChatAvailableReactionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setChatAvailableReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "available_reactions": req.AvailableReactions, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SetChatClientDataRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6009,9 +5590,9 @@ type PinChatMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the new pinned message MessageId int64 `json:"message_id"` - // Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats + // True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats DisableNotification bool `json:"disable_notification"` - // Pass true to pin the message only for self; private chats only + // True, if the message needs to be pinned for one side only; private chats only OnlyForSelf bool `json:"only_for_self"` } @@ -6431,11 +6012,11 @@ func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) ( } type ClearAllDraftMessagesRequest struct { - // Pass true to keep local message drafts in secret chats + // If true, local draft messages in secret chats will not be cleared ExcludeSecretChats bool `json:"exclude_secret_chats"` } -// Clears message drafts in all chats +// Clears draft messages in all chats func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6456,107 +6037,10 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } -type GetSavedNotificationSoundRequest struct { - // Identifier of the notification sound - NotificationSoundId JsonInt64 `json:"notification_sound_id"` -} - -// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier -func (client *Client) GetSavedNotificationSound(req *GetSavedNotificationSoundRequest) (*NotificationSounds, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getSavedNotificationSound", - }, - Data: map[string]interface{}{ - "notification_sound_id": req.NotificationSoundId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalNotificationSounds(result.Data) -} - -// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used -func (client *Client) GetSavedNotificationSounds() (*NotificationSounds, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getSavedNotificationSounds", - }, - Data: map[string]interface{}{}, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalNotificationSounds(result.Data) -} - -type AddSavedNotificationSoundRequest struct { - // Notification sound file to add - Sound InputFile `json:"sound"` -} - -// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed -func (client *Client) AddSavedNotificationSound(req *AddSavedNotificationSoundRequest) (*NotificationSound, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addSavedNotificationSound", - }, - Data: map[string]interface{}{ - "sound": req.Sound, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalNotificationSound(result.Data) -} - -type RemoveSavedNotificationSoundRequest struct { - // Identifier of the notification sound - NotificationSoundId JsonInt64 `json:"notification_sound_id"` -} - -// Removes a notification sound from the list of saved notification sounds -func (client *Client) RemoveSavedNotificationSound(req *RemoveSavedNotificationSoundRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeSavedNotificationSound", - }, - Data: map[string]interface{}{ - "notification_sound_id": req.NotificationSoundId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type GetChatNotificationSettingsExceptionsRequest struct { // If specified, only chats from the scope will be returned; pass null to return chats from all scopes Scope NotificationSettingsScope `json:"scope"` - // Pass true to include in the response chats with only non-default sound + // If true, also chats with non-default sound will be returned CompareSound bool `json:"compare_sound"` } @@ -6637,7 +6121,7 @@ func (client *Client) SetScopeNotificationSettings(req *SetScopeNotificationSett return UnmarshalOk(result.Data) } -// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown +// Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown func (client *Client) ResetAllNotificationSettings() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6661,11 +6145,11 @@ type ToggleChatIsPinnedRequest struct { ChatList ChatList `json:"chat_list"` // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true to pin the chat; pass false to unpin it + // True, if the chat is pinned IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list +// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6717,71 +6201,16 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetAttachmentMenuBotRequest struct { - // Bot's user identifier - BotUserId int64 `json:"bot_user_id"` -} - -// Returns information about a bot that can be added to attachment menu -func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getAttachmentMenuBot", - }, - 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 UnmarshalAttachmentMenuBot(result.Data) -} - -type ToggleBotIsAddedToAttachmentMenuRequest struct { - // Bot's user identifier - BotUserId int64 `json:"bot_user_id"` - // Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu - IsAdded bool `json:"is_added"` -} - -// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true -func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleBotIsAddedToAttachmentMenu", - }, - Data: map[string]interface{}{ - "bot_user_id": req.BotUserId, - "is_added": req.IsAdded, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` - // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first Priority int32 `json:"priority"` // The starting position from which the file needs to be downloaded Offset int32 `json:"offset"` // Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit Limit int32 `json:"limit"` - // Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started + // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent Synchronous bool `json:"synchronous"` } @@ -7106,195 +6535,6 @@ func (client *Client) DeleteFile(req *DeleteFileRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type AddFileToDownloadsRequest struct { - // Identifier of the file to download - FileId int32 `json:"file_id"` - // Chat identifier of the message with the file - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first - Priority int32 `json:"priority"` -} - -// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file -func (client *Client) AddFileToDownloads(req *AddFileToDownloadsRequest) (*File, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addFileToDownloads", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - "chat_id": req.ChatId, - "message_id": req.MessageId, - "priority": req.Priority, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFile(result.Data) -} - -type ToggleDownloadIsPausedRequest struct { - // Identifier of the downloaded file - FileId int32 `json:"file_id"` - // Pass true if the download is paused - IsPaused bool `json:"is_paused"` -} - -// Changes pause state of a file in the file download list -func (client *Client) ToggleDownloadIsPaused(req *ToggleDownloadIsPausedRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleDownloadIsPaused", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - "is_paused": req.IsPaused, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ToggleAllDownloadsArePausedRequest struct { - // Pass true to pause all downloads; pass false to unpause them - ArePaused bool `json:"are_paused"` -} - -// Changes pause state of all files in the file download list -func (client *Client) ToggleAllDownloadsArePaused(req *ToggleAllDownloadsArePausedRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleAllDownloadsArePaused", - }, - Data: map[string]interface{}{ - "are_paused": req.ArePaused, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type RemoveFileFromDownloadsRequest struct { - // Identifier of the downloaded file - FileId int32 `json:"file_id"` - // Pass true to delete the file from the TDLib file cache - DeleteFromCache bool `json:"delete_from_cache"` -} - -// Removes a file from the file download list -func (client *Client) RemoveFileFromDownloads(req *RemoveFileFromDownloadsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeFileFromDownloads", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - "delete_from_cache": req.DeleteFromCache, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type RemoveAllFilesFromDownloadsRequest struct { - // Pass true to remove only active downloads, including paused - OnlyActive bool `json:"only_active"` - // Pass true to remove only completed downloads - OnlyCompleted bool `json:"only_completed"` - // Pass true to delete the file from the TDLib file cache - DeleteFromCache bool `json:"delete_from_cache"` -} - -// Removes all files from the file download list -func (client *Client) RemoveAllFilesFromDownloads(req *RemoveAllFilesFromDownloadsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeAllFilesFromDownloads", - }, - Data: map[string]interface{}{ - "only_active": req.OnlyActive, - "only_completed": req.OnlyCompleted, - "delete_from_cache": req.DeleteFromCache, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SearchFileDownloadsRequest struct { - // Query to search for; may be empty to return all downloaded files - Query string `json:"query"` - // Pass true to search only for active downloads, including paused - OnlyActive bool `json:"only_active"` - // Pass true to search only for completed downloads - OnlyCompleted bool `json:"only_completed"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of files to be returned - Limit int32 `json:"limit"` -} - -// Searches for files in the file download list or recently downloaded files from the list -func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*FoundFileDownloads, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "searchFileDownloads", - }, - Data: map[string]interface{}{ - "query": req.Query, - "only_active": req.OnlyActive, - "only_completed": req.OnlyCompleted, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundFileDownloads(result.Data) -} - type GetMessageFileTypeRequest struct { // Beginning of the message file; up to 100 first lines MessageFileHead string `json:"message_file_head"` @@ -7426,7 +6666,7 @@ type CreateChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 + // True, if the link only creates join request. If true, member_limit must not be specified CreatesJoinRequest bool `json:"creates_join_request"` } @@ -7466,7 +6706,7 @@ type EditChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 + // True, if the link only creates join request. If true, member_limit must not be specified CreatesJoinRequest bool `json:"creates_join_request"` } @@ -7809,7 +7049,7 @@ type ProcessChatJoinRequestRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user that sent the request UserId int64 `json:"user_id"` - // Pass true to approve the request; pass false to decline it + // True, if the request is approved. Otherwise the request is declived Approve bool `json:"approve"` } @@ -7841,7 +7081,7 @@ type ProcessChatJoinRequestsRequest struct { ChatId int64 `json:"chat_id"` // Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links InviteLink string `json:"invite_link"` - // Pass true to approve all requests; pass false to decline them + // True, if the requests are approved. Otherwise the requests are declived Approve bool `json:"approve"` } @@ -7873,7 +7113,7 @@ type CreateCallRequest struct { UserId int64 `json:"user_id"` // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` - // Pass true to create a video call + // True, if a video call needs to be created IsVideo bool `json:"is_video"` } @@ -7961,11 +7201,11 @@ func (client *Client) SendCallSignalingData(req *SendCallSignalingDataRequest) ( type DiscardCallRequest struct { // Call identifier CallId int32 `json:"call_id"` - // Pass true if the user was disconnected + // True, if the user was disconnected IsDisconnected bool `json:"is_disconnected"` // The call duration, in seconds Duration int32 `json:"duration"` - // Pass true if the call was a video call + // True, if the call was a video call IsVideo bool `json:"is_video"` // Identifier of the connection used during the call ConnectionId JsonInt64 `json:"connection_id"` @@ -8116,14 +7356,12 @@ func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultPar } type CreateVideoChatRequest struct { - // Identifier of a chat in which the video chat will be created + // Chat identifier, in which the video chat will be created ChatId int64 `json:"chat_id"` // Group call title; if empty, chat title will be used Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future StartDate int32 `json:"start_date"` - // Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges - IsRtmpStream bool `json:"is_rtmp_stream"` } // Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights @@ -8133,10 +7371,9 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId Type: "createVideoChat", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "title": req.Title, - "start_date": req.StartDate, - "is_rtmp_stream": req.IsRtmpStream, + "chat_id": req.ChatId, + "title": req.Title, + "start_date": req.StartDate, }, }) if err != nil { @@ -8150,58 +7387,6 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId return UnmarshalGroupCallId(result.Data) } -type GetVideoChatRtmpUrlRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Returns RTMP URL for streaming to the chat; requires creator privileges -func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getVideoChatRtmpUrl", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalRtmpUrl(result.Data) -} - -type ReplaceVideoChatRtmpUrlRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Replaces the current RTMP URL for streaming to the chat; requires creator privileges -func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "replaceVideoChatRtmpUrl", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalRtmpUrl(result.Data) -} - type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -8292,9 +7477,9 @@ type JoinGroupCallRequest struct { AudioSourceId int32 `json:"audio_source_id"` // Group call join payload; received from tgcalls Payload string `json:"payload"` - // Pass true to join the call with muted microphone + // True, if the user's microphone is muted IsMuted bool `json:"is_muted"` - // Pass true if the user's video is enabled + // True, if the user's video is enabled IsMyVideoEnabled bool `json:"is_my_video_enabled"` // If non-empty, invite hash to be used to join the group call without being muted by administrators InviteHash string `json:"invite_hash"` @@ -8680,7 +7865,7 @@ type SetGroupCallParticipantIsSpeakingRequest struct { GroupCallId int32 `json:"group_call_id"` // Group call participant's synchronization audio source identifier, or 0 for the current user AudioSource int32 `json:"audio_source"` - // Pass true if the user is speaking + // True, if the user is speaking IsSpeaking bool `json:"is_speaking"` } @@ -8712,7 +7897,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true to mute the user; pass false to unmute the them + // Pass true if the user must be muted and false otherwise IsMuted bool `json:"is_muted"` } @@ -8884,32 +8069,6 @@ func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetGroupCallStreamsRequest struct { - // Group call identifier - GroupCallId int32 `json:"group_call_id"` -} - -// Returns information about available group call streams -func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getGroupCallStreams", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGroupCallStreams(result.Data) -} - type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -8980,11 +8139,11 @@ func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlo type BlockMessageSenderFromRepliesRequest struct { // The identifier of an incoming message in the Replies chat MessageId int64 `json:"message_id"` - // Pass true to delete the message + // Pass true if the message must be deleted DeleteMessage bool `json:"delete_message"` - // Pass true to delete all messages from the same sender + // Pass true if all messages from the same sender must be deleted DeleteAllMessages bool `json:"delete_all_messages"` - // Pass true to report the sender to the Telegram moderators + // Pass true if the sender must be reported to the Telegram moderators ReportSpam bool `json:"report_spam"` } @@ -9042,9 +8201,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored + // The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored Contact *Contact `json:"contact"` - // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number + // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -9234,32 +8393,6 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } -type SearchUserByPhoneNumberRequest struct { - // Phone number to search for - PhoneNumber string `json:"phone_number"` -} - -// Searches a user by their phone number -func (client *Client) SearchUserByPhoneNumber(req *SearchUserByPhoneNumberRequest) (*User, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "searchUserByPhoneNumber", - }, - Data: map[string]interface{}{ - "phone_number": req.PhoneNumber, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalUser(result.Data) -} - type SharePhoneNumberRequest struct { // Identifier of the user with whom to share the phone number. The user must be a mutual contact UserId int64 `json:"user_id"` @@ -9896,7 +9029,7 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e type SearchEmojisRequest struct { // Text to search for Text string `json:"text"` - // Pass true if only emojis, which exactly match the text, needs to be returned + // True, if only emojis, which exactly match text needs to be returned ExactMatch bool `json:"exact_match"` // List of possible IETF language tags of the user's input language; may be empty if unknown InputLanguageCodes []string `json:"input_language_codes"` @@ -10151,7 +9284,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage type GetWebPageInstantViewRequest struct { // The web page URL Url string `json:"url"` - // Pass true to get full instant view for the web page + // If true, the full instant view for the web page will be returned ForceFull bool `json:"force_full"` } @@ -10413,7 +9546,7 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode type SetCommandsRequest struct { // The scope to which the commands are relevant; pass null to change commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands + // A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands LanguageCode string `json:"language_code"` // List of the bot's commands Commands []*BotCommand `json:"commands"` @@ -10445,7 +9578,7 @@ func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { type DeleteCommandsRequest struct { // The scope to which the commands are relevant; pass null to delete commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 language code or an empty string + // A two-letter ISO 639-1 country code or an empty string LanguageCode string `json:"language_code"` } @@ -10474,7 +9607,7 @@ func (client *Client) DeleteCommands(req *DeleteCommandsRequest) (*Ok, error) { type GetCommandsRequest struct { // The scope to which the commands are relevant; pass null to get commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 language code or an empty string + // A two-letter ISO 639-1 country code or an empty string LanguageCode string `json:"language_code"` } @@ -10500,113 +9633,6 @@ func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) return UnmarshalBotCommands(result.Data) } -type SetMenuButtonRequest struct { - // Identifier of the user or 0 to set menu button for all users - UserId int64 `json:"user_id"` - // New menu button - MenuButton *BotMenuButton `json:"menu_button"` -} - -// Sets menu button for the given user or for all users; for bots only -func (client *Client) SetMenuButton(req *SetMenuButtonRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setMenuButton", - }, - Data: map[string]interface{}{ - "user_id": req.UserId, - "menu_button": req.MenuButton, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type GetMenuButtonRequest struct { - // Identifier of the user or 0 to get the default menu button - UserId int64 `json:"user_id"` -} - -// Returns menu button set by the bot for the given user; for bots only -func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMenuButton", - }, - Data: map[string]interface{}{ - "user_id": req.UserId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalBotMenuButton(result.Data) -} - -type SetDefaultGroupAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to basic group and supergroup chats; may be null - DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` -} - -// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only -func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdministratorRightsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setDefaultGroupAdministratorRights", - }, - Data: map[string]interface{}{ - "default_group_administrator_rights": req.DefaultGroupAdministratorRights, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SetDefaultChannelAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to channels; may be null - DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` -} - -// Sets default administrator rights for adding the bot to channel chats; for bots only -func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChannelAdministratorRightsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setDefaultChannelAdministratorRights", - }, - Data: map[string]interface{}{ - "default_channel_administrator_rights": req.DefaultChannelAdministratorRights, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -10674,7 +9700,7 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { type ToggleSessionCanAcceptCallsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // Pass true to allow accepting incoming calls by the session; pass false otherwise + // True, if incoming calls can be accepted by the session CanAcceptCalls bool `json:"can_accept_calls"` } @@ -10703,7 +9729,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // Pass true to allow accepring secret chats by the session; pass false otherwise + // True, if incoming secret chats can be accepted by the session CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -11098,7 +10124,7 @@ type GetPaymentFormRequest struct { // Message identifier MessageId int64 `json:"message_id"` // Preferred payment form theme; pass null to use the default theme - Theme *ThemeParameters `json:"theme"` + Theme *PaymentFormTheme `json:"theme"` } // Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy @@ -11131,7 +10157,7 @@ type ValidateOrderInfoRequest struct { MessageId int64 `json:"message_id"` // The order information, provided by the user; pass null if empty OrderInfo *OrderInfo `json:"order_info"` - // Pass true to save the order information + // True, if the order information can be saved AllowSave bool `json:"allow_save"` } @@ -11232,7 +10258,7 @@ func (client *Client) GetPaymentReceipt(req *GetPaymentReceiptRequest) (*Payment return UnmarshalPaymentReceipt(result.Data) } -// Returns saved order information. Returns a 404 error if there is no saved order information +// Returns saved order info, if any func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11251,7 +10277,7 @@ func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { return UnmarshalOrderInfo(result.Data) } -// Deletes saved order information +// Deletes saved order info func (client *Client) DeleteSavedOrderInfo() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11309,7 +10335,7 @@ func (client *Client) GetSupportUser() (*User, error) { } type GetBackgroundsRequest struct { - // Pass true to order returned backgrounds for a dark theme + // True, if the backgrounds must be ordered for dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -11394,7 +10420,7 @@ type SetBackgroundRequest struct { Background InputBackground `json:"background"` // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` - // Pass true if the background is changed for a dark theme + // True, if the background is chosen for dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -11467,7 +10493,7 @@ func (client *Client) ResetBackgrounds() (*Ok, error) { } type GetLocalizationTargetInfoRequest struct { - // Pass true to get only locally available information without sending network requests + // If true, returns only locally available information without sending network requests OnlyLocal bool `json:"only_local"` } @@ -12041,7 +11067,7 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of reported messages; may be empty to report the whole chat + // Identifiers of reported messages, if any MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat Reason ChatReportReason `json:"reason"` @@ -12291,7 +11317,7 @@ type OptimizeStorageRequest struct { Size int64 `json:"size"` // Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit Ttl int32 `json:"ttl"` - // Limit on the total number of files after deletion. Pass -1 to use the default limit + // Limit on the total count of files after deletion. Pass -1 to use the default limit Count int32 `json:"count"` // The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value ImmunityDelay int32 `json:"immunity_delay"` @@ -12363,7 +11389,7 @@ func (client *Client) SetNetworkType(req *SetNetworkTypeRequest) (*Ok, error) { } type GetNetworkStatisticsRequest struct { - // Pass true to get statistics only for the current library launch + // If true, returns only data for the current library launch OnlyCurrent bool `json:"only_current"` } @@ -13104,7 +12130,7 @@ type UploadStickerFileRequest struct { // Sticker file owner; ignored for regular users UserId int64 `json:"user_id"` // Sticker file to upload - Sticker *InputSticker `json:"sticker"` + Sticker InputSticker `json:"sticker"` } // Uploads a file with a sticker; returns the uploaded file @@ -13200,8 +12226,10 @@ type CreateNewStickerSetRequest struct { Title string `json:"title"` // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters Name string `json:"name"` - // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown - Stickers []*InputSticker `json:"stickers"` + // True, if stickers are masks. Animated stickers can't be masks + IsMasks bool `json:"is_masks"` + // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown + Stickers []InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` } @@ -13216,6 +12244,7 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti "user_id": req.UserId, "title": req.Title, "name": req.Name, + "is_masks": req.IsMasks, "stickers": req.Stickers, "source": req.Source, }, @@ -13237,7 +12266,7 @@ type AddStickerToSetRequest struct { // Sticker set name Name string `json:"name"` // Sticker to add to the set - Sticker *InputSticker `json:"sticker"` + Sticker InputSticker `json:"sticker"` } // Adds a new sticker to a set; for bots only. Returns the sticker set @@ -13268,7 +12297,7 @@ type SetStickerSetThumbnailRequest struct { UserId int64 `json:"user_id"` // Sticker set name Name string `json:"name"` - // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set + // Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them Thumbnail InputFile `json:"thumbnail"` } @@ -13361,7 +12390,7 @@ type GetMapThumbnailFileRequest struct { Height int32 `json:"height"` // Map scale; 1-3 Scale int32 `json:"scale"` - // Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown + // Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown ChatId int64 `json:"chat_id"` } @@ -13566,7 +12595,7 @@ func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*Phone } type GetPhoneNumberInfoSyncRequest struct { - // A two-letter ISO 639-1 language code for country information localization + // A two-letter ISO 639-1 country code for country information localization LanguageCode string `json:"language_code"` // The phone number prefix PhoneNumberPrefix string `json:"phone_number_prefix"` @@ -13716,7 +12745,7 @@ type AddProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // Pass true to immediately enable the proxy + // True, if the proxy needs to be enabled Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -13753,7 +12782,7 @@ type EditProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // Pass true to immediately enable the proxy + // True, if the proxy needs to be enabled Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -14358,7 +13387,7 @@ type TestProxyRequest struct { Port int32 `json:"port"` // Proxy type Type ProxyType `json:"type"` - // Identifier of a datacenter with which to test connection + // Identifier of a datacenter, with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request Timeout float64 `json:"timeout"` @@ -14458,9 +13487,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(result.Data) - case TypeUpdateMessageUnreadReactions: - return UnmarshalUpdateMessageUnreadReactions(result.Data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(result.Data) @@ -14491,9 +13517,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) - case TypeUpdateChatAvailableReactions: - return UnmarshalUpdateChatAvailableReactions(result.Data) - case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) @@ -14518,9 +13541,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(result.Data) - case TypeUpdateChatUnreadReactionCount: - return UnmarshalUpdateChatUnreadReactionCount(result.Data) - case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(result.Data) @@ -14602,18 +13622,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(result.Data) - case TypeUpdateFileDownloads: - return UnmarshalUpdateFileDownloads(result.Data) - - case TypeUpdateFileAddedToDownloads: - return UnmarshalUpdateFileAddedToDownloads(result.Data) - - case TypeUpdateFileDownload: - return UnmarshalUpdateFileDownload(result.Data) - - case TypeUpdateFileRemovedFromDownloads: - return UnmarshalUpdateFileRemovedFromDownloads(result.Data) - case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) @@ -14656,9 +13664,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(result.Data) - case TypeUpdateSavedNotificationSounds: - return UnmarshalUpdateSavedNotificationSounds(result.Data) - case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(result.Data) @@ -14677,15 +13682,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) - case TypeUpdateAttachmentMenuBots: - return UnmarshalUpdateAttachmentMenuBots(result.Data) - - case TypeUpdateWebAppMessageSent: - return UnmarshalUpdateWebAppMessageSent(result.Data) - - case TypeUpdateReactions: - return UnmarshalUpdateReactions(result.Data) - case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) diff --git a/client/type.go b/client/type.go index 16ce0f0..0022c59 100755 --- a/client/type.go +++ b/client/type.go @@ -12,7 +12,6 @@ const ( ClassInputFile = "InputFile" ClassThumbnailFormat = "ThumbnailFormat" ClassMaskPoint = "MaskPoint" - ClassStickerType = "StickerType" ClassPollType = "PollType" ClassUserType = "UserType" ClassInputChatPhoto = "InputChatPhoto" @@ -88,6 +87,7 @@ const ( ClassSuggestedAction = "SuggestedAction" ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" + ClassInputSticker = "InputSticker" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" @@ -133,19 +133,16 @@ const ( ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" ClassBotCommands = "BotCommands" - ClassBotMenuButton = "BotMenuButton" ClassChatLocation = "ChatLocation" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" ClassChatPhotos = "ChatPhotos" - ClassChatPermissions = "ChatPermissions" - ClassChatAdministratorRights = "ChatAdministratorRights" ClassUser = "User" - ClassBotInfo = "BotInfo" ClassUserFullInfo = "UserFullInfo" ClassUsers = "Users" ClassChatAdministrator = "ChatAdministrator" ClassChatAdministrators = "ChatAdministrators" + ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" ClassChatInviteLink = "ChatInviteLink" @@ -166,9 +163,7 @@ const ( ClassMessageSenders = "MessageSenders" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageReplyInfo = "MessageReplyInfo" - ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" - ClassUnreadReaction = "UnreadReaction" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" @@ -177,9 +172,6 @@ const ( ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" ClassSponsoredMessage = "SponsoredMessage" - ClassFileDownload = "FileDownload" - ClassDownloadedFileCounts = "DownloadedFileCounts" - ClassFoundFileDownloads = "FoundFileDownloads" ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" @@ -196,7 +188,6 @@ const ( ClassChatsNearby = "ChatsNearby" ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" - ClassWebAppInfo = "WebAppInfo" ClassMessageThreadInfo = "MessageThreadInfo" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" @@ -210,13 +201,13 @@ const ( ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" - ClassThemeParameters = "ThemeParameters" ClassLabeledPricePart = "LabeledPricePart" ClassInvoice = "Invoice" ClassOrderInfo = "OrderInfo" ClassShippingOption = "ShippingOption" ClassSavedCredentials = "SavedCredentials" ClassPaymentsProviderStripe = "PaymentsProviderStripe" + ClassPaymentFormTheme = "PaymentFormTheme" ClassPaymentForm = "PaymentForm" ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" @@ -249,9 +240,6 @@ const ( ClassCallServer = "CallServer" ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" - ClassGroupCallStream = "GroupCallStream" - ClassGroupCallStreams = "GroupCallStreams" - ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" @@ -259,15 +247,8 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" - ClassAddedReaction = "AddedReaction" - ClassAddedReactions = "AddedReactions" - ClassAvailableReactions = "AvailableReactions" - ClassReaction = "Reaction" ClassAnimations = "Animations" ClassImportedContacts = "ImportedContacts" - ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" - ClassAttachmentMenuBot = "AttachmentMenuBot" - ClassSentWebAppMessage = "SentWebAppMessage" ClassHttpUrl = "HttpUrl" ClassInlineQueryResults = "InlineQueryResults" ClassCallbackQueryAnswer = "CallbackQueryAnswer" @@ -287,8 +268,6 @@ const ( ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" - ClassNotificationSound = "NotificationSound" - ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" ClassJsonObjectMember = "JsonObjectMember" @@ -317,7 +296,6 @@ const ( ClassDeepLinkInfo = "DeepLinkInfo" ClassProxy = "Proxy" ClassProxies = "Proxies" - ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" @@ -377,22 +355,17 @@ const ( TypePhotoSize = "photoSize" TypeMinithumbnail = "minithumbnail" TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" - TypeThumbnailFormatGif = "thumbnailFormatGif" - TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" TypeThumbnailFormatPng = "thumbnailFormatPng" - TypeThumbnailFormatTgs = "thumbnailFormatTgs" - TypeThumbnailFormatWebm = "thumbnailFormatWebm" TypeThumbnailFormatWebp = "thumbnailFormatWebp" + TypeThumbnailFormatGif = "thumbnailFormatGif" + TypeThumbnailFormatTgs = "thumbnailFormatTgs" + TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" TypeThumbnail = "thumbnail" TypeMaskPointForehead = "maskPointForehead" TypeMaskPointEyes = "maskPointEyes" TypeMaskPointMouth = "maskPointMouth" TypeMaskPointChin = "maskPointChin" TypeMaskPosition = "maskPosition" - TypeStickerTypeStatic = "stickerTypeStatic" - TypeStickerTypeAnimated = "stickerTypeAnimated" - TypeStickerTypeVideo = "stickerTypeVideo" - TypeStickerTypeMask = "stickerTypeMask" TypeClosedVectorPath = "closedVectorPath" TypePollOption = "pollOption" TypePollTypeRegular = "pollTypeRegular" @@ -419,7 +392,6 @@ const ( TypeUserTypeUnknown = "userTypeUnknown" TypeBotCommand = "botCommand" TypeBotCommands = "botCommands" - TypeBotMenuButton = "botMenuButton" TypeChatLocation = "chatLocation" TypeAnimatedChatPhoto = "animatedChatPhoto" TypeChatPhoto = "chatPhoto" @@ -427,14 +399,12 @@ const ( TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" TypeInputChatPhotoStatic = "inputChatPhotoStatic" TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" - TypeChatPermissions = "chatPermissions" - TypeChatAdministratorRights = "chatAdministratorRights" TypeUser = "user" - TypeBotInfo = "botInfo" TypeUserFullInfo = "userFullInfo" TypeUsers = "users" TypeChatAdministrator = "chatAdministrator" TypeChatAdministrators = "chatAdministrators" + TypeChatPermissions = "chatPermissions" TypeChatMemberStatusCreator = "chatMemberStatusCreator" TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" TypeChatMemberStatusMember = "chatMemberStatusMember" @@ -486,9 +456,7 @@ const ( TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageReplyInfo = "messageReplyInfo" - TypeMessageReaction = "messageReaction" TypeMessageInteractionInfo = "messageInteractionInfo" - TypeUnreadReaction = "unreadReaction" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" TypeMessage = "message" @@ -499,9 +467,6 @@ const ( TypeMessageCalendarDay = "messageCalendarDay" TypeMessageCalendar = "messageCalendar" TypeSponsoredMessage = "sponsoredMessage" - TypeFileDownload = "fileDownload" - TypeDownloadedFileCounts = "downloadedFileCounts" - TypeFoundFileDownloads = "foundFileDownloads" TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" @@ -541,11 +506,9 @@ const ( TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" - TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" TypeKeyboardButton = "keyboardButton" TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" - TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" @@ -559,7 +522,6 @@ const ( TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" TypeLoginUrlInfoOpen = "loginUrlInfoOpen" TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" - TypeWebAppInfo = "webAppInfo" TypeMessageThreadInfo = "messageThreadInfo" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" @@ -625,7 +587,6 @@ const ( TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" TypeBankCardInfo = "bankCardInfo" TypeAddress = "address" - TypeThemeParameters = "themeParameters" TypeLabeledPricePart = "labeledPricePart" TypeInvoice = "invoice" TypeOrderInfo = "orderInfo" @@ -636,6 +597,7 @@ const ( TypeInputCredentialsApplePay = "inputCredentialsApplePay" TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" TypePaymentsProviderStripe = "paymentsProviderStripe" + TypePaymentFormTheme = "paymentFormTheme" TypePaymentForm = "paymentForm" TypeValidatedOrderInfo = "validatedOrderInfo" TypePaymentResult = "paymentResult" @@ -758,8 +720,6 @@ const ( TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageWebsiteConnected = "messageWebsiteConnected" - TypeMessageWebAppDataSent = "messageWebAppDataSent" - TypeMessageWebAppDataReceived = "messageWebAppDataReceived" TypeMessagePassportDataSent = "messagePassportDataSent" TypeMessagePassportDataReceived = "messagePassportDataReceived" TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" @@ -776,7 +736,6 @@ const ( TypeTextEntityTypeItalic = "textEntityTypeItalic" TypeTextEntityTypeUnderline = "textEntityTypeUnderline" TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" - TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler" TypeTextEntityTypeCode = "textEntityTypeCode" TypeTextEntityTypePre = "textEntityTypePre" TypeTextEntityTypePreCode = "textEntityTypePreCode" @@ -819,7 +778,6 @@ const ( TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" TypeSearchMessagesFilterMention = "searchMessagesFilterMention" TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" - TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction" TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" TypeChatActionTyping = "chatActionTyping" @@ -868,9 +826,6 @@ const ( TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeGroupCallStream = "groupCallStream" - TypeGroupCallStreams = "groupCallStreams" - TypeRtmpUrl = "rtmpUrl" TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" TypeGroupCall = "groupCall" TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" @@ -887,17 +842,10 @@ const ( TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" TypeCall = "call" TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" - TypeAddedReaction = "addedReaction" - TypeAddedReactions = "addedReactions" - TypeAvailableReactions = "availableReactions" - TypeReaction = "reaction" TypeAnimations = "animations" TypeDiceStickersRegular = "diceStickersRegular" TypeDiceStickersSlotMachine = "diceStickersSlotMachine" TypeImportedContacts = "importedContacts" - TypeAttachmentMenuBotColor = "attachmentMenuBotColor" - TypeAttachmentMenuBot = "attachmentMenuBot" - TypeSentWebAppMessage = "sentWebAppMessage" TypeHttpUrl = "httpUrl" TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" @@ -933,39 +881,38 @@ const ( TypeGameHighScores = "gameHighScores" TypeChatEventMessageEdited = "chatEventMessageEdited" TypeChatEventMessageDeleted = "chatEventMessageDeleted" + TypeChatEventPollStopped = "chatEventPollStopped" TypeChatEventMessagePinned = "chatEventMessagePinned" TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" - TypeChatEventPollStopped = "chatEventPollStopped" TypeChatEventMemberJoined = "chatEventMemberJoined" TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" - TypeChatEventMemberInvited = "chatEventMemberInvited" TypeChatEventMemberLeft = "chatEventMemberLeft" + TypeChatEventMemberInvited = "chatEventMemberInvited" TypeChatEventMemberPromoted = "chatEventMemberPromoted" TypeChatEventMemberRestricted = "chatEventMemberRestricted" - TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged" - TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" - TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" - TypeChatEventLocationChanged = "chatEventLocationChanged" - TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" - TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" - TypeChatEventPhotoChanged = "chatEventPhotoChanged" - TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" - TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" TypeChatEventTitleChanged = "chatEventTitleChanged" + TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" TypeChatEventUsernameChanged = "chatEventUsernameChanged" - TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventPhotoChanged = "chatEventPhotoChanged" TypeChatEventInvitesToggled = "chatEventInvitesToggled" - TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventLocationChanged = "chatEventLocationChanged" + TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" - TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" TypeChatEvent = "chatEvent" TypeChatEvents = "chatEvents" TypeChatEventLogFilters = "chatEventLogFilters" @@ -1055,8 +1002,6 @@ const ( TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" - TypeNotificationSound = "notificationSound" - TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" TypeOptionValueBoolean = "optionValueBoolean" @@ -1099,27 +1044,21 @@ const ( TypeChatReportReasonCopyright = "chatReportReasonCopyright" TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" TypeChatReportReasonFake = "chatReportReasonFake" - TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs" - TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails" TypeChatReportReasonCustom = "chatReportReasonCustom" TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" - TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" TypeInternalLinkTypeBackground = "internalLinkTypeBackground" TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" - TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" @@ -1129,7 +1068,6 @@ const ( TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" - TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" @@ -1138,7 +1076,6 @@ const ( TypeFileTypeAnimation = "fileTypeAnimation" TypeFileTypeAudio = "fileTypeAudio" TypeFileTypeDocument = "fileTypeDocument" - TypeFileTypeNotificationSound = "fileTypeNotificationSound" TypeFileTypePhoto = "fileTypePhoto" TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" TypeFileTypeSecret = "fileTypeSecret" @@ -1201,7 +1138,8 @@ const ( TypeProxyTypeMtproto = "proxyTypeMtproto" TypeProxy = "proxy" TypeProxies = "proxies" - TypeInputSticker = "inputSticker" + TypeInputStickerStatic = "inputStickerStatic" + TypeInputStickerAnimated = "inputStickerAnimated" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" TypeStatisticalGraphData = "statisticalGraphData" @@ -1235,7 +1173,6 @@ const ( TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" TypeUpdateMessageContentOpened = "updateMessageContentOpened" TypeUpdateMessageMentionRead = "updateMessageMentionRead" - TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions" TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" TypeUpdateNewChat = "updateNewChat" TypeUpdateChatTitle = "updateChatTitle" @@ -1246,7 +1183,6 @@ const ( TypeUpdateChatReadInbox = "updateChatReadInbox" TypeUpdateChatReadOutbox = "updateChatReadOutbox" TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" TypeUpdateChatDraftMessage = "updateChatDraftMessage" TypeUpdateChatMessageSender = "updateChatMessageSender" TypeUpdateChatMessageTtl = "updateChatMessageTtl" @@ -1255,7 +1191,6 @@ const ( TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" TypeUpdateChatTheme = "updateChatTheme" TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" - TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" TypeUpdateChatVideoChat = "updateChatVideoChat" TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" @@ -1283,10 +1218,6 @@ const ( TypeUpdateFile = "updateFile" TypeUpdateFileGenerationStart = "updateFileGenerationStart" TypeUpdateFileGenerationStop = "updateFileGenerationStop" - TypeUpdateFileDownloads = "updateFileDownloads" - TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads" - TypeUpdateFileDownload = "updateFileDownload" - TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads" TypeUpdateCall = "updateCall" TypeUpdateGroupCall = "updateGroupCall" TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" @@ -1301,16 +1232,12 @@ const ( TypeUpdateRecentStickers = "updateRecentStickers" TypeUpdateFavoriteStickers = "updateFavoriteStickers" TypeUpdateSavedAnimations = "updateSavedAnimations" - TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" TypeUpdateSelectedBackground = "updateSelectedBackground" TypeUpdateChatThemes = "updateChatThemes" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUsersNearby = "updateUsersNearby" - TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" - TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" - TypeUpdateReactions = "updateReactions" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" @@ -1357,7 +1284,7 @@ type InputFile interface { InputFileType() string } -// Describes format of a thumbnail +// Describes format of the thumbnail type ThumbnailFormat interface { ThumbnailFormatType() string } @@ -1367,11 +1294,6 @@ type MaskPoint interface { MaskPointType() string } -// Describes type of a sticker -type StickerType interface { - StickerTypeType() string -} - // Describes the type of a poll type PollType interface { PollTypeType() string @@ -1747,6 +1669,11 @@ type ProxyType interface { ProxyTypeType() string } +// Describes a sticker that needs to be added to a sticker set +type InputSticker interface { + InputStickerType() string +} + // Describes a statistical graph type StatisticalGraph interface { StatisticalGraphType() string @@ -2166,7 +2093,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -2191,7 +2118,7 @@ type TermsOfService struct { meta // Text of the terms of service Text *FormattedText `json:"text"` - // The minimum age of a user to be able to accept the terms; 0 if age isn't restricted + // The minimum age of a user to be able to accept the terms; 0 if any MinUserAge int32 `json:"min_user_age"` // True, if a blocking popup with terms of service must be shown to the user ShowPopup bool `json:"show_popup"` @@ -2623,7 +2550,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location + // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location Id string `json:"id"` // Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time UniqueId string `json:"unique_id"` @@ -2877,56 +2804,6 @@ func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { return TypeThumbnailFormatJpeg } -// The thumbnail is in static GIF format. It will be used only for some bot inline results -type ThumbnailFormatGif struct { - meta -} - -func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatGif - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatGif) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatGif) GetType() string { - return TypeThumbnailFormatGif -} - -func (*ThumbnailFormatGif) ThumbnailFormatType() string { - return TypeThumbnailFormatGif -} - -// The thumbnail is in MPEG4 format. It will be used only for some animations and videos -type ThumbnailFormatMpeg4 struct { - meta -} - -func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatMpeg4 - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatMpeg4) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatMpeg4) GetType() string { - return TypeThumbnailFormatMpeg4 -} - -func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { - return TypeThumbnailFormatMpeg4 -} - // The thumbnail is in PNG format. It will be used only for background patterns type ThumbnailFormatPng struct { meta @@ -2952,7 +2829,57 @@ func (*ThumbnailFormatPng) ThumbnailFormatType() string { return TypeThumbnailFormatPng } -// The thumbnail is in TGS format. It will be used only for TGS sticker sets +// The thumbnail is in WEBP format. It will be used only for some stickers +type ThumbnailFormatWebp struct { + meta +} + +func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatWebp) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatWebp) GetType() string { + return TypeThumbnailFormatWebp +} + +func (*ThumbnailFormatWebp) ThumbnailFormatType() string { + return TypeThumbnailFormatWebp +} + +// The thumbnail is in static GIF format. It will be used only for some bot inline results +type ThumbnailFormatGif struct { + meta +} + +func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatGif + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatGif) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatGif) GetType() string { + return TypeThumbnailFormatGif +} + +func (*ThumbnailFormatGif) ThumbnailFormatType() string { + return TypeThumbnailFormatGif +} + +// The thumbnail is in TGS format. It will be used only for animated sticker sets type ThumbnailFormatTgs struct { meta } @@ -2977,54 +2904,29 @@ func (*ThumbnailFormatTgs) ThumbnailFormatType() string { return TypeThumbnailFormatTgs } -// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets -type ThumbnailFormatWebm struct { +// The thumbnail is in MPEG4 format. It will be used only for some animations and videos +type ThumbnailFormatMpeg4 struct { meta } -func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) { +func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ThumbnailFormatWebm + type stub ThumbnailFormatMpeg4 return json.Marshal((*stub)(entity)) } -func (*ThumbnailFormatWebm) GetClass() string { +func (*ThumbnailFormatMpeg4) GetClass() string { return ClassThumbnailFormat } -func (*ThumbnailFormatWebm) GetType() string { - return TypeThumbnailFormatWebm +func (*ThumbnailFormatMpeg4) GetType() string { + return TypeThumbnailFormatMpeg4 } -func (*ThumbnailFormatWebm) ThumbnailFormatType() string { - return TypeThumbnailFormatWebm -} - -// The thumbnail is in WEBP format. It will be used only for some stickers -type ThumbnailFormatWebp struct { - meta -} - -func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatWebp - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatWebp) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatWebp) GetType() string { - return TypeThumbnailFormatWebp -} - -func (*ThumbnailFormatWebp) ThumbnailFormatType() string { - return TypeThumbnailFormatWebp +func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { + return TypeThumbnailFormatMpeg4 } // Represents a thumbnail @@ -3231,108 +3133,6 @@ func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { return nil } -// The sticker is an image in WEBP format -type StickerTypeStatic struct { - meta -} - -func (entity *StickerTypeStatic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerTypeStatic - - return json.Marshal((*stub)(entity)) -} - -func (*StickerTypeStatic) GetClass() string { - return ClassStickerType -} - -func (*StickerTypeStatic) GetType() string { - return TypeStickerTypeStatic -} - -func (*StickerTypeStatic) StickerTypeType() string { - return TypeStickerTypeStatic -} - -// The sticker is an animation in TGS format -type StickerTypeAnimated struct { - meta -} - -func (entity *StickerTypeAnimated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerTypeAnimated - - return json.Marshal((*stub)(entity)) -} - -func (*StickerTypeAnimated) GetClass() string { - return ClassStickerType -} - -func (*StickerTypeAnimated) GetType() string { - return TypeStickerTypeAnimated -} - -func (*StickerTypeAnimated) StickerTypeType() string { - return TypeStickerTypeAnimated -} - -// The sticker is a video in WEBM format -type StickerTypeVideo struct { - meta -} - -func (entity *StickerTypeVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerTypeVideo - - return json.Marshal((*stub)(entity)) -} - -func (*StickerTypeVideo) GetClass() string { - return ClassStickerType -} - -func (*StickerTypeVideo) GetType() string { - return TypeStickerTypeVideo -} - -func (*StickerTypeVideo) StickerTypeType() string { - return TypeStickerTypeVideo -} - -// The sticker is a mask in WEBP format to be placed on photos or videos -type StickerTypeMask struct { - meta - // Position where the mask is placed; may be null - MaskPosition *MaskPosition `json:"mask_position"` -} - -func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerTypeMask - - return json.Marshal((*stub)(entity)) -} - -func (*StickerTypeMask) GetClass() string { - return ClassStickerType -} - -func (*StickerTypeMask) GetType() string { - return TypeStickerTypeMask -} - -func (*StickerTypeMask) StickerTypeType() string { - return TypeStickerTypeMask -} - // Represents a closed vector path. The path begins at the end point of the last command type ClosedVectorPath struct { meta @@ -3604,8 +3404,12 @@ type Sticker struct { Height int32 `json:"height"` // Emoji corresponding to the sticker Emoji string `json:"emoji"` - // Sticker type - Type StickerType `json:"type"` + // True, if the sticker is an animated sticker in TGS format + IsAnimated bool `json:"is_animated"` + // True, if the sticker is a mask + IsMask bool `json:"is_mask"` + // Position where the mask is placed; may be null + MaskPosition *MaskPosition `json:"mask_position"` // Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner Outline []*ClosedVectorPath `json:"outline"` // Sticker thumbnail in WEBP or JPEG format; may be null @@ -3630,37 +3434,6 @@ func (*Sticker) GetType() string { return TypeSticker } -func (sticker *Sticker) UnmarshalJSON(data []byte) error { - var tmp struct { - SetId JsonInt64 `json:"set_id"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Emoji string `json:"emoji"` - Type json.RawMessage `json:"type"` - Outline []*ClosedVectorPath `json:"outline"` - Thumbnail *Thumbnail `json:"thumbnail"` - Sticker *File `json:"sticker"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - sticker.SetId = tmp.SetId - sticker.Width = tmp.Width - sticker.Height = tmp.Height - sticker.Emoji = tmp.Emoji - sticker.Outline = tmp.Outline - sticker.Thumbnail = tmp.Thumbnail - sticker.Sticker = tmp.Sticker - - fieldType, _ := UnmarshalStickerType(tmp.Type) - sticker.Type = fieldType - - return nil -} - // Describes a video file type Video struct { meta @@ -3769,7 +3542,7 @@ type AnimatedEmoji struct { Sticker *Sticker `json:"sticker"` // Emoji modifier fitzpatrick type; 0-6; 0 if none FitzpatrickType int32 `json:"fitzpatrick_type"` - // File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + // File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container Sound *File `json:"sound"` } @@ -4114,8 +3887,6 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // 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 can be added to attachment menu - CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` } func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { @@ -4213,31 +3984,6 @@ func (*BotCommands) GetType() string { return TypeBotCommands } -// Describes a button to be shown instead of bot commands menu button -type BotMenuButton struct { - meta - // Text of the button - Text string `json:"text"` - // URL to be passed to openWebApp - Url string `json:"url"` -} - -func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotMenuButton - - return json.Marshal((*stub)(entity)) -} - -func (*BotMenuButton) GetClass() string { - return ClassBotMenuButton -} - -func (*BotMenuButton) GetType() string { - return TypeBotMenuButton -} - // Represents a location to which a chat is connected type ChatLocation struct { meta @@ -4464,86 +4210,6 @@ func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byt return nil } -// 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, locations, and venues - CanSendMessages bool `json:"can_send_messages"` - // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions - CanSendMediaMessages bool `json:"can_send_media_messages"` - // True, if the user can send polls. Implies can_send_messages permissions - CanSendPolls bool `json:"can_send_polls"` - // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions - CanSendOtherMessages bool `json:"can_send_other_messages"` - // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions - CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` - // True, if the user can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the user can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the user can pin messages - CanPinMessages bool `json:"can_pin_messages"` -} - -func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPermissions - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPermissions) GetClass() string { - return ClassChatPermissions -} - -func (*ChatPermissions) GetType() string { - return TypeChatPermissions -} - -// Describes rights of the administrator -type ChatAdministratorRights struct { - meta - // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only - CanManageChat bool `json:"can_manage_chat"` - // True, if the administrator can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts; applicable to channels only - CanPostMessages bool `json:"can_post_messages"` - // True, if the administrator can edit messages of other users and pin messages; applicable to channels only - CanEditMessages bool `json:"can_edit_messages"` - // True, if the administrator can delete messages of other users - CanDeleteMessages bool `json:"can_delete_messages"` - // True, if the administrator can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members; always true for channels - CanRestrictMembers bool `json:"can_restrict_members"` - // True, if the administrator can pin messages; applicable to basic groups and supergroups only - CanPinMessages bool `json:"can_pin_messages"` - // 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 manage video chats - CanManageVideoChats bool `json:"can_manage_video_chats"` - // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only - IsAnonymous bool `json:"is_anonymous"` -} - -func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAdministratorRights - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAdministratorRights) GetClass() string { - return ClassChatAdministratorRights -} - -func (*ChatAdministratorRights) GetType() string { - return TypeChatAdministratorRights -} - // Represents a user type User struct { meta @@ -4575,7 +4241,7 @@ type User struct { IsScam bool `json:"is_scam"` // True, if many users reported this user as a fake account IsFake bool `json:"is_fake"` - // If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser + // If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser HaveAccess bool `json:"have_access"` // Type of the user Type UserType `json:"type"` @@ -4650,39 +4316,6 @@ func (user *User) UnmarshalJSON(data []byte) error { return nil } -// Contains information about a bot -type BotInfo struct { - meta - // The text that is shown on the bot's profile page and is sent together with the link when users share the bot - ShareText string `json:"share_text"` - // The text shown in the chat with the bot if the chat is empty - Description string `json:"description"` - // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown - MenuButton *BotMenuButton `json:"menu_button"` - // List of the bot commands - Commands []*BotCommand `json:"commands"` - // Default administrator rights for adding the bot to basic group and supergroup chats; may be null - DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` - // Default administrator rights for adding the bot to channels; may be null - DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` -} - -func (entity *BotInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotInfo - - return json.Marshal((*stub)(entity)) -} - -func (*BotInfo) GetClass() string { - return ClassBotInfo -} - -func (*BotInfo) GetType() string { - return TypeBotInfo -} - // Contains full information about a user type UserFullInfo struct { meta @@ -4702,10 +4335,14 @@ type UserFullInfo struct { NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` // A short user bio Bio string `json:"bio"` + // For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot + ShareText string `json:"share_text"` + // For bots, the text shown in the chat with the bot if the chat is empty + Description string `json:"description"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // For bots, information about the bot; may be null - BotInfo *BotInfo `json:"bot_info"` + // For bots, list of the bot commands + Commands []*BotCommand `json:"commands"` } func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { @@ -4727,7 +4364,7 @@ func (*UserFullInfo) GetType() string { // Represents a list of users type Users struct { meta - // Approximate total number of users found + // Approximate total count of users found TotalCount int32 `json:"total_count"` // A list of user identifiers UserIds []int64 `json:"user_ids"` @@ -4799,6 +4436,43 @@ func (*ChatAdministrators) GetType() string { return TypeChatAdministrators } +// 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, locations, and venues + CanSendMessages bool `json:"can_send_messages"` + // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions + CanSendMediaMessages bool `json:"can_send_media_messages"` + // True, if the user can send polls. Implies can_send_messages permissions + CanSendPolls bool `json:"can_send_polls"` + // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions + CanSendOtherMessages bool `json:"can_send_other_messages"` + // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions + CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` + // True, if the user can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the user can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the user can pin messages + CanPinMessages bool `json:"can_pin_messages"` +} + +func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPermissions) GetClass() string { + return ClassChatPermissions +} + +func (*ChatPermissions) GetType() string { + return TypeChatPermissions +} + // The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta @@ -4837,8 +4511,28 @@ type ChatMemberStatusAdministrator struct { CustomTitle string `json:"custom_title"` // 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 *ChatAdministratorRights `json:"rights"` + // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + CanManageChat bool `json:"can_manage_chat"` + // True, if the administrator can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the administrator can create channel posts; applicable to channels only + CanPostMessages bool `json:"can_post_messages"` + // True, if the administrator can edit messages of other users and pin messages; applicable to channels only + CanEditMessages bool `json:"can_edit_messages"` + // True, if the administrator can delete messages of other users + CanDeleteMessages bool `json:"can_delete_messages"` + // True, if the administrator can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the administrator can restrict, ban, or unban chat members; always true for channels + CanRestrictMembers bool `json:"can_restrict_members"` + // True, if the administrator can pin messages; applicable to basic groups and supergroups only + CanPinMessages bool `json:"can_pin_messages"` + // 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 manage video chats + CanManageVideoChats bool `json:"can_manage_video_chats"` + // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only + IsAnonymous bool `json:"is_anonymous"` } func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { @@ -5026,7 +4720,7 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { // Contains a list of chat members type ChatMembers struct { meta - // Approximate total number of chat members found + // Approximate total count of chat members found TotalCount int32 `json:"total_count"` // A list of chat members Members []*ChatMember `json:"members"` @@ -5485,7 +5179,7 @@ func (*ChatInviteLink) GetType() string { // Contains a list of chat invite links type ChatInviteLinks struct { meta - // Approximate total number of chat invite links found + // Approximate total count of chat invite links found TotalCount int32 `json:"total_count"` // List of invite links InviteLinks []*ChatInviteLink `json:"invite_links"` @@ -5587,7 +5281,7 @@ func (*ChatInviteLinkMember) GetType() string { // Contains a list of chat members joined a chat via an invite link type ChatInviteLinkMembers struct { meta - // Approximate total number of chat members found + // Approximate total count of chat members found TotalCount int32 `json:"total_count"` // List of chat members, joined a chat via an invite link Members []*ChatInviteLinkMember `json:"members"` @@ -5715,7 +5409,7 @@ func (*ChatJoinRequest) GetType() string { // Contains a list of requests to join a chat type ChatJoinRequests struct { meta - // Approximate total number of requests found + // Approximate total count of requests found TotalCount int32 `json:"total_count"` // List of the requests Requests []*ChatJoinRequest `json:"requests"` @@ -5984,7 +5678,7 @@ type SupergroupFullInfo struct { StickerSetId JsonInt64 `json:"sticker_set_id"` // Location to which the supergroup is connected; may be null Location *ChatLocation `json:"location"` - // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only + // Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group BotCommands []*BotCommands `json:"bot_commands"` @@ -6202,7 +5896,7 @@ func (*MessageSenderChat) MessageSenderType() string { // Represents a list of message senders type MessageSenders struct { meta - // Approximate total number of messages senders found + // Approximate total count of messages senders found TotalCount int32 `json:"total_count"` // List of message senders Senders []MessageSender `json:"senders"` @@ -6496,58 +6190,6 @@ func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { return nil } -// Contains information about a reaction to a message -type MessageReaction struct { - meta - // Text representation of the reaction - Reaction string `json:"reaction"` - // Number of times the reaction was added - TotalCount int32 `json:"total_count"` - // True, if the reaction is chosen by the current user - IsChosen bool `json:"is_chosen"` - // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats - RecentSenderIds []MessageSender `json:"recent_sender_ids"` -} - -func (entity *MessageReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageReaction - - return json.Marshal((*stub)(entity)) -} - -func (*MessageReaction) GetClass() string { - return ClassMessageReaction -} - -func (*MessageReaction) GetType() string { - return TypeMessageReaction -} - -func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Reaction string `json:"reaction"` - TotalCount int32 `json:"total_count"` - IsChosen bool `json:"is_chosen"` - RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageReaction.Reaction = tmp.Reaction - messageReaction.TotalCount = tmp.TotalCount - messageReaction.IsChosen = tmp.IsChosen - - fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) - messageReaction.RecentSenderIds = fieldRecentSenderIds - - return nil -} - // Contains information about interactions with a message type MessageInteractionInfo struct { meta @@ -6557,8 +6199,6 @@ type MessageInteractionInfo struct { ForwardCount int32 `json:"forward_count"` // Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself ReplyInfo *MessageReplyInfo `json:"reply_info"` - // The list of reactions added to the message - Reactions []*MessageReaction `json:"reactions"` } func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { @@ -6577,54 +6217,6 @@ func (*MessageInteractionInfo) GetType() string { return TypeMessageInteractionInfo } -// Contains information about an unread reaction to a message -type UnreadReaction struct { - meta - // Text representation of the reaction - Reaction string `json:"reaction"` - // Identifier of the sender, added the reaction - SenderId MessageSender `json:"sender_id"` - // True, if the reaction was added with a big animation - IsBig bool `json:"is_big"` -} - -func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UnreadReaction - - return json.Marshal((*stub)(entity)) -} - -func (*UnreadReaction) GetClass() string { - return ClassUnreadReaction -} - -func (*UnreadReaction) GetType() string { - return TypeUnreadReaction -} - -func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Reaction string `json:"reaction"` - SenderId json.RawMessage `json:"sender_id"` - IsBig bool `json:"is_big"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - unreadReaction.Reaction = tmp.Reaction - unreadReaction.IsBig = tmp.IsBig - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - unreadReaction.SenderId = fieldSenderId - - return nil -} - // The message is being sent now, but has not yet been delivered to the server type MessageSendingStatePending struct { meta @@ -6712,15 +6304,13 @@ type Message struct { CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the list of added reactions is available through getMessageAddedReactions - CanGetAddedReactions bool `json:"can_get_added_reactions"` - // True, if the message statistics are available through getMessageStatistics + // True, if the message statistics are available CanGetStatistics bool `json:"can_get_statistics"` - // True, if information about the message thread is available through getMessageThread + // True, if the message thread info is available CanGetMessageThread bool `json:"can_get_message_thread"` // True, if chat members already viewed the message can be received through getMessageViewers CanGetViewers bool `json:"can_get_viewers"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` @@ -6736,8 +6326,6 @@ type Message struct { ForwardInfo *MessageForwardInfo `json:"forward_info"` // Information about interactions with the message; may be null InteractionInfo *MessageInteractionInfo `json:"interaction_info"` - // Information about unread reactions added to the message - UnreadReactions []*UnreadReaction `json:"unread_reactions"` // If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id ReplyInChatId int64 `json:"reply_in_chat_id"` // If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message @@ -6792,7 +6380,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { CanBeSaved bool `json:"can_be_saved"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - CanGetAddedReactions bool `json:"can_get_added_reactions"` CanGetStatistics bool `json:"can_get_statistics"` CanGetMessageThread bool `json:"can_get_message_thread"` CanGetViewers bool `json:"can_get_viewers"` @@ -6804,7 +6391,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { EditDate int32 `json:"edit_date"` ForwardInfo *MessageForwardInfo `json:"forward_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` - UnreadReactions []*UnreadReaction `json:"unread_reactions"` ReplyInChatId int64 `json:"reply_in_chat_id"` ReplyToMessageId int64 `json:"reply_to_message_id"` MessageThreadId int64 `json:"message_thread_id"` @@ -6832,7 +6418,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers - message.CanGetAddedReactions = tmp.CanGetAddedReactions message.CanGetStatistics = tmp.CanGetStatistics message.CanGetMessageThread = tmp.CanGetMessageThread message.CanGetViewers = tmp.CanGetViewers @@ -6844,7 +6429,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo message.InteractionInfo = tmp.InteractionInfo - message.UnreadReactions = tmp.UnreadReactions message.ReplyInChatId = tmp.ReplyInChatId message.ReplyToMessageId = tmp.ReplyToMessageId message.MessageThreadId = tmp.MessageThreadId @@ -6876,7 +6460,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { // Contains a list of messages type Messages struct { meta - // Approximate total number of messages found + // Approximate total count of messages found TotalCount int32 `json:"total_count"` // List of messages; messages may be null Messages []*Message `json:"messages"` @@ -6901,7 +6485,7 @@ func (*Messages) GetType() string { // Contains a list of messages found by a search type FoundMessages struct { meta - // Approximate total number of messages found; -1 if unknown + // Approximate total count of messages found; -1 if unknown TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` @@ -6955,7 +6539,7 @@ func (*MessagePosition) GetType() string { // Contains a list of message positions type MessagePositions struct { meta - // Total number of messages found + // Total count of messages found TotalCount int32 `json:"total_count"` // List of message positions Positions []*MessagePosition `json:"positions"` @@ -7032,11 +6616,9 @@ type SponsoredMessage struct { meta // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages MessageId int64 `json:"message_id"` - // Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link + // Chat identifier SponsorChatId int64 `json:"sponsor_chat_id"` - // Information about the sponsor chat; may be null unless sponsor_chat_id == 0 - SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` - // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead + // An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead Link InternalLinkType `json:"link"` // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` @@ -7060,11 +6642,10 @@ func (*SponsoredMessage) GetType() string { func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { - MessageId int64 `json:"message_id"` - SponsorChatId int64 `json:"sponsor_chat_id"` - SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` - Link json.RawMessage `json:"link"` - Content json.RawMessage `json:"content"` + MessageId int64 `json:"message_id"` + SponsorChatId int64 `json:"sponsor_chat_id"` + Link json.RawMessage `json:"link"` + Content json.RawMessage `json:"content"` } err := json.Unmarshal(data, &tmp) @@ -7074,7 +6655,6 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { sponsoredMessage.MessageId = tmp.MessageId sponsoredMessage.SponsorChatId = tmp.SponsorChatId - sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) sponsoredMessage.Link = fieldLink @@ -7085,91 +6665,6 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { return nil } -// Describes a file added to file download list -type FileDownload struct { - meta - // File identifier - FileId int32 `json:"file_id"` - // The message with the file - Message *Message `json:"message"` - // Point in time (Unix timestamp) when the file was added to the download list - AddDate int32 `json:"add_date"` - // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed - CompleteDate int32 `json:"complete_date"` - // True, if downloading of the file is paused - IsPaused bool `json:"is_paused"` -} - -func (entity *FileDownload) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FileDownload - - return json.Marshal((*stub)(entity)) -} - -func (*FileDownload) GetClass() string { - return ClassFileDownload -} - -func (*FileDownload) GetType() string { - return TypeFileDownload -} - -// Contains number of being downloaded and recently downloaded files found -type DownloadedFileCounts struct { - meta - // Number of active file downloads found, including paused - ActiveCount int32 `json:"active_count"` - // Number of paused file downloads found - PausedCount int32 `json:"paused_count"` - // Number of completed file downloads found - CompletedCount int32 `json:"completed_count"` -} - -func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DownloadedFileCounts - - return json.Marshal((*stub)(entity)) -} - -func (*DownloadedFileCounts) GetClass() string { - return ClassDownloadedFileCounts -} - -func (*DownloadedFileCounts) GetType() string { - return TypeDownloadedFileCounts -} - -// Contains a list of downloaded files, found by a search -type FoundFileDownloads struct { - meta - // Total number of suitable files, ignoring offset - TotalCounts *DownloadedFileCounts `json:"total_counts"` - // The list of files - Files []*FileDownload `json:"files"` - // The offset for the next request. If empty, there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FoundFileDownloads - - return json.Marshal((*stub)(entity)) -} - -func (*FoundFileDownloads) GetClass() string { - return ClassFoundFileDownloads -} - -func (*FoundFileDownloads) GetType() string { - return TypeFoundFileDownloads -} - // Notification settings applied to all private and secret chats when the corresponding chat setting has a default value type NotificationSettingsScopePrivateChats struct { meta @@ -7195,7 +6690,7 @@ func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopePrivateChats } -// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value +// Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value type NotificationSettingsScopeGroupChats struct { meta } @@ -7220,7 +6715,7 @@ func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() stri return TypeNotificationSettingsScopeGroupChats } -// Notification settings applied to all channel chats when the corresponding chat setting has a default value +// Notification settings applied to all channels when the corresponding chat setting has a default value type NotificationSettingsScopeChannelChats struct { meta } @@ -7252,10 +6747,10 @@ type ChatNotificationSettings struct { UseDefaultMuteFor bool `json:"use_default_mute_for"` // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // If true, the value for the relevant type of chat is used instead of sound_id + // If true, sound is ignored and the value for the relevant type of chat is used instead UseDefaultSound bool `json:"use_default_sound"` - // Identifier of the notification sound to be played; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` + // The name of an audio file to be used for notification sounds; only applies to iOS applications + Sound string `json:"sound"` // If true, show_preview is ignored and the value for the relevant type of chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications @@ -7291,8 +6786,8 @@ type ScopeNotificationSettings struct { meta // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // Identifier of the notification sound to be played; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` + // The name of an audio file to be used for notification sounds; only applies to iOS applications + Sound string `json:"sound"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message @@ -7320,7 +6815,7 @@ func (*ScopeNotificationSettings) GetType() string { // Contains information about a message draft type DraftMessage struct { meta - // Identifier of the replied message; 0 if none + // Identifier of the message to reply to; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` @@ -7914,12 +7409,8 @@ type Chat struct { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` // Number of unread messages with a mention/reply in the chat UnreadMentionCount int32 `json:"unread_mention_count"` - // Number of messages with unread reactions in the chat - UnreadReactionCount int32 `json:"unread_reaction_count"` - // Notification settings for the chat + // Notification settings for this chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // List of reactions, available in the chat - AvailableReactions []string `json:"available_reactions"` // Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats MessageTtl int32 `json:"message_ttl"` // If non-empty, name of a theme, set for the chat @@ -7976,9 +7467,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` - UnreadReactionCount int32 `json:"unread_reaction_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - AvailableReactions []string `json:"available_reactions"` MessageTtl int32 `json:"message_ttl"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` @@ -8012,9 +7501,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount - chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings - chat.AvailableReactions = tmp.AvailableReactions chat.MessageTtl = tmp.MessageTtl chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat @@ -8038,7 +7525,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { // Represents a list of chats type Chats struct { meta - // Approximate total number of chats found + // Approximate total count of chats found TotalCount int32 `json:"total_count"` // List of chat identifiers ChatIds []int64 `json:"chat_ids"` @@ -8451,33 +7938,6 @@ func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestPoll } -// A button that opens a web app by calling getWebAppUrl -type KeyboardButtonTypeWebApp struct { - meta - // An HTTP URL to pass to getWebAppUrl - Url string `json:"url"` -} - -func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeWebApp) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeWebApp) GetType() string { - return TypeKeyboardButtonTypeWebApp -} - -func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeWebApp -} - // Represents a single button in a bot keyboard type KeyboardButton struct { meta @@ -8549,10 +8009,10 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo +// A button that opens a specified URL and automatically authorize the current user if allowed to do so type InlineKeyboardButtonTypeLoginUrl struct { meta - // An HTTP URL to pass to getLoginUrlInfo + // An HTTP URL to open Url string `json:"url"` // Unique button identifier Id int64 `json:"id"` @@ -8580,33 +8040,6 @@ func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeLoginUrl } -// A button that opens a web app by calling openWebApp -type InlineKeyboardButtonTypeWebApp struct { - meta - // An HTTP URL to pass to openWebApp - Url string `json:"url"` -} - -func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeWebApp) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeWebApp) GetType() string { - return TypeInlineKeyboardButtonTypeWebApp -} - -func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeWebApp -} - // A button that sends a callback query to a bot type InlineKeyboardButtonTypeCallback struct { meta @@ -8991,31 +8424,6 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { return TypeLoginUrlInfoRequestConfirmation } -// 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 a message thread type MessageThreadInfo struct { meta @@ -11087,7 +10495,7 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` - // Chat username by which all other information about the chat can be resolved + // Chat username, by which all other information about the chat can be resolved Username string `json:"username"` } @@ -11593,39 +11001,6 @@ func (*Address) GetType() string { return TypeAddress } -// Contains parameters of the app theme -type ThemeParameters struct { - meta - // A color of the background in the RGB24 format - BackgroundColor int32 `json:"background_color"` - // A color of text in the RGB24 format - TextColor int32 `json:"text_color"` - // A color of hints in the RGB24 format - HintColor int32 `json:"hint_color"` - // A color of links in the RGB24 format - LinkColor int32 `json:"link_color"` - // A color of the buttons in the RGB24 format - ButtonColor int32 `json:"button_color"` - // A color of text on the buttons in the RGB24 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 -} - // Portion of the price of a product (e.g., "delivery cost", "tax amount") type LabeledPricePart struct { meta @@ -11916,6 +11291,39 @@ func (*PaymentsProviderStripe) GetType() string { return TypePaymentsProviderStripe } +// Theme colors for a payment form +type PaymentFormTheme struct { + meta + // A color of the payment form background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // A color of hints in the RGB24 format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB24 format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB24 format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB24 format + ButtonTextColor int32 `json:"button_text_color"` +} + +func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentFormTheme + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentFormTheme) GetClass() string { + return ClassPaymentFormTheme +} + +func (*PaymentFormTheme) GetType() string { + return TypePaymentFormTheme +} + // Contains information about an invoice payment form type PaymentForm struct { meta @@ -15542,63 +14950,7 @@ func (*MessageWebsiteConnected) MessageContentType() string { return TypeMessageWebsiteConnected } -// Data from a web app has been sent to a bot -type MessageWebAppDataSent struct { - meta - // Text of the keyboardButtonTypeWebApp button, which opened the web app - ButtonText string `json:"button_text"` -} - -func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebAppDataSent - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebAppDataSent) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebAppDataSent) GetType() string { - return TypeMessageWebAppDataSent -} - -func (*MessageWebAppDataSent) MessageContentType() string { - return TypeMessageWebAppDataSent -} - -// Data from a web app has been received; for bots only -type MessageWebAppDataReceived struct { - meta - // Text of the keyboardButtonTypeWebApp button, which opened the web app - ButtonText string `json:"button_text"` - // Received data - Data string `json:"data"` -} - -func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebAppDataReceived - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebAppDataReceived) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebAppDataReceived) GetType() string { - return TypeMessageWebAppDataReceived -} - -func (*MessageWebAppDataReceived) MessageContentType() string { - return TypeMessageWebAppDataReceived -} - -// Telegram Passport data has been sent to a bot +// Telegram Passport data has been sent type MessagePassportDataSent struct { meta // List of Telegram Passport element types sent @@ -16049,31 +15401,6 @@ func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { return TypeTextEntityTypeStrikethrough } -// A spoiler text. Not supported in secret chats -type TextEntityTypeSpoiler struct { - meta -} - -func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeSpoiler - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeSpoiler) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeSpoiler) GetType() string { - return TypeTextEntityTypeSpoiler -} - -func (*TextEntityTypeSpoiler) TextEntityTypeType() string { - return TypeTextEntityTypeSpoiler -} - // Text that must be formatted as if inside a code HTML tag type TextEntityTypeCode struct { meta @@ -16339,8 +15666,6 @@ type MessageSendOptions struct { DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` - // Pass true if the content of the message must be protected from forwarding and saving; for bots only - ProtectContent bool `json:"protect_content"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` } @@ -16365,7 +15690,6 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { DisableNotification bool `json:"disable_notification"` FromBackground bool `json:"from_background"` - ProtectContent bool `json:"protect_content"` SchedulingState json.RawMessage `json:"scheduling_state"` } @@ -16376,7 +15700,6 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground - messageSendOptions.ProtectContent = tmp.ProtectContent fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) messageSendOptions.SchedulingState = fieldSchedulingState @@ -16414,7 +15737,7 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` // True, if rich web page previews for URLs in the message text must be disabled DisableWebPagePreview bool `json:"disable_web_page_preview"` @@ -17589,31 +16912,6 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } -// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user -type SearchMessagesFilterUnreadReaction struct { - meta -} - -func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterUnreadReaction - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterUnreadReaction) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterUnreadReaction) GetType() string { - return TypeSearchMessagesFilterUnreadReaction -} - -func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterUnreadReaction -} - // Returns only failed to send messages. This filter can be used only if the message database is used type SearchMessagesFilterFailedToSend struct { meta @@ -18260,7 +17558,7 @@ type StickerSet struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed + // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -18270,8 +17568,10 @@ type StickerSet struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // Type of the stickers in the set - StickerType StickerType `json:"sticker_type"` + // True, is the stickers in the set are animated + IsAnimated bool `json:"is_animated"` + // True, if the stickers in the set are masks + IsMasks bool `json:"is_masks"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -18296,45 +17596,6 @@ func (*StickerSet) GetType() string { return TypeStickerSet } -func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - Title string `json:"title"` - Name string `json:"name"` - Thumbnail *Thumbnail `json:"thumbnail"` - ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` - IsInstalled bool `json:"is_installed"` - IsArchived bool `json:"is_archived"` - IsOfficial bool `json:"is_official"` - StickerType json.RawMessage `json:"sticker_type"` - IsViewed bool `json:"is_viewed"` - Stickers []*Sticker `json:"stickers"` - Emojis []*Emojis `json:"emojis"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - stickerSet.Id = tmp.Id - stickerSet.Title = tmp.Title - stickerSet.Name = tmp.Name - stickerSet.Thumbnail = tmp.Thumbnail - stickerSet.ThumbnailOutline = tmp.ThumbnailOutline - stickerSet.IsInstalled = tmp.IsInstalled - stickerSet.IsArchived = tmp.IsArchived - stickerSet.IsOfficial = tmp.IsOfficial - stickerSet.IsViewed = tmp.IsViewed - stickerSet.Stickers = tmp.Stickers - stickerSet.Emojis = tmp.Emojis - - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - stickerSet.StickerType = fieldStickerType - - return nil -} - // Represents short information about a sticker set type StickerSetInfo struct { meta @@ -18344,7 +17605,7 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null + // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -18354,8 +17615,10 @@ type StickerSetInfo struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // Type of the stickers in the set - StickerType StickerType `json:"sticker_type"` + // True, is the stickers in the set are animated + IsAnimated bool `json:"is_animated"` + // True, if the stickers in the set are masks + IsMasks bool `json:"is_masks"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -18380,45 +17643,6 @@ func (*StickerSetInfo) GetType() string { return TypeStickerSetInfo } -func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - Title string `json:"title"` - Name string `json:"name"` - Thumbnail *Thumbnail `json:"thumbnail"` - ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` - IsInstalled bool `json:"is_installed"` - IsArchived bool `json:"is_archived"` - IsOfficial bool `json:"is_official"` - StickerType json.RawMessage `json:"sticker_type"` - IsViewed bool `json:"is_viewed"` - Size int32 `json:"size"` - Covers []*Sticker `json:"covers"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - stickerSetInfo.Id = tmp.Id - stickerSetInfo.Title = tmp.Title - stickerSetInfo.Name = tmp.Name - stickerSetInfo.Thumbnail = tmp.Thumbnail - stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline - stickerSetInfo.IsInstalled = tmp.IsInstalled - stickerSetInfo.IsArchived = tmp.IsArchived - stickerSetInfo.IsOfficial = tmp.IsOfficial - stickerSetInfo.IsViewed = tmp.IsViewed - stickerSetInfo.Size = tmp.Size - stickerSetInfo.Covers = tmp.Covers - - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - stickerSetInfo.StickerType = fieldStickerType - - return nil -} - // Represents a list of sticker sets type StickerSets struct { meta @@ -19032,81 +18256,6 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } -// Describes an available stream in a group call -type GroupCallStream struct { - meta - // Identifier of an audio/video channel - ChannelId int32 `json:"channel_id"` - // Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds - Scale int32 `json:"scale"` - // Point in time when the stream currently ends; Unix timestamp in milliseconds - TimeOffset int64 `json:"time_offset"` -} - -func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallStream - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallStream) GetClass() string { - return ClassGroupCallStream -} - -func (*GroupCallStream) GetType() string { - return TypeGroupCallStream -} - -// Represents a list of group call streams -type GroupCallStreams struct { - meta - // A list of group call streams - Streams []*GroupCallStream `json:"streams"` -} - -func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallStreams - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallStreams) GetClass() string { - return ClassGroupCallStreams -} - -func (*GroupCallStreams) GetType() string { - return TypeGroupCallStreams -} - -// Represents an RTMP url -type RtmpUrl struct { - meta - // The URL - Url string `json:"url"` - // Stream key - StreamKey string `json:"stream_key"` -} - -func (entity *RtmpUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RtmpUrl - - return json.Marshal((*stub)(entity)) -} - -func (*RtmpUrl) GetClass() string { - return ClassRtmpUrl -} - -func (*RtmpUrl) GetType() string { - return TypeRtmpUrl -} - // Describes a recently speaking participant in a group call type GroupCallRecentSpeaker struct { meta @@ -19164,8 +18313,6 @@ type GroupCall struct { EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active IsActive bool `json:"is_active"` - // True, if the chat is an RTMP stream instead of an ordinary video chat - IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` // True, if user was kicked from the call because of network loss and the call needs to be rejoined @@ -19174,8 +18321,6 @@ type GroupCall struct { CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` - // True, if group call participants, which are muted, aren't returned in participant list - HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` // At most 3 recently speaking users in the group call @@ -19686,141 +18831,6 @@ func (*PhoneNumberAuthenticationSettings) GetType() string { return TypePhoneNumberAuthenticationSettings } -// Represents a reaction applied to a message -type AddedReaction struct { - meta - // Text representation of the reaction - Reaction string `json:"reaction"` - // Identifier of the chat member, applied the reaction - SenderId MessageSender `json:"sender_id"` -} - -func (entity *AddedReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AddedReaction - - return json.Marshal((*stub)(entity)) -} - -func (*AddedReaction) GetClass() string { - return ClassAddedReaction -} - -func (*AddedReaction) GetType() string { - return TypeAddedReaction -} - -func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Reaction string `json:"reaction"` - SenderId json.RawMessage `json:"sender_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - addedReaction.Reaction = tmp.Reaction - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - addedReaction.SenderId = fieldSenderId - - return nil -} - -// Represents a list of reactions added to a message -type AddedReactions struct { - meta - // The total number of found reactions - TotalCount int32 `json:"total_count"` - // The list of added reactions - Reactions []*AddedReaction `json:"reactions"` - // The offset for the next request. If empty, there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *AddedReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AddedReactions - - return json.Marshal((*stub)(entity)) -} - -func (*AddedReactions) GetClass() string { - return ClassAddedReactions -} - -func (*AddedReactions) GetType() string { - return TypeAddedReactions -} - -// Represents a list of available reactions -type AvailableReactions struct { - meta - // List of reactions - Reactions []string `json:"reactions"` -} - -func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AvailableReactions - - return json.Marshal((*stub)(entity)) -} - -func (*AvailableReactions) GetClass() string { - return ClassAvailableReactions -} - -func (*AvailableReactions) GetType() string { - return TypeAvailableReactions -} - -// Contains stickers which must be used for reaction animation rendering -type Reaction struct { - meta - // Text representation of the reaction - Reaction string `json:"reaction"` - // Reaction title - Title string `json:"title"` - // True, if the reaction can be added to new messages and enabled in chats - IsActive bool `json:"is_active"` - // Static icon for the reaction - StaticIcon *Sticker `json:"static_icon"` - // Appear animation for the reaction - AppearAnimation *Sticker `json:"appear_animation"` - // Select animation for the reaction - SelectAnimation *Sticker `json:"select_animation"` - // Activate animation for the reaction - ActivateAnimation *Sticker `json:"activate_animation"` - // Effect animation for the reaction - EffectAnimation *Sticker `json:"effect_animation"` - // Around animation for the reaction; may be null - AroundAnimation *Sticker `json:"around_animation"` - // Center animation for the reaction; may be null - CenterAnimation *Sticker `json:"center_animation"` -} - -func (entity *Reaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Reaction - - return json.Marshal((*stub)(entity)) -} - -func (*Reaction) GetClass() string { - return ClassReaction -} - -func (*Reaction) GetType() string { - return TypeReaction -} - // Represents a list of animations type Animations struct { meta @@ -19931,93 +18941,6 @@ func (*ImportedContacts) GetType() string { return TypeImportedContacts } -// Describes a color to highlight a bot added to attachment menu -type AttachmentMenuBotColor struct { - meta - // Color in the RGB24 format for light themes - LightColor int32 `json:"light_color"` - // Color in the RGB24 format for dark themes - DarkColor int32 `json:"dark_color"` -} - -func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AttachmentMenuBotColor - - return json.Marshal((*stub)(entity)) -} - -func (*AttachmentMenuBotColor) GetClass() string { - return ClassAttachmentMenuBotColor -} - -func (*AttachmentMenuBotColor) GetType() string { - return TypeAttachmentMenuBotColor -} - -// Represents a bot added to attachment menu -type AttachmentMenuBot struct { - meta - // User identifier of the bot added to attachment menu - BotUserId int64 `json:"bot_user_id"` - // Name for the bot in attachment menu - Name string `json:"name"` - // Color to highlight selected name of the bot if appropriate; may be null - NameColor *AttachmentMenuBotColor `json:"name_color"` - // Default attachment menu icon for the bot in SVG format; may be null - DefaultIcon *File `json:"default_icon"` - // Attachment menu icon for the bot in SVG format for the official iOS app; may be null - IosStaticIcon *File `json:"ios_static_icon"` - // Attachment menu icon for the bot in TGS format for the official iOS app; may be null - IosAnimatedIcon *File `json:"ios_animated_icon"` - // Attachment menu icon for the bot in TGS format for the official Android app; may be null - AndroidIcon *File `json:"android_icon"` - // Attachment menu icon for the bot in TGS format for the official native macOS app; may be null - MacosIcon *File `json:"macos_icon"` - // Color to highlight selected icon of the bot if appropriate; may be null - IconColor *AttachmentMenuBotColor `json:"icon_color"` -} - -func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AttachmentMenuBot - - return json.Marshal((*stub)(entity)) -} - -func (*AttachmentMenuBot) GetClass() string { - return ClassAttachmentMenuBot -} - -func (*AttachmentMenuBot) GetType() string { - return TypeAttachmentMenuBot -} - -// Information about the message sent by answerWebAppQuery -type SentWebAppMessage struct { - meta - // Identifier of the sent inline message, if known - InlineMessageId string `json:"inline_message_id"` -} - -func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SentWebAppMessage - - return json.Marshal((*stub)(entity)) -} - -func (*SentWebAppMessage) GetClass() string { - return ClassSentWebAppMessage -} - -func (*SentWebAppMessage) GetType() string { - return TypeSentWebAppMessage -} - // Contains an HTTP URL type HttpUrl struct { meta @@ -20639,14 +19562,14 @@ func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(da return nil } -// Represents a link to a WEBP, TGS, or WEBM sticker +// Represents a link to a WEBP or TGS sticker type InputInlineQueryResultSticker struct { meta // Unique identifier of the query result Id string `json:"id"` // URL of the sticker thumbnail, if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) + // The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) StickerUrl string `json:"sticker_url"` // Width of the sticker StickerWidth int32 `json:"sticker_width"` @@ -21606,6 +20529,33 @@ func (*ChatEventMessageDeleted) ChatEventActionType() string { return TypeChatEventMessageDeleted } +// A poll in a message was stopped +type ChatEventPollStopped struct { + meta + // The message with the poll + Message *Message `json:"message"` +} + +func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPollStopped + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPollStopped) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPollStopped) GetType() string { + return TypeChatEventPollStopped +} + +func (*ChatEventPollStopped) ChatEventActionType() string { + return TypeChatEventPollStopped +} + // A message was pinned type ChatEventMessagePinned struct { meta @@ -21660,33 +20610,6 @@ func (*ChatEventMessageUnpinned) ChatEventActionType() string { return TypeChatEventMessageUnpinned } -// A poll in a message was stopped -type ChatEventPollStopped struct { - meta - // The message with the poll - Message *Message `json:"message"` -} - -func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPollStopped - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPollStopped) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPollStopped) GetType() string { - return TypeChatEventPollStopped -} - -func (*ChatEventPollStopped) ChatEventActionType() string { - return TypeChatEventPollStopped -} - // A new member joined the chat type ChatEventMemberJoined struct { meta @@ -21768,6 +20691,31 @@ func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { return TypeChatEventMemberJoinedByRequest } +// A member left the chat +type ChatEventMemberLeft struct { + meta +} + +func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberLeft) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberLeft) GetType() string { + return TypeChatEventMemberLeft +} + +func (*ChatEventMemberLeft) ChatEventActionType() string { + return TypeChatEventMemberLeft +} + // A new chat member was invited type ChatEventMemberInvited struct { meta @@ -21816,31 +20764,6 @@ func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) return nil } -// A member left the chat -type ChatEventMemberLeft struct { - meta -} - -func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberLeft) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberLeft) GetType() string { - return TypeChatEventMemberLeft -} - -func (*ChatEventMemberLeft) ChatEventActionType() string { - return TypeChatEventMemberLeft -} - // A chat member has gained/lost administrator status, or the list of their administrator privileges has changed type ChatEventMemberPromoted struct { meta @@ -21950,149 +20873,33 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [ return nil } -// The chat available reactions were changed -type ChatEventAvailableReactionsChanged struct { +// The chat title was changed +type ChatEventTitleChanged struct { meta - // Previous chat available reactions - OldAvailableReactions []string `json:"old_available_reactions"` - // New chat available reactions - NewAvailableReactions []string `json:"new_available_reactions"` + // Previous chat title + OldTitle string `json:"old_title"` + // New chat title + NewTitle string `json:"new_title"` } -func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventAvailableReactionsChanged + type stub ChatEventTitleChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventAvailableReactionsChanged) GetClass() string { +func (*ChatEventTitleChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventAvailableReactionsChanged) GetType() string { - return TypeChatEventAvailableReactionsChanged +func (*ChatEventTitleChanged) GetType() string { + return TypeChatEventTitleChanged } -func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { - return TypeChatEventAvailableReactionsChanged -} - -// The chat description was changed -type ChatEventDescriptionChanged struct { - meta - // Previous chat description - OldDescription string `json:"old_description"` - // New chat description - NewDescription string `json:"new_description"` -} - -func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventDescriptionChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventDescriptionChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventDescriptionChanged) GetType() string { - return TypeChatEventDescriptionChanged -} - -func (*ChatEventDescriptionChanged) ChatEventActionType() string { - return TypeChatEventDescriptionChanged -} - -// The linked chat of a supergroup was changed -type ChatEventLinkedChatChanged struct { - meta - // Previous supergroup linked chat identifier - OldLinkedChatId int64 `json:"old_linked_chat_id"` - // New supergroup linked chat identifier - NewLinkedChatId int64 `json:"new_linked_chat_id"` -} - -func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventLinkedChatChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventLinkedChatChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventLinkedChatChanged) GetType() string { - return TypeChatEventLinkedChatChanged -} - -func (*ChatEventLinkedChatChanged) ChatEventActionType() string { - return TypeChatEventLinkedChatChanged -} - -// The supergroup location was changed -type ChatEventLocationChanged struct { - meta - // Previous location; may be null - OldLocation *ChatLocation `json:"old_location"` - // New location; may be null - NewLocation *ChatLocation `json:"new_location"` -} - -func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventLocationChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventLocationChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventLocationChanged) GetType() string { - return TypeChatEventLocationChanged -} - -func (*ChatEventLocationChanged) ChatEventActionType() string { - return TypeChatEventLocationChanged -} - -// The message TTL was changed -type ChatEventMessageTtlChanged struct { - meta - // Previous value of message_ttl - OldMessageTtl int32 `json:"old_message_ttl"` - // New value of message_ttl - NewMessageTtl int32 `json:"new_message_ttl"` -} - -func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageTtlChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageTtlChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageTtlChanged) GetType() string { - return TypeChatEventMessageTtlChanged -} - -func (*ChatEventMessageTtlChanged) ChatEventActionType() string { - return TypeChatEventMessageTtlChanged +func (*ChatEventTitleChanged) ChatEventActionType() string { + return TypeChatEventTitleChanged } // The chat permissions was changed @@ -22124,120 +20931,33 @@ func (*ChatEventPermissionsChanged) ChatEventActionType() string { return TypeChatEventPermissionsChanged } -// The chat photo was changed -type ChatEventPhotoChanged struct { +// The chat description was changed +type ChatEventDescriptionChanged struct { meta - // Previous chat photo value; may be null - OldPhoto *ChatPhoto `json:"old_photo"` - // New chat photo value; may be null - NewPhoto *ChatPhoto `json:"new_photo"` + // Previous chat description + OldDescription string `json:"old_description"` + // New chat description + NewDescription string `json:"new_description"` } -func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventPhotoChanged + type stub ChatEventDescriptionChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventPhotoChanged) GetClass() string { +func (*ChatEventDescriptionChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventPhotoChanged) GetType() string { - return TypeChatEventPhotoChanged +func (*ChatEventDescriptionChanged) GetType() string { + return TypeChatEventDescriptionChanged } -func (*ChatEventPhotoChanged) ChatEventActionType() string { - return TypeChatEventPhotoChanged -} - -// The slow_mode_delay setting of a supergroup was changed -type ChatEventSlowModeDelayChanged struct { - meta - // Previous value of slow_mode_delay, in seconds - OldSlowModeDelay int32 `json:"old_slow_mode_delay"` - // New value of slow_mode_delay, in seconds - NewSlowModeDelay int32 `json:"new_slow_mode_delay"` -} - -func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSlowModeDelayChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSlowModeDelayChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSlowModeDelayChanged) GetType() string { - return TypeChatEventSlowModeDelayChanged -} - -func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { - return TypeChatEventSlowModeDelayChanged -} - -// The supergroup sticker set was changed -type ChatEventStickerSetChanged struct { - meta - // Previous identifier of the chat sticker set; 0 if none - OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` - // New identifier of the chat sticker set; 0 if none - NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` -} - -func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventStickerSetChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventStickerSetChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventStickerSetChanged) GetType() string { - return TypeChatEventStickerSetChanged -} - -func (*ChatEventStickerSetChanged) ChatEventActionType() string { - return TypeChatEventStickerSetChanged -} - -// The chat title was changed -type ChatEventTitleChanged struct { - meta - // Previous chat title - OldTitle string `json:"old_title"` - // New chat title - NewTitle string `json:"new_title"` -} - -func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventTitleChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventTitleChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventTitleChanged) GetType() string { - return TypeChatEventTitleChanged -} - -func (*ChatEventTitleChanged) ChatEventActionType() string { - return TypeChatEventTitleChanged +func (*ChatEventDescriptionChanged) ChatEventActionType() string { + return TypeChatEventDescriptionChanged } // The chat username was changed @@ -22269,31 +20989,33 @@ func (*ChatEventUsernameChanged) ChatEventActionType() string { return TypeChatEventUsernameChanged } -// The has_protected_content setting of a channel was toggled -type ChatEventHasProtectedContentToggled struct { +// The chat photo was changed +type ChatEventPhotoChanged struct { meta - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` + // Previous chat photo value; may be null + OldPhoto *ChatPhoto `json:"old_photo"` + // New chat photo value; may be null + NewPhoto *ChatPhoto `json:"new_photo"` } -func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { +func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventHasProtectedContentToggled + type stub ChatEventPhotoChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventHasProtectedContentToggled) GetClass() string { +func (*ChatEventPhotoChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventHasProtectedContentToggled) GetType() string { - return TypeChatEventHasProtectedContentToggled +func (*ChatEventPhotoChanged) GetType() string { + return TypeChatEventPhotoChanged } -func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { - return TypeChatEventHasProtectedContentToggled +func (*ChatEventPhotoChanged) ChatEventActionType() string { + return TypeChatEventPhotoChanged } // The can_invite_users permission of a supergroup chat was toggled @@ -22323,31 +21045,91 @@ func (*ChatEventInvitesToggled) ChatEventActionType() string { return TypeChatEventInvitesToggled } -// The is_all_history_available setting of a supergroup was toggled -type ChatEventIsAllHistoryAvailableToggled struct { +// The linked chat of a supergroup was changed +type ChatEventLinkedChatChanged struct { meta - // New value of is_all_history_available - IsAllHistoryAvailable bool `json:"is_all_history_available"` + // Previous supergroup linked chat identifier + OldLinkedChatId int64 `json:"old_linked_chat_id"` + // New supergroup linked chat identifier + NewLinkedChatId int64 `json:"new_linked_chat_id"` } -func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) { +func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventIsAllHistoryAvailableToggled + type stub ChatEventLinkedChatChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string { +func (*ChatEventLinkedChatChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventIsAllHistoryAvailableToggled) GetType() string { - return TypeChatEventIsAllHistoryAvailableToggled +func (*ChatEventLinkedChatChanged) GetType() string { + return TypeChatEventLinkedChatChanged } -func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { - return TypeChatEventIsAllHistoryAvailableToggled +func (*ChatEventLinkedChatChanged) ChatEventActionType() string { + return TypeChatEventLinkedChatChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + meta + // Previous value of slow_mode_delay, in seconds + OldSlowModeDelay int32 `json:"old_slow_mode_delay"` + // New value of slow_mode_delay, in seconds + NewSlowModeDelay int32 `json:"new_slow_mode_delay"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + +// The message TTL was changed +type ChatEventMessageTtlChanged struct { + meta + // Previous value of message_ttl + OldMessageTtl int32 `json:"old_message_ttl"` + // New value of message_ttl + NewMessageTtl int32 `json:"new_message_ttl"` +} + +func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageTtlChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageTtlChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageTtlChanged) GetType() string { + return TypeChatEventMessageTtlChanged +} + +func (*ChatEventMessageTtlChanged) ChatEventActionType() string { + return TypeChatEventMessageTtlChanged } // The sign_messages setting of a channel was toggled @@ -22377,6 +21159,118 @@ func (*ChatEventSignMessagesToggled) ChatEventActionType() string { return TypeChatEventSignMessagesToggled } +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + +// The supergroup sticker set was changed +type ChatEventStickerSetChanged struct { + meta + // Previous identifier of the chat sticker set; 0 if none + OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` + // New identifier of the chat sticker set; 0 if none + NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` +} + +func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventStickerSetChanged) GetType() string { + return TypeChatEventStickerSetChanged +} + +func (*ChatEventStickerSetChanged) ChatEventActionType() string { + return TypeChatEventStickerSetChanged +} + +// The supergroup location was changed +type ChatEventLocationChanged struct { + meta + // Previous location; may be null + OldLocation *ChatLocation `json:"old_location"` + // New location; may be null + NewLocation *ChatLocation `json:"new_location"` +} + +func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLocationChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLocationChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventLocationChanged) GetType() string { + return TypeChatEventLocationChanged +} + +func (*ChatEventLocationChanged) ChatEventActionType() string { + return TypeChatEventLocationChanged +} + +// The is_all_history_available setting of a supergroup was toggled +type ChatEventIsAllHistoryAvailableToggled struct { + meta + // New value of is_all_history_available + IsAllHistoryAvailable bool `json:"is_all_history_available"` +} + +func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventIsAllHistoryAvailableToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventIsAllHistoryAvailableToggled) GetType() string { + return TypeChatEventIsAllHistoryAvailableToggled +} + +func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { + return TypeChatEventIsAllHistoryAvailableToggled +} + // A chat invite link was edited type ChatEventInviteLinkEdited struct { meta @@ -22514,33 +21408,6 @@ func (*ChatEventVideoChatEnded) ChatEventActionType() string { return TypeChatEventVideoChatEnded } -// The mute_new_participants setting of a video chat was toggled -type ChatEventVideoChatMuteNewParticipantsToggled struct { - meta - // New value of the mute_new_participants setting - MuteNewParticipants bool `json:"mute_new_participants"` -} - -func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatMuteNewParticipantsToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - // A video chat participant was muted or unmuted type ChatEventVideoChatParticipantIsMutedToggled struct { meta @@ -22637,6 +21504,33 @@ func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatPartici return nil } +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + // Represents a chat event type ChatEvent struct { meta @@ -22786,7 +21680,7 @@ func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { return TypeLanguagePackStringValueOrdinary } -// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information +// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info type LanguagePackStringValuePluralized struct { meta // Value for zero objects @@ -22926,7 +21820,7 @@ type LanguagePackInfo struct { Name string `json:"name"` // Name of the language in that language NativeName string `json:"native_name"` - // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information + // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info PluralCode string `json:"plural_code"` // True, if the language pack is official IsOfficial bool `json:"is_official"` @@ -23968,7 +22862,7 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The user has too many chats with username, one of them must be made private first +// The user has too much chats with username, one of them must be made private first type CheckChatUsernameResultPublicChatsTooMuch struct { meta } @@ -25298,62 +24192,6 @@ func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string { return TypeNotificationGroupTypeCalls } -// Describes a notification sound in MP3 format -type NotificationSound struct { - meta - // Unique identifier of the notification sound - Id JsonInt64 `json:"id"` - // Duration of the sound, in seconds - Duration int32 `json:"duration"` - // Point in time (Unix timestamp) when the sound was created - Date int32 `json:"date"` - // Title of the notification sound - Title string `json:"title"` - // Arbitrary data, defined while the sound was uploaded - Data string `json:"data"` - // File containing the sound - Sound *File `json:"sound"` -} - -func (entity *NotificationSound) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSound - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSound) GetClass() string { - return ClassNotificationSound -} - -func (*NotificationSound) GetType() string { - return TypeNotificationSound -} - -// Contains a list of notification sounds -type NotificationSounds struct { - meta - // A list of notification sounds - NotificationSounds []*NotificationSound `json:"notification_sounds"` -} - -func (entity *NotificationSounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSounds - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSounds) GetClass() string { - return ClassNotificationSounds -} - -func (*NotificationSounds) GetType() string { - return TypeNotificationSounds -} - // Contains information about a notification type Notification struct { meta @@ -25361,8 +24199,8 @@ type Notification struct { Id int32 `json:"id"` // Notification date Date int32 `json:"date"` - // Identifier of the notification sound to be played; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` + // True, if the notification was initially silent + IsSilent bool `json:"is_silent"` // Notification type Type NotificationType `json:"type"` } @@ -25385,10 +24223,10 @@ func (*Notification) GetType() string { func (notification *Notification) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` - Date int32 `json:"date"` - SoundId JsonInt64 `json:"sound_id"` - Type json.RawMessage `json:"type"` + Id int32 `json:"id"` + Date int32 `json:"date"` + IsSilent bool `json:"is_silent"` + Type json.RawMessage `json:"type"` } err := json.Unmarshal(data, &tmp) @@ -25398,7 +24236,7 @@ func (notification *Notification) UnmarshalJSON(data []byte) error { notification.Id = tmp.Id notification.Date = tmp.Date - notification.SoundId = tmp.SoundId + notification.IsSilent = tmp.IsSilent fieldType, _ := UnmarshalNotificationType(tmp.Type) notification.Type = fieldType @@ -26357,7 +25195,7 @@ type ConnectedWebsite struct { LastActiveDate int32 `json:"last_active_date"` // IP address from which the user was logged in, in human-readable format Ip string `json:"ip"` - // Human-readable description of a country and a region from which the user was logged in, based on the IP address + // Human-readable description of a country and a region, from which the user was logged in, based on the IP address Location string `json:"location"` } @@ -26575,56 +25413,6 @@ func (*ChatReportReasonFake) ChatReportReasonType() string { return TypeChatReportReasonFake } -// The chat has illegal drugs related content -type ChatReportReasonIllegalDrugs struct { - meta -} - -func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatReportReasonIllegalDrugs - - return json.Marshal((*stub)(entity)) -} - -func (*ChatReportReasonIllegalDrugs) GetClass() string { - return ClassChatReportReason -} - -func (*ChatReportReasonIllegalDrugs) GetType() string { - return TypeChatReportReasonIllegalDrugs -} - -func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string { - return TypeChatReportReasonIllegalDrugs -} - -// The chat contains messages with personal details -type ChatReportReasonPersonalDetails struct { - meta -} - -func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatReportReasonPersonalDetails - - return json.Marshal((*stub)(entity)) -} - -func (*ChatReportReasonPersonalDetails) GetClass() string { - return ClassChatReportReason -} - -func (*ChatReportReasonPersonalDetails) GetType() string { - return TypeChatReportReasonPersonalDetails -} - -func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string { - return TypeChatReportReasonPersonalDetails -} - // A custom reason provided by the user type ChatReportReasonCustom struct { meta @@ -26675,58 +25463,6 @@ func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { return TypeInternalLinkTypeActiveSessions } -// The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL -type InternalLinkTypeAttachmentMenuBot struct { - meta - // An internal link pointing to a chat; may be null if the current chat needs to be kept - ChatLink InternalLinkType `json:"chat_link"` - // Username of the bot - BotUsername string `json:"bot_username"` - // URL to be passed to openWebApp - Url string `json:"url"` -} - -func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeAttachmentMenuBot - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeAttachmentMenuBot) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeAttachmentMenuBot) GetType() string { - return TypeInternalLinkTypeAttachmentMenuBot -} - -func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string { - return TypeInternalLinkTypeAttachmentMenuBot -} - -func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatLink json.RawMessage `json:"chat_link"` - BotUsername string `json:"bot_username"` - Url string `json:"url"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername - internalLinkTypeAttachmentMenuBot.Url = tmp.Url - - fieldChatLink, _ := UnmarshalInternalLinkType(tmp.ChatLink) - internalLinkTypeAttachmentMenuBot.ChatLink = fieldChatLink - - return nil -} - // The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode type InternalLinkTypeAuthenticationCode struct { meta @@ -26810,15 +25546,13 @@ func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStart } -// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. +// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group type InternalLinkTypeBotStartInGroup struct { meta // Username of the bot BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` - // Expected administrator rights for the bot; may be null - AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` } func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { @@ -26841,35 +25575,6 @@ func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStartInGroup } -// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights -type InternalLinkTypeBotAddToChannel struct { - meta - // Username of the bot - BotUsername string `json:"bot_username"` - // Expected administrator rights for the bot - AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` -} - -func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeBotAddToChannel - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeBotAddToChannel) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeBotAddToChannel) GetType() string { - return TypeInternalLinkTypeBotAddToChannel -} - -func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { - return TypeInternalLinkTypeBotAddToChannel -} - // The link is a link to the change phone number section of the app type InternalLinkTypeChangePhoneNumber struct { meta @@ -27003,31 +25708,6 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// The link is a link to the language settings section of the app -type InternalLinkTypeLanguageSettings struct { - meta -} - -func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeLanguageSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeLanguageSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeLanguageSettings) GetType() string { - return TypeInternalLinkTypeLanguageSettings -} - -func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeLanguageSettings -} - // The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link type InternalLinkTypeMessage struct { meta @@ -27148,31 +25828,6 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { return TypeInternalLinkTypePhoneNumberConfirmation } -// The link is a link to the privacy and security settings section of the app -type InternalLinkTypePrivacyAndSecuritySettings struct { - meta -} - -func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypePrivacyAndSecuritySettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings -} - -func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings -} - // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta @@ -27433,34 +26088,7 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link -type InternalLinkTypeUserPhoneNumber struct { - meta - // Phone number of the user - PhoneNumber string `json:"phone_number"` -} - -func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeUserPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeUserPhoneNumber) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeUserPhoneNumber) GetType() string { - return TypeInternalLinkTypeUserPhoneNumber -} - -func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { - return TypeInternalLinkTypeUserPhoneNumber -} - -// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link type InternalLinkTypeVideoChat struct { meta // Username of the chat with the video chat @@ -27672,31 +26300,6 @@ func (*FileTypeDocument) FileTypeType() string { return TypeFileTypeDocument } -// The file is a notification sound -type FileTypeNotificationSound struct { - meta -} - -func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FileTypeNotificationSound - - return json.Marshal((*stub)(entity)) -} - -func (*FileTypeNotificationSound) GetClass() string { - return ClassFileType -} - -func (*FileTypeNotificationSound) GetType() string { - return TypeFileTypeNotificationSound -} - -func (*FileTypeNotificationSound) FileTypeType() string { - return TypeFileTypeNotificationSound -} - // The file is a photo type FileTypePhoto struct { meta @@ -28859,7 +27462,7 @@ func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string { // A chat invite link type TMeUrlTypeChatInvite struct { meta - // Information about the chat invite link + // Chat invite link info Info *ChatInviteLinkInfo `json:"info"` } @@ -29447,38 +28050,42 @@ func (*Proxies) GetType() string { return TypeProxies } -// A sticker to be added to a sticker set -type InputSticker struct { +// A static sticker in PNG format, which will be converted to WEBP server-side +type InputStickerStatic struct { meta - // File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + // PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square Sticker InputFile `json:"sticker"` // Emojis corresponding to the sticker Emojis string `json:"emojis"` - // Sticker type - Type StickerType `json:"type"` + // For masks, position where the mask is placed; pass null if unspecified + MaskPosition *MaskPosition `json:"mask_position"` } -func (entity *InputSticker) MarshalJSON() ([]byte, error) { +func (entity *InputStickerStatic) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputSticker + type stub InputStickerStatic return json.Marshal((*stub)(entity)) } -func (*InputSticker) GetClass() string { +func (*InputStickerStatic) GetClass() string { return ClassInputSticker } -func (*InputSticker) GetType() string { - return TypeInputSticker +func (*InputStickerStatic) GetType() string { + return TypeInputStickerStatic } -func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { +func (*InputStickerStatic) InputStickerType() string { + return TypeInputStickerStatic +} + +func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Emojis string `json:"emojis"` - Type json.RawMessage `json:"type"` + Sticker json.RawMessage `json:"sticker"` + Emojis string `json:"emojis"` + MaskPosition *MaskPosition `json:"mask_position"` } err := json.Unmarshal(data, &tmp) @@ -29486,13 +28093,59 @@ func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { return err } - inputSticker.Emojis = tmp.Emojis + inputStickerStatic.Emojis = tmp.Emojis + inputStickerStatic.MaskPosition = tmp.MaskPosition fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputSticker.Sticker = fieldSticker + inputStickerStatic.Sticker = fieldSticker - fieldType, _ := UnmarshalStickerType(tmp.Type) - inputSticker.Type = fieldType + return nil +} + +// An animated sticker in TGS format +type InputStickerAnimated struct { + meta + // File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + Sticker InputFile `json:"sticker"` + // Emojis corresponding to the sticker + Emojis string `json:"emojis"` +} + +func (entity *InputStickerAnimated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStickerAnimated + + return json.Marshal((*stub)(entity)) +} + +func (*InputStickerAnimated) GetClass() string { + return ClassInputSticker +} + +func (*InputStickerAnimated) GetType() string { + return TypeInputStickerAnimated +} + +func (*InputStickerAnimated) InputStickerType() string { + return TypeInputStickerAnimated +} + +func (inputStickerAnimated *InputStickerAnimated) UnmarshalJSON(data []byte) error { + var tmp struct { + Sticker json.RawMessage `json:"sticker"` + Emojis string `json:"emojis"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStickerAnimated.Emojis = tmp.Emojis + + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputStickerAnimated.Sticker = fieldSticker return nil } @@ -30670,39 +29323,6 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } -// The list of unread reactions added to a message was changed -type UpdateMessageUnreadReactions struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // The new list of unread reactions - UnreadReactions []*UnreadReaction `json:"unread_reactions"` - // The new number of messages with unread reactions left in the chat - UnreadReactionCount int32 `json:"unread_reaction_count"` -} - -func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateMessageUnreadReactions - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateMessageUnreadReactions) GetClass() string { - return ClassUpdate -} - -func (*UpdateMessageUnreadReactions) GetType() string { - return TypeUpdateMessageUnreadReactions -} - -func (*UpdateMessageUnreadReactions) UpdateType() string { - return TypeUpdateMessageUnreadReactions -} - // A message with a live location was viewed. When the update is received, the application is supposed to update the live location type UpdateMessageLiveLocationViewed struct { meta @@ -31014,35 +29634,6 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } -// The chat available reactions were changed -type UpdateChatAvailableReactions struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new list of reactions, available in the chat - AvailableReactions []string `json:"available_reactions"` -} - -func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatAvailableReactions - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatAvailableReactions) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatAvailableReactions) GetType() string { - return TypeUpdateChatAvailableReactions -} - -func (*UpdateChatAvailableReactions) UpdateType() string { - return TypeUpdateChatAvailableReactions -} - // A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied type UpdateChatDraftMessage struct { meta @@ -31296,35 +29887,6 @@ func (*UpdateChatUnreadMentionCount) UpdateType() string { return TypeUpdateChatUnreadMentionCount } -// The chat unread_reaction_count has changed -type UpdateChatUnreadReactionCount struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The number of messages with unread reactions left in the chat - UnreadReactionCount int32 `json:"unread_reaction_count"` -} - -func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatUnreadReactionCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatUnreadReactionCount) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatUnreadReactionCount) GetType() string { - return TypeUpdateChatUnreadReactionCount -} - -func (*UpdateChatUnreadReactionCount) UpdateType() string { - return TypeUpdateChatUnreadReactionCount -} - // A chat video chat state has changed type UpdateChatVideoChat struct { meta @@ -31526,7 +30088,7 @@ func (*UpdateChatFilters) UpdateType() string { return TypeUpdateChatFilters } -// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed +// The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed type UpdateChatOnlineMemberCount struct { meta // Identifier of the chat @@ -31643,8 +30205,8 @@ type UpdateNotificationGroup struct { ChatId int64 `json:"chat_id"` // Chat identifier, which notification settings must be applied to the added notifications NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - // Identifier of the notification sound to be played; 0 if sound is disabled - NotificationSoundId JsonInt64 `json:"notification_sound_id"` + // True, if the notifications must be shown without sound + IsSilent bool `json:"is_silent"` // Total number of unread notifications in the group, can be bigger than number of active notifications TotalCount int32 `json:"total_count"` // List of added group notifications, sorted by notification ID @@ -31679,7 +30241,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt Type json.RawMessage `json:"type"` ChatId int64 `json:"chat_id"` NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - NotificationSoundId JsonInt64 `json:"notification_sound_id"` + IsSilent bool `json:"is_silent"` TotalCount int32 `json:"total_count"` AddedNotifications []*Notification `json:"added_notifications"` RemovedNotificationIds []int32 `json:"removed_notification_ids"` @@ -31693,7 +30255,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId updateNotificationGroup.ChatId = tmp.ChatId updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId - updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId + updateNotificationGroup.IsSilent = tmp.IsSilent updateNotificationGroup.TotalCount = tmp.TotalCount updateNotificationGroup.AddedNotifications = tmp.AddedNotifications updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds @@ -32229,128 +30791,6 @@ func (*UpdateFileGenerationStop) UpdateType() string { return TypeUpdateFileGenerationStop } -// The state of the file download list has changed -type UpdateFileDownloads struct { - meta - // Total size of files in the file download list, in bytes - TotalSize int64 `json:"total_size"` - // Total number of files in the file download list - TotalCount int32 `json:"total_count"` - // Total downloaded size of files in the file download list, in bytes - DownloadedSize int64 `json:"downloaded_size"` -} - -func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateFileDownloads - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateFileDownloads) GetClass() string { - return ClassUpdate -} - -func (*UpdateFileDownloads) GetType() string { - return TypeUpdateFileDownloads -} - -func (*UpdateFileDownloads) UpdateType() string { - return TypeUpdateFileDownloads -} - -// A file was added to the file download list. This update is sent only after file download list is loaded for the first time -type UpdateFileAddedToDownloads struct { - meta - // The added file download - FileDownload *FileDownload `json:"file_download"` - // New number of being downloaded and recently downloaded files found - Counts *DownloadedFileCounts `json:"counts"` -} - -func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateFileAddedToDownloads - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateFileAddedToDownloads) GetClass() string { - return ClassUpdate -} - -func (*UpdateFileAddedToDownloads) GetType() string { - return TypeUpdateFileAddedToDownloads -} - -func (*UpdateFileAddedToDownloads) UpdateType() string { - return TypeUpdateFileAddedToDownloads -} - -// A file download was changed. This update is sent only after file download list is loaded for the first time -type UpdateFileDownload struct { - meta - // File identifier - FileId int32 `json:"file_id"` - // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed - CompleteDate int32 `json:"complete_date"` - // True, if downloading of the file is paused - IsPaused bool `json:"is_paused"` - // New number of being downloaded and recently downloaded files found - Counts *DownloadedFileCounts `json:"counts"` -} - -func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateFileDownload - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateFileDownload) GetClass() string { - return ClassUpdate -} - -func (*UpdateFileDownload) GetType() string { - return TypeUpdateFileDownload -} - -func (*UpdateFileDownload) UpdateType() string { - return TypeUpdateFileDownload -} - -// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time -type UpdateFileRemovedFromDownloads struct { - meta - // File identifier - FileId int32 `json:"file_id"` - // New number of being downloaded and recently downloaded files found - Counts *DownloadedFileCounts `json:"counts"` -} - -func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateFileRemovedFromDownloads - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateFileRemovedFromDownloads) GetClass() string { - return ClassUpdate -} - -func (*UpdateFileRemovedFromDownloads) GetType() string { - return TypeUpdateFileRemovedFromDownloads -} - -func (*UpdateFileRemovedFromDownloads) UpdateType() string { - return TypeUpdateFileRemovedFromDownloads -} - // New call was created or information about a call was updated type UpdateCall struct { meta @@ -32841,33 +31281,6 @@ func (*UpdateSavedAnimations) UpdateType() string { return TypeUpdateSavedAnimations } -// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time -type UpdateSavedNotificationSounds struct { - meta - // The new list of identifiers of saved notification sounds - NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` -} - -func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateSavedNotificationSounds - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateSavedNotificationSounds) GetClass() string { - return ClassUpdate -} - -func (*UpdateSavedNotificationSounds) GetType() string { - return TypeUpdateSavedNotificationSounds -} - -func (*UpdateSavedNotificationSounds) UpdateType() string { - return TypeUpdateSavedNotificationSounds -} - // The selected background has changed type UpdateSelectedBackground struct { meta @@ -33054,87 +31467,6 @@ func (*UpdateUsersNearby) UpdateType() string { return TypeUpdateUsersNearby } -// The list of bots added to attachment menu has changed -type UpdateAttachmentMenuBots struct { - meta - // The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen - Bots []*AttachmentMenuBot `json:"bots"` -} - -func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateAttachmentMenuBots - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateAttachmentMenuBots) GetClass() string { - return ClassUpdate -} - -func (*UpdateAttachmentMenuBots) GetType() string { - return TypeUpdateAttachmentMenuBots -} - -func (*UpdateAttachmentMenuBots) UpdateType() string { - return TypeUpdateAttachmentMenuBots -} - -// A message was sent by an opened web app, so the web app needs to be closed -type UpdateWebAppMessageSent struct { - meta - // Identifier of web app launch - WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` -} - -func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateWebAppMessageSent - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateWebAppMessageSent) GetClass() string { - return ClassUpdate -} - -func (*UpdateWebAppMessageSent) GetType() string { - return TypeUpdateWebAppMessageSent -} - -func (*UpdateWebAppMessageSent) UpdateType() string { - return TypeUpdateWebAppMessageSent -} - -// The list of supported reactions has changed -type UpdateReactions struct { - meta - // The new list of supported reactions - Reactions []*Reaction `json:"reactions"` -} - -func (entity *UpdateReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateReactions - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateReactions) GetClass() string { - return ClassUpdate -} - -func (*UpdateReactions) GetType() string { - return TypeUpdateReactions -} - -func (*UpdateReactions) UpdateType() string { - return TypeUpdateReactions -} - // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -33280,7 +31612,7 @@ type UpdateNewInlineQuery struct { SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` - // The type of the chat from which the query originated; may be null if unknown + // The type of the chat, from which the query originated; may be null if unknown ChatType ChatType `json:"chat_type"` // Text of the query Query string `json:"query"` @@ -33379,7 +31711,7 @@ type UpdateNewCallbackQuery struct { SenderUserId int64 `json:"sender_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` - // Identifier of the message from which the query originated + // Identifier of the message, from which the query originated MessageId int64 `json:"message_id"` // Identifier that uniquely corresponds to the chat to which the message was sent ChatInstance JsonInt64 `json:"chat_instance"` @@ -33441,7 +31773,7 @@ type UpdateNewInlineCallbackQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int64 `json:"sender_user_id"` - // Identifier of the inline message from which the query originated + // Identifier of the inline message, from which the query originated InlineMessageId string `json:"inline_message_id"` // An identifier uniquely corresponding to the chat a message was sent to ChatInstance JsonInt64 `json:"chat_instance"` diff --git a/client/unmarshaler.go b/client/unmarshaler.go index bfefaa5..8c5bac0 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -163,23 +163,20 @@ func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatGif: - return UnmarshalThumbnailFormatGif(data) - - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) - case TypeThumbnailFormatPng: return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) + + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatWebm: - return UnmarshalThumbnailFormatWebm(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -240,46 +237,6 @@ func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) { return list, nil } -func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeStickerTypeStatic: - return UnmarshalStickerTypeStatic(data) - - case TypeStickerTypeAnimated: - return UnmarshalStickerTypeAnimated(data) - - case TypeStickerTypeVideo: - return UnmarshalStickerTypeVideo(data) - - case TypeStickerTypeMask: - return UnmarshalStickerTypeMask(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfStickerType(dataList []json.RawMessage) ([]StickerType, error) { - list := []StickerType{} - - for _, data := range dataList { - entity, err := UnmarshalStickerType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalPollType(data json.RawMessage) (PollType, error) { var meta meta @@ -938,9 +895,6 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeKeyboardButtonTypeWebApp: - return UnmarshalKeyboardButtonTypeWebApp(data) - default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -975,9 +929,6 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) - case TypeInlineKeyboardButtonTypeWebApp: - return UnmarshalInlineKeyboardButtonTypeWebApp(data) - case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -1852,12 +1803,6 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) - case TypeMessageWebAppDataSent: - return UnmarshalMessageWebAppDataSent(data) - - case TypeMessageWebAppDataReceived: - return UnmarshalMessageWebAppDataReceived(data) - case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -1934,9 +1879,6 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) - case TypeTextEntityTypeSpoiler: - return UnmarshalTextEntityTypeSpoiler(data) - case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -2138,9 +2080,6 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) - case TypeSearchMessagesFilterUnreadReaction: - return UnmarshalSearchMessagesFilterUnreadReaction(data) - case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -2714,15 +2653,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -2732,63 +2671,60 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberInvited: - return UnmarshalChatEventMemberInvited(data) - case TypeChatEventMemberLeft: return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberInvited: + return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventAvailableReactionsChanged: - return UnmarshalChatEventAvailableReactionsChanged(data) - - case TypeChatEventDescriptionChanged: - return UnmarshalChatEventDescriptionChanged(data) - - case TypeChatEventLinkedChatChanged: - return UnmarshalChatEventLinkedChatChanged(data) - - case TypeChatEventLocationChanged: - return UnmarshalChatEventLocationChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) case TypeChatEventPermissionsChanged: return UnmarshalChatEventPermissionsChanged(data) - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) + case TypeChatEventDescriptionChanged: + return UnmarshalChatEventDescriptionChanged(data) case TypeChatEventUsernameChanged: return UnmarshalChatEventUsernameChanged(data) - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) case TypeChatEventInvitesToggled: return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventIsAllHistoryAvailableToggled: - return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) + + case TypeChatEventIsAllHistoryAvailableToggled: + return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -2804,15 +2740,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3644,12 +3580,6 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) - - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) - case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -3684,9 +3614,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: - return UnmarshalInternalLinkTypeAttachmentMenuBot(data) - case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -3699,9 +3626,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(data) - case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -3717,9 +3641,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) - case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -3732,9 +3653,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) - case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -3762,9 +3680,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUserPhoneNumber: - return UnmarshalInternalLinkTypeUserPhoneNumber(data) - case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -3808,9 +3723,6 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) - case TypeFileTypeNotificationSound: - return UnmarshalFileTypeNotificationSound(data) - case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -4192,6 +4104,40 @@ func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { return list, nil } +func UnmarshalInputSticker(data json.RawMessage) (InputSticker, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStickerStatic: + return UnmarshalInputStickerStatic(data) + + case TypeInputStickerAnimated: + return UnmarshalInputStickerAnimated(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputSticker(dataList []json.RawMessage) ([]InputSticker, error) { + list := []InputSticker{} + + for _, data := range dataList { + entity, err := UnmarshalInputSticker(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { var meta meta @@ -4388,9 +4334,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) - case TypeUpdateMessageUnreadReactions: - return UnmarshalUpdateMessageUnreadReactions(data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -4421,9 +4364,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatAvailableReactions: - return UnmarshalUpdateChatAvailableReactions(data) - case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) @@ -4448,9 +4388,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) - case TypeUpdateChatUnreadReactionCount: - return UnmarshalUpdateChatUnreadReactionCount(data) - case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -4532,18 +4469,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) - case TypeUpdateFileDownloads: - return UnmarshalUpdateFileDownloads(data) - - case TypeUpdateFileAddedToDownloads: - return UnmarshalUpdateFileAddedToDownloads(data) - - case TypeUpdateFileDownload: - return UnmarshalUpdateFileDownload(data) - - case TypeUpdateFileRemovedFromDownloads: - return UnmarshalUpdateFileRemovedFromDownloads(data) - case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -4586,9 +4511,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) - case TypeUpdateSavedNotificationSounds: - return UnmarshalUpdateSavedNotificationSounds(data) - case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -4607,15 +4529,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) - case TypeUpdateAttachmentMenuBots: - return UnmarshalUpdateAttachmentMenuBots(data) - - case TypeUpdateWebAppMessageSent: - return UnmarshalUpdateWebAppMessageSent(data) - - case TypeUpdateReactions: - return UnmarshalUpdateReactions(data) - case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -5024,22 +4937,6 @@ func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, e return &resp, err } -func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { - var resp ThumbnailFormatGif - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { - var resp ThumbnailFormatMpeg4 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { var resp ThumbnailFormatPng @@ -5048,6 +4945,22 @@ func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, err return &resp, err } +func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { + var resp ThumbnailFormatWebp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { + var resp ThumbnailFormatGif + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, error) { var resp ThumbnailFormatTgs @@ -5056,16 +4969,8 @@ func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, err return &resp, err } -func UnmarshalThumbnailFormatWebm(data json.RawMessage) (*ThumbnailFormatWebm, error) { - var resp ThumbnailFormatWebm - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { - var resp ThumbnailFormatWebp +func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { + var resp ThumbnailFormatMpeg4 err := json.Unmarshal(data, &resp) @@ -5120,38 +5025,6 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { return &resp, err } -func UnmarshalStickerTypeStatic(data json.RawMessage) (*StickerTypeStatic, error) { - var resp StickerTypeStatic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerTypeAnimated(data json.RawMessage) (*StickerTypeAnimated, error) { - var resp StickerTypeAnimated - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerTypeVideo(data json.RawMessage) (*StickerTypeVideo, error) { - var resp StickerTypeVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) { - var resp StickerTypeMask - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { var resp ClosedVectorPath @@ -5360,14 +5233,6 @@ func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { return &resp, err } -func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { - var resp BotMenuButton - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { var resp ChatLocation @@ -5424,22 +5289,6 @@ func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnim return &resp, err } -func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { - var resp ChatPermissions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { - var resp ChatAdministratorRights - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -5448,14 +5297,6 @@ func UnmarshalUser(data json.RawMessage) (*User, error) { return &resp, err } -func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { - var resp BotInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { var resp UserFullInfo @@ -5488,6 +5329,14 @@ func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, err return &resp, err } +func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { + var resp ChatPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { var resp ChatMemberStatusCreator @@ -5896,14 +5745,6 @@ func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) return &resp, err } -func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { - var resp MessageReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { var resp MessageInteractionInfo @@ -5912,14 +5753,6 @@ func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionI return &resp, err } -func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { - var resp UnreadReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { var resp MessageSendingStatePending @@ -6000,30 +5833,6 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) return &resp, err } -func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { - var resp FileDownload - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { - var resp DownloadedFileCounts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { - var resp FoundFileDownloads - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { var resp NotificationSettingsScopePrivateChats @@ -6336,14 +6145,6 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt return &resp, err } -func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { - var resp KeyboardButtonTypeWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { var resp KeyboardButton @@ -6368,14 +6169,6 @@ func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKey return &resp, err } -func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { - var resp InlineKeyboardButtonTypeWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { var resp InlineKeyboardButtonTypeCallback @@ -6480,14 +6273,6 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn return &resp, err } -func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { - var resp WebAppInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -7008,14 +6793,6 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) { return &resp, err } -func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { - var resp ThemeParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { var resp LabeledPricePart @@ -7096,6 +6873,14 @@ func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStr return &resp, err } +func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) { + var resp PaymentFormTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { var resp PaymentForm @@ -8072,22 +7857,6 @@ func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConn return &resp, err } -func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { - var resp MessageWebAppDataSent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { - var resp MessageWebAppDataReceived - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) { var resp MessagePassportDataSent @@ -8216,14 +7985,6 @@ func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityType return &resp, err } -func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { - var resp TextEntityTypeSpoiler - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { var resp TextEntityTypeCode @@ -8560,14 +8321,6 @@ func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMe return &resp, err } -func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { - var resp SearchMessagesFilterUnreadReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { var resp SearchMessagesFilterFailedToSend @@ -8952,30 +8705,6 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } -func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { - var resp GroupCallStream - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { - var resp GroupCallStreams - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { - var resp RtmpUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { var resp GroupCallRecentSpeaker @@ -9104,38 +8833,6 @@ func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNum return &resp, err } -func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { - var resp AddedReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { - var resp AddedReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { - var resp AvailableReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReaction(data json.RawMessage) (*Reaction, error) { - var resp Reaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { var resp Animations @@ -9168,30 +8865,6 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) return &resp, err } -func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { - var resp AttachmentMenuBotColor - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { - var resp AttachmentMenuBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { - var resp SentWebAppMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { var resp HttpUrl @@ -9472,6 +9145,14 @@ func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDe return &resp, err } +func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { + var resp ChatEventPollStopped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { var resp ChatEventMessagePinned @@ -9488,14 +9169,6 @@ func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageU return &resp, err } -func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { - var resp ChatEventPollStopped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { var resp ChatEventMemberJoined @@ -9520,16 +9193,16 @@ func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMe return &resp, err } -func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { - var resp ChatEventMemberInvited +func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { + var resp ChatEventMemberLeft err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { - var resp ChatEventMemberLeft +func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { + var resp ChatEventMemberInvited err := json.Unmarshal(data, &resp) @@ -9552,40 +9225,8 @@ func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberR return &resp, err } -func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { - var resp ChatEventAvailableReactionsChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) { - var resp ChatEventDescriptionChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { - var resp ChatEventLinkedChatChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { - var resp ChatEventLocationChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { - var resp ChatEventMessageTtlChanged +func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { + var resp ChatEventTitleChanged err := json.Unmarshal(data, &resp) @@ -9600,32 +9241,8 @@ func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermi return &resp, err } -func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { - var resp ChatEventPhotoChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { - var resp ChatEventSlowModeDelayChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { - var resp ChatEventStickerSetChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { - var resp ChatEventTitleChanged +func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) { + var resp ChatEventDescriptionChanged err := json.Unmarshal(data, &resp) @@ -9640,8 +9257,8 @@ func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsername return &resp, err } -func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { - var resp ChatEventHasProtectedContentToggled +func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { + var resp ChatEventPhotoChanged err := json.Unmarshal(data, &resp) @@ -9656,8 +9273,24 @@ func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesTo return &resp, err } -func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { - var resp ChatEventIsAllHistoryAvailableToggled +func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { + var resp ChatEventLinkedChatChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { + var resp ChatEventMessageTtlChanged err := json.Unmarshal(data, &resp) @@ -9672,6 +9305,38 @@ func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSign return &resp, err } +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { + var resp ChatEventStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { + var resp ChatEventLocationChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { + var resp ChatEventIsAllHistoryAvailableToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { var resp ChatEventInviteLinkEdited @@ -9712,14 +9377,6 @@ func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChat return &resp, err } -func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { - var resp ChatEventVideoChatMuteNewParticipantsToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { var resp ChatEventVideoChatParticipantIsMutedToggled @@ -9736,6 +9393,14 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa return &resp, err } +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { var resp ChatEvent @@ -10448,22 +10113,6 @@ func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGro return &resp, err } -func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) { - var resp NotificationSound - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) { - var resp NotificationSounds - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalNotification(data json.RawMessage) (*Notification, error) { var resp Notification @@ -10800,22 +10449,6 @@ func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, return &resp, err } -func UnmarshalChatReportReasonIllegalDrugs(data json.RawMessage) (*ChatReportReasonIllegalDrugs, error) { - var resp ChatReportReasonIllegalDrugs - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatReportReasonPersonalDetails(data json.RawMessage) (*ChatReportReasonPersonalDetails, error) { - var resp ChatReportReasonPersonalDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { var resp ChatReportReasonCustom @@ -10832,14 +10465,6 @@ func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLin return &resp, err } -func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) { - var resp InternalLinkTypeAttachmentMenuBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { var resp InternalLinkTypeAuthenticationCode @@ -10872,14 +10497,6 @@ func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) { - var resp InternalLinkTypeBotAddToChannel - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { var resp InternalLinkTypeChangePhoneNumber @@ -10920,14 +10537,6 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { - var resp InternalLinkTypeLanguageSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { var resp InternalLinkTypeMessage @@ -10960,14 +10569,6 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } -func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { - var resp InternalLinkTypePrivacyAndSecuritySettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { var resp InternalLinkTypeProxy @@ -11040,14 +10641,6 @@ func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalL return &resp, err } -func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { - var resp InternalLinkTypeUserPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { var resp InternalLinkTypeVideoChat @@ -11112,14 +10705,6 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) return &resp, err } -func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { - var resp FileTypeNotificationSound - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { var resp FileTypePhoto @@ -11616,8 +11201,16 @@ func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { return &resp, err } -func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { - var resp InputSticker +func UnmarshalInputStickerStatic(data json.RawMessage) (*InputStickerStatic, error) { + var resp InputStickerStatic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStickerAnimated(data json.RawMessage) (*InputStickerAnimated, error) { + var resp InputStickerAnimated err := json.Unmarshal(data, &resp) @@ -11888,14 +11481,6 @@ func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMent return &resp, err } -func UnmarshalUpdateMessageUnreadReactions(data json.RawMessage) (*UpdateMessageUnreadReactions, error) { - var resp UpdateMessageUnreadReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { var resp UpdateMessageLiveLocationViewed @@ -11976,14 +11561,6 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } -func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { - var resp UpdateChatAvailableReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { var resp UpdateChatDraftMessage @@ -12048,14 +11625,6 @@ func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnr return &resp, err } -func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUnreadReactionCount, error) { - var resp UpdateChatUnreadReactionCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { var resp UpdateChatVideoChat @@ -12272,38 +11841,6 @@ func UnmarshalUpdateFileGenerationStop(data json.RawMessage) (*UpdateFileGenerat return &resp, err } -func UnmarshalUpdateFileDownloads(data json.RawMessage) (*UpdateFileDownloads, error) { - var resp UpdateFileDownloads - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateFileAddedToDownloads(data json.RawMessage) (*UpdateFileAddedToDownloads, error) { - var resp UpdateFileAddedToDownloads - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateFileDownload(data json.RawMessage) (*UpdateFileDownload, error) { - var resp UpdateFileDownload - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateFileRemovedFromDownloads(data json.RawMessage) (*UpdateFileRemovedFromDownloads, error) { - var resp UpdateFileRemovedFromDownloads - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { var resp UpdateCall @@ -12416,14 +11953,6 @@ func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimation return &resp, err } -func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) { - var resp UpdateSavedNotificationSounds - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { var resp UpdateSelectedBackground @@ -12472,30 +12001,6 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error return &resp, err } -func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) { - var resp UpdateAttachmentMenuBots - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) { - var resp UpdateWebAppMessageSent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateReactions(data json.RawMessage) (*UpdateReactions, error) { - var resp UpdateReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -12851,23 +12356,20 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatGif: - return UnmarshalThumbnailFormatGif(data) - - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) - case TypeThumbnailFormatPng: return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) + + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatWebm: - return UnmarshalThumbnailFormatWebm(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) case TypeThumbnail: return UnmarshalThumbnail(data) @@ -12887,18 +12389,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMaskPosition: return UnmarshalMaskPosition(data) - case TypeStickerTypeStatic: - return UnmarshalStickerTypeStatic(data) - - case TypeStickerTypeAnimated: - return UnmarshalStickerTypeAnimated(data) - - case TypeStickerTypeVideo: - return UnmarshalStickerTypeVideo(data) - - case TypeStickerTypeMask: - return UnmarshalStickerTypeMask(data) - case TypeClosedVectorPath: return UnmarshalClosedVectorPath(data) @@ -12977,9 +12467,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommands: return UnmarshalBotCommands(data) - case TypeBotMenuButton: - return UnmarshalBotMenuButton(data) - case TypeChatLocation: return UnmarshalChatLocation(data) @@ -13001,18 +12488,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputChatPhotoAnimation: return UnmarshalInputChatPhotoAnimation(data) - case TypeChatPermissions: - return UnmarshalChatPermissions(data) - - case TypeChatAdministratorRights: - return UnmarshalChatAdministratorRights(data) - case TypeUser: return UnmarshalUser(data) - case TypeBotInfo: - return UnmarshalBotInfo(data) - case TypeUserFullInfo: return UnmarshalUserFullInfo(data) @@ -13025,6 +12503,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministrators: return UnmarshalChatAdministrators(data) + case TypeChatPermissions: + return UnmarshalChatPermissions(data) + case TypeChatMemberStatusCreator: return UnmarshalChatMemberStatusCreator(data) @@ -13178,15 +12659,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageReplyInfo: return UnmarshalMessageReplyInfo(data) - case TypeMessageReaction: - return UnmarshalMessageReaction(data) - case TypeMessageInteractionInfo: return UnmarshalMessageInteractionInfo(data) - case TypeUnreadReaction: - return UnmarshalUnreadReaction(data) - case TypeMessageSendingStatePending: return UnmarshalMessageSendingStatePending(data) @@ -13217,15 +12692,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) - case TypeFileDownload: - return UnmarshalFileDownload(data) - - case TypeDownloadedFileCounts: - return UnmarshalDownloadedFileCounts(data) - - case TypeFoundFileDownloads: - return UnmarshalFoundFileDownloads(data) - case TypeNotificationSettingsScopePrivateChats: return UnmarshalNotificationSettingsScopePrivateChats(data) @@ -13343,9 +12809,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeKeyboardButtonTypeWebApp: - return UnmarshalKeyboardButtonTypeWebApp(data) - case TypeKeyboardButton: return UnmarshalKeyboardButton(data) @@ -13355,9 +12818,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) - case TypeInlineKeyboardButtonTypeWebApp: - return UnmarshalInlineKeyboardButtonTypeWebApp(data) - case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -13397,9 +12857,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLoginUrlInfoRequestConfirmation: return UnmarshalLoginUrlInfoRequestConfirmation(data) - case TypeWebAppInfo: - return UnmarshalWebAppInfo(data) - case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) @@ -13595,9 +13052,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddress: return UnmarshalAddress(data) - case TypeThemeParameters: - return UnmarshalThemeParameters(data) - case TypeLabeledPricePart: return UnmarshalLabeledPricePart(data) @@ -13628,6 +13082,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaymentsProviderStripe: return UnmarshalPaymentsProviderStripe(data) + case TypePaymentFormTheme: + return UnmarshalPaymentFormTheme(data) + case TypePaymentForm: return UnmarshalPaymentForm(data) @@ -13994,12 +13451,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) - case TypeMessageWebAppDataSent: - return UnmarshalMessageWebAppDataSent(data) - - case TypeMessageWebAppDataReceived: - return UnmarshalMessageWebAppDataReceived(data) - case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -14048,9 +13499,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) - case TypeTextEntityTypeSpoiler: - return UnmarshalTextEntityTypeSpoiler(data) - case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -14177,9 +13625,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) - case TypeSearchMessagesFilterUnreadReaction: - return UnmarshalSearchMessagesFilterUnreadReaction(data) - case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -14324,15 +13769,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) - case TypeGroupCallStream: - return UnmarshalGroupCallStream(data) - - case TypeGroupCallStreams: - return UnmarshalGroupCallStreams(data) - - case TypeRtmpUrl: - return UnmarshalRtmpUrl(data) - case TypeGroupCallRecentSpeaker: return UnmarshalGroupCallRecentSpeaker(data) @@ -14381,18 +13817,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePhoneNumberAuthenticationSettings: return UnmarshalPhoneNumberAuthenticationSettings(data) - case TypeAddedReaction: - return UnmarshalAddedReaction(data) - - case TypeAddedReactions: - return UnmarshalAddedReactions(data) - - case TypeAvailableReactions: - return UnmarshalAvailableReactions(data) - - case TypeReaction: - return UnmarshalReaction(data) - case TypeAnimations: return UnmarshalAnimations(data) @@ -14405,15 +13829,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeImportedContacts: return UnmarshalImportedContacts(data) - case TypeAttachmentMenuBotColor: - return UnmarshalAttachmentMenuBotColor(data) - - case TypeAttachmentMenuBot: - return UnmarshalAttachmentMenuBot(data) - - case TypeSentWebAppMessage: - return UnmarshalSentWebAppMessage(data) - case TypeHttpUrl: return UnmarshalHttpUrl(data) @@ -14519,15 +13934,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -14537,63 +13952,60 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberInvited: - return UnmarshalChatEventMemberInvited(data) - case TypeChatEventMemberLeft: return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberInvited: + return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventAvailableReactionsChanged: - return UnmarshalChatEventAvailableReactionsChanged(data) - - case TypeChatEventDescriptionChanged: - return UnmarshalChatEventDescriptionChanged(data) - - case TypeChatEventLinkedChatChanged: - return UnmarshalChatEventLinkedChatChanged(data) - - case TypeChatEventLocationChanged: - return UnmarshalChatEventLocationChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) case TypeChatEventPermissionsChanged: return UnmarshalChatEventPermissionsChanged(data) - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) + case TypeChatEventDescriptionChanged: + return UnmarshalChatEventDescriptionChanged(data) case TypeChatEventUsernameChanged: return UnmarshalChatEventUsernameChanged(data) - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) case TypeChatEventInvitesToggled: return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventIsAllHistoryAvailableToggled: - return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) + + case TypeChatEventIsAllHistoryAvailableToggled: + return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -14609,15 +14021,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEvent: return UnmarshalChatEvent(data) @@ -14885,12 +14297,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroupTypeCalls: return UnmarshalNotificationGroupTypeCalls(data) - case TypeNotificationSound: - return UnmarshalNotificationSound(data) - - case TypeNotificationSounds: - return UnmarshalNotificationSounds(data) - case TypeNotification: return UnmarshalNotification(data) @@ -15017,21 +14423,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) - - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) - case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: - return UnmarshalInternalLinkTypeAttachmentMenuBot(data) - case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -15044,9 +14441,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(data) - case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -15062,9 +14456,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) - case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -15077,9 +14468,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) - case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -15107,9 +14495,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUserPhoneNumber: - return UnmarshalInternalLinkTypeUserPhoneNumber(data) - case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -15134,9 +14519,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) - case TypeFileTypeNotificationSound: - return UnmarshalFileTypeNotificationSound(data) - case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -15323,8 +14705,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxies: return UnmarshalProxies(data) - case TypeInputSticker: - return UnmarshalInputSticker(data) + case TypeInputStickerStatic: + return UnmarshalInputStickerStatic(data) + + case TypeInputStickerAnimated: + return UnmarshalInputStickerAnimated(data) case TypeDateRange: return UnmarshalDateRange(data) @@ -15425,9 +14810,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) - case TypeUpdateMessageUnreadReactions: - return UnmarshalUpdateMessageUnreadReactions(data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -15458,9 +14840,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatAvailableReactions: - return UnmarshalUpdateChatAvailableReactions(data) - case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) @@ -15485,9 +14864,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) - case TypeUpdateChatUnreadReactionCount: - return UnmarshalUpdateChatUnreadReactionCount(data) - case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -15569,18 +14945,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) - case TypeUpdateFileDownloads: - return UnmarshalUpdateFileDownloads(data) - - case TypeUpdateFileAddedToDownloads: - return UnmarshalUpdateFileAddedToDownloads(data) - - case TypeUpdateFileDownload: - return UnmarshalUpdateFileDownload(data) - - case TypeUpdateFileRemovedFromDownloads: - return UnmarshalUpdateFileRemovedFromDownloads(data) - case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -15623,9 +14987,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) - case TypeUpdateSavedNotificationSounds: - return UnmarshalUpdateSavedNotificationSounds(data) - case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -15644,15 +15005,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) - case TypeUpdateAttachmentMenuBots: - return UnmarshalUpdateAttachmentMenuBots(data) - - case TypeUpdateWebAppMessageSent: - return UnmarshalUpdateWebAppMessageSent(data) - - case TypeUpdateReactions: - return UnmarshalUpdateReactions(data) - case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) diff --git a/data/td_api.json b/data/td_api.json index 2d04387..fd374de 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -315,7 +315,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other" + "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other" } ] }, @@ -332,7 +332,7 @@ { "name": "min_user_age", "type": "int32", - "description": "The minimum age of a user to be able to accept the terms; 0 if age isn't restricted" + "description": "The minimum age of a user to be able to accept the terms; 0 if any" }, { "name": "show_popup", @@ -568,7 +568,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" + "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -742,42 +742,36 @@ "class": "ThumbnailFormat", "properties": [] }, - { - "name": "thumbnailFormatGif", - "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatMpeg4", - "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", - "class": "ThumbnailFormat", - "properties": [] - }, { "name": "thumbnailFormatPng", "description": "The thumbnail is in PNG format. It will be used only for background patterns", "class": "ThumbnailFormat", "properties": [] }, - { - "name": "thumbnailFormatTgs", - "description": "The thumbnail is in TGS format. It will be used only for TGS sticker sets", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatWebm", - "description": "The thumbnail is in WEBM format. It will be used only for WEBM sticker sets", - "class": "ThumbnailFormat", - "properties": [] - }, { "name": "thumbnailFormatWebp", "description": "The thumbnail is in WEBP format. It will be used only for some stickers", "class": "ThumbnailFormat", "properties": [] }, + { + "name": "thumbnailFormatGif", + "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatTgs", + "description": "The thumbnail is in TGS format. It will be used only for animated sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatMpeg4", + "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", + "class": "ThumbnailFormat", + "properties": [] + }, { "name": "thumbnail", "description": "Represents a thumbnail", @@ -856,36 +850,6 @@ } ] }, - { - "name": "stickerTypeStatic", - "description": "The sticker is an image in WEBP format", - "class": "StickerType", - "properties": [] - }, - { - "name": "stickerTypeAnimated", - "description": "The sticker is an animation in TGS format", - "class": "StickerType", - "properties": [] - }, - { - "name": "stickerTypeVideo", - "description": "The sticker is a video in WEBM format", - "class": "StickerType", - "properties": [] - }, - { - "name": "stickerTypeMask", - "description": "The sticker is a mask in WEBP format to be placed on photos or videos", - "class": "StickerType", - "properties": [ - { - "name": "mask_position", - "type": "maskPosition", - "description": "Position where the mask is placed; may be null" - } - ] - }, { "name": "closedVectorPath", "description": "Represents a closed vector path. The path begins at the end point of the last command", @@ -1138,9 +1102,19 @@ "description": "Emoji corresponding to the sticker" }, { - "name": "type", - "type": "StickerType", - "description": "Sticker type" + "name": "is_animated", + "type": "Bool", + "description": "True, if the sticker is an animated sticker in TGS format" + }, + { + "name": "is_mask", + "type": "Bool", + "description": "True, if the sticker is a mask" + }, + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; may be null" }, { "name": "outline", @@ -1293,7 +1267,7 @@ { "name": "sound", "type": "file", - "description": "File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" + "description": "File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" } ] }, @@ -1587,11 +1561,6 @@ "name": "need_location", "type": "Bool", "description": "True, if the location of the user is expected to be sent with every inline query to this bot" - }, - { - "name": "can_be_added_to_attachment_menu", - "type": "Bool", - "description": "True, if the bot can be added to attachment menu" } ] }, @@ -1635,23 +1604,6 @@ } ] }, - { - "name": "botMenuButton", - "description": "Describes a button to be shown instead of bot commands menu button", - "class": "BotMenuButton", - "properties": [ - { - "name": "text", - "type": "string", - "description": "Text of the button" - }, - { - "name": "url", - "type": "string", - "description": "URL to be passed to openWebApp" - } - ] - }, { "name": "chatLocation", "description": "Represents a location to which a chat is connected", @@ -1781,115 +1733,6 @@ } ] }, - { - "name": "chatPermissions", - "description": "Describes actions that a user is allowed to take in a chat", - "class": "ChatPermissions", - "properties": [ - { - "name": "can_send_messages", - "type": "Bool", - "description": "True, if the user can send text messages, contacts, locations, and venues" - }, - { - "name": "can_send_media_messages", - "type": "Bool", - "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" - }, - { - "name": "can_send_polls", - "type": "Bool", - "description": "True, if the user can send polls. Implies can_send_messages permissions" - }, - { - "name": "can_send_other_messages", - "type": "Bool", - "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" - }, - { - "name": "can_add_web_page_previews", - "type": "Bool", - "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the user can change the chat title, photo, and other settings" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the user can invite new users to the chat" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the user can pin messages" - } - ] - }, - { - "name": "chatAdministratorRights", - "description": "Describes rights of the administrator", - "class": "ChatAdministratorRights", - "properties": [ - { - "name": "can_manage_chat", - "type": "Bool", - "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the administrator can change the chat title, photo, and other settings" - }, - { - "name": "can_post_messages", - "type": "Bool", - "description": "True, if the administrator can create channel posts; applicable to channels only" - }, - { - "name": "can_edit_messages", - "type": "Bool", - "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" - }, - { - "name": "can_delete_messages", - "type": "Bool", - "description": "True, if the administrator can delete messages of other users" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the administrator can invite new users to the chat" - }, - { - "name": "can_restrict_members", - "type": "Bool", - "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" - }, - { - "name": "can_promote_members", - "type": "Bool", - "description": "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" - }, - { - "name": "can_manage_video_chats", - "type": "Bool", - "description": "True, if the administrator can manage video chats" - }, - { - "name": "is_anonymous", - "type": "Bool", - "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" - } - ] - }, { "name": "user", "description": "Represents a user", @@ -1968,7 +1811,7 @@ { "name": "have_access", "type": "Bool", - "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser" + "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser" }, { "name": "type", @@ -1982,43 +1825,6 @@ } ] }, - { - "name": "botInfo", - "description": "Contains information about a bot", - "class": "BotInfo", - "properties": [ - { - "name": "share_text", - "type": "string", - "description": "The text that is shown on the bot's profile page and is sent together with the link when users share the bot" - }, - { - "name": "description", - "type": "string", - "description": "The text shown in the chat with the bot if the chat is empty" - }, - { - "name": "menu_button", - "type": "botMenuButton", - "description": "Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown" - }, - { - "name": "commands", - "type": "vector\u003cbotCommand\u003e", - "description": "List of the bot commands" - }, - { - "name": "default_group_administrator_rights", - "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" - }, - { - "name": "default_channel_administrator_rights", - "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to channels; may be null" - } - ] - }, { "name": "userFullInfo", "description": "Contains full information about a user", @@ -2064,15 +1870,25 @@ "type": "string", "description": "A short user bio" }, + { + "name": "share_text", + "type": "string", + "description": "For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot" + }, + { + "name": "description", + "type": "string", + "description": "For bots, the text shown in the chat with the bot if the chat is empty" + }, { "name": "group_in_common_count", "type": "int32", "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" }, { - "name": "bot_info", - "type": "botInfo", - "description": "For bots, information about the bot; may be null" + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "For bots, list of the bot commands" } ] }, @@ -2084,7 +1900,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of users found" + "description": "Approximate total count of users found" }, { "name": "user_ids", @@ -2127,6 +1943,53 @@ } ] }, + { + "name": "chatPermissions", + "description": "Describes actions that a user is allowed to take in a chat", + "class": "ChatPermissions", + "properties": [ + { + "name": "can_send_messages", + "type": "Bool", + "description": "True, if the user can send text messages, contacts, locations, and venues" + }, + { + "name": "can_send_media_messages", + "type": "Bool", + "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" + }, + { + "name": "can_send_polls", + "type": "Bool", + "description": "True, if the user can send polls. Implies can_send_messages permissions" + }, + { + "name": "can_send_other_messages", + "type": "Bool", + "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" + }, + { + "name": "can_add_web_page_previews", + "type": "Bool", + "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the user can change the chat title, photo, and other settings" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the user can invite new users to the chat" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the user can pin messages" + } + ] + }, { "name": "chatMemberStatusCreator", "description": "The user is the owner of the chat and has all the administrator privileges", @@ -2165,9 +2028,59 @@ "description": "True, if the current user can edit the administrator privileges for the called user" }, { - "name": "rights", - "type": "chatAdministratorRights", - "description": "Rights of the administrator" + "name": "can_manage_chat", + "type": "Bool", + "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the administrator can change the chat title, photo, and other settings" + }, + { + "name": "can_post_messages", + "type": "Bool", + "description": "True, if the administrator can create channel posts; applicable to channels only" + }, + { + "name": "can_edit_messages", + "type": "Bool", + "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" + }, + { + "name": "can_delete_messages", + "type": "Bool", + "description": "True, if the administrator can delete messages of other users" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the administrator can invite new users to the chat" + }, + { + "name": "can_restrict_members", + "type": "Bool", + "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" + }, + { + "name": "can_promote_members", + "type": "Bool", + "description": "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" + }, + { + "name": "can_manage_video_chats", + "type": "Bool", + "description": "True, if the administrator can manage video chats" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" } ] }, @@ -2252,7 +2165,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of chat members found" + "description": "Approximate total count of chat members found" }, { "name": "members", @@ -2467,7 +2380,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of chat invite links found" + "description": "Approximate total count of chat invite links found" }, { "name": "invite_links", @@ -2540,7 +2453,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of chat members found" + "description": "Approximate total count of chat members found" }, { "name": "members", @@ -2636,7 +2549,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of requests found" + "description": "Approximate total count of requests found" }, { "name": "requests", @@ -2906,7 +2819,7 @@ { "name": "invite_link", "type": "chatInviteLink", - "description": "Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only" + "description": "Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only" }, { "name": "bot_commands", @@ -3012,7 +2925,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of messages senders found" + "description": "Approximate total count of messages senders found" }, { "name": "senders", @@ -3160,33 +3073,6 @@ } ] }, - { - "name": "messageReaction", - "description": "Contains information about a reaction to a message", - "class": "MessageReaction", - "properties": [ - { - "name": "reaction", - "type": "string", - "description": "Text representation of the reaction" - }, - { - "name": "total_count", - "type": "int32", - "description": "Number of times the reaction was added" - }, - { - "name": "is_chosen", - "type": "Bool", - "description": "True, if the reaction is chosen by the current user" - }, - { - "name": "recent_sender_ids", - "type": "vector\u003cMessageSender\u003e", - "description": "Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats" - } - ] - }, { "name": "messageInteractionInfo", "description": "Contains information about interactions with a message", @@ -3206,33 +3092,6 @@ "name": "reply_info", "type": "messageReplyInfo", "description": "Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself" - }, - { - "name": "reactions", - "type": "vector\u003cmessageReaction\u003e", - "description": "The list of reactions added to the message" - } - ] - }, - { - "name": "unreadReaction", - "description": "Contains information about an unread reaction to a message", - "class": "UnreadReaction", - "properties": [ - { - "name": "reaction", - "type": "string", - "description": "Text representation of the reaction" - }, - { - "name": "sender_id", - "type": "MessageSender", - "description": "Identifier of the sender, added the reaction" - }, - { - "name": "is_big", - "type": "Bool", - "description": "True, if the reaction was added with a big animation" } ] }, @@ -3339,20 +3198,15 @@ "type": "Bool", "description": "True, if the message can be deleted for all users" }, - { - "name": "can_get_added_reactions", - "type": "Bool", - "description": "True, if the list of added reactions is available through getMessageAddedReactions" - }, { "name": "can_get_statistics", "type": "Bool", - "description": "True, if the message statistics are available through getMessageStatistics" + "description": "True, if the message statistics are available" }, { "name": "can_get_message_thread", "type": "Bool", - "description": "True, if information about the message thread is available through getMessageThread" + "description": "True, if the message thread info is available" }, { "name": "can_get_viewers", @@ -3362,7 +3216,7 @@ { "name": "can_get_media_timestamp_links", "type": "Bool", - "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink" + "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description" }, { "name": "has_timestamped_media", @@ -3399,11 +3253,6 @@ "type": "messageInteractionInfo", "description": "Information about interactions with the message; may be null" }, - { - "name": "unread_reactions", - "type": "vector\u003cunreadReaction\u003e", - "description": "Information about unread reactions added to the message" - }, { "name": "reply_in_chat_id", "type": "int53", @@ -3469,7 +3318,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of messages found" + "description": "Approximate total count of messages found" }, { "name": "messages", @@ -3486,7 +3335,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of messages found; -1 if unknown" + "description": "Approximate total count of messages found; -1 if unknown" }, { "name": "messages", @@ -3530,7 +3379,7 @@ { "name": "total_count", "type": "int32", - "description": "Total number of messages found" + "description": "Total count of messages found" }, { "name": "positions", @@ -3586,17 +3435,12 @@ { "name": "sponsor_chat_id", "type": "int53", - "description": "Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link" - }, - { - "name": "sponsor_chat_info", - "type": "chatInviteLinkInfo", - "description": "Information about the sponsor chat; may be null unless sponsor_chat_id == 0" + "description": "Chat identifier" }, { "name": "link", "type": "InternalLinkType", - "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" + "description": "An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead" }, { "name": "content", @@ -3605,82 +3449,6 @@ } ] }, - { - "name": "fileDownload", - "description": "Describes a file added to file download list", - "class": "FileDownload", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "File identifier" - }, - { - "name": "message", - "type": "message", - "description": "The message with the file" - }, - { - "name": "add_date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the file was added to the download list" - }, - { - "name": "complete_date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" - }, - { - "name": "is_paused", - "type": "Bool", - "description": "True, if downloading of the file is paused" - } - ] - }, - { - "name": "downloadedFileCounts", - "description": "Contains number of being downloaded and recently downloaded files found", - "class": "DownloadedFileCounts", - "properties": [ - { - "name": "active_count", - "type": "int32", - "description": "Number of active file downloads found, including paused" - }, - { - "name": "paused_count", - "type": "int32", - "description": "Number of paused file downloads found" - }, - { - "name": "completed_count", - "type": "int32", - "description": "Number of completed file downloads found" - } - ] - }, - { - "name": "foundFileDownloads", - "description": "Contains a list of downloaded files, found by a search", - "class": "FoundFileDownloads", - "properties": [ - { - "name": "total_counts", - "type": "downloadedFileCounts", - "description": "Total number of suitable files, ignoring offset" - }, - { - "name": "files", - "type": "vector\u003cfileDownload\u003e", - "description": "The list of files" - }, - { - "name": "next_offset", - "type": "string", - "description": "The offset for the next request. If empty, there are no more results" - } - ] - }, { "name": "notificationSettingsScopePrivateChats", "description": "Notification settings applied to all private and secret chats when the corresponding chat setting has a default value", @@ -3689,13 +3457,13 @@ }, { "name": "notificationSettingsScopeGroupChats", - "description": "Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value", + "description": "Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "notificationSettingsScopeChannelChats", - "description": "Notification settings applied to all channel chats when the corresponding chat setting has a default value", + "description": "Notification settings applied to all channels when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, @@ -3717,12 +3485,12 @@ { "name": "use_default_sound", "type": "Bool", - "description": "If true, the value for the relevant type of chat is used instead of sound_id" + "description": "If true, sound is ignored and the value for the relevant type of chat is used instead" }, { - "name": "sound_id", - "type": "int64", - "description": "Identifier of the notification sound to be played; 0 if sound is disabled" + "name": "sound", + "type": "string", + "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" }, { "name": "use_default_show_preview", @@ -3767,9 +3535,9 @@ "description": "Time left before notifications will be unmuted, in seconds" }, { - "name": "sound_id", - "type": "int64", - "description": "Identifier of the notification sound to be played; 0 if sound is disabled" + "name": "sound", + "type": "string", + "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" }, { "name": "show_preview", @@ -3796,7 +3564,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "description": "Identifier of the message to reply to; 0 if none" }, { "name": "date", @@ -4204,20 +3972,10 @@ "type": "int32", "description": "Number of unread messages with a mention/reply in the chat" }, - { - "name": "unread_reaction_count", - "type": "int32", - "description": "Number of messages with unread reactions in the chat" - }, { "name": "notification_settings", "type": "chatNotificationSettings", - "description": "Notification settings for the chat" - }, - { - "name": "available_reactions", - "type": "vector\u003cstring\u003e", - "description": "List of reactions, available in the chat" + "description": "Notification settings for this chat" }, { "name": "message_ttl", @@ -4269,7 +4027,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total number of chats found" + "description": "Approximate total count of chats found" }, { "name": "chat_ids", @@ -4434,18 +4192,6 @@ } ] }, - { - "name": "keyboardButtonTypeWebApp", - "description": "A button that opens a web app by calling getWebAppUrl", - "class": "KeyboardButtonType", - "properties": [ - { - "name": "url", - "type": "string", - "description": "An HTTP URL to pass to getWebAppUrl" - } - ] - }, { "name": "keyboardButton", "description": "Represents a single button in a bot keyboard", @@ -4477,13 +4223,13 @@ }, { "name": "inlineKeyboardButtonTypeLoginUrl", - "description": "A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo", + "description": "A button that opens a specified URL and automatically authorize the current user if allowed to do so", "class": "InlineKeyboardButtonType", "properties": [ { "name": "url", "type": "string", - "description": "An HTTP URL to pass to getLoginUrlInfo" + "description": "An HTTP URL to open" }, { "name": "id", @@ -4497,18 +4243,6 @@ } ] }, - { - "name": "inlineKeyboardButtonTypeWebApp", - "description": "A button that opens a web app by calling openWebApp", - "class": "InlineKeyboardButtonType", - "properties": [ - { - "name": "url", - "type": "string", - "description": "An HTTP URL to pass to openWebApp" - } - ] - }, { "name": "inlineKeyboardButtonTypeCallback", "description": "A button that sends a callback query to a bot", @@ -4708,23 +4442,6 @@ } ] }, - { - "name": "webAppInfo", - "description": "Contains information about a web app", - "class": "WebAppInfo", - "properties": [ - { - "name": "launch_id", - "type": "int64", - "description": "Unique identifier for the web app launch" - }, - { - "name": "url", - "type": "string", - "description": "A web app URL to open in a web view" - } - ] - }, { "name": "messageThreadInfo", "description": "Contains information about a message thread", @@ -5595,7 +5312,7 @@ { "name": "username", "type": "string", - "description": "Chat username by which all other information about the chat can be resolved" + "description": "Chat username, by which all other information about the chat can be resolved" } ] }, @@ -5983,43 +5700,6 @@ } ] }, - { - "name": "themeParameters", - "description": "Contains parameters of the app theme", - "class": "ThemeParameters", - "properties": [ - { - "name": "background_color", - "type": "int32", - "description": "A color of the background in the RGB24 format" - }, - { - "name": "text_color", - "type": "int32", - "description": "A color of text in the RGB24 format" - }, - { - "name": "hint_color", - "type": "int32", - "description": "A color of hints in the RGB24 format" - }, - { - "name": "link_color", - "type": "int32", - "description": "A color of links in the RGB24 format" - }, - { - "name": "button_color", - "type": "int32", - "description": "A color of the buttons in the RGB24 format" - }, - { - "name": "button_text_color", - "type": "int32", - "description": "A color of text on the buttons in the RGB24 format" - } - ] - }, { "name": "labeledPricePart", "description": "Portion of the price of a product (e.g., \"delivery cost\", \"tax amount\")", @@ -6250,6 +5930,43 @@ } ] }, + { + "name": "paymentFormTheme", + "description": "Theme colors for a payment form", + "class": "PaymentFormTheme", + "properties": [ + { + "name": "background_color", + "type": "int32", + "description": "A color of the payment form background in the RGB24 format" + }, + { + "name": "text_color", + "type": "int32", + "description": "A color of text in the RGB24 format" + }, + { + "name": "hint_color", + "type": "int32", + "description": "A color of hints in the RGB24 format" + }, + { + "name": "link_color", + "type": "int32", + "description": "A color of links in the RGB24 format" + }, + { + "name": "button_color", + "type": "int32", + "description": "A color of the buttons in the RGB24 format" + }, + { + "name": "button_text_color", + "type": "int32", + "description": "A color of text on the buttons in the RGB24 format" + } + ] + }, { "name": "paymentForm", "description": "Contains information about an invoice payment form", @@ -8123,38 +7840,9 @@ } ] }, - { - "name": "messageWebAppDataSent", - "description": "Data from a web app has been sent to a bot", - "class": "MessageContent", - "properties": [ - { - "name": "button_text", - "type": "string", - "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" - } - ] - }, - { - "name": "messageWebAppDataReceived", - "description": "Data from a web app has been received; for bots only", - "class": "MessageContent", - "properties": [ - { - "name": "button_text", - "type": "string", - "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" - }, - { - "name": "data", - "type": "string", - "description": "Received data" - } - ] - }, { "name": "messagePassportDataSent", - "description": "Telegram Passport data has been sent to a bot", + "description": "Telegram Passport data has been sent", "class": "MessageContent", "properties": [ { @@ -8281,12 +7969,6 @@ "class": "TextEntityType", "properties": [] }, - { - "name": "textEntityTypeSpoiler", - "description": "A spoiler text. Not supported in secret chats", - "class": "TextEntityType", - "properties": [] - }, { "name": "textEntityTypeCode", "description": "Text that must be formatted as if inside a code HTML tag", @@ -8402,11 +8084,6 @@ "type": "Bool", "description": "Pass true if the message is sent from the background" }, - { - "name": "protect_content", - "type": "Bool", - "description": "Pass true if the content of the message must be protected from forwarding and saving; for bots only" - }, { "name": "scheduling_state", "type": "MessageSchedulingState", @@ -8444,7 +8121,7 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" + "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { "name": "disable_web_page_preview", @@ -9044,12 +8721,6 @@ "class": "SearchMessagesFilter", "properties": [] }, - { - "name": "searchMessagesFilterUnreadReaction", - "description": "Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user", - "class": "SearchMessagesFilter", - "properties": [] - }, { "name": "searchMessagesFilterFailedToSend", "description": "Returns only failed to send messages. This filter can be used only if the message database is used", @@ -9283,7 +8954,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" + "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" }, { "name": "thumbnail_outline", @@ -9306,9 +8977,14 @@ "description": "True, if the sticker set is official" }, { - "name": "sticker_type", - "type": "StickerType", - "description": "Type of the stickers in the set" + "name": "is_animated", + "type": "Bool", + "description": "True, is the stickers in the set are animated" + }, + { + "name": "is_masks", + "type": "Bool", + "description": "True, if the stickers in the set are masks" }, { "name": "is_viewed", @@ -9350,7 +9026,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" + "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" }, { "name": "thumbnail_outline", @@ -9373,9 +9049,14 @@ "description": "True, if the sticker set is official" }, { - "name": "sticker_type", - "type": "StickerType", - "description": "Type of the stickers in the set" + "name": "is_animated", + "type": "Bool", + "description": "True, is the stickers in the set are animated" + }, + { + "name": "is_masks", + "type": "Bool", + "description": "True, if the stickers in the set are masks" }, { "name": "is_viewed", @@ -9686,57 +9367,6 @@ "class": "GroupCallVideoQuality", "properties": [] }, - { - "name": "groupCallStream", - "description": "Describes an available stream in a group call", - "class": "GroupCallStream", - "properties": [ - { - "name": "channel_id", - "type": "int32", - "description": "Identifier of an audio/video channel" - }, - { - "name": "scale", - "type": "int32", - "description": "Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds" - }, - { - "name": "time_offset", - "type": "int53", - "description": "Point in time when the stream currently ends; Unix timestamp in milliseconds" - } - ] - }, - { - "name": "groupCallStreams", - "description": "Represents a list of group call streams", - "class": "GroupCallStreams", - "properties": [ - { - "name": "streams", - "type": "vector\u003cgroupCallStream\u003e", - "description": "A list of group call streams" - } - ] - }, - { - "name": "rtmpUrl", - "description": "Represents an RTMP url", - "class": "RtmpUrl", - "properties": [ - { - "name": "url", - "type": "string", - "description": "The URL" - }, - { - "name": "stream_key", - "type": "string", - "description": "Stream key" - } - ] - }, { "name": "groupCallRecentSpeaker", "description": "Describes a recently speaking participant in a group call", @@ -9784,11 +9414,6 @@ "type": "Bool", "description": "True, if the call is active" }, - { - "name": "is_rtmp_stream", - "type": "Bool", - "description": "True, if the chat is an RTMP stream instead of an ordinary video chat" - }, { "name": "is_joined", "type": "Bool", @@ -9809,11 +9434,6 @@ "type": "int32", "description": "Number of participants in the group call" }, - { - "name": "has_hidden_listeners", - "type": "Bool", - "description": "True, if group call participants, which are muted, aren't returned in participant list" - }, { "name": "loaded_all_participants", "type": "Bool", @@ -10120,114 +9740,6 @@ } ] }, - { - "name": "addedReaction", - "description": "Represents a reaction applied to a message", - "class": "AddedReaction", - "properties": [ - { - "name": "reaction", - "type": "string", - "description": "Text representation of the reaction" - }, - { - "name": "sender_id", - "type": "MessageSender", - "description": "Identifier of the chat member, applied the reaction" - } - ] - }, - { - "name": "addedReactions", - "description": "Represents a list of reactions added to a message", - "class": "AddedReactions", - "properties": [ - { - "name": "total_count", - "type": "int32", - "description": "The total number of found reactions" - }, - { - "name": "reactions", - "type": "vector\u003caddedReaction\u003e", - "description": "The list of added reactions" - }, - { - "name": "next_offset", - "type": "string", - "description": "The offset for the next request. If empty, there are no more results" - } - ] - }, - { - "name": "availableReactions", - "description": "Represents a list of available reactions", - "class": "AvailableReactions", - "properties": [ - { - "name": "reactions", - "type": "vector\u003cstring\u003e", - "description": "List of reactions" - } - ] - }, - { - "name": "reaction", - "description": "Contains stickers which must be used for reaction animation rendering", - "class": "Reaction", - "properties": [ - { - "name": "reaction", - "type": "string", - "description": "Text representation of the reaction" - }, - { - "name": "title", - "type": "string", - "description": "Reaction title" - }, - { - "name": "is_active", - "type": "Bool", - "description": "True, if the reaction can be added to new messages and enabled in chats" - }, - { - "name": "static_icon", - "type": "sticker", - "description": "Static icon for the reaction" - }, - { - "name": "appear_animation", - "type": "sticker", - "description": "Appear animation for the reaction" - }, - { - "name": "select_animation", - "type": "sticker", - "description": "Select animation for the reaction" - }, - { - "name": "activate_animation", - "type": "sticker", - "description": "Activate animation for the reaction" - }, - { - "name": "effect_animation", - "type": "sticker", - "description": "Effect animation for the reaction" - }, - { - "name": "around_animation", - "type": "sticker", - "description": "Around animation for the reaction; may be null" - }, - { - "name": "center_animation", - "type": "sticker", - "description": "Center animation for the reaction; may be null" - } - ] - }, { "name": "animations", "description": "Represents a list of animations", @@ -10301,87 +9813,6 @@ } ] }, - { - "name": "attachmentMenuBotColor", - "description": "Describes a color to highlight a bot added to attachment menu", - "class": "AttachmentMenuBotColor", - "properties": [ - { - "name": "light_color", - "type": "int32", - "description": "Color in the RGB24 format for light themes" - }, - { - "name": "dark_color", - "type": "int32", - "description": "Color in the RGB24 format for dark themes" - } - ] - }, - { - "name": "attachmentMenuBot", - "description": "Represents a bot added to attachment menu", - "class": "AttachmentMenuBot", - "properties": [ - { - "name": "bot_user_id", - "type": "int53", - "description": "User identifier of the bot added to attachment menu" - }, - { - "name": "name", - "type": "string", - "description": "Name for the bot in attachment menu" - }, - { - "name": "name_color", - "type": "attachmentMenuBotColor", - "description": "Color to highlight selected name of the bot if appropriate; may be null" - }, - { - "name": "default_icon", - "type": "file", - "description": "Default attachment menu icon for the bot in SVG format; may be null" - }, - { - "name": "ios_static_icon", - "type": "file", - "description": "Attachment menu icon for the bot in SVG format for the official iOS app; may be null" - }, - { - "name": "ios_animated_icon", - "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official iOS app; may be null" - }, - { - "name": "android_icon", - "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official Android app; may be null" - }, - { - "name": "macos_icon", - "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official native macOS app; may be null" - }, - { - "name": "icon_color", - "type": "attachmentMenuBotColor", - "description": "Color to highlight selected icon of the bot if appropriate; may be null" - } - ] - }, - { - "name": "sentWebAppMessage", - "description": "Information about the message sent by answerWebAppQuery", - "class": "SentWebAppMessage", - "properties": [ - { - "name": "inline_message_id", - "type": "string", - "description": "Identifier of the sent inline message, if known" - } - ] - }, { "name": "httpUrl", "description": "Contains an HTTP URL", @@ -10782,7 +10213,7 @@ }, { "name": "inputInlineQueryResultSticker", - "description": "Represents a link to a WEBP, TGS, or WEBM sticker", + "description": "Represents a link to a WEBP or TGS sticker", "class": "InputInlineQueryResult", "properties": [ { @@ -10798,7 +10229,7 @@ { "name": "sticker_url", "type": "string", - "description": "The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)" + "description": "The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)" }, { "name": "sticker_width", @@ -11417,6 +10848,18 @@ } ] }, + { + "name": "chatEventPollStopped", + "description": "A poll in a message was stopped", + "class": "ChatEventAction", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with the poll" + } + ] + }, { "name": "chatEventMessagePinned", "description": "A message was pinned", @@ -11441,18 +10884,6 @@ } ] }, - { - "name": "chatEventPollStopped", - "description": "A poll in a message was stopped", - "class": "ChatEventAction", - "properties": [ - { - "name": "message", - "type": "message", - "description": "The message with the poll" - } - ] - }, { "name": "chatEventMemberJoined", "description": "A new member joined the chat", @@ -11488,6 +10919,12 @@ } ] }, + { + "name": "chatEventMemberLeft", + "description": "A member left the chat", + "class": "ChatEventAction", + "properties": [] + }, { "name": "chatEventMemberInvited", "description": "A new chat member was invited", @@ -11505,12 +10942,6 @@ } ] }, - { - "name": "chatEventMemberLeft", - "description": "A member left the chat", - "class": "ChatEventAction", - "properties": [] - }, { "name": "chatEventMemberPromoted", "description": "A chat member has gained/lost administrator status, or the list of their administrator privileges has changed", @@ -11556,87 +10987,19 @@ ] }, { - "name": "chatEventAvailableReactionsChanged", - "description": "The chat available reactions were changed", + "name": "chatEventTitleChanged", + "description": "The chat title was changed", "class": "ChatEventAction", "properties": [ { - "name": "old_available_reactions", - "type": "vector\u003cstring\u003e", - "description": "Previous chat available reactions" - }, - { - "name": "new_available_reactions", - "type": "vector\u003cstring\u003e", - "description": "New chat available reactions" - } - ] - }, - { - "name": "chatEventDescriptionChanged", - "description": "The chat description was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_description", + "name": "old_title", "type": "string", - "description": "Previous chat description" + "description": "Previous chat title" }, { - "name": "new_description", + "name": "new_title", "type": "string", - "description": "New chat description" - } - ] - }, - { - "name": "chatEventLinkedChatChanged", - "description": "The linked chat of a supergroup was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_linked_chat_id", - "type": "int53", - "description": "Previous supergroup linked chat identifier" - }, - { - "name": "new_linked_chat_id", - "type": "int53", - "description": "New supergroup linked chat identifier" - } - ] - }, - { - "name": "chatEventLocationChanged", - "description": "The supergroup location was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_location", - "type": "chatLocation", - "description": "Previous location; may be null" - }, - { - "name": "new_location", - "type": "chatLocation", - "description": "New location; may be null" - } - ] - }, - { - "name": "chatEventMessageTtlChanged", - "description": "The message TTL was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_message_ttl", - "type": "int32", - "description": "Previous value of message_ttl" - }, - { - "name": "new_message_ttl", - "type": "int32", - "description": "New value of message_ttl" + "description": "New chat title" } ] }, @@ -11658,70 +11021,19 @@ ] }, { - "name": "chatEventPhotoChanged", - "description": "The chat photo was changed", + "name": "chatEventDescriptionChanged", + "description": "The chat description was changed", "class": "ChatEventAction", "properties": [ { - "name": "old_photo", - "type": "chatPhoto", - "description": "Previous chat photo value; may be null" - }, - { - "name": "new_photo", - "type": "chatPhoto", - "description": "New chat photo value; may be null" - } - ] - }, - { - "name": "chatEventSlowModeDelayChanged", - "description": "The slow_mode_delay setting of a supergroup was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_slow_mode_delay", - "type": "int32", - "description": "Previous value of slow_mode_delay, in seconds" - }, - { - "name": "new_slow_mode_delay", - "type": "int32", - "description": "New value of slow_mode_delay, in seconds" - } - ] - }, - { - "name": "chatEventStickerSetChanged", - "description": "The supergroup sticker set was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_sticker_set_id", - "type": "int64", - "description": "Previous identifier of the chat sticker set; 0 if none" - }, - { - "name": "new_sticker_set_id", - "type": "int64", - "description": "New identifier of the chat sticker set; 0 if none" - } - ] - }, - { - "name": "chatEventTitleChanged", - "description": "The chat title was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_title", + "name": "old_description", "type": "string", - "description": "Previous chat title" + "description": "Previous chat description" }, { - "name": "new_title", + "name": "new_description", "type": "string", - "description": "New chat title" + "description": "New chat description" } ] }, @@ -11743,14 +11055,19 @@ ] }, { - "name": "chatEventHasProtectedContentToggled", - "description": "The has_protected_content setting of a channel was toggled", + "name": "chatEventPhotoChanged", + "description": "The chat photo was changed", "class": "ChatEventAction", "properties": [ { - "name": "has_protected_content", - "type": "Bool", - "description": "New value of has_protected_content" + "name": "old_photo", + "type": "chatPhoto", + "description": "Previous chat photo value; may be null" + }, + { + "name": "new_photo", + "type": "chatPhoto", + "description": "New chat photo value; may be null" } ] }, @@ -11767,14 +11084,53 @@ ] }, { - "name": "chatEventIsAllHistoryAvailableToggled", - "description": "The is_all_history_available setting of a supergroup was toggled", + "name": "chatEventLinkedChatChanged", + "description": "The linked chat of a supergroup was changed", "class": "ChatEventAction", "properties": [ { - "name": "is_all_history_available", - "type": "Bool", - "description": "New value of is_all_history_available" + "name": "old_linked_chat_id", + "type": "int53", + "description": "Previous supergroup linked chat identifier" + }, + { + "name": "new_linked_chat_id", + "type": "int53", + "description": "New supergroup linked chat identifier" + } + ] + }, + { + "name": "chatEventSlowModeDelayChanged", + "description": "The slow_mode_delay setting of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_slow_mode_delay", + "type": "int32", + "description": "Previous value of slow_mode_delay, in seconds" + }, + { + "name": "new_slow_mode_delay", + "type": "int32", + "description": "New value of slow_mode_delay, in seconds" + } + ] + }, + { + "name": "chatEventMessageTtlChanged", + "description": "The message TTL was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_message_ttl", + "type": "int32", + "description": "Previous value of message_ttl" + }, + { + "name": "new_message_ttl", + "type": "int32", + "description": "New value of message_ttl" } ] }, @@ -11790,6 +11146,64 @@ } ] }, + { + "name": "chatEventHasProtectedContentToggled", + "description": "The has_protected_content setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "chatEventStickerSetChanged", + "description": "The supergroup sticker set was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_sticker_set_id", + "type": "int64", + "description": "Previous identifier of the chat sticker set; 0 if none" + }, + { + "name": "new_sticker_set_id", + "type": "int64", + "description": "New identifier of the chat sticker set; 0 if none" + } + ] + }, + { + "name": "chatEventLocationChanged", + "description": "The supergroup location was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_location", + "type": "chatLocation", + "description": "Previous location; may be null" + }, + { + "name": "new_location", + "type": "chatLocation", + "description": "New location; may be null" + } + ] + }, + { + "name": "chatEventIsAllHistoryAvailableToggled", + "description": "The is_all_history_available setting of a supergroup was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "is_all_history_available", + "type": "Bool", + "description": "New value of is_all_history_available" + } + ] + }, { "name": "chatEventInviteLinkEdited", "description": "A chat invite link was edited", @@ -11855,18 +11269,6 @@ } ] }, - { - "name": "chatEventVideoChatMuteNewParticipantsToggled", - "description": "The mute_new_participants setting of a video chat was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "mute_new_participants", - "type": "Bool", - "description": "New value of the mute_new_participants setting" - } - ] - }, { "name": "chatEventVideoChatParticipantIsMutedToggled", "description": "A video chat participant was muted or unmuted", @@ -11901,6 +11303,18 @@ } ] }, + { + "name": "chatEventVideoChatMuteNewParticipantsToggled", + "description": "The mute_new_participants setting of a video chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ] + }, { "name": "chatEvent", "description": "Represents a chat event", @@ -12021,7 +11435,7 @@ }, { "name": "languagePackStringValuePluralized", - "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information", + "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info", "class": "LanguagePackStringValue", "properties": [ { @@ -12119,7 +11533,7 @@ { "name": "plural_code", "type": "string", - "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information" + "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info" }, { "name": "is_official", @@ -12646,7 +12060,7 @@ }, { "name": "checkChatUsernameResultPublicChatsTooMuch", - "description": "The user has too many chats with username, one of them must be made private first", + "description": "The user has too much chats with username, one of them must be made private first", "class": "CheckChatUsernameResult", "properties": [] }, @@ -13275,55 +12689,6 @@ "class": "NotificationGroupType", "properties": [] }, - { - "name": "notificationSound", - "description": "Describes a notification sound in MP3 format", - "class": "NotificationSound", - "properties": [ - { - "name": "id", - "type": "int64", - "description": "Unique identifier of the notification sound" - }, - { - "name": "duration", - "type": "int32", - "description": "Duration of the sound, in seconds" - }, - { - "name": "date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the sound was created" - }, - { - "name": "title", - "type": "string", - "description": "Title of the notification sound" - }, - { - "name": "data", - "type": "string", - "description": "Arbitrary data, defined while the sound was uploaded" - }, - { - "name": "sound", - "type": "file", - "description": "File containing the sound" - } - ] - }, - { - "name": "notificationSounds", - "description": "Contains a list of notification sounds", - "class": "NotificationSounds", - "properties": [ - { - "name": "notification_sounds", - "type": "vector\u003cnotificationSound\u003e", - "description": "A list of notification sounds" - } - ] - }, { "name": "notification", "description": "Contains information about a notification", @@ -13340,9 +12705,9 @@ "description": "Notification date" }, { - "name": "sound_id", - "type": "int64", - "description": "Identifier of the notification sound to be played; 0 if sound is disabled" + "name": "is_silent", + "type": "Bool", + "description": "True, if the notification was initially silent" }, { "name": "type", @@ -13809,7 +13174,7 @@ { "name": "location", "type": "string", - "description": "Human-readable description of a country and a region from which the user was logged in, based on the IP address" + "description": "Human-readable description of a country and a region, from which the user was logged in, based on the IP address" } ] }, @@ -13867,18 +13232,6 @@ "class": "ChatReportReason", "properties": [] }, - { - "name": "chatReportReasonIllegalDrugs", - "description": "The chat has illegal drugs related content", - "class": "ChatReportReason", - "properties": [] - }, - { - "name": "chatReportReasonPersonalDetails", - "description": "The chat contains messages with personal details", - "class": "ChatReportReason", - "properties": [] - }, { "name": "chatReportReasonCustom", "description": "A custom reason provided by the user", @@ -13891,28 +13244,6 @@ "class": "InternalLinkType", "properties": [] }, - { - "name": "internalLinkTypeAttachmentMenuBot", - "description": "The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL", - "class": "InternalLinkType", - "properties": [ - { - "name": "chat_link", - "type": "InternalLinkType", - "description": "An internal link pointing to a chat; may be null if the current chat needs to be kept" - }, - { - "name": "bot_username", - "type": "string", - "description": "Username of the bot" - }, - { - "name": "url", - "type": "string", - "description": "URL to be passed to openWebApp" - } - ] - }, { "name": "internalLinkTypeAuthenticationCode", "description": "The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode", @@ -13956,7 +13287,7 @@ }, { "name": "internalLinkTypeBotStartInGroup", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat.", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group", "class": "InternalLinkType", "properties": [ { @@ -13968,28 +13299,6 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" - }, - { - "name": "administrator_rights", - "type": "chatAdministratorRights", - "description": "Expected administrator rights for the bot; may be null" - } - ] - }, - { - "name": "internalLinkTypeBotAddToChannel", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", - "class": "InternalLinkType", - "properties": [ - { - "name": "bot_username", - "type": "string", - "description": "Username of the bot" - }, - { - "name": "administrator_rights", - "type": "chatAdministratorRights", - "description": "Expected administrator rights for the bot" } ] }, @@ -14046,12 +13355,6 @@ } ] }, - { - "name": "internalLinkTypeLanguageSettings", - "description": "The link is a link to the language settings section of the app", - "class": "InternalLinkType", - "properties": [] - }, { "name": "internalLinkTypeMessage", "description": "The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link", @@ -14130,12 +13433,6 @@ } ] }, - { - "name": "internalLinkTypePrivacyAndSecuritySettings", - "description": "The link is a link to the privacy and security settings section of the app", - "class": "InternalLinkType", - "properties": [] - }, { "name": "internalLinkTypeProxy", "description": "The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy", @@ -14230,21 +13527,9 @@ "class": "InternalLinkType", "properties": [] }, - { - "name": "internalLinkTypeUserPhoneNumber", - "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", - "class": "InternalLinkType", - "properties": [ - { - "name": "phone_number", - "type": "string", - "description": "Phone number of the user" - } - ] - }, { "name": "internalLinkTypeVideoChat", - "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link", + "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link", "class": "InternalLinkType", "properties": [ { @@ -14354,12 +13639,6 @@ "class": "FileType", "properties": [] }, - { - "name": "fileTypeNotificationSound", - "description": "The file is a notification sound", - "class": "FileType", - "properties": [] - }, { "name": "fileTypePhoto", "description": "The file is a photo", @@ -14821,7 +14100,7 @@ { "name": "info", "type": "chatInviteLinkInfo", - "description": "Information about the chat invite link" + "description": "Chat invite link info" } ] }, @@ -15086,14 +14365,14 @@ ] }, { - "name": "inputSticker", - "description": "A sticker to be added to a sticker set", + "name": "inputStickerStatic", + "description": "A static sticker in PNG format, which will be converted to WEBP server-side", "class": "InputSticker", "properties": [ { "name": "sticker", "type": "InputFile", - "description": "File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" + "description": "PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square" }, { "name": "emojis", @@ -15101,9 +14380,26 @@ "description": "Emojis corresponding to the sticker" }, { - "name": "type", - "type": "StickerType", - "description": "Sticker type" + "name": "mask_position", + "type": "maskPosition", + "description": "For masks, position where the mask is placed; pass null if unspecified" + } + ] + }, + { + "name": "inputStickerAnimated", + "description": "An animated sticker in TGS format", + "class": "InputSticker", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" + }, + { + "name": "emojis", + "type": "string", + "description": "Emojis corresponding to the sticker" } ] }, @@ -15789,33 +15085,6 @@ } ] }, - { - "name": "updateMessageUnreadReactions", - "description": "The list of unread reactions added to a message was changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" - }, - { - "name": "unread_reactions", - "type": "vector\u003cunreadReaction\u003e", - "description": "The new list of unread reactions" - }, - { - "name": "unread_reaction_count", - "type": "int32", - "description": "The new number of messages with unread reactions left in the chat" - } - ] - }, { "name": "updateMessageLiveLocationViewed", "description": "A message with a live location was viewed. When the update is received, the application is supposed to update the live location", @@ -15991,23 +15260,6 @@ } ] }, - { - "name": "updateChatAvailableReactions", - "description": "The chat available reactions were changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "available_reactions", - "type": "vector\u003cstring\u003e", - "description": "The new list of reactions, available in the chat" - } - ] - }, { "name": "updateChatDraftMessage", "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", @@ -16149,23 +15401,6 @@ } ] }, - { - "name": "updateChatUnreadReactionCount", - "description": "The chat unread_reaction_count has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "unread_reaction_count", - "type": "int32", - "description": "The number of messages with unread reactions left in the chat" - } - ] - }, { "name": "updateChatVideoChat", "description": "A chat video chat state has changed", @@ -16282,7 +15517,7 @@ }, { "name": "updateChatOnlineMemberCount", - "description": "The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed", + "description": "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed", "class": "Update", "properties": [ { @@ -16357,9 +15592,9 @@ "description": "Chat identifier, which notification settings must be applied to the added notifications" }, { - "name": "notification_sound_id", - "type": "int64", - "description": "Identifier of the notification sound to be played; 0 if sound is disabled" + "name": "is_silent", + "type": "Bool", + "description": "True, if the notifications must be shown without sound" }, { "name": "total_count", @@ -16645,89 +15880,6 @@ } ] }, - { - "name": "updateFileDownloads", - "description": "The state of the file download list has changed", - "class": "Update", - "properties": [ - { - "name": "total_size", - "type": "int53", - "description": "Total size of files in the file download list, in bytes" - }, - { - "name": "total_count", - "type": "int32", - "description": "Total number of files in the file download list" - }, - { - "name": "downloaded_size", - "type": "int53", - "description": "Total downloaded size of files in the file download list, in bytes" - } - ] - }, - { - "name": "updateFileAddedToDownloads", - "description": "A file was added to the file download list. This update is sent only after file download list is loaded for the first time", - "class": "Update", - "properties": [ - { - "name": "file_download", - "type": "fileDownload", - "description": "The added file download" - }, - { - "name": "counts", - "type": "downloadedFileCounts", - "description": "New number of being downloaded and recently downloaded files found" - } - ] - }, - { - "name": "updateFileDownload", - "description": "A file download was changed. This update is sent only after file download list is loaded for the first time", - "class": "Update", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "File identifier" - }, - { - "name": "complete_date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" - }, - { - "name": "is_paused", - "type": "Bool", - "description": "True, if downloading of the file is paused" - }, - { - "name": "counts", - "type": "downloadedFileCounts", - "description": "New number of being downloaded and recently downloaded files found" - } - ] - }, - { - "name": "updateFileRemovedFromDownloads", - "description": "A file was removed from the file download list. This update is sent only after file download list is loaded for the first time", - "class": "Update", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "File identifier" - }, - { - "name": "counts", - "type": "downloadedFileCounts", - "description": "New number of being downloaded and recently downloaded files found" - } - ] - }, { "name": "updateCall", "description": "New call was created or information about a call was updated", @@ -16961,18 +16113,6 @@ } ] }, - { - "name": "updateSavedNotificationSounds", - "description": "The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", - "class": "Update", - "properties": [ - { - "name": "notification_sound_ids", - "type": "vector\u003cint64\u003e", - "description": "The new list of identifiers of saved notification sounds" - } - ] - }, { "name": "updateSelectedBackground", "description": "The selected background has changed", @@ -17065,42 +16205,6 @@ } ] }, - { - "name": "updateAttachmentMenuBots", - "description": "The list of bots added to attachment menu has changed", - "class": "Update", - "properties": [ - { - "name": "bots", - "type": "vector\u003cattachmentMenuBot\u003e", - "description": "The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen" - } - ] - }, - { - "name": "updateWebAppMessageSent", - "description": "A message was sent by an opened web app, so the web app needs to be closed", - "class": "Update", - "properties": [ - { - "name": "web_app_launch_id", - "type": "int64", - "description": "Identifier of web app launch" - } - ] - }, - { - "name": "updateReactions", - "description": "The list of supported reactions has changed", - "class": "Update", - "properties": [ - { - "name": "reactions", - "type": "vector\u003creaction\u003e", - "description": "The new list of supported reactions" - } - ] - }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -17192,7 +16296,7 @@ { "name": "chat_type", "type": "ChatType", - "description": "The type of the chat from which the query originated; may be null if unknown" + "description": "The type of the chat, from which the query originated; may be null if unknown" }, { "name": "query", @@ -17261,7 +16365,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message from which the query originated" + "description": "Identifier of the message, from which the query originated" }, { "name": "chat_instance", @@ -17293,7 +16397,7 @@ { "name": "inline_message_id", "type": "string", - "description": "Identifier of the inline message from which the query originated" + "description": "Identifier of the inline message, from which the query originated" }, { "name": "chat_instance", @@ -17673,16 +16777,12 @@ }, { "name": "ThumbnailFormat", - "description": "Describes format of a thumbnail" + "description": "Describes format of the thumbnail" }, { "name": "MaskPoint", "description": "Part of the face, relative to which a mask is placed" }, - { - "name": "StickerType", - "description": "Describes type of a sticker" - }, { "name": "PollType", "description": "Describes the type of a poll" @@ -17983,6 +17083,10 @@ "name": "ProxyType", "description": "Describes the type of a proxy server" }, + { + "name": "InputSticker", + "description": "Describes a sticker that needs to be added to a sticker set" + }, { "name": "StatisticalGraph", "description": "Describes a statistical graph" @@ -18284,7 +17388,7 @@ { "name": "set_recovery_email_address", "type": "Bool", - "description": "Pass true to change also the recovery email address" + "description": "Pass true if the recovery email address must be changed" }, { "name": "new_recovery_email_address", @@ -18580,7 +17684,7 @@ }, { "name": "getMessageLocally", - "description": "Returns information about a message, if it is available without sending network request. This is an offline request", + "description": "Returns information about a message, if it is available locally without sending network request. This is an offline request", "class": "Message", "properties": [ { @@ -19065,7 +18169,7 @@ { "name": "only_local", "type": "Bool", - "description": "Pass true to get only messages that are available without sending network requests" + "description": "If true, returns only messages that are available locally without sending network requests" } ], "is_synchronous": false, @@ -19118,7 +18222,7 @@ { "name": "remove_from_chat_list", "type": "Bool", - "description": "Pass true to remove the chat from all chat lists" + "description": "Pass true if the chat needs to be removed from the chat list" }, { "name": "revoke", @@ -19131,7 +18235,7 @@ }, { "name": "deleteChat", - "description": "Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat", + "description": "Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method", "class": "Ok", "properties": [ { @@ -19230,7 +18334,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function" + "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" }, { "name": "min_date", @@ -19264,7 +18368,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" }, { "name": "limit", @@ -19298,26 +18402,7 @@ { "name": "only_missed", "type": "Bool", - "description": "Pass true to search only for messages with missed/declined calls" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "searchOutgoingDocumentMessages", - "description": "Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order", - "class": "FoundMessages", - "properties": [ - { - "name": "query", - "type": "string", - "description": "Query to search for in document file name and message caption" - }, - { - "name": "limit", - "type": "int32", - "description": "The maximum number of messages to be returned; up to 100" + "description": "If true, returns only messages with missed/declined calls" } ], "is_synchronous": false, @@ -19396,7 +18481,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" }, { "name": "from_message_id", @@ -19425,7 +18510,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" }, { "name": "from_message_id", @@ -19454,7 +18539,7 @@ { "name": "return_local", "type": "Bool", - "description": "Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally" + "description": "If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown" } ], "is_synchronous": false, @@ -19492,7 +18577,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" }, { "name": "limit", @@ -19627,30 +18712,6 @@ "is_synchronous": false, "type": 1 }, - { - "name": "translateText", - "description": "Translates a text to the given language. Returns a 404 error if the translation can't be performed", - "class": "Text", - "properties": [ - { - "name": "text", - "type": "string", - "description": "Text to translate" - }, - { - "name": "from_language_code", - "type": "string", - "description": "A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically" - }, - { - "name": "to_language_code", - "type": "string", - "description": "A two-letter ISO 639-1 language code of the language to which the message is translated" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getChatAvailableMessageSenders", "description": "Returns list of message sender identifiers, which can be used to send messages in a chat", @@ -19702,7 +18763,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "description": "Identifier of the message to reply to or 0" }, { "name": "options", @@ -19741,7 +18802,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a replied message; 0 if none" + "description": "Identifier of a message to reply to or 0" }, { "name": "options", @@ -19752,11 +18813,6 @@ "name": "input_message_contents", "type": "vector\u003cInputMessageContent\u003e", "description": "Contents of messages to be sent. At most 10 messages can be added to an album" - }, - { - "name": "only_preview", - "type": "Bool", - "description": "Pass true to get fake messages instead of actually sending them" } ], "is_synchronous": false, @@ -19804,7 +18860,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a replied message; 0 if none" + "description": "Identifier of a message to reply to or 0" }, { "name": "options", @@ -19824,7 +18880,7 @@ { "name": "hide_via_bot", "type": "Bool", - "description": "Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\"), and GetOption(\"venue_search_bot_username\")" + "description": "If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\") and GetOption(\"venue_search_bot_username\")" } ], "is_synchronous": false, @@ -19858,17 +18914,17 @@ { "name": "send_copy", "type": "Bool", - "description": "Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" + "description": "If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" }, { "name": "remove_caption", "type": "Bool", - "description": "Pass true to remove media captions of message copies. Ignored if send_copy is false" + "description": "If true, media caption of message copies will be removed. Ignored if send_copy is false" }, { "name": "only_preview", "type": "Bool", - "description": "Pass true to get fake messages instead of actually forwarding them" + "description": "If true, messages will not be forwarded and instead fake messages will be returned" } ], "is_synchronous": false, @@ -19925,7 +18981,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "description": "Identifier of the message to reply to or 0" }, { "name": "disable_notification", @@ -20312,88 +19368,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getMessageAvailableReactions", - "description": "Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message", - "class": "AvailableReactions", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat to which the message belongs" - }, - { - "name": "message_id", - "type": "int53", - "description": "Identifier of the message" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "setMessageReaction", - "description": "Changes chosen reaction for a message", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat to which the message belongs" - }, - { - "name": "message_id", - "type": "int53", - "description": "Identifier of the message" - }, - { - "name": "reaction", - "type": "string", - "description": "Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction" - }, - { - "name": "is_big", - "type": "Bool", - "description": "Pass true if the reaction is added with a big animation" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "getMessageAddedReactions", - "description": "Returns reactions added for a message, along with their sender", - "class": "AddedReactions", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat to which the message belongs" - }, - { - "name": "message_id", - "type": "int53", - "description": "Identifier of the message" - }, - { - "name": "reaction", - "type": "string", - "description": "If non-empty, only added reactions with the specified text representation will be returned" - }, - { - "name": "offset", - "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" - }, - { - "name": "limit", - "type": "int32", - "description": "The maximum number of reactions to be returned; must be positive and can't be greater than 100" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getTextEntities", "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously", @@ -20410,7 +19384,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -20435,7 +19409,7 @@ { "name": "text", "type": "formattedText", - "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" + "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" } ], "is_synchronous": true, @@ -20554,20 +19528,6 @@ "is_synchronous": true, "type": 1 }, - { - "name": "getThemeParametersJsonString", - "description": "Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously", - "class": "Text", - "properties": [ - { - "name": "theme", - "type": "themeParameters", - "description": "Theme parameters to convert to JSON" - } - ], - "is_synchronous": true, - "type": 1 - }, { "name": "setPollAnswer", "description": "Changes the user answer to a poll. A poll in quiz mode can be answered only once", @@ -20711,7 +19671,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "Pass true to allow the bot to send messages to the current user" + "description": "True, if the user allowed the bot to send them messages" } ], "is_synchronous": false, @@ -20764,7 +19724,7 @@ { "name": "is_personal", "type": "Bool", - "description": "Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query" + "description": "True, if the result of the query can be cached for the specified user" }, { "name": "results", @@ -20795,121 +19755,6 @@ "is_synchronous": false, "type": 3 }, - { - "name": "getWebAppUrl", - "description": "Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed", - "class": "HttpUrl", - "properties": [ - { - "name": "bot_user_id", - "type": "int53", - "description": "Identifier of the target bot" - }, - { - "name": "url", - "type": "string", - "description": "The URL from the keyboardButtonTypeWebApp button" - }, - { - "name": "theme", - "type": "themeParameters", - "description": "Preferred web app theme; pass null to use the default theme" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "sendWebAppData", - "description": "Sends data received from a keyboardButtonTypeWebApp web app to a bot", - "class": "Ok", - "properties": [ - { - "name": "bot_user_id", - "type": "int53", - "description": "Identifier of the target bot" - }, - { - "name": "button_text", - "type": "string", - "description": "Text of the keyboardButtonTypeWebApp button, which opened the web app" - }, - { - "name": "data", - "type": "string", - "description": "Received data" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "openWebApp", - "description": "Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", - "class": "WebAppInfo", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now" - }, - { - "name": "bot_user_id", - "type": "int53", - "description": "Identifier of the bot, providing the web app" - }, - { - "name": "url", - "type": "string", - "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" - }, - { - "name": "theme", - "type": "themeParameters", - "description": "Preferred web app theme; pass null to use the default theme" - }, - { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the replied message for the message sent by the web app; 0 if none" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "closeWebApp", - "description": "Informs TDLib that a previously opened web app was closed", - "class": "Ok", - "properties": [ - { - "name": "web_app_launch_id", - "type": "int64", - "description": "Identifier of web app launch, received from openWebApp" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "answerWebAppQuery", - "description": "Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only", - "class": "SentWebAppMessage", - "properties": [ - { - "name": "web_app_query_id", - "type": "string", - "description": "Identifier of the web app query" - }, - { - "name": "result", - "type": "InputInlineQueryResult", - "description": "The result of the query" - } - ], - "is_synchronous": false, - "type": 3 - }, { "name": "getCallbackQueryAnswer", "description": "Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires", @@ -20952,7 +19797,7 @@ { "name": "show_alert", "type": "Bool", - "description": "Pass true to show an alert to the user instead of a toast notification" + "description": "If true, an alert must be shown to the user instead of a toast notification" }, { "name": "url", @@ -21029,7 +19874,7 @@ { "name": "edit_message", "type": "Bool", - "description": "Pass true to edit the game message to include the current scoreboard" + "description": "True, if the message needs to be edited" }, { "name": "user_id", @@ -21063,7 +19908,7 @@ { "name": "edit_message", "type": "Bool", - "description": "Pass true to edit the game message to include the current scoreboard" + "description": "True, if the message needs to be edited" }, { "name": "user_id", @@ -21221,7 +20066,7 @@ { "name": "force_read", "type": "Bool", - "description": "Pass true to mark as read the specified messages even the chat is closed" + "description": "True, if messages in closed chats must be marked as read by the request" } ], "is_synchronous": false, @@ -21306,7 +20151,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" + "description": "True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" } ], "is_synchronous": false, @@ -21326,20 +20171,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "readAllChatReactions", - "description": "Marks all reactions in a chat as read", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "createPrivateChat", "description": "Returns an existing chat corresponding to a given user", @@ -21353,7 +20184,7 @@ { "name": "force", "type": "Bool", - "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -21372,7 +20203,7 @@ { "name": "force", "type": "Bool", - "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -21391,7 +20222,7 @@ { "name": "force", "type": "Bool", - "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -21443,7 +20274,7 @@ { "name": "is_channel", "type": "Bool", - "description": "Pass true to create a channel chat" + "description": "True, if a channel chat needs to be created" }, { "name": "description", @@ -21458,7 +20289,7 @@ { "name": "for_import", "type": "Bool", - "description": "Pass true to create a supergroup for importing messages using importMessage" + "description": "True, if the supergroup is created for importing messages using importMessage" } ], "is_synchronous": false, @@ -21662,7 +20493,7 @@ }, { "name": "setChatMessageTtl", - "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).", + "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)", "class": "Ok", "properties": [ { @@ -21673,7 +20504,7 @@ { "name": "ttl", "type": "int32", - "description": "New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400" + "description": "New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret" } ], "is_synchronous": false, @@ -21773,7 +20604,7 @@ { "name": "has_protected_content", "type": "Bool", - "description": "New value of has_protected_content" + "description": "True, if chat content can't be saved locally, forwarded, or copied" } ], "is_synchronous": false, @@ -21817,25 +20648,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "setChatAvailableReactions", - "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Identifier of the chat" - }, - { - "name": "available_reactions", - "type": "vector\u003cstring\u003e", - "description": "New list of reactions, available in the chat. All reactions must be active" - } - ], - "is_synchronous": false, - "type": 1 - }, { "name": "setChatClientData", "description": "Changes application-specific data associated with a chat", @@ -21949,12 +20761,12 @@ { "name": "disable_notification", "type": "Bool", - "description": "Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats" + "description": "True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats" }, { "name": "only_for_self", "type": "Bool", - "description": "Pass true to pin the message only for self; private chats only" + "description": "True, if the message needs to be pinned for one side only; private chats only" } ], "is_synchronous": false, @@ -22213,63 +21025,13 @@ }, { "name": "clearAllDraftMessages", - "description": "Clears message drafts in all chats", + "description": "Clears draft messages in all chats", "class": "Ok", "properties": [ { "name": "exclude_secret_chats", "type": "Bool", - "description": "Pass true to keep local message drafts in secret chats" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "getSavedNotificationSound", - "description": "Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier", - "class": "NotificationSounds", - "properties": [ - { - "name": "notification_sound_id", - "type": "int64", - "description": "Identifier of the notification sound" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "getSavedNotificationSounds", - "description": "Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used", - "class": "NotificationSounds", - "properties": [], - "is_synchronous": false, - "type": 2 - }, - { - "name": "addSavedNotificationSound", - "description": "Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed", - "class": "NotificationSound", - "properties": [ - { - "name": "sound", - "type": "InputFile", - "description": "Notification sound file to add" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "removeSavedNotificationSound", - "description": "Removes a notification sound from the list of saved notification sounds", - "class": "Ok", - "properties": [ - { - "name": "notification_sound_id", - "type": "int64", - "description": "Identifier of the notification sound" + "description": "If true, local draft messages in secret chats will not be cleared" } ], "is_synchronous": false, @@ -22288,7 +21050,7 @@ { "name": "compare_sound", "type": "Bool", - "description": "Pass true to include in the response chats with only non-default sound" + "description": "If true, also chats with non-default sound will be returned" } ], "is_synchronous": false, @@ -22329,7 +21091,7 @@ }, { "name": "resetAllNotificationSettings", - "description": "Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown", + "description": "Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to \"default\" and message previews are shown", "class": "Ok", "properties": [], "is_synchronous": false, @@ -22337,7 +21099,7 @@ }, { "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/archive chat list", + "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/arhive chat list", "class": "Ok", "properties": [ { @@ -22353,7 +21115,7 @@ { "name": "is_pinned", "type": "Bool", - "description": "Pass true to pin the chat; pass false to unpin it" + "description": "True, if the chat is pinned" } ], "is_synchronous": false, @@ -22378,39 +21140,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getAttachmentMenuBot", - "description": "Returns information about a bot that can be added to attachment menu", - "class": "AttachmentMenuBot", - "properties": [ - { - "name": "bot_user_id", - "type": "int53", - "description": "Bot's user identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "toggleBotIsAddedToAttachmentMenu", - "description": "Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true", - "class": "Ok", - "properties": [ - { - "name": "bot_user_id", - "type": "int53", - "description": "Bot's user identifier" - }, - { - "name": "is_added", - "type": "Bool", - "description": "Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -22424,7 +21153,7 @@ { "name": "priority", "type": "int32", - "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first" }, { "name": "offset", @@ -22439,7 +21168,7 @@ { "name": "synchronous", "type": "Bool", - "description": "Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started" + "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent" } ], "is_synchronous": false, @@ -22645,145 +21374,6 @@ "is_synchronous": false, "type": 1 }, - { - "name": "addFileToDownloads", - "description": "Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file", - "class": "File", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "Identifier of the file to download" - }, - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the message with the file" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" - }, - { - "name": "priority", - "type": "int32", - "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "toggleDownloadIsPaused", - "description": "Changes pause state of a file in the file download list", - "class": "Ok", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "Identifier of the downloaded file" - }, - { - "name": "is_paused", - "type": "Bool", - "description": "Pass true if the download is paused" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "toggleAllDownloadsArePaused", - "description": "Changes pause state of all files in the file download list", - "class": "Ok", - "properties": [ - { - "name": "are_paused", - "type": "Bool", - "description": "Pass true to pause all downloads; pass false to unpause them" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "removeFileFromDownloads", - "description": "Removes a file from the file download list", - "class": "Ok", - "properties": [ - { - "name": "file_id", - "type": "int32", - "description": "Identifier of the downloaded file" - }, - { - "name": "delete_from_cache", - "type": "Bool", - "description": "Pass true to delete the file from the TDLib file cache" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "removeAllFilesFromDownloads", - "description": "Removes all files from the file download list", - "class": "Ok", - "properties": [ - { - "name": "only_active", - "type": "Bool", - "description": "Pass true to remove only active downloads, including paused" - }, - { - "name": "only_completed", - "type": "Bool", - "description": "Pass true to remove only completed downloads" - }, - { - "name": "delete_from_cache", - "type": "Bool", - "description": "Pass true to delete the file from the TDLib file cache" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "searchFileDownloads", - "description": "Searches for files in the file download list or recently downloaded files from the list", - "class": "FoundFileDownloads", - "properties": [ - { - "name": "query", - "type": "string", - "description": "Query to search for; may be empty to return all downloaded files" - }, - { - "name": "only_active", - "type": "Bool", - "description": "Pass true to search only for active downloads, including paused" - }, - { - "name": "only_completed", - "type": "Bool", - "description": "Pass true to search only for completed downloads" - }, - { - "name": "offset", - "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" - }, - { - "name": "limit", - "type": "int32", - "description": "The maximum number of files to be returned" - } - ], - "is_synchronous": false, - "type": 1 - }, { "name": "getMessageFileType", "description": "Returns information about a file with messages exported from another app", @@ -22878,7 +21468,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" + "description": "True, if the link only creates join request. If true, member_limit must not be specified" } ], "is_synchronous": false, @@ -22917,7 +21507,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" + "description": "True, if the link only creates join request. If true, member_limit must not be specified" } ], "is_synchronous": false, @@ -23161,7 +21751,7 @@ { "name": "approve", "type": "Bool", - "description": "Pass true to approve the request; pass false to decline it" + "description": "True, if the request is approved. Otherwise the request is declived" } ], "is_synchronous": false, @@ -23185,7 +21775,7 @@ { "name": "approve", "type": "Bool", - "description": "Pass true to approve all requests; pass false to decline them" + "description": "True, if the requests are approved. Otherwise the requests are declived" } ], "is_synchronous": false, @@ -23209,7 +21799,7 @@ { "name": "is_video", "type": "Bool", - "description": "Pass true to create a video call" + "description": "True, if a video call needs to be created" } ], "is_synchronous": false, @@ -23266,7 +21856,7 @@ { "name": "is_disconnected", "type": "Bool", - "description": "Pass true if the user was disconnected" + "description": "True, if the user was disconnected" }, { "name": "duration", @@ -23276,7 +21866,7 @@ { "name": "is_video", "type": "Bool", - "description": "Pass true if the call was a video call" + "description": "True, if the call was a video call" }, { "name": "connection_id", @@ -23376,7 +21966,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat in which the video chat will be created" + "description": "Chat identifier, in which the video chat will be created" }, { "name": "title", @@ -23387,39 +21977,6 @@ "name": "start_date", "type": "int32", "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future" - }, - { - "name": "is_rtmp_stream", - "type": "Bool", - "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "getVideoChatRtmpUrl", - "description": "Returns RTMP URL for streaming to the chat; requires creator privileges", - "class": "RtmpUrl", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "replaceVideoChatRtmpUrl", - "description": "Replaces the current RTMP URL for streaming to the chat; requires creator privileges", - "class": "RtmpUrl", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" } ], "is_synchronous": false, @@ -23500,12 +22057,12 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true to join the call with muted microphone" + "description": "True, if the user's microphone is muted" }, { "name": "is_my_video_enabled", "type": "Bool", - "description": "Pass true if the user's video is enabled" + "description": "True, if the user's video is enabled" }, { "name": "invite_hash", @@ -23762,7 +22319,7 @@ { "name": "is_speaking", "type": "Bool", - "description": "Pass true if the user is speaking" + "description": "True, if the user is speaking" } ], "is_synchronous": false, @@ -23786,7 +22343,7 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true to mute the user; pass false to unmute the them" + "description": "Pass true if the user must be muted and false otherwise" } ], "is_synchronous": false, @@ -23887,20 +22444,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getGroupCallStreams", - "description": "Returns information about available group call streams", - "class": "GroupCallStreams", - "properties": [ - { - "name": "group_call_id", - "type": "int32", - "description": "Group call identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getGroupCallStreamSegment", "description": "Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video", @@ -23967,17 +22510,17 @@ { "name": "delete_message", "type": "Bool", - "description": "Pass true to delete the message" + "description": "Pass true if the message must be deleted" }, { "name": "delete_all_messages", "type": "Bool", - "description": "Pass true to delete all messages from the same sender" + "description": "Pass true if all messages from the same sender must be deleted" }, { "name": "report_spam", "type": "Bool", - "description": "Pass true to report the sender to the Telegram moderators" + "description": "Pass true if the sender must be reported to the Telegram moderators" } ], "is_synchronous": false, @@ -24010,12 +22553,12 @@ { "name": "contact", "type": "contact", - "description": "The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored" + "description": "The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored" }, { "name": "share_phone_number", "type": "Bool", - "description": "Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" + "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" } ], "is_synchronous": false, @@ -24106,20 +22649,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "searchUserByPhoneNumber", - "description": "Searches a user by their phone number", - "class": "User", - "properties": [ - { - "name": "phone_number", - "type": "string", - "description": "Phone number to search for" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "sharePhoneNumber", "description": "Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber", @@ -24519,7 +23048,7 @@ { "name": "exact_match", "type": "Bool", - "description": "Pass true if only emojis, which exactly match the text, needs to be returned" + "description": "True, if only emojis, which exactly match text needs to be returned" }, { "name": "input_language_codes", @@ -24662,7 +23191,7 @@ { "name": "force_full", "type": "Bool", - "description": "Pass true to get full instant view for the web page" + "description": "If true, the full instant view for the web page will be returned" } ], "is_synchronous": false, @@ -24811,7 +23340,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" + "description": "A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" }, { "name": "commands", @@ -24835,7 +23364,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 language code or an empty string" + "description": "A two-letter ISO 639-1 country code or an empty string" } ], "is_synchronous": false, @@ -24854,68 +23383,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 language code or an empty string" - } - ], - "is_synchronous": false, - "type": 3 - }, - { - "name": "setMenuButton", - "description": "Sets menu button for the given user or for all users; for bots only", - "class": "Ok", - "properties": [ - { - "name": "user_id", - "type": "int53", - "description": "Identifier of the user or 0 to set menu button for all users" - }, - { - "name": "menu_button", - "type": "botMenuButton", - "description": "New menu button" - } - ], - "is_synchronous": false, - "type": 3 - }, - { - "name": "getMenuButton", - "description": "Returns menu button set by the bot for the given user; for bots only", - "class": "BotMenuButton", - "properties": [ - { - "name": "user_id", - "type": "int53", - "description": "Identifier of the user or 0 to get the default menu button" - } - ], - "is_synchronous": false, - "type": 3 - }, - { - "name": "setDefaultGroupAdministratorRights", - "description": "Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only", - "class": "Ok", - "properties": [ - { - "name": "default_group_administrator_rights", - "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" - } - ], - "is_synchronous": false, - "type": 3 - }, - { - "name": "setDefaultChannelAdministratorRights", - "description": "Sets default administrator rights for adding the bot to channel chats; for bots only", - "class": "Ok", - "properties": [ - { - "name": "default_channel_administrator_rights", - "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to channels; may be null" + "description": "A two-letter ISO 639-1 country code or an empty string" } ], "is_synchronous": false, @@ -24964,7 +23432,7 @@ { "name": "can_accept_calls", "type": "Bool", - "description": "Pass true to allow accepting incoming calls by the session; pass false otherwise" + "description": "True, if incoming calls can be accepted by the session" } ], "is_synchronous": false, @@ -24983,7 +23451,7 @@ { "name": "can_accept_secret_chats", "type": "Bool", - "description": "Pass true to allow accepring secret chats by the session; pass false otherwise" + "description": "True, if incoming secret chats can be accepted by the session" } ], "is_synchronous": false, @@ -25241,7 +23709,7 @@ }, { "name": "theme", - "type": "themeParameters", + "type": "paymentFormTheme", "description": "Preferred payment form theme; pass null to use the default theme" } ], @@ -25271,7 +23739,7 @@ { "name": "allow_save", "type": "Bool", - "description": "Pass true to save the order information" + "description": "True, if the order information can be saved" } ], "is_synchronous": false, @@ -25342,7 +23810,7 @@ }, { "name": "getSavedOrderInfo", - "description": "Returns saved order information. Returns a 404 error if there is no saved order information", + "description": "Returns saved order info, if any", "class": "OrderInfo", "properties": [], "is_synchronous": false, @@ -25350,7 +23818,7 @@ }, { "name": "deleteSavedOrderInfo", - "description": "Deletes saved order information", + "description": "Deletes saved order info", "class": "Ok", "properties": [], "is_synchronous": false, @@ -25380,7 +23848,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "Pass true to order returned backgrounds for a dark theme" + "description": "True, if the backgrounds must be ordered for dark theme" } ], "is_synchronous": false, @@ -25437,7 +23905,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "Pass true if the background is changed for a dark theme" + "description": "True, if the background is chosen for dark theme" } ], "is_synchronous": false, @@ -25473,7 +23941,7 @@ { "name": "only_local", "type": "Bool", - "description": "Pass true to get only locally available information without sending network requests" + "description": "If true, returns only locally available information without sending network requests" } ], "is_synchronous": false, @@ -25796,7 +24264,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of reported messages; may be empty to report the whole chat" + "description": "Identifiers of reported messages, if any" }, { "name": "reason", @@ -25956,7 +24424,7 @@ { "name": "count", "type": "int32", - "description": "Limit on the total number of files after deletion. Pass -1 to use the default limit" + "description": "Limit on the total count of files after deletion. Pass -1 to use the default limit" }, { "name": "immunity_delay", @@ -26014,7 +24482,7 @@ { "name": "only_current", "type": "Bool", - "description": "Pass true to get statistics only for the current library launch" + "description": "If true, returns only data for the current library launch" } ], "is_synchronous": false, @@ -26403,7 +24871,7 @@ }, { "name": "sticker", - "type": "inputSticker", + "type": "InputSticker", "description": "Sticker file to upload" } ], @@ -26458,10 +24926,15 @@ "type": "string", "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" }, + { + "name": "is_masks", + "type": "Bool", + "description": "True, if stickers are masks. Animated stickers can't be masks" + }, { "name": "stickers", - "type": "vector\u003cinputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown" + "type": "vector\u003cInputSticker\u003e", + "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown" }, { "name": "source", @@ -26489,7 +24962,7 @@ }, { "name": "sticker", - "type": "inputSticker", + "type": "InputSticker", "description": "Sticker to add to the set" } ], @@ -26514,7 +24987,7 @@ { "name": "thumbnail", "type": "InputFile", - "description": "Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set" + "description": "Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them" } ], "is_synchronous": false, @@ -26586,7 +25059,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown" + "description": "Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown" } ], "is_synchronous": false, @@ -26696,7 +25169,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 language code for country information localization" + "description": "A two-letter ISO 639-1 country code for country information localization" }, { "name": "phone_number_prefix", @@ -26779,7 +25252,7 @@ { "name": "enable", "type": "Bool", - "description": "Pass true to immediately enable the proxy" + "description": "True, if the proxy needs to be enabled" }, { "name": "type", @@ -26813,7 +25286,7 @@ { "name": "enable", "type": "Bool", - "description": "Pass true to immediately enable the proxy" + "description": "True, if the proxy needs to be enabled" }, { "name": "type", @@ -27137,7 +25610,7 @@ { "name": "dc_id", "type": "int32", - "description": "Identifier of a datacenter with which to test connection" + "description": "Identifier of a datacenter, with which to test connection" }, { "name": "timeout", diff --git a/data/td_api.tl b/data/td_api.tl index 0621bb6..d973c2b 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -73,11 +73,11 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; -//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user +//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; @@ -147,7 +147,7 @@ localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_ //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. //-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location +//-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) //@is_uploading_completed True, if a remote copy is fully available @@ -191,29 +191,26 @@ photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vect minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; -//@class ThumbnailFormat @description Describes format of a thumbnail +//@class ThumbnailFormat @description Describes format of the thumbnail //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in static GIF format. It will be used only for some bot inline results -thumbnailFormatGif = ThumbnailFormat; - -//@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos -thumbnailFormatMpeg4 = ThumbnailFormat; - //@description The thumbnail is in PNG format. It will be used only for background patterns thumbnailFormatPng = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets -thumbnailFormatTgs = ThumbnailFormat; - -//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets -thumbnailFormatWebm = ThumbnailFormat; - //@description The thumbnail is in WEBP format. It will be used only for some stickers thumbnailFormatWebp = ThumbnailFormat; +//@description The thumbnail is in static GIF format. It will be used only for some bot inline results +thumbnailFormatGif = ThumbnailFormat; + +//@description The thumbnail is in TGS format. It will be used only for animated sticker sets +thumbnailFormatTgs = ThumbnailFormat; + +//@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos +thumbnailFormatMpeg4 = ThumbnailFormat; + //@description Represents a thumbnail @format Thumbnail format @width Thumbnail width @height Thumbnail height @file The thumbnail thumbnail format:ThumbnailFormat width:int32 height:int32 file:file = Thumbnail; @@ -240,21 +237,6 @@ maskPointChin = MaskPoint; maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; -//@class StickerType @description Describes type of a sticker - -//@description The sticker is an image in WEBP format -stickerTypeStatic = StickerType; - -//@description The sticker is an animation in TGS format -stickerTypeAnimated = StickerType; - -//@description The sticker is a video in WEBM format -stickerTypeVideo = StickerType; - -//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null -stickerTypeMask mask_position:maskPosition = StickerType; - - //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands closedVectorPath commands:vector = ClosedVectorPath; @@ -295,9 +277,9 @@ document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Photo; //@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker @type Sticker type @outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner -//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker -sticker set_id:int64 width:int32 height:int32 emoji:string type:StickerType outline:vector thumbnail:thumbnail sticker:file = Sticker; +//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask is placed; may be null +//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker +sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition outline:vector thumbnail:thumbnail sticker:file = Sticker; //@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender @@ -318,7 +300,7 @@ voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; //@description Describes an animated representation of an emoji //@sticker Animated sticker for the emoji //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none -//@sound File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container +//@sound File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 @@ -366,14 +348,10 @@ userTypeRegular = UserType; //@description A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user userTypeDeleted = UserType; -//@description A bot (see https://core.telegram.org/bots) -//@can_join_groups True, if the bot can be invited to basic group and supergroup chats +//@description A bot (see https://core.telegram.org/bots) @can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages -//@is_inline True, if the bot supports inline queries -//@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) -//@need_location True, if the location of the user is expected to be sent with every inline query to this bot -//@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; +//@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the application input field) @need_location True, if the location of the user is expected to be sent with every inline query to this bot +userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = 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; @@ -385,9 +363,6 @@ botCommand command:string description:string = 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; -//@description Describes a button to be shown instead of bot commands menu button @text Text of the button @url URL to be passed to openWebApp -botMenuButton text:string url:string = BotMenuButton; - //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner chatLocation location:location address:string = ChatLocation; @@ -426,32 +401,6 @@ inputChatPhotoStatic photo:InputFile = InputChatPhoto; inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputChatPhoto; -//@description Describes actions that a user is allowed to take in a chat -//@can_send_messages True, if the user can send text messages, contacts, locations, and venues -//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions -//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions -//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions -//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions -//@can_change_info True, if the user can change the chat title, photo, and other settings -//@can_invite_users True, if the user can invite new users to the chat -//@can_pin_messages True, if the user can pin messages -chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; - -//@description Describes rights of the administrator -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only -//@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only -//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only -//@can_delete_messages True, if the administrator can delete messages of other users -//@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels -//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only -//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them -//@can_manage_video_chats True, if the administrator can manage video chats -//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; - - //@description Represents a user //@id User identifier //@first_name First name of the user @@ -467,20 +416,11 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account -//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser +//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User; -//@description Contains information about a bot -//@share_text The text that is shown on the bot's profile page and is sent together with the link when users share the bot -//@param_description The text shown in the chat with the bot if the chat is empty -//@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown -//@commands List of the bot commands -//@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null -//@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null -botInfo share_text:string description:string menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; - //@description Contains full information about a user //@photo User profile photo; may be null //@is_blocked True, if the user is blocked by the current user @@ -490,11 +430,13 @@ botInfo share_text:string description:string menu_button:botMenuButton commands: //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@bio A short user bio +//@share_text For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot +//@param_description For bots, the text shown in the chat with the bot if the chat is empty //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@bot_info For bots, information about the bot; may be null -userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +//@commands For bots, list of the bot commands +userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector = UserFullInfo; -//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers +//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -505,6 +447,18 @@ chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdminist chatAdministrators administrators:vector = ChatAdministrators; +//@description Describes actions that a user is allowed to take in a chat +//@can_send_messages True, if the user can send text messages, contacts, locations, and venues +//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions +//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions +//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions +//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions +//@can_change_info True, if the user can change the chat title, photo, and other settings +//@can_invite_users True, if the user can invite new users to the chat +//@can_pin_messages True, if the user can pin messages +chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; + + //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges @@ -516,8 +470,18 @@ chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = C //@description 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 //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user -//@rights Rights of the administrator -chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; +//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_change_info True, if the administrator can change the chat title, photo, and other settings +//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only +//@can_delete_messages True, if the administrator can delete messages of other users +//@can_invite_users True, if the administrator can invite new users to the chat +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only +//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +//@can_manage_video_chats True, if the administrator can manage video chats +//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -543,7 +507,7 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; -//@description Contains a list of chat members @total_count Approximate total number of chat members found @members A list of chat members +//@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members chatMembers total_count:int32 members:vector = ChatMembers; @@ -613,7 +577,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@is_revoked True, if the link was revoked chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; -//@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links +//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; //@description Describes a chat administrator with a number of active and revoked chat invite links @@ -628,7 +592,7 @@ chatInviteLinkCounts invite_link_counts:vector = ChatInvite //@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; -//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link +//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; //@description Contains information about a chat invite link @@ -647,7 +611,7 @@ chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; -//@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests +//@description Contains a list of requests to join a chat @total_count Approximate total count of requests found @requests List of the requests chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; //@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests @@ -708,7 +672,7 @@ supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_co //@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators //@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@location Location to which the supergroup is connected; may be null -//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only +//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none @@ -747,7 +711,7 @@ messageSenderUser user_id:int53 = MessageSender; messageSenderChat chat_id:int53 = MessageSender; -//@description Represents a list of message senders @total_count Approximate total number of messages senders found @senders List of message senders +//@description Represents a list of message senders @total_count Approximate total count of messages senders found @senders List of message senders messageSenders total_count:int32 senders:vector = MessageSenders; @@ -790,25 +754,11 @@ messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announc //@last_message_id Identifier of the last reply to the message messageReplyInfo reply_count:int32 recent_replier_ids:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; -//@description Contains information about a reaction to a message -//@reaction Text representation of the reaction -//@total_count Number of times the reaction was added -//@is_chosen True, if the reaction is chosen by the current user -//@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats -messageReaction reaction:string total_count:int32 is_chosen:Bool recent_sender_ids:vector = MessageReaction; - //@description Contains information about interactions with a message //@view_count Number of times the message was viewed //@forward_count Number of times the message was forwarded //@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself -//@reactions The list of reactions added to the message -messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector = MessageInteractionInfo; - -//@description Contains information about an unread reaction to a message -//@reaction Text representation of the reaction -//@sender_id Identifier of the sender, added the reaction -//@is_big True, if the reaction was added with a big animation -unreadReaction reaction:string sender_id:MessageSender is_big:Bool = UnreadReaction; +messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo; //@class MessageSendingState @description Contains information about the sending state of the message @@ -836,11 +786,10 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions -//@can_get_statistics True, if the message statistics are available through getMessageStatistics -//@can_get_message_thread True, if information about the message thread is available through getMessageThread +//@can_get_statistics True, if the message statistics are available +//@can_get_message_thread True, if the message thread info is available //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@contains_unread_mention True, if the message contains an unread mention for the current user @@ -848,7 +797,6 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@edit_date Point in time (Unix timestamp) when the message was last edited //@forward_info Information about the initial message sender; may be null //@interaction_info Information about interactions with the message; may be null -//@unread_reactions Information about unread reactions added to the message //@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id //@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs @@ -860,18 +808,18 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; -//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null +//@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total count of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; //@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; -//@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions +//@description Contains a list of message positions @total_count Total count of messages found @positions List of message positions messagePositions total_count:int32 positions:vector = MessagePositions; //@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day @@ -883,32 +831,10 @@ messageCalendar total_count:int32 days:vector = MessageCalen //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages -//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link -//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 -//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead +//@sponsor_chat_id Chat identifier +//@link An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead //@content Content of the message. Currently, can be only of the type messageText -sponsoredMessage message_id:int53 sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo link:InternalLinkType content:MessageContent = SponsoredMessage; - - -//@description Describes a file added to file download list -//@file_id File identifier -//@message The message with the file -//@add_date Point in time (Unix timestamp) when the file was added to the download list -//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed -//@is_paused True, if downloading of the file is paused -fileDownload file_id:int32 message:message add_date:int32 complete_date:int32 is_paused:Bool = FileDownload; - -//@description Contains number of being downloaded and recently downloaded files found -//@active_count Number of active file downloads found, including paused -//@paused_count Number of paused file downloads found -//@completed_count Number of completed file downloads found -downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 = DownloadedFileCounts; - -//@description Contains a list of downloaded files, found by a search -//@total_counts Total number of suitable files, ignoring offset -//@files The list of files -//@next_offset The offset for the next request. If empty, there are no more results -foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; +sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType content:MessageContent = SponsoredMessage; //@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant @@ -916,32 +842,32 @@ foundFileDownloads total_counts:downloadedFileCounts files:vector //@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value notificationSettingsScopePrivateChats = NotificationSettingsScope; -//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value +//@description Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value notificationSettingsScopeGroupChats = NotificationSettingsScope; -//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value +//@description Notification settings applied to all channels when the corresponding chat setting has a default value notificationSettingsScopeChannelChats = NotificationSettingsScope; //@description Contains information about notification settings for a chat //@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat is used instead @mute_for Time left before notifications will be unmuted, in seconds -//@use_default_sound If true, the value for the relevant type of chat is used instead of sound_id @sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@use_default_sound If true, sound is ignored and the value for the relevant type of chat is used instead @sound The name of an audio file to be used for notification sounds; only applies to iOS applications //@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content must be displayed in notifications //@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead @disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message //@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead @disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound:string use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@sound The name of an audio file to be used for notification sounds; only applies to iOS applications //@show_preview True, if message content must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to_message_id Identifier of the message to reply to; 0 if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; @@ -1052,9 +978,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the chat -//@unread_reaction_count Number of messages with unread reactions in the chat -//@notification_settings Notification settings for the chat -//@available_reactions List of reactions, available in the chat +//@notification_settings Notification settings for this chat //@message_ttl Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null @@ -1063,9 +987,9 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:vector message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; -//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers +//@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1129,9 +1053,6 @@ keyboardButtonTypeRequestLocation = KeyboardButtonType; //@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; -//@description A button that opens a web app by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl -keyboardButtonTypeWebApp url:string = KeyboardButtonType; - //@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button keyboardButton text:string type:KeyboardButtonType = KeyboardButton; @@ -1142,12 +1063,9 @@ keyboardButton text:string type:KeyboardButtonType = KeyboardButton; //@description A button that opens a specified URL @url HTTP or tg:// URL to open inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; -//@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @url An HTTP URL to pass to getLoginUrlInfo @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages +//@description A button that opens a specified URL and automatically authorize the current user if allowed to do so @url An HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType; -//@description A button that opens a web app by calling openWebApp @url An HTTP URL to pass to openWebApp -inlineKeyboardButtonTypeWebApp url:string = InlineKeyboardButtonType; - //@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; @@ -1205,10 +1123,6 @@ loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo; loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo; -//@description Contains information about a web app @launch_id Unique identifier for the web app launch @url A web app URL to open in a web view -webAppInfo launch_id:int64 url:string = WebAppInfo; - - //@description Contains information about a message thread //@chat_id Identifier of the chat to which the message thread belongs //@message_thread_id Message thread identifier, unique within the chat @@ -1387,7 +1301,7 @@ pageBlockCollage page_blocks:vector caption:pageBlockCaption = PageBl //@description A slideshow @page_blocks Slideshow item contents @caption Block caption pageBlockSlideshow page_blocks:vector caption:pageBlockCaption = PageBlock; -//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username by which all other information about the chat can be resolved +//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username, by which all other information about the chat can be resolved pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; //@description A table @caption Table caption @cells Table cells @is_bordered True, if the table is bordered @is_striped True, if the table is striped @@ -1467,12 +1381,6 @@ bankCardInfo title:string actions:vector = BankCardInfo; address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address; -//@description Contains parameters of the app theme @background_color A color of the background in the RGB24 format @text_color A color of text in the RGB24 format -//@hint_color A color of hints in the RGB24 format @link_color A color of links in the RGB24 format @button_color A color of the buttons in the RGB24 format -//@button_text_color A color of text on the buttons in the RGB24 format -themeParameters background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; - - //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency labeledPricePart label:string amount:int53 = LabeledPricePart; @@ -1516,6 +1424,11 @@ inputCredentialsGooglePay data:string = InputCredentials; //@description Stripe payment provider @publishable_key Stripe API publishable key @need_country True, if the user country must be provided @need_postal_code True, if the user ZIP/postal code must be provided @need_cardholder_name True, if the cardholder name must be provided paymentsProviderStripe publishable_key:string need_country:Bool need_postal_code:Bool need_cardholder_name:Bool = PaymentsProviderStripe; +//@description Theme colors for a payment form @background_color A color of the payment form background in the RGB24 format @text_color A color of text in the RGB24 format +//@hint_color A color of hints in the RGB24 format @link_color A color of links in the RGB24 format @button_color A color of the buttons in the RGB24 format +//@button_text_color A color of text on the buttons in the RGB24 format +paymentFormTheme background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = PaymentFormTheme; + //@description Contains information about an invoice payment form //@id The payment form identifier //@invoice Full information of the invoice @@ -1949,13 +1862,7 @@ messageContactRegistered = MessageContent; //@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website messageWebsiteConnected domain_name:string = MessageContent; -//@description Data from a web app has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app -messageWebAppDataSent button_text:string = MessageContent; - -//@description Data from a web app has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app @data Received data -messageWebAppDataReceived button_text:string data:string = MessageContent; - -//@description Telegram Passport data has been sent to a bot @types List of Telegram Passport element types sent +//@description Telegram Passport data has been sent @types List of Telegram Passport element types sent messagePassportDataSent types:vector = MessageContent; //@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials @@ -2006,9 +1913,6 @@ textEntityTypeUnderline = TextEntityType; //@description A strikethrough text textEntityTypeStrikethrough = TextEntityType; -//@description A spoiler text. Not supported in secret chats -textEntityTypeSpoiler = TextEntityType; - //@description Text that must be formatted as if inside a code HTML tag textEntityTypeCode = TextEntityType; @@ -2047,9 +1951,8 @@ messageSchedulingStateSendWhenOnline = MessageSchedulingState; //@description Options to be used when a message is sent //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background -//@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled -messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; +messageSendOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; //@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local @@ -2060,7 +1963,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@class InputMessageContent @description The content of a message to send -//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled @clear_draft True, if a chat message draft must be deleted inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; @@ -2173,9 +2076,6 @@ searchMessagesFilterMention = SearchMessagesFilter; //@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user searchMessagesFilterUnreadMention = SearchMessagesFilter; -//@description Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user -searchMessagesFilterUnreadReaction = SearchMessagesFilter; - //@description Returns only failed to send messages. This filter can be used only if the message database is used searchMessagesFilterFailedToSend = SearchMessagesFilter; @@ -2259,20 +2159,20 @@ stickers stickers:vector = Stickers; emojis emojis:vector = Emojis; //@description Represents a sticker set -//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed +//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously -//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets +//@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set @emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set -//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null +//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously -//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets +//@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set @covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -2358,19 +2258,6 @@ groupCallVideoQualityMedium = GroupCallVideoQuality; groupCallVideoQualityFull = GroupCallVideoQuality; -//@description Describes an available stream in a group call -//@channel_id Identifier of an audio/video channel -//@scale Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds -//@time_offset Point in time when the stream currently ends; Unix timestamp in milliseconds -groupCallStream channel_id:int32 scale:int32 time_offset:int53 = GroupCallStream; - -//@description Represents a list of group call streams @streams A list of group call streams -groupCallStreams streams:vector = GroupCallStreams; - -//@description Represents an RTMP url @url The URL @stream_key Stream key -rtmpUrl url:string stream_key:string = RtmpUrl; - - //@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, is the user has spoken recently groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCallRecentSpeaker; @@ -2380,12 +2267,10 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended //@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start //@is_active True, if the call is active -//@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat //@is_joined True, if the call is joined //@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined //@can_be_managed True, if the current user can manage the group call //@participant_count Number of participants in the group call -//@has_hidden_listeners True, if group call participants, which are muted, aren't returned in participant list //@loaded_all_participants True, if all group call participants are loaded //@recent_speakers At most 3 recently speaking users in the group call //@is_my_video_enabled True, if the current user's video is enabled @@ -2396,7 +2281,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on //@is_video_recorded True, if a video file is being recorded for the call //@duration Call duration, in seconds; for ended calls only -groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; +groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; //@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers groupCallVideoSourceGroup semantics:string source_ids:vector = GroupCallVideoSourceGroup; @@ -2470,30 +2355,6 @@ call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Cal phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool authentication_tokens:vector = PhoneNumberAuthenticationSettings; -//@description Represents a reaction applied to a message @reaction Text representation of the reaction @sender_id Identifier of the chat member, applied the reaction -addedReaction reaction:string sender_id:MessageSender = AddedReaction; - -//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results -addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; - -//@description Represents a list of available reactions @reactions List of reactions -availableReactions reactions:vector = AvailableReactions; - - -//@description Contains stickers which must be used for reaction animation rendering -//@reaction Text representation of the reaction -//@title Reaction title -//@is_active True, if the reaction can be added to new messages and enabled in chats -//@static_icon Static icon for the reaction -//@appear_animation Appear animation for the reaction -//@select_animation Select animation for the reaction -//@activate_animation Activate animation for the reaction -//@effect_animation Effect animation for the reaction -//@around_animation Around animation for the reaction; may be null -//@center_animation Center animation for the reaction; may be null -reaction reaction:string title:string is_active:Bool static_icon:sticker appear_animation:sticker select_animation:sticker activate_animation:sticker effect_animation:sticker around_animation:sticker center_animation:sticker = Reaction; - - //@description Represents a list of animations @animations List of animations animations animations:vector = Animations; @@ -2517,25 +2378,6 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente importedContacts user_ids:vector importer_count:vector = ImportedContacts; -//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes -attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; - -//@description Represents a bot added to attachment menu -//@bot_user_id User identifier of the bot added to attachment menu -//@name Name for the bot in attachment menu -//@name_color Color to highlight selected name of the bot if appropriate; may be null -//@default_icon Default attachment menu icon for the bot in SVG format; may be null -//@ios_static_icon Attachment menu icon for the bot in SVG format for the official iOS app; may be null -//@ios_animated_icon Attachment menu icon for the bot in TGS format for the official iOS app; may be null -//@android_icon Attachment menu icon for the bot in TGS format for the official Android app; may be null -//@macos_icon Attachment menu icon for the bot in TGS format for the official native macOS app; may be null -//@icon_color Color to highlight selected icon of the bot if appropriate; may be null -attachmentMenuBot bot_user_id:int53 name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file android_icon:file macos_icon:file icon_color:attachmentMenuBotColor = AttachmentMenuBot; - -//@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known -sentWebAppMessage inline_message_id:string = SentWebAppMessage; - - //@description Contains an HTTP URL @url The URL httpUrl url:string = HttpUrl; @@ -2590,8 +2432,8 @@ inputInlineQueryResultLocation id:string location:location live_period:int32 tit //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultPhoto id:string title:string description:string thumbnail_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; -//@description Represents a link to a WEBP, TGS, or WEBM sticker @id Unique identifier of the query result @thumbnail_url URL of the sticker thumbnail, if it exists -//@sticker_url The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker +//@description Represents a link to a WEBP or TGS sticker @id Unique identifier of the query result @thumbnail_url URL of the sticker thumbnail, if it exists +//@sticker_url The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -2695,15 +2537,15 @@ chatEventMessageEdited old_message:message new_message:message = ChatEventAction //@description A message was deleted @message Deleted message chatEventMessageDeleted message:message = ChatEventAction; +//@description A poll in a message was stopped @message The message with the poll +chatEventPollStopped message:message = ChatEventAction; + //@description A message was pinned @message Pinned message chatEventMessagePinned message:message = ChatEventAction; //@description A message was unpinned @message Unpinned message chatEventMessageUnpinned message:message = ChatEventAction; -//@description A poll in a message was stopped @message The message with the poll -chatEventPollStopped message:message = ChatEventAction; - //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; @@ -2713,63 +2555,60 @@ chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction; //@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; -//@description A new chat member was invited @user_id New member user identifier @status New member status -chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction; - //@description A member left the chat chatEventMemberLeft = ChatEventAction; +//@description A new chat member was invited @user_id New member user identifier @status New member status +chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction; + //@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; //@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; -//@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions -chatEventAvailableReactionsChanged old_available_reactions:vector new_available_reactions:vector = ChatEventAction; - -//@description The chat description was changed @old_description Previous chat description @new_description New chat description -chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; - -//@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier -chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; - -//@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null -chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction; - -//@description The message TTL was changed @old_message_ttl Previous value of message_ttl @new_message_ttl New value of message_ttl -chatEventMessageTtlChanged old_message_ttl:int32 new_message_ttl:int32 = ChatEventAction; +//@description The chat title was changed @old_title Previous chat title @new_title New chat title +chatEventTitleChanged old_title:string new_title:string = ChatEventAction; //@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; -//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null -chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; - -//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds -chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; - -//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none -chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; - -//@description The chat title was changed @old_title Previous chat title @new_title New chat title -chatEventTitleChanged old_title:string new_title:string = ChatEventAction; +//@description The chat description was changed @old_description Previous chat description @new_description New chat description +chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; //@description The chat username was changed @old_username Previous chat username @new_username New chat username chatEventUsernameChanged old_username:string new_username:string = ChatEventAction; -//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content -chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; +//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null +chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; //@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; -//@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available -chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; +//@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier +chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; + +//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds +chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; + +//@description The message TTL was changed @old_message_ttl Previous value of message_ttl @new_message_ttl New value of message_ttl +chatEventMessageTtlChanged old_message_ttl:int32 new_message_ttl:int32 = ChatEventAction; //@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; +//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content +chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; + +//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; + +//@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null +chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction; + +//@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available +chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; + //@description A chat invite link was edited @old_invite_link Previous information about the invite link @new_invite_link New information about the invite link chatEventInviteLinkEdited old_invite_link:chatInviteLink new_invite_link:chatInviteLink = ChatEventAction; @@ -2785,15 +2624,15 @@ chatEventVideoChatCreated group_call_id:int32 = ChatEventAction; //@description A video chat was ended @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall chatEventVideoChatEnded group_call_id:int32 = ChatEventAction; -//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting -chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; - //@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; //@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; +//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting +chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; + //@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent; @@ -2821,7 +2660,7 @@ chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool //@description An ordinary language pack string @value String value languagePackStringValueOrdinary value:string = LanguagePackStringValue; -//@description A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information +//@description A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info //@zero_value Value for zero objects @one_value Value for one object @two_value Value for two objects //@few_value Value for few objects @many_value Value for many objects @other_value Default value languagePackStringValuePluralized zero_value:string one_value:string two_value:string few_value:string many_value:string other_value:string = LanguagePackStringValue; @@ -2839,7 +2678,7 @@ languagePackStrings strings:vector = LanguagePackStrings; //@description Contains information about a language pack @id Unique language pack identifier //@base_language_pack_id Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs //@name Language name @native_name Name of the language in that language -//@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information +//@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info //@is_official True, if the language pack is official @is_rtl True, if the language pack strings are RTL @is_beta True, if the language pack is a beta language pack //@is_installed True, if the language pack is installed by the current user //@total_string_count Total number of non-deleted strings from the language pack @translated_string_count Total number of translated strings from the language pack @@ -2991,7 +2830,7 @@ checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult; //@description The username is occupied checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult; -//@description The user has too many chats with username, one of them must be made private first +//@description The user has too much chats with username, one of them must be made private first checkChatUsernameResultPublicChatsTooMuch = CheckChatUsernameResult; //@description The user can't be a member of a public supergroup @@ -3159,22 +2998,9 @@ notificationGroupTypeSecretChat = NotificationGroupType; notificationGroupTypeCalls = NotificationGroupType; -//@description Describes a notification sound in MP3 format -//@id Unique identifier of the notification sound -//@duration Duration of the sound, in seconds -//@date Point in time (Unix timestamp) when the sound was created -//@title Title of the notification sound -//@data Arbitrary data, defined while the sound was uploaded -//@sound File containing the sound -notificationSound id:int64 duration:int32 date:int32 title:string data:string sound:file = NotificationSound; - -//@description Contains a list of notification sounds @notification_sounds A list of notification sounds -notificationSounds notification_sounds:vector = NotificationSounds; - - //@description Contains information about a notification @id Unique persistent identifier of this notification @date Notification date -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled @type Notification type -notification id:int32 date:int32 sound_id:int64 type:NotificationType = Notification; +//@is_silent True, if the notification was initially silent @type Notification type +notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notification; //@description Describes a group of notifications @id Unique persistent auto-incremented from 1 identifier of the notification group @type Type of the group //@chat_id Identifier of a chat to which all notifications in the group belong @@ -3307,7 +3133,7 @@ sessions sessions:vector inactive_session_ttl_days:int32 = Sessions; //@log_in_date Point in time (Unix timestamp) when the user was logged in //@last_active_date Point in time (Unix timestamp) when obtained authorization was last used //@ip IP address from which the user was logged in, in human-readable format -//@location Human-readable description of a country and a region from which the user was logged in, based on the IP address +//@location Human-readable description of a country and a region, from which the user was logged in, based on the IP address connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; //@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites @@ -3337,12 +3163,6 @@ chatReportReasonUnrelatedLocation = ChatReportReason; //@description The chat represents a fake account chatReportReasonFake = ChatReportReason; -//@description The chat has illegal drugs related content -chatReportReasonIllegalDrugs = ChatReportReason; - -//@description The chat contains messages with personal details -chatReportReasonPersonalDetails = ChatReportReason; - //@description A custom reason provided by the user chatReportReasonCustom = ChatReportReason; @@ -3352,13 +3172,6 @@ chatReportReasonCustom = ChatReportReason; //@description The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link internalLinkTypeActiveSessions = InternalLinkType; -//@description The link is a link to an attachment menu bot to be opened in the specified chat. Process given chat_link to open corresponding chat. -//-Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. -//-If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. -//-If attachment menu bots can't be used in the current chat, show an error to the user. If the bot is added to attachment menu, then use openWebApp with the given URL -//@chat_link An internal link pointing to a chat; may be null if the current chat needs to be kept @bot_username Username of the bot @url URL to be passed to openWebApp -internalLinkTypeAttachmentMenuBot chat_link:InternalLinkType bot_username:string url:string = InternalLinkType; - //@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code internalLinkTypeAuthenticationCode code:string = InternalLinkType; @@ -3371,19 +3184,9 @@ internalLinkTypeBackground background_name:string = InternalLinkType; internalLinkTypeBotStart bot_username:string start_parameter:string = InternalLinkType; //@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, -//-ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. -//-If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, -//-check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, -//-and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. -//-Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. -//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage @administrator_rights Expected administrator rights for the bot; may be null -internalLinkTypeBotStartInGroup bot_username:string start_parameter:string administrator_rights:chatAdministratorRights = InternalLinkType; - -//@description The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, -//-ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, -//-check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights -//@bot_username Username of the bot @administrator_rights Expected administrator rights for the bot -internalLinkTypeBotAddToChannel bot_username:string administrator_rights:chatAdministratorRights = InternalLinkType; +//-ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage +internalLinkTypeBotStartInGroup bot_username:string start_parameter:string = InternalLinkType; //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; @@ -3401,9 +3204,6 @@ internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkTy //@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; -//@description The link is a link to the language settings section of the app -internalLinkTypeLanguageSettings = InternalLinkType; - //@description The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo internalLinkTypeMessage url:string = InternalLinkType; @@ -3420,9 +3220,6 @@ internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:st //@hash Hash value from the link @phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; -//@description The link is a link to the privacy and security settings section of the app -internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; - //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy //@server Proxy server IP address @port Proxy server port @type Type of the proxy internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; @@ -3452,10 +3249,7 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; //@description The link is a link to an unsupported proxy. An alert can be shown to the user internalLinkTypeUnsupportedProxy = InternalLinkType; -//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link @phone_number Phone number of the user -internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType; - -//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link +//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link //@chat_username Username of the chat with the video chat @invite_hash If non-empty, invite hash to be used to join the video chat without being muted by administrators //@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; @@ -3492,9 +3286,6 @@ fileTypeAudio = FileType; //@description The file is a document fileTypeDocument = FileType; -//@description The file is a notification sound -fileTypeNotificationSound = FileType; - //@description The file is a photo fileTypePhoto = FileType; @@ -3655,7 +3446,7 @@ tMeUrlTypeUser user_id:int53 = TMeUrlType; //@description A URL linking to a public supergroup or channel @supergroup_id Identifier of the supergroup or channel tMeUrlTypeSupergroup supergroup_id:int53 = TMeUrlType; -//@description A chat invite link @info Information about the chat invite link +//@description A chat invite link @info Chat invite link info tMeUrlTypeChatInvite info:chatInviteLinkInfo = TMeUrlType; //@description A URL linking to a sticker set @sticker_set_id Identifier of the sticker set @@ -3732,11 +3523,18 @@ proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool typ proxies proxies:vector = Proxies; -//@description A sticker to be added to a sticker set -//@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements +//@class InputSticker @description Describes a sticker that needs to be added to a sticker set + +//@description A static sticker in PNG format, which will be converted to WEBP server-side +//@sticker PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square //@emojis Emojis corresponding to the sticker -//@type Sticker type -inputSticker sticker:InputFile emojis:string type:StickerType = InputSticker; +//@mask_position For masks, position where the mask is placed; pass null if unspecified +inputStickerStatic sticker:InputFile emojis:string mask_position:maskPosition = InputSticker; + +//@description An animated sticker in TGS format +//@sticker File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements +//@emojis Emojis corresponding to the sticker +inputStickerAnimated sticker:InputFile emojis:string = InputSticker; //@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends @@ -3902,9 +3700,6 @@ updateMessageContentOpened chat_id:int53 message_id:int53 = Update; //@description A message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count The new number of unread mention messages left in the chat updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update; -//@description The list of unread reactions added to a message was changed @chat_id Chat identifier @message_id Message identifier @unread_reactions The new list of unread reactions @unread_reaction_count The new number of messages with unread reactions left in the chat -updateMessageUnreadReactions chat_id:int53 message_id:int53 unread_reactions:vector unread_reaction_count:int32 = Update; - //@description A message with a live location was viewed. When the update is received, the application is supposed to update the live location //@chat_id Identifier of the chat with the live location message @message_id Identifier of the message with live location updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update; @@ -3936,9 +3731,6 @@ updateChatReadOutbox chat_id:int53 last_read_outbox_message_id:int53 = Update; //@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update; -//@description The chat available reactions were changed @chat_id Chat identifier @available_reactions The new list of reactions, available in the chat -updateChatAvailableReactions chat_id:int53 available_reactions:vector = Update; - //@description A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied @chat_id Chat identifier @draft_message The new draft message; may be null @positions The new chat positions in the chat lists updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector = Update; @@ -3964,9 +3756,6 @@ updateChatTheme chat_id:int53 theme_name:string = Update; //@description The chat unread_mention_count has changed @chat_id Chat identifier @unread_mention_count The number of unread mention messages left in the chat updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update; -//@description The chat unread_reaction_count has changed @chat_id Chat identifier @unread_reaction_count The number of messages with unread reactions left in the chat -updateChatUnreadReactionCount chat_id:int53 unread_reaction_count:int32 = Update; - //@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat updateChatVideoChat chat_id:int53 video_chat:videoChat = Update; @@ -3988,7 +3777,7 @@ updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; //@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters updateChatFilters chat_filters:vector = Update; -//@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown +//@description The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings @@ -4002,10 +3791,10 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@type New type of the notification group //@chat_id Identifier of a chat to which all notifications in the group belong //@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications -//@notification_sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@is_silent True, if the notifications must be shown without sound //@total_count Total number of unread notifications in the group, can be bigger than number of active notifications //@added_notifications List of added group notifications, sorted by notification ID @removed_notification_ids Identifiers of removed group notifications, sorted by notification ID -updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; +updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 is_silent:Bool total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; //@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector = Update; @@ -4065,24 +3854,6 @@ updateFileGenerationStart generation_id:int64 original_path:string destination_p //@description File generation is no longer needed @generation_id Unique identifier for the generation process updateFileGenerationStop generation_id:int64 = Update; -//@description The state of the file download list has changed -//@total_size Total size of files in the file download list, in bytes -//@total_count Total number of files in the file download list -//@downloaded_size Total downloaded size of files in the file download list, in bytes -updateFileDownloads total_size:int53 total_count:int32 downloaded_size:int53 = Update; - -//@description A file was added to the file download list. This update is sent only after file download list is loaded for the first time @file_download The added file download @counts New number of being downloaded and recently downloaded files found -updateFileAddedToDownloads file_download:fileDownload counts:downloadedFileCounts = Update; - -//@description A file download was changed. This update is sent only after file download list is loaded for the first time @file_id File identifier -//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed -//@is_paused True, if downloading of the file is paused -//@counts New number of being downloaded and recently downloaded files found -updateFileDownload file_id:int32 complete_date:int32 is_paused:Bool counts:downloadedFileCounts = Update; - -//@description A file was removed from the file download list. This update is sent only after file download list is loaded for the first time @file_id File identifier @counts New number of being downloaded and recently downloaded files found -updateFileRemovedFromDownloads file_id:int32 counts:downloadedFileCounts = Update; - //@description New call was created or information about a call was updated @call New data about a call updateCall call:call = Update; @@ -4131,9 +3902,6 @@ updateFavoriteStickers sticker_ids:vector = Update; //@description The list of saved animations was updated @animation_ids The new list of file identifiers of saved animations updateSavedAnimations animation_ids:vector = Update; -//@description The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds -updateSavedNotificationSounds notification_sound_ids:vector = Update; - //@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null updateSelectedBackground for_dark_theme:Bool background:background = Update; @@ -4152,15 +3920,6 @@ updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService //@description The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby updateUsersNearby users_nearby:vector = Update; -//@description The list of bots added to attachment menu has changed @bots The new list of bots added to attachment menu. The bots must be shown in attachment menu only in private chats. The bots must not be shown on scheduled messages screen -updateAttachmentMenuBots bots:vector = Update; - -//@description A message was sent by an opened web app, so the web app needs to be closed @web_app_launch_id Identifier of web app launch -updateWebAppMessageSent web_app_launch_id:int64 = Update; - -//@description The list of supported reactions has changed @reactions The new list of supported reactions -updateReactions reactions:vector = Update; - //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; @@ -4175,7 +3934,7 @@ updateAnimationSearchParameters provider:string emojis:vector = Update; updateSuggestedActions added_actions:vector removed_actions:vector = Update; //@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location; may be null -//@chat_type The type of the chat from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return +//@chat_type The type of the chat, from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_type:ChatType query:string offset:string = Update; //@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location; may be null @@ -4183,11 +3942,11 @@ updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_t updateNewChosenInlineResult sender_user_id:int53 user_location:location query:string result_id:string inline_message_id:string = Update; //@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query -//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message from which the query originated +//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message, from which the query originated //@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update; -//@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message from which the query originated +//@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message, from which the query originated //@chat_instance An identifier uniquely corresponding to the chat a message was sent to @payload Query payload updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; @@ -4334,7 +4093,7 @@ setDatabaseEncryptionKey new_encryption_key:bytes = Ok; getPasswordState = PasswordState; //@description Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed -//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true to change also the recovery email address @new_recovery_email_address New recovery email address; may be empty +//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true if the recovery email address must be changed @new_recovery_email_address New recovery email address; may be empty setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; //@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The password for the current user @@ -4403,7 +4162,7 @@ getChat chat_id:int53 = Chat; //@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessage chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get +//@description Returns information about a message, if it is available locally without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessageLocally chat_id:int53 message_id:int53 = Message; //@description Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively @@ -4502,7 +4261,7 @@ getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message //@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@only_local Pass true to get only messages that are available without sending network requests +//@only_local If true, returns only messages that are available locally without sending network requests getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages; //@description Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. @@ -4515,10 +4274,10 @@ getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages; //@description Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat -//@chat_id Chat identifier @remove_from_chat_list Pass true to remove the chat from all chat lists @revoke Pass true to delete chat history for all users +//@chat_id Chat identifier @remove_from_chat_list Pass true if the chat needs to be removed from the chat list @revoke Pass true to delete chat history for all users deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; -//@description Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @chat_id Chat identifier +//@description Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method @chat_id Chat identifier deleteChat chat_id:int53 = Ok; //@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query @@ -4541,7 +4300,7 @@ searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_messa //@offset_chat_id The chat identifier of the last found message, or 0 for the first request //@offset_message_id The message identifier of the last found message, or 0 for the first request //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function +//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function //@min_date If not 0, the minimum date of the messages to return //@max_date If not 0, the maximum date of the messages to return searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = Messages; @@ -4549,22 +4308,16 @@ searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id: //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats //@query Query to search for. If empty, searchChatMessages must be used instead -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@filter Additional filter for messages to search; pass null to search for all messages searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages; //@description Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@from_message_id Identifier of the message from which to search; use 0 to get results from the last message -//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@only_missed Pass true to search only for messages with missed/declined calls +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit @only_missed If true, returns only messages with missed/declined calls searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages; -//@description Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order -//@query Query to search for in document file name and message caption -//@limit The maximum number of messages to be returned; up to 100 -searchOutgoingDocumentMessages query:string limit:int32 = FoundMessages; - //@description Deletes all call messages @revoke Pass true to delete the messages for all users deleteAllCallMessages revoke:Bool = Ok; @@ -4580,18 +4333,18 @@ getChatMessageByDate chat_id:int53 date:int32 = Message; //@description 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 //@chat_id Identifier of the chat in which to return information about message positions -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function //@from_message_id The message identifier from which to return information about message positions //@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions; //@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" //@chat_id Identifier of the chat in which to return information about messages -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function //@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; -//@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally +//@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier @@ -4600,7 +4353,7 @@ getChatScheduledMessages chat_id:int53 = Messages; //@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; @@ -4633,13 +4386,6 @@ getMessageEmbeddingCode chat_id:int53 message_id:int53 for_album:Bool = Text; getMessageLinkInfo url:string = MessageLinkInfo; -//@description Translates a text to the given language. Returns a 404 error if the translation can't be performed -//@text Text to translate -//@from_language_code A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically -//@to_language_code A two-letter ISO 639-1 language code of the language to which the message is translated -translateText text:string from_language_code:string to_language_code:string = Text; - - //@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier getChatAvailableMessageSenders chat_id:int53 = MessageSenders; @@ -4649,7 +4395,7 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to_message_id Identifier of the message to reply to or 0 //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent @@ -4658,11 +4404,10 @@ sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 opti //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to_message_id Identifier of a message to reply to or 0 //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -//@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @chat_id Identifier of the target chat @parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking) @@ -4671,11 +4416,11 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to_message_id Identifier of a message to reply to or 0 //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline result -//@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username"), and GetOption("venue_search_bot_username") +//@hide_via_bot If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message @@ -4683,9 +4428,9 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_mess //@from_chat_id Identifier of the chat from which to forward messages //@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously //@options Options to be used to send the messages; pass null to use default options -//@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local -//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false -//@only_preview Pass true to get fake messages instead of actually forwarding them +//@send_copy If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local +//@remove_caption If true, media caption of message copies will be removed. Ignored if send_copy is false +//@only_preview If true, messages will not be forwarded and instead fake messages will be returned forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. @@ -4699,7 +4444,7 @@ sendChatScreenshotTakenNotification chat_id:int53 = Ok; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to_message_id Identifier of the message to reply to or 0 //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; @@ -4790,35 +4535,14 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; -//@description Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message -//@chat_id Identifier of the chat to which the message belongs -//@message_id Identifier of the message -getMessageAvailableReactions chat_id:int53 message_id:int53 = AvailableReactions; - -//@description Changes chosen reaction for a message -//@chat_id Identifier of the chat to which the message belongs -//@message_id Identifier of the message -//@reaction Text representation of the new chosen reaction. Can be an empty string or the currently chosen non-big reaction to remove the reaction -//@is_big Pass true if the reaction is added with a big animation -setMessageReaction chat_id:int53 message_id:int53 reaction:string is_big:Bool = Ok; - -//@description Returns reactions added for a message, along with their sender -//@chat_id Identifier of the chat to which the message belongs -//@message_id Identifier of the message -//@reaction If non-empty, only added reactions with the specified text representation will be returned -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of reactions to be returned; must be positive and can't be greater than 100 -getMessageAddedReactions chat_id:int53 message_id:int53 reaction:string offset:string limit:int32 = AddedReactions; - - //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously -//@text The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" +//@text The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" parseMarkdown text:formattedText = FormattedText; //@description Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously @text The text @@ -4843,19 +4567,14 @@ getJsonValue json:string = JsonValue; //@description Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously @json_value The JsonValue object getJsonString json_value:JsonValue = Text; -//@description Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously @theme Theme parameters to convert to JSON -getThemeParametersJsonString theme:themeParameters = Text; - //@description Changes the user answer to a poll. A poll in quiz mode can be answered only once -//@chat_id Identifier of the chat to which the poll belongs -//@message_id Identifier of the message containing the poll +//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector = Ok; //@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib -//@chat_id Identifier of the chat to which the poll belongs -//@message_id Identifier of the message containing the poll +//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option //@offset Number of users to skip in the result; must be non-negative //@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached @@ -4879,7 +4598,7 @@ getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. //-Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button //@chat_id Chat identifier of the message with the button @message_id Message identifier of the message with the button @button_id Button identifier -//@allow_write_access Pass true to allow the bot to send messages to the current user +//@allow_write_access True, if the user allowed the bot to send them messages getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; @@ -4893,7 +4612,7 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que //@description Sets the result of an inline query; for bots only //@inline_query_id Identifier of the inline query -//@is_personal Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query +//@is_personal True, if the result of the query can be cached for the specified user //@results The results of the query //@cache_time Allowed time to cache the results of the query, in seconds //@next_offset Offset for the next inline query; pass an empty string if there are no more results @@ -4902,38 +4621,10 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que answerInlineQuery inline_query_id:int64 is_personal:Bool results:vector cache_time:int32 next_offset:string switch_pm_text:string switch_pm_parameter:string = Ok; -//@description Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed -//@bot_user_id Identifier of the target bot -//@url The URL from the keyboardButtonTypeWebApp button -//@theme Preferred web app theme; pass null to use the default theme -getWebAppUrl bot_user_id:int53 url:string theme:themeParameters = HttpUrl; - -//@description Sends data received from a keyboardButtonTypeWebApp web app to a bot -//@bot_user_id Identifier of the target bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the web app @data Received data -sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; - -//@description Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. -//-For each bot, a confirmation alert about data sent to the bot must be shown once -//@chat_id Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now -//@bot_user_id Identifier of the bot, providing the web app -//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise -//@theme Preferred web app theme; pass null to use the default theme -//@reply_to_message_id Identifier of the replied message for the message sent by the web app; 0 if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters reply_to_message_id:int53 = WebAppInfo; - -//@description Informs TDLib that a previously opened web app was closed @web_app_launch_id Identifier of web app launch, received from openWebApp -closeWebApp web_app_launch_id:int64 = Ok; - -//@description Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only -//@web_app_query_id Identifier of the web app query -//@result The result of the query -answerWebAppQuery web_app_query_id:string result:InputInlineQueryResult = SentWebAppMessage; - - //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires @chat_id Identifier of the chat with the message @message_id Identifier of the message from which the query originated @payload Query payload getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer; -//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert Pass true to show an alert to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds +//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert If true, an alert must be shown to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds answerCallbackQuery callback_query_id:int64 text:string show_alert:Bool url:string cache_time:int32 = Ok; @@ -4944,12 +4635,11 @@ answerShippingQuery shipping_query_id:int64 shipping_options:vector force_read:Bool = Ok; //@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed @chat_id Chat identifier of the message @message_id Identifier of the message with the opened content @@ -4996,24 +4686,21 @@ getInternalLinkType link:string = InternalLinkType; getExternalLinkInfo link:string = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed -//@link The HTTP link @allow_write_access Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages +//@link The HTTP link @allow_write_access True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages getExternalLink link:string allow_write_access:Bool = HttpUrl; //@description Marks all mentions in a chat as read @chat_id Chat identifier readAllChatMentions chat_id:int53 = Ok; -//@description Marks all reactions in a chat as read @chat_id Chat identifier -readAllChatReactions chat_id:int53 = Ok; - -//@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect +//@description Returns an existing chat corresponding to a given user @user_id User identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect createPrivateChat user_id:int53 force:Bool = Chat; -//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect +//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect createBasicGroupChat basic_group_id:int53 force:Bool = Chat; -//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect +//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect createSupergroupChat supergroup_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier @@ -5024,10 +4711,10 @@ createNewBasicGroupChat user_ids:vector title:string = Chat; //@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat //@title Title of the new chat; 1-128 characters -//@is_channel Pass true to create a channel chat +//@is_channel True, if a channel chat needs to be created //@param_description Chat description; 0-255 characters //@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat -//@for_import Pass true to create a supergroup for importing messages using importMessage +//@for_import True, if the supergroup is created for importing messages using importMessage createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user @@ -5075,8 +4762,8 @@ setChatTitle chat_id:int53 title:string = Ok; setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; //@description Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels -//-Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). -//@chat_id Chat identifier @ttl New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400 +//-Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) +//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret setChatMessageTtl chat_id:int53 ttl:int32 = Ok; //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right @@ -5094,7 +4781,7 @@ setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMes setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; //@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges -//@chat_id Chat identifier @has_protected_content New value of has_protected_content +//@chat_id Chat identifier @has_protected_content True, if chat content can't be saved locally, forwarded, or copied toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -5103,9 +4790,6 @@ toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok; //@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok; -//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions New list of reactions, available in the chat. All reactions must be active -setChatAvailableReactions chat_id:int53 available_reactions:vector = Ok; - //@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data setChatClientData chat_id:int53 client_data:string = Ok; @@ -5125,8 +4809,8 @@ setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; //@description Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel //@chat_id Identifier of the chat //@message_id Identifier of the new pinned message -//@disable_notification Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats -//@only_for_self Pass true to pin the message only for self; private chats only +//@disable_notification True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats +//@only_for_self True, if the message needs to be pinned for one side only; private chats only pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool only_for_self:Bool = Ok; //@description Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat @message_id Identifier of the removed pinned message @@ -5182,26 +4866,13 @@ searchChatMembers chat_id:int53 query:string limit:int32 filter:ChatMembersFilte getChatAdministrators chat_id:int53 = ChatAdministrators; -//@description Clears message drafts in all chats @exclude_secret_chats Pass true to keep local message drafts in secret chats +//@description Clears draft messages in all chats @exclude_secret_chats If true, local draft messages in secret chats will not be cleared clearAllDraftMessages exclude_secret_chats:Bool = Ok; -//@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound -getSavedNotificationSound notification_sound_id:int64 = NotificationSounds; - -//@description Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used -getSavedNotificationSounds = NotificationSounds; - -//@description Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, it is position isn't changed @sound Notification sound file to add -addSavedNotificationSound sound:InputFile = NotificationSound; - -//@description Removes a notification sound from the list of saved notification sounds @notification_sound_id Identifier of the notification sound -removeSavedNotificationSound notification_sound_id:int64 = Ok; - - //@description Returns list of chats with non-default notification settings //@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes -//@compare_sound Pass true to include in the response chats with only non-default sound +//@compare_sound If true, also chats with non-default sound will be returned getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; //@description Returns the notification settings for chats of a given type @scope Types of chats for which to return the notification settings information @@ -5210,31 +4881,25 @@ getScopeNotificationSettings scope:NotificationSettingsScope = ScopeNotification //@description Changes notification settings for chats of a given type @scope Types of chats for which to change the notification settings @notification_settings The new notification settings for the given scope setScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Ok; -//@description Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown +//@description Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown resetAllNotificationSettings = Ok; -//@description Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list -//@chat_list Chat list in which to change the pinned state of the chat @chat_id Chat identifier @is_pinned Pass true to pin the chat; pass false to unpin it +//@description Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list +//@chat_list Chat list in which to change the pinned state of the chat @chat_id Chat identifier @is_pinned True, if the chat is pinned toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; -//@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier -getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; - -//@description Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true @bot_user_id Bot's user identifier @is_added Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu -toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool = Ok; - - //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download -//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first +//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first //@offset The starting position from which the file needs to be downloaded //@limit Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit -//@synchronous Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started +//@synchronous If false, this request returns file state just after the download has been started. If true, this request returns file state only after +//-the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent downloadFile file_id:int32 priority:int32 offset:int32 limit:int32 synchronous:Bool = File; //@description Returns file downloaded prefix size from a given offset, in bytes @file_id Identifier of the file @offset Offset from which downloaded prefix size needs to be calculated @@ -5279,39 +4944,6 @@ readFilePart file_id:int32 offset:int32 count:int32 = FilePart; //@description Deletes a file from the TDLib file cache @file_id Identifier of the file to delete deleteFile file_id:int32 = Ok; -//@description Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. -//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file -//@file_id Identifier of the file to download -//@chat_id Chat identifier of the message with the file -//@message_id Message identifier -//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first -addFileToDownloads file_id:int32 chat_id:int53 message_id:int53 priority:int32 = File; - -//@description Changes pause state of a file in the file download list -//@file_id Identifier of the downloaded file -//@is_paused Pass true if the download is paused -toggleDownloadIsPaused file_id:int32 is_paused:Bool = Ok; - -//@description Changes pause state of all files in the file download list @are_paused Pass true to pause all downloads; pass false to unpause them -toggleAllDownloadsArePaused are_paused:Bool = Ok; - -//@description Removes a file from the file download list @file_id Identifier of the downloaded file @delete_from_cache Pass true to delete the file from the TDLib file cache -removeFileFromDownloads file_id:int32 delete_from_cache:Bool = Ok; - -//@description Removes all files from the file download list -//@only_active Pass true to remove only active downloads, including paused -//@only_completed Pass true to remove only completed downloads -//@delete_from_cache Pass true to delete the file from the TDLib file cache -removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cache:Bool = Ok; - -//@description Searches for files in the file download list or recently downloaded files from the list -//@query Query to search for; may be empty to return all downloaded files -//@only_active Pass true to search only for active downloads, including paused -//@only_completed Pass true to search only for completed downloads -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of files to be returned -searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads; - //@description Returns information about a file with messages exported from another app @message_file_head Beginning of the message file; up to 100 first lines getMessageFileType message_file_head:string = MessageFileType; @@ -5335,7 +4967,7 @@ replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink; //@name Invite link name; 0-32 characters //@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never //@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited -//@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 +//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; //@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @@ -5344,7 +4976,7 @@ createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limi //@name Invite link name; 0-32 characters //@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never //@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited -//@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 +//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified editChatInviteLink chat_id:int53 invite_link:string name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; //@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links @@ -5396,17 +5028,17 @@ joinChatByInviteLink invite_link:string = Chat; //@limit The maximum number of requests to join the chat to return getChatJoinRequests chat_id:int53 invite_link:string query:string offset_request:chatJoinRequest limit:int32 = ChatJoinRequests; -//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve Pass true to approve the request; pass false to decline it +//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve True, if the request is approved. Otherwise the request is declived processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok; //@description Handles all pending join requests for a given link in a chat //@chat_id Chat identifier //@invite_link Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links -//@approve Pass true to approve all requests; pass false to decline them +//@approve True, if the requests are approved. Otherwise the requests are declived processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok; -//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video Pass true to create a video call +//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video True, if a video call needs to be created createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId; //@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application @@ -5415,7 +5047,7 @@ acceptCall call_id:int32 protocol:callProtocol = Ok; //@description Sends call signaling data @call_id Call identifier @data The data sendCallSignalingData call_id:int32 data:bytes = Ok; -//@description Discards a call @call_id Call identifier @is_disconnected Pass true if the user was disconnected @duration The call duration, in seconds @is_video Pass true if the call was a video call @connection_id Identifier of the connection used during the call +//@description Discards a call @call_id Call identifier @is_disconnected True, if the user was disconnected @duration The call duration, in seconds @is_video True, if the call was a video call @connection_id Identifier of the connection used during the call discardCall call_id:int32 is_disconnected:Bool duration:int32 is_video:Bool connection_id:int64 = Ok; //@description Sends a call rating @call_id Call identifier @rating Call rating; 1-5 @comment An optional user comment if the rating is less than 5 @problems List of the exact types of problems with the call, specified by the user @@ -5432,17 +5064,10 @@ getVideoChatAvailableParticipants chat_id:int53 = MessageSenders; setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSender = Ok; //@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights -//@chat_id Identifier of a chat in which the video chat will be created +//@chat_id Chat identifier, in which the video chat will be created //@title Group call title; if empty, chat title will be used //@start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future -//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges -createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId; - -//@description Returns RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier -getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; - -//@description Replaces the current RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier -replaceVideoChatRtmpUrl chat_id:int53 = RtmpUrl; +createVideoChat chat_id:int53 title:string start_date:int32 = GroupCallId; //@description Returns information about a group call @group_call_id Group call identifier getGroupCall group_call_id:int32 = GroupCall; @@ -5459,8 +5084,8 @@ toggleGroupCallEnabledStartNotification group_call_id:int32 enabled_start_notifi //@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only //@audio_source_id Caller audio channel synchronization source identifier; received from tgcalls //@payload Group call join payload; received from tgcalls -//@is_muted Pass true to join the call with muted microphone -//@is_my_video_enabled Pass true if the user's video is enabled +//@is_muted True, if the user's microphone is muted +//@is_my_video_enabled True, if the user's video is enabled //@invite_hash If non-empty, invite hash to be used to join the group call without being muted by administrators joinGroupCall group_call_id:int32 participant_id:MessageSender audio_source_id:int32 payload:string is_muted:Bool is_my_video_enabled:Bool invite_hash:string = Text; @@ -5509,11 +5134,11 @@ toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok; toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok; //@description Informs TDLib that speaking state of a participant of an active group has changed @group_call_id Group call identifier -//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking Pass true if the user is speaking +//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking True, if the user is speaking setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = Ok; //@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves -//@group_call_id Group call identifier @participant_id Participant identifier @is_muted Pass true to mute the user; pass false to unmute the them +//@group_call_id Group call identifier @participant_id Participant identifier @is_muted Pass true if the user must be muted and false otherwise toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; //@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level @@ -5536,9 +5161,6 @@ leaveGroupCall group_call_id:int32 = Ok; //@description Ends a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier endGroupCall group_call_id:int32 = Ok; -//@description Returns information about available group call streams @group_call_id Group call identifier -getGroupCallStreams group_call_id:int32 = GroupCallStreams; - //@description Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video //@group_call_id Group call identifier //@time_offset Point in time when the stream segment begins; Unix timestamp in milliseconds @@ -5553,17 +5175,17 @@ toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat -//@delete_message Pass true to delete the message -//@delete_all_messages Pass true to delete all messages from the same sender -//@report_spam Pass true to report the sender to the Telegram moderators +//@delete_message Pass true if the message must be deleted +//@delete_all_messages Pass true if all messages from the same sender must be deleted +//@report_spam Pass true if the sender must be reported to the Telegram moderators blockMessageSenderFromReplies message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok; //@description Returns users and chats that were blocked by the current user @offset Number of users and chats to skip in the result; must be non-negative @limit The maximum number of users and chats to return; up to 100 getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders; -//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored -//@share_phone_number Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number +//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored +//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported @@ -5589,9 +5211,6 @@ changeImportedContacts contacts:vector = ImportedContacts; clearImportedContacts = Ok; -//@description Searches a user by their phone number @phone_number Phone number to search for -searchUserByPhoneNumber phone_number:string = User; - //@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact sharePhoneNumber user_id:int53 = Ok; @@ -5667,7 +5286,7 @@ removeFavoriteSticker sticker:InputFile = Ok; //@description Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object @sticker Sticker file identifier getStickerEmojis sticker:InputFile = Emojis; -//@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match Pass true if only emojis, which exactly match the text, needs to be returned @input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown +//@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match True, if only emojis, which exactly match text needs to be returned @input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown searchEmojis text:string exact_match:Bool input_language_codes:vector = Emojis; //@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji @@ -5702,7 +5321,7 @@ removeRecentHashtag hashtag:string = Ok; //@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview @text Message text with formatting getWebPagePreview text:formattedText = WebPage; -//@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page +//@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full If true, the full instant view for the web page will be returned getWebPageInstantView url:string force_full:Bool = WebPageInstantView; @@ -5737,34 +5356,20 @@ checkChangePhoneNumberCode code:string = Ok; //@description Sets the list of commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to change commands in the default bot command scope -//@language_code A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands +//@language_code A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands //@commands List of the bot's commands setCommands scope:BotCommandScope language_code:string commands:vector = Ok; //@description Deletes commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to delete commands in the default bot command scope -//@language_code A two-letter ISO 639-1 language code or an empty string +//@language_code A two-letter ISO 639-1 country code or an empty string deleteCommands scope:BotCommandScope language_code:string = Ok; //@description Returns the list of commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to get commands in the default bot command scope -//@language_code A two-letter ISO 639-1 language code or an empty string +//@language_code A two-letter ISO 639-1 country code or an empty string getCommands scope:BotCommandScope language_code:string = BotCommands; -//@description Sets menu button for the given user or for all users; for bots only -//@user_id Identifier of the user or 0 to set menu button for all users -//@menu_button New menu button -setMenuButton user_id:int53 menu_button:botMenuButton = Ok; - -//@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button -getMenuButton user_id:int53 = BotMenuButton; - -//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null -setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok; - -//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null -setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok; - //@description Returns all active sessions of the current user getActiveSessions = Sessions; @@ -5775,10 +5380,10 @@ terminateSession session_id:int64 = Ok; //@description Terminates all other sessions of the current user terminateAllOtherSessions = Ok; -//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise +//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls True, if incoming calls can be accepted by the session toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; -//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepring secret chats by the session; pass false otherwise +//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats True, if incoming secret chats can be accepted by the session toggleSessionCanAcceptSecretChats session_id:int64 can_accept_secret_chats:Bool = Ok; //@description Changes the period of inactivity after which sessions will automatically be terminated @inactive_session_ttl_days New number of days of inactivity before sessions will be automatically terminated; 1-366 days @@ -5832,13 +5437,13 @@ getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filte //@chat_id Chat identifier of the Invoice message //@message_id Message identifier //@theme Preferred payment form theme; pass null to use the default theme -getPaymentForm chat_id:int53 message_id:int53 theme:themeParameters = PaymentForm; +getPaymentForm chat_id:int53 message_id:int53 theme:paymentFormTheme = PaymentForm; //@description Validates the order information provided by a user and returns the available shipping options for a flexible invoice //@chat_id Chat identifier of the Invoice message //@message_id Message identifier //@order_info The order information, provided by the user; pass null if empty -//@allow_save Pass true to save the order information +//@allow_save True, if the order information can be saved validateOrderInfo chat_id:int53 message_id:int53 order_info:orderInfo allow_save:Bool = ValidatedOrderInfo; //@description Sends a filled-out payment form to the bot for final verification @chat_id Chat identifier of the Invoice message @message_id Message identifier @@ -5849,10 +5454,10 @@ sendPaymentForm chat_id:int53 message_id:int53 payment_form_id:int64 order_info_ //@description Returns information about a successful payment @chat_id Chat identifier of the PaymentSuccessful message @message_id Message identifier getPaymentReceipt chat_id:int53 message_id:int53 = PaymentReceipt; -//@description Returns saved order information. Returns a 404 error if there is no saved order information +//@description Returns saved order info, if any getSavedOrderInfo = OrderInfo; -//@description Deletes saved order information +//@description Deletes saved order info deleteSavedOrderInfo = Ok; //@description Deletes saved credentials for all payment provider bots @@ -5863,7 +5468,7 @@ deleteSavedCredentials = Ok; getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme +//@description Returns backgrounds installed by the user @for_dark_theme True, if the backgrounds must be ordered for dark theme getBackgrounds for_dark_theme:Bool = Backgrounds; //@description Constructs a persistent HTTP URL for a background @name Background name @type Background type @@ -5875,7 +5480,7 @@ searchBackground name:string = Background; //@description Changes the background selected by the user; adds background to the list of installed backgrounds //@background The input background to use; pass null to create a new filled backgrounds or to remove the current background //@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme Pass true if the background is changed for a dark theme +//@for_dark_theme True, if the background is chosen for dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; //@description Removes background from the list of installed backgrounds @background_id The background identifier @@ -5885,7 +5490,7 @@ removeBackground background_id:int64 = Ok; resetBackgrounds = Ok; -//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests +//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local If true, returns only locally available information without sending network requests getLocalizationTargetInfo only_local:Bool = LocalizationTargetInfo; //@description Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization @language_pack_id Language pack identifier @@ -5958,7 +5563,7 @@ deleteAccount reason:string = Ok; removeChatActionBar chat_id:int53 = Ok; //@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported -//@chat_id Chat identifier @message_ids Identifiers of reported messages; may be empty to report the whole chat @reason The reason for reporting the chat @text Additional report details; 0-1024 characters +//@chat_id Chat identifier @message_ids Identifiers of reported messages, if any @reason The reason for reporting the chat @text Additional report details; 0-1024 characters reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; //@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported @@ -5987,7 +5592,7 @@ getDatabaseStatistics = DatabaseStatistics; //@description Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted //@size Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit //@ttl Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit -//@count Limit on the total number of files after deletion. Pass -1 to use the default limit +//@count Limit on the total count of files after deletion. Pass -1 to use the default limit //@immunity_delay The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value //@file_types If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted //@chat_ids If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos) @@ -6001,7 +5606,7 @@ optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types //-Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics @type The new network type; pass null to set network type to networkTypeOther setNetworkType type:NetworkType = Ok; -//@description Returns network data usage statistics. Can be called before authorization @only_current Pass true to get statistics only for the current library launch +//@description Returns network data usage statistics. Can be called before authorization @only_current If true, returns only data for the current library launch getNetworkStatistics only_current:Bool = NetworkStatistics; //@description Adds the specified data to data usage statistics. Can be called before authorization @entry The network statistics entry with the data to be added to statistics @@ -6088,7 +5693,7 @@ setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok; //@description Uploads a file with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload -uploadStickerFile user_id:int53 sticker:inputSticker = File; +uploadStickerFile user_id:int53 sticker:InputSticker = File; //@description Returns a suggested name for a new sticker set with a given title @title Sticker set title; 1-64 characters getSuggestedStickerSetName title:string = Text; @@ -6100,17 +5705,18 @@ checkStickerSetName name:string = CheckStickerSetNameResult; //@user_id Sticker set owner; ignored for regular users //@title Sticker set title; 1-64 characters //@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters -//@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown +//@is_masks True, if stickers are masks. Animated stickers can't be masks +//@stickers List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown //@source Source of the sticker set; may be empty if unknown -createNewStickerSet user_id:int53 title:string name:string stickers:vector source:string = StickerSet; +createNewStickerSet user_id:int53 title:string name:string is_masks:Bool stickers:vector source:string = StickerSet; //@description Adds a new sticker to a set; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set -addStickerToSet user_id:int53 name:string sticker:inputSticker = StickerSet; +addStickerToSet user_id:int53 name:string sticker:InputSticker = StickerSet; //@description Sets a sticker set thumbnail; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name -//@thumbnail Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set +//@thumbnail Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet; //@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot @@ -6121,7 +5727,7 @@ setStickerPositionInSet sticker:InputFile position:int32 = Ok; removeStickerFromSet sticker:InputFile = Ok; -//@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded @location Location of the map center @zoom Map zoom level; 13-20 @width Map width in pixels before applying scale; 16-1024 @height Map height in pixels before applying scale; 16-1024 @scale Map scale; 1-3 @chat_id Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown +//@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded @location Location of the map center @zoom Map zoom level; 13-20 @width Map width in pixels before applying scale; 16-1024 @height Map height in pixels before applying scale; 16-1024 @scale Map scale; 1-3 @chat_id Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown getMapThumbnailFile location:location zoom:int32 width:int32 height:int32 scale:int32 chat_id:int53 = File; @@ -6150,7 +5756,7 @@ getCountryCode = Text; getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo; //@description Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously -//@language_code A two-letter ISO 639-1 language code for country information localization @phone_number_prefix The phone number prefix +//@language_code A two-letter ISO 639-1 country code for country information localization @phone_number_prefix The phone number prefix getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo; //@description Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram @@ -6167,10 +5773,10 @@ getApplicationConfig = JsonValue; saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok; -//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable Pass true to immediately enable the proxy @type Proxy type +//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; -//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable Pass true to immediately enable the proxy @type Proxy type +//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy; //@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier @@ -6239,7 +5845,7 @@ testSquareInt x:int32 = TestInt; //@description Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization @server Proxy server IP address @port Proxy server port @type Proxy type -//@dc_id Identifier of a datacenter with which to test connection @timeout The maximum overall timeout for the request +//@dc_id Identifier of a datacenter, with which to test connection @timeout The maximum overall timeout for the request testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok; //@description Forces an updates.getDifference call to the Telegram servers; for testing only testGetDifference = Ok; From 1e5d43121b0bbd16093707a6a2b1d987938a3d90 Mon Sep 17 00:00:00 2001 From: astra Date: Sun, 4 Jun 2023 20:58:07 +0000 Subject: [PATCH 6/7] Update to v1.8.10 --- Makefile | 2 +- client/function.go | 3528 +++++++++++++-- client/type.go | 9718 +++++++++++++++++++++++++++++++++-------- client/unmarshaler.go | 3389 ++++++++++++-- data/td_api.json | 6806 ++++++++++++++++++++++++----- data/td_api.tl | 3756 ++++++++++++---- 6 files changed, 22858 insertions(+), 4341 deletions(-) diff --git a/Makefile b/Makefile index 8d6428e..d8ac66a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := v1.8.0 +TAG := 93c42f6d7c1209937431469f80427d48907f1b8d schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 927f3da..0e9b236 100755 --- a/client/function.go +++ b/client/function.go @@ -26,12 +26,15 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(result.Data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(result.Data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(result.Data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(result.Data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(result.Data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(result.Data) @@ -62,8 +65,38 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { } type SetTdlibParametersRequest struct { - // Parameters for TDLib initialization - Parameters *TdlibParameters `json:"parameters"` + // Pass true to use Telegram test environment instead of the production environment + UseTestDc bool `json:"use_test_dc"` + // The path to the directory for the persistent database; if empty, the current working directory will be used + DatabaseDirectory string `json:"database_directory"` + // The path to the directory for storing files; if empty, database_directory will be used + FilesDirectory string `json:"files_directory"` + // Encryption key for the database + DatabaseEncryptionKey []byte `json:"database_encryption_key"` + // Pass true to keep information about downloaded and uploaded files between application restarts + UseFileDatabase bool `json:"use_file_database"` + // Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database + UseChatInfoDatabase bool `json:"use_chat_info_database"` + // Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database + UseMessageDatabase bool `json:"use_message_database"` + // Pass true to enable support for secret chats + UseSecretChats bool `json:"use_secret_chats"` + // Application identifier for Telegram API access, which can be obtained at https://my.telegram.org + ApiId int32 `json:"api_id"` + // Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org + ApiHash string `json:"api_hash"` + // IETF language tag of the user's operating system language; must be non-empty + SystemLanguageCode string `json:"system_language_code"` + // Model of the device the application is being run on; must be non-empty + DeviceModel string `json:"device_model"` + // Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib + SystemVersion string `json:"system_version"` + // Application version; must be non-empty + ApplicationVersion string `json:"application_version"` + // Pass true to automatically delete old files in background + EnableStorageOptimizer bool `json:"enable_storage_optimizer"` + // Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name + IgnoreFileNames bool `json:"ignore_file_names"` } // Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters @@ -73,33 +106,22 @@ func (client *Client) SetTdlibParameters(req *SetTdlibParametersRequest) (*Ok, e Type: "setTdlibParameters", }, Data: map[string]interface{}{ - "parameters": req.Parameters, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type CheckDatabaseEncryptionKeyRequest struct { - // Encryption key to check or set up - EncryptionKey []byte `json:"encryption_key"` -} - -// Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey -func (client *Client) CheckDatabaseEncryptionKey(req *CheckDatabaseEncryptionKeyRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "checkDatabaseEncryptionKey", - }, - Data: map[string]interface{}{ - "encryption_key": req.EncryptionKey, + "use_test_dc": req.UseTestDc, + "database_directory": req.DatabaseDirectory, + "files_directory": req.FilesDirectory, + "database_encryption_key": req.DatabaseEncryptionKey, + "use_file_database": req.UseFileDatabase, + "use_chat_info_database": req.UseChatInfoDatabase, + "use_message_database": req.UseMessageDatabase, + "use_secret_chats": req.UseSecretChats, + "api_id": req.ApiId, + "api_hash": req.ApiHash, + "system_language_code": req.SystemLanguageCode, + "device_model": req.DeviceModel, + "system_version": req.SystemVersion, + "application_version": req.ApplicationVersion, + "enable_storage_optimizer": req.EnableStorageOptimizer, + "ignore_file_names": req.IgnoreFileNames, }, }) if err != nil { @@ -142,7 +164,33 @@ func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNu return UnmarshalOk(result.Data) } -// Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed +type SetAuthenticationEmailAddressRequest struct { + // The email address of the user + EmailAddress string `json:"email_address"` +} + +// Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress +func (client *Client) SetAuthenticationEmailAddress(req *SetAuthenticationEmailAddressRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAuthenticationEmailAddress", + }, + Data: map[string]interface{}{ + "email_address": req.EmailAddress, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode func (client *Client) ResendAuthenticationCode() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -161,6 +209,32 @@ func (client *Client) ResendAuthenticationCode() (*Ok, error) { return UnmarshalOk(result.Data) } +type CheckAuthenticationEmailCodeRequest struct { + // Email address authentication to check + Code EmailAddressAuthentication `json:"code"` +} + +// Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode +func (client *Client) CheckAuthenticationEmailCode(req *CheckAuthenticationEmailCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationEmailCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckAuthenticationCodeRequest struct { // Authentication code to check Code string `json:"code"` @@ -243,11 +317,11 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) { } type CheckAuthenticationPasswordRequest struct { - // The password to check + // The 2-step verification password to check Password string `json:"password"` } -// Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword +// Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswordRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -268,7 +342,7 @@ func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswo return UnmarshalOk(result.Data) } -// Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword +// Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) RequestAuthenticationPasswordRecovery() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -292,7 +366,7 @@ type CheckAuthenticationPasswordRecoveryCodeRequest struct { RecoveryCode string `json:"recovery_code"` } -// Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword +// Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenticationPasswordRecoveryCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -316,13 +390,13 @@ func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenti type RecoverAuthenticationPasswordRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` } -// Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword +// Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPasswordRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -454,7 +528,7 @@ func (client *Client) ConfirmQrCodeAuthentication(req *ConfirmQrCodeAuthenticati return UnmarshalSession(result.Data) } -// Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization +// Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization func (client *Client) GetCurrentState() (*Updates, error) { result, err := client.Send(Request{ meta: meta{ @@ -519,19 +593,19 @@ func (client *Client) GetPasswordState() (*PasswordState, error) { } type SetPasswordRequest struct { - // Previous password of the user + // Previous 2-step verification password of the user OldPassword string `json:"old_password"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` - // Pass true if the recovery email address must be changed + // Pass true to change also the recovery email address SetRecoveryEmailAddress bool `json:"set_recovery_email_address"` // New recovery email address; may be empty NewRecoveryEmailAddress string `json:"new_recovery_email_address"` } -// Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed +// Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, error) { result, err := client.Send(Request{ meta: meta{ @@ -556,8 +630,79 @@ func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, erro return UnmarshalPasswordState(result.Data) } +type SetLoginEmailAddressRequest struct { + // New login email address + NewLoginEmailAddress string `json:"new_login_email_address"` +} + +// Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly +func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setLoginEmailAddress", + }, + Data: map[string]interface{}{ + "new_login_email_address": req.NewLoginEmailAddress, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) +} + +// Resends the login email address verification code +func (client *Client) ResendLoginEmailAddressCode() (*EmailAddressAuthenticationCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "resendLoginEmailAddressCode", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) +} + +type CheckLoginEmailAddressCodeRequest struct { + // Email address authentication to check + Code EmailAddressAuthentication `json:"code"` +} + +// Checks the login email address authentication +func (client *Client) CheckLoginEmailAddressCode(req *CheckLoginEmailAddressCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkLoginEmailAddressCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetRecoveryEmailAddressRequest struct { - // The password for the current user + // The 2-step verification password for the current user Password string `json:"password"` } @@ -583,7 +728,7 @@ func (client *Client) GetRecoveryEmailAddress(req *GetRecoveryEmailAddressReques } type SetRecoveryEmailAddressRequest struct { - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` // New recovery email address NewRecoveryEmailAddress string `json:"new_recovery_email_address"` @@ -704,7 +849,7 @@ func (client *Client) CheckPasswordRecoveryCode(req *CheckPasswordRecoveryCodeRe type RecoverPasswordRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` @@ -784,7 +929,7 @@ func (client *Client) CancelPasswordReset() (*Ok, error) { } type CreateTemporaryPasswordRequest struct { - // Persistent user password + // The 2-step verification password of the current user Password string `json:"password"` // Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 ValidFor int32 `json:"valid_for"` @@ -1094,7 +1239,7 @@ type GetMessageLocallyRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message, if it is available locally without sending network request. This is an offline request +// Returns information about a message, if it is available without sending network request. This is an offline request func (client *Client) GetMessageLocally(req *GetMessageLocallyRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1123,7 +1268,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively +// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1730,8 +1875,11 @@ func (client *Client) CheckChatUsername(req *CheckChatUsernameRequest) (CheckCha case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(result.Data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(result.Data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(result.Data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(result.Data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(result.Data) @@ -1772,7 +1920,7 @@ type CheckCreatedPublicChatsLimitRequest struct { Type PublicChatType `json:"type"` } -// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached +// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium func (client *Client) CheckCreatedPublicChatsLimit(req *CheckCreatedPublicChatsLimitRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -1812,7 +1960,7 @@ func (client *Client) GetSuitableDiscussionChats() (*Chats, error) { return UnmarshalChats(result.Data) } -// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error +// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1872,7 +2020,7 @@ type GetChatHistoryRequest struct { Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages that are available locally without sending network requests + // Pass true to get only messages that are available without sending network requests OnlyLocal bool `json:"only_local"` } @@ -1942,7 +2090,7 @@ func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryReques type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true if the chat needs to be removed from the chat list + // Pass true to remove the chat from all chat lists RemoveFromChatList bool `json:"remove_from_chat_list"` // Pass true to delete chat history for all users Revoke bool `json:"revoke"` @@ -1976,7 +2124,7 @@ type DeleteChatRequest struct { ChatId int64 `json:"chat_id"` } -// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method +// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2016,8 +2164,8 @@ type SearchChatMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` } -// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messages, error) { +// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation +func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*FoundChatMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchChatMessages", @@ -2041,7 +2189,7 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messa return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundChatMessages(result.Data) } type SearchMessagesRequest struct { @@ -2049,15 +2197,11 @@ type SearchMessagesRequest struct { ChatList ChatList `json:"chat_list"` // Query to search for Query string `json:"query"` - // The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message - OffsetDate int32 `json:"offset_date"` - // The chat identifier of the last found message, or 0 for the first request - OffsetChatId int64 `json:"offset_chat_id"` - // The message identifier of the last found message, or 0 for the first request - OffsetMessageId int64 `json:"offset_message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // If not 0, the minimum date of the messages to return MinDate int32 `json:"min_date"` @@ -2066,21 +2210,19 @@ type SearchMessagesRequest struct { } // Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, error) { +func (client *Client) SearchMessages(req *SearchMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchMessages", }, Data: map[string]interface{}{ - "chat_list": req.ChatList, - "query": req.Query, - "offset_date": req.OffsetDate, - "offset_chat_id": req.OffsetChatId, - "offset_message_id": req.OffsetMessageId, - "limit": req.Limit, - "filter": req.Filter, - "min_date": req.MinDate, - "max_date": req.MaxDate, + "chat_list": req.ChatList, + "query": req.Query, + "offset": req.Offset, + "limit": req.Limit, + "filter": req.Filter, + "min_date": req.MinDate, + "max_date": req.MaxDate, }, }) if err != nil { @@ -2091,7 +2233,7 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, err return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundMessages(result.Data) } type SearchSecretMessagesRequest struct { @@ -2099,7 +2241,7 @@ type SearchSecretMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for. If empty, searchChatMessages must be used instead Query string `json:"query"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2133,24 +2275,24 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F } type SearchCallMessagesRequest struct { - // Identifier of the message from which to search; use 0 to get results from the last message - FromMessageId int64 `json:"from_message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages with missed/declined calls + // Pass true to search only for messages with missed/declined calls OnlyMissed bool `json:"only_missed"` } -// Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messages, error) { +// Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchCallMessages", }, Data: map[string]interface{}{ - "from_message_id": req.FromMessageId, - "limit": req.Limit, - "only_missed": req.OnlyMissed, + "offset": req.Offset, + "limit": req.Limit, + "only_missed": req.OnlyMissed, }, }) if err != nil { @@ -2161,7 +2303,36 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundMessages(result.Data) +} + +type SearchOutgoingDocumentMessagesRequest struct { + // Query to search for in document file name and message caption + Query string `json:"query"` + // The maximum number of messages to be returned; up to 100 + Limit int32 `json:"limit"` +} + +// Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order +func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocumentMessagesRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchOutgoingDocumentMessages", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) } type DeleteAllCallMessagesRequest struct { @@ -2270,7 +2441,7 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M type GetChatSparseMessagePositionsRequest struct { // Identifier of the chat in which to return information about message positions ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about message positions FromMessageId int64 `json:"from_message_id"` @@ -2305,7 +2476,7 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` @@ -2339,7 +2510,7 @@ type GetChatMessageCountRequest struct { ChatId int64 `json:"chat_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` - // If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown + // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally ReturnLocal bool `json:"return_local"` } @@ -2366,6 +2537,41 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou return UnmarshalCount(result.Data) } +type GetChatMessagePositionRequest struct { + // Identifier of the chat in which to find message position + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function + Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified thread will be considered; supergroups only + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats +func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatMessagePosition", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + type GetChatScheduledMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -2397,7 +2603,7 @@ type GetMessagePublicForwardsRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2427,16 +2633,16 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ return UnmarshalFoundMessages(result.Data) } -type GetChatSponsoredMessageRequest struct { +type GetChatSponsoredMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` } -// Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat -func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageRequest) (*SponsoredMessage, error) { +// Returns sponsored messages to be shown in a chat; for channel chats only +func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequest) (*SponsoredMessages, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatSponsoredMessage", + Type: "getChatSponsoredMessages", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -2450,7 +2656,7 @@ func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageReques return nil, buildResponseError(result.Data) } - return UnmarshalSponsoredMessage(result.Data) + return UnmarshalSponsoredMessages(result.Data) } type RemoveNotificationRequest struct { @@ -2520,8 +2726,8 @@ type GetMessageLinkRequest struct { MediaTimestamp int32 `json:"media_timestamp"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` - // Pass true to create a link to the message as a channel post comment, or from a message thread - ForComment bool `json:"for_comment"` + // Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic + InMessageThread bool `json:"in_message_thread"` } // Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request @@ -2531,11 +2737,11 @@ func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink, Type: "getMessageLink", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "media_timestamp": req.MediaTimestamp, - "for_album": req.ForAlbum, - "for_comment": req.ForComment, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "media_timestamp": req.MediaTimestamp, + "for_album": req.ForAlbum, + "in_message_thread": req.InMessageThread, }, }) if err != nil { @@ -2607,13 +2813,106 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa return UnmarshalMessageLinkInfo(result.Data) } +type TranslateTextRequest struct { + // Text to translate + Text string `json:"text"` + // A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically + FromLanguageCode string `json:"from_language_code"` + // A two-letter ISO 639-1 language code of the language to which the message is translated + ToLanguageCode string `json:"to_language_code"` +} + +// Translates a text to the given language. Returns a 404 error if the translation can't be performed +func (client *Client) TranslateText(req *TranslateTextRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateText", + }, + Data: map[string]interface{}{ + "text": req.Text, + "from_language_code": req.FromLanguageCode, + "to_language_code": req.ToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type RecognizeSpeechRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "recognizeSpeech", + }, + 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 UnmarshalOk(result.Data) +} + +type RateSpeechRecognitionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Pass true if the speech recognition is good + IsGood bool `json:"is_good"` +} + +// Rates recognized speech in a video note or a voice note message +func (client *Client) RateSpeechRecognition(req *RateSpeechRecognitionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "rateSpeechRecognition", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "is_good": req.IsGood, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatAvailableMessageSendersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } // Returns list of message sender identifiers, which can be used to send messages in a chat -func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*MessageSenders, error) { +func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*ChatMessageSenders, error) { result, err := client.Send(Request{ meta: meta{ Type: "getChatAvailableMessageSenders", @@ -2630,7 +2929,7 @@ func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessag return nil, buildResponseError(result.Data) } - return UnmarshalMessageSenders(result.Data) + return UnmarshalChatMessageSenders(result.Data) } type SetChatMessageSenderRequest struct { @@ -2667,7 +2966,7 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the message to reply to or 0 + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2708,12 +3007,14 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 + // Identifier of a replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` + // Pass true to get fake messages instead of actually sending them + OnlyPreview bool `json:"only_preview"` } // Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages @@ -2728,6 +3029,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "input_message_contents": req.InputMessageContents, + "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -2778,7 +3080,7 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 + // Identifier of a replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -2786,7 +3088,7 @@ type SendInlineQueryResultMessageRequest struct { QueryId JsonInt64 `json:"query_id"` // Identifier of the inline result ResultId string `json:"result_id"` - // If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") + // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -2820,17 +3122,19 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the message will be sent; for forum threads only + MessageThreadId int64 `json:"message_thread_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local + // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local SendCopy bool `json:"send_copy"` - // If true, media caption of message copies will be removed. Ignored if send_copy is false + // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // If true, messages will not be forwarded and instead fake messages will be returned + // Pass true to get fake messages instead of actually forwarding them OnlyPreview bool `json:"only_preview"` } @@ -2841,13 +3145,14 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e Type: "forwardMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "from_chat_id": req.FromChatId, - "message_ids": req.MessageIds, - "options": req.Options, - "send_copy": req.SendCopy, - "remove_caption": req.RemoveCaption, - "only_preview": req.OnlyPreview, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "from_chat_id": req.FromChatId, + "message_ids": req.MessageIds, + "options": req.Options, + "send_copy": req.SendCopy, + "remove_caption": req.RemoveCaption, + "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -2921,7 +3226,7 @@ type AddLocalMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the message to reply to or 0 + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` @@ -3168,7 +3473,7 @@ type EditMessageCaptionRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; 0-GetOption("message_caption_length_max") characters; pass null to remove caption + // New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption Caption *FormattedText `json:"caption"` } @@ -3335,7 +3640,7 @@ type EditInlineMessageCaptionRequest struct { InlineMessageId string `json:"inline_message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; pass null to remove caption; 0-GetOption("message_caption_length_max") characters + // New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -3423,12 +3728,613 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +// Returns list of custom emojis, which can be used as forum topic icon by all users +func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopicDefaultIcons", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type CreateForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Name of the topic; 1-128 characters + Name string `json:"name"` + // Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons + Icon *ForumTopicIcon `json:"icon"` +} + +// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup +func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "name": req.Name, + "icon": req.Icon, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopicInfo(result.Data) +} + +type EditForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // New name of the topic; 0-128 characters. If empty, the previous topic name is kept + Name string `json:"name"` + // Pass true to edit the icon of the topic. Icon of the General topic can't be edited + EditIconCustomEmoji bool `json:"edit_icon_custom_emoji"` + // Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` +} + +// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "name": req.Name, + "edit_icon_custom_emoji": req.EditIconCustomEmoji, + "icon_custom_emoji_id": req.IconCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns information about a forum topic +func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopic(result.Data) +} + +type GetForumTopicLinkRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns an HTTPS link to a topic in a forum chat. This is an offline request +func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*MessageLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopicLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageLink(result.Data) +} + +type GetForumTopicsRequest struct { + // Identifier of the forum chat + ChatId int64 `json:"chat_id"` + // Query to search for in the forum topic's name + Query string `json:"query"` + // The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic + OffsetDate int32 `json:"offset_date"` + // The message identifier of the last message in the last found topic, or 0 for the first request + OffsetMessageId int64 `json:"offset_message_id"` + // The message thread identifier of the last found topic, or 0 for the first request + OffsetMessageThreadId int64 `json:"offset_message_thread_id"` + // The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server +func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "query": req.Query, + "offset_date": req.OffsetDate, + "offset_message_id": req.OffsetMessageId, + "offset_message_thread_id": req.OffsetMessageThreadId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopics(result.Data) +} + +type SetForumTopicNotificationSettingsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` +} + +// Changes the notification settings of a forum topic +func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotificationSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setForumTopicNotificationSettings", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "notification_settings": req.NotificationSettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleForumTopicIsClosedRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // Pass true to close the topic; pass false to reopen it + IsClosed bool `json:"is_closed"` +} + +// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleForumTopicIsClosed", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "is_closed": req.IsClosed, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGeneralForumTopicIsHiddenRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Pass true to hide and close the General topic; pass false to unhide it + IsHidden bool `json:"is_hidden"` +} + +// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup +func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTopicIsHiddenRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGeneralForumTopicIsHidden", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_hidden": req.IsHidden, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleForumTopicIsPinnedRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // Pass true to pin the topic; pass false to unpin it + IsPinned bool `json:"is_pinned"` +} + +// Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleForumTopicIsPinned", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetPinnedForumTopicsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new list of pinned forum topics + MessageThreadIds []int64 `json:"message_thread_ids"` +} + +// Changes the order of pinned forum topics +func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setPinnedForumTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_ids": req.MessageThreadIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages +func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetEmojiReactionRequest struct { + // Text representation of the reaction + Emoji string `json:"emoji"` +} + +// Returns information about a emoji reaction. Returns a 404 error if the reaction is not found +func (client *Client) GetEmojiReaction(req *GetEmojiReactionRequest) (*EmojiReaction, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getEmojiReaction", + }, + Data: map[string]interface{}{ + "emoji": req.Emoji, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiReaction(result.Data) +} + +// Returns TGS stickers with generic animations for custom emoji reactions +func (client *Client) GetCustomEmojiReactionAnimations() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCustomEmojiReactionAnimations", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type GetMessageAvailableReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Number of reaction per row, 5-25 + RowSize int32 `json:"row_size"` +} + +// Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message +func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAvailableReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "row_size": req.RowSize, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAvailableReactions(result.Data) +} + +// Clears the list of recently used reactions +func (client *Client) ClearRecentReactions() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearRecentReactions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddMessageReactionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reaction to add + ReactionType ReactionType `json:"reaction_type"` + // Pass true if the reaction is added with a big animation + IsBig bool `json:"is_big"` + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool `json:"update_recent_reactions"` +} + +// Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message +func (client *Client) AddMessageReaction(req *AddMessageReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addMessageReaction", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + "is_big": req.IsBig, + "update_recent_reactions": req.UpdateRecentReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveMessageReactionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reaction to remove + ReactionType ReactionType `json:"reaction_type"` +} + +// Removes a reaction from a message. A chosen reaction can always be removed +func (client *Client) RemoveMessageReaction(req *RemoveMessageReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeMessageReaction", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMessageAddedReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reactions to return; pass null to return all added reactions + ReactionType ReactionType `json:"reaction_type"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of reactions to be returned; must be positive and can't be greater than 100 + Limit int32 `json:"limit"` +} + +// Returns reactions added for a message, along with their sender +func (client *Client) GetMessageAddedReactions(req *GetMessageAddedReactionsRequest) (*AddedReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAddedReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAddedReactions(result.Data) +} + +type SetDefaultReactionTypeRequest struct { + // New type of the default reaction + ReactionType ReactionType `json:"reaction_type"` +} + +// Changes type of default reaction for the current user +func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultReactionType", + }, + Data: map[string]interface{}{ + "reaction_type": req.ReactionType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetTextEntitiesRequest struct { // The text in which to look for entites Text string `json:"text"` } -// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3456,7 +4362,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3479,7 +4385,7 @@ func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*Formatt } type ParseMarkdownRequest struct { - // The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" + // The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" Text *FormattedText `json:"text"` } @@ -3728,6 +4634,32 @@ func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { return UnmarshalText(result.Data) } +type GetThemeParametersJsonStringRequest struct { + // Theme parameters to convert to JSON + Theme *ThemeParameters `json:"theme"` +} + +// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously +func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getThemeParametersJsonString", + }, + Data: map[string]interface{}{ + "theme": req.Theme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type SetPollAnswerRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -3904,7 +4836,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // True, if the user allowed the bot to send them messages + // Pass true to allow the bot to send messages to the current user AllowWriteAccess bool `json:"allow_write_access"` } @@ -3973,7 +4905,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // True, if the result of the query can be cached for the specified user + // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` // The results of the query Results []InputInlineQueryResult `json:"results"` @@ -4014,6 +4946,172 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type GetWebAppUrlRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The URL from the keyboardButtonTypeWebApp button + Url string `json:"url"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` +} + +// Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp button is pressed +func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWebAppUrl", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "application_name": req.ApplicationName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + +type SendWebAppDataRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` + // Received data + Data string `json:"data"` +} + +// Sends data received from a keyboardButtonTypeWebApp Web App to a bot +func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendWebAppData", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "button_text": req.ButtonText, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type OpenWebAppRequest struct { + // Identifier of the chat in which the Web App is opened + ChatId int64 `json:"chat_id"` + // Identifier of the bot, providing the Web App + BotUserId int64 `json:"bot_user_id"` + // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise + Url string `json:"url"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` + // If not 0, a message thread identifier in which the message will be sent + MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the replied message for the message sent by the Web App; 0 if none + ReplyToMessageId int64 `json:"reply_to_message_id"` +} + +// Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once +func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openWebApp", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "application_name": req.ApplicationName, + "message_thread_id": req.MessageThreadId, + "reply_to_message_id": req.ReplyToMessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWebAppInfo(result.Data) +} + +type CloseWebAppRequest struct { + // Identifier of Web App launch, received from openWebApp + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +// Informs TDLib that a previously opened Web App was closed +func (client *Client) CloseWebApp(req *CloseWebAppRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeWebApp", + }, + Data: map[string]interface{}{ + "web_app_launch_id": req.WebAppLaunchId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AnswerWebAppQueryRequest struct { + // Identifier of the Web App query + WebAppQueryId string `json:"web_app_query_id"` + // The result of the query + Result InputInlineQueryResult `json:"result"` +} + +// Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only +func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerWebAppQuery", + }, + Data: map[string]interface{}{ + "web_app_query_id": req.WebAppQueryId, + "result": req.Result, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSentWebAppMessage(result.Data) +} + type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` @@ -4051,7 +5149,7 @@ type AnswerCallbackQueryRequest struct { CallbackQueryId JsonInt64 `json:"callback_query_id"` // Text of the answer Text string `json:"text"` - // If true, an alert must be shown to the user instead of a toast notification + // Pass true to show an alert to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -4150,7 +5248,7 @@ type SetGameScoreRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4189,7 +5287,7 @@ func (client *Client) SetGameScore(req *SetGameScoreRequest) (*Message, error) { type SetInlineGameScoreRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4292,7 +5390,7 @@ type DeleteChatReplyMarkupRequest struct { MessageId int64 `json:"message_id"` } -// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed +// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4405,7 +5503,7 @@ type ViewMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // True, if messages in closed chats must be marked as read by the request + // Pass true to mark as read the specified messages even the chat is closed ForceRead bool `json:"force_read"` } @@ -4518,6 +5616,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(result.Data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(result.Data) @@ -4530,21 +5631,39 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(result.Data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) + case TypeInternalLinkTypeFilterSettings: return UnmarshalInternalLinkTypeFilterSettings(result.Data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(result.Data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(result.Data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(result.Data) @@ -4557,6 +5676,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -4566,6 +5691,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(result.Data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) @@ -4584,6 +5712,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(result.Data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(result.Data) @@ -4630,7 +5764,7 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -4682,10 +5816,94 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } +type ReadAllMessageThreadMentionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which mentions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all mentions in a forum topic as read +func (client *Client) ReadAllMessageThreadMentions(req *ReadAllMessageThreadMentionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadMentions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllChatReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Marks all reactions in a chat or a forum topic as read +func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllChatReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllMessageThreadReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which reactions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all reactions in a forum topic as read +func (client *Client) ReadAllMessageThreadReactions(req *ReadAllMessageThreadReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4714,7 +5932,7 @@ func (client *Client) CreatePrivateChat(req *CreatePrivateChatRequest) (*Chat, e type CreateBasicGroupChatRequest struct { // Basic group identifier BasicGroupId int64 `json:"basic_group_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4743,7 +5961,7 @@ func (client *Client) CreateBasicGroupChat(req *CreateBasicGroupChatRequest) (*C type CreateSupergroupChatRequest struct { // Supergroup or channel identifier SupergroupId int64 `json:"supergroup_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4800,6 +6018,8 @@ type CreateNewBasicGroupChatRequest struct { UserIds []int64 `json:"user_ids"` // Title of the new basic group; 1-128 characters Title string `json:"title"` + // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } // Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat @@ -4809,8 +6029,9 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques Type: "createNewBasicGroupChat", }, Data: map[string]interface{}{ - "user_ids": req.UserIds, - "title": req.Title, + "user_ids": req.UserIds, + "title": req.Title, + "message_auto_delete_time": req.MessageAutoDeleteTime, }, }) if err != nil { @@ -4827,13 +6048,15 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // True, if a channel chat needs to be created + // Pass true to create a channel chat IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` // Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat Location *ChatLocation `json:"location"` - // True, if the supergroup is created for importing messages using importMessage + // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Pass true to create a supergroup for importing messages using importMessage ForImport bool `json:"for_import"` } @@ -4844,11 +6067,12 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques Type: "createNewSupergroupChat", }, Data: map[string]interface{}{ - "title": req.Title, - "is_channel": req.IsChannel, - "description": req.Description, - "location": req.Location, - "for_import": req.ForImport, + "title": req.Title, + "is_channel": req.IsChannel, + "description": req.Description, + "location": req.Location, + "message_auto_delete_time": req.MessageAutoDeleteTime, + "for_import": req.ForImport, }, }) if err != nil { @@ -5000,7 +6224,7 @@ type CreateChatFilterRequest struct { Filter *ChatFilter `json:"filter"` } -// Creates new chat filter. Returns information about the created chat filter +// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -5079,6 +6303,8 @@ func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error type ReorderChatFiltersRequest struct { // Identifiers of chat filters in the new correct order ChatFilterIds []int32 `json:"chat_filter_ids"` + // Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users + MainChatListPosition int32 `json:"main_chat_list_position"` } // Changes the order of chat filters @@ -5088,7 +6314,8 @@ func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, e Type: "reorderChatFilters", }, Data: map[string]interface{}{ - "chat_filter_ids": req.ChatFilterIds, + "chat_filter_ids": req.ChatFilterIds, + "main_chat_list_position": req.MainChatListPosition, }, }) if err != nil { @@ -5205,22 +6432,22 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SetChatMessageTtlRequest struct { +type SetChatMessageAutoDeleteTimeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret - Ttl int32 `json:"ttl"` + // New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } -// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) -func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) { +// Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDeleteTimeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setChatMessageTtl", + Type: "setChatMessageAutoDeleteTime", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "ttl": req.Ttl, + "chat_id": req.ChatId, + "message_auto_delete_time": req.MessageAutoDeleteTime, }, }) if err != nil { @@ -5327,7 +6554,7 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, type SetChatNotificationSettingsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever + // New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } @@ -5356,7 +6583,7 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin type ToggleChatHasProtectedContentRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // True, if chat content can't be saved locally, forwarded, or copied + // New value of has_protected_content HasProtectedContent bool `json:"has_protected_content"` } @@ -5440,6 +6667,35 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul return UnmarshalOk(result.Data) } +type SetChatAvailableReactionsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Reactions available in the chat. All emoji reactions must be active + AvailableReactions ChatAvailableReactions `json:"available_reactions"` +} + +// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +func (client *Client) SetChatAvailableReactions(req *SetChatAvailableReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatAvailableReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "available_reactions": req.AvailableReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatClientDataRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5590,9 +6846,9 @@ type PinChatMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the new pinned message MessageId int64 `json:"message_id"` - // True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats + // Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats DisableNotification bool `json:"disable_notification"` - // True, if the message needs to be pinned for one side only; private chats only + // Pass true to pin the message only for self; private chats only OnlyForSelf bool `json:"only_for_self"` } @@ -5675,12 +6931,41 @@ func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*O return UnmarshalOk(result.Data) } +type UnpinAllMessageThreadMessagesRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier in which messages will be unpinned + MessageThreadId int64 `json:"message_thread_id"` +} + +// Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup +func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "unpinAllMessageThreadMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type JoinChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method +// 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) { result, err := client.Send(Request{ meta: meta{ @@ -5894,7 +7179,7 @@ type TransferChatOwnershipRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user UserId int64 `json:"user_id"` - // The password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -5961,7 +7246,7 @@ type SearchChatMembersRequest struct { Filter ChatMembersFilter `json:"filter"` } -// Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels +// Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels func (client *Client) SearchChatMembers(req *SearchChatMembersRequest) (*ChatMembers, error) { result, err := client.Send(Request{ meta: meta{ @@ -6012,11 +7297,11 @@ func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) ( } type ClearAllDraftMessagesRequest struct { - // If true, local draft messages in secret chats will not be cleared + // Pass true to keep local message drafts in secret chats ExcludeSecretChats bool `json:"exclude_secret_chats"` } -// Clears draft messages in all chats +// Clears message drafts in all chats func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6037,10 +7322,107 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } +type GetSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier +func (client *Client) GetSavedNotificationSound(req *GetSavedNotificationSoundRequest) (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used +func (client *Client) GetSavedNotificationSounds() (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSounds", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +type AddSavedNotificationSoundRequest struct { + // Notification sound file to add + Sound InputFile `json:"sound"` +} + +// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed +func (client *Client) AddSavedNotificationSound(req *AddSavedNotificationSoundRequest) (*NotificationSound, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addSavedNotificationSound", + }, + Data: map[string]interface{}{ + "sound": req.Sound, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSound(result.Data) +} + +type RemoveSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Removes a notification sound from the list of saved notification sounds +func (client *Client) RemoveSavedNotificationSound(req *RemoveSavedNotificationSoundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatNotificationSettingsExceptionsRequest struct { // If specified, only chats from the scope will be returned; pass null to return chats from all scopes Scope NotificationSettingsScope `json:"scope"` - // If true, also chats with non-default sound will be returned + // Pass true to include in the response chats with only non-default sound CompareSound bool `json:"compare_sound"` } @@ -6121,7 +7503,7 @@ func (client *Client) SetScopeNotificationSettings(req *SetScopeNotificationSett return UnmarshalOk(result.Data) } -// Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown +// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown func (client *Client) ResetAllNotificationSettings() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6145,11 +7527,11 @@ type ToggleChatIsPinnedRequest struct { ChatList ChatList `json:"chat_list"` // Chat identifier ChatId int64 `json:"chat_id"` - // True, if the chat is pinned + // Pass true to pin the chat; pass false to unpin it IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list +// Changes the pinned state of a chat. There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6201,16 +7583,150 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetAttachmentMenuBotRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` +} + +// Returns information about a bot that can be added to attachment menu +func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAttachmentMenuBot", + }, + 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 UnmarshalAttachmentMenuBot(result.Data) +} + +type ToggleBotIsAddedToAttachmentMenuRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` + // Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu + IsAdded bool `json:"is_added"` + // Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false + AllowWriteAccess bool `json:"allow_write_access"` +} + +// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true +func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBotIsAddedToAttachmentMenu", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "is_added": req.IsAdded, + "allow_write_access": req.AllowWriteAccess, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getThemedEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns recent emoji statuses +func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getRecentEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns default emoji statuses +func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Clears the list of recently used emoji statuses +func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearRecentEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` - // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first Priority int32 `json:"priority"` // The starting position from which the file needs to be downloaded - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit - Limit int32 `json:"limit"` - // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent + Limit int64 `json:"limit"` + // Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started Synchronous bool `json:"synchronous"` } @@ -6243,11 +7759,11 @@ type GetFileDownloadedPrefixSizeRequest struct { // Identifier of the file FileId int32 `json:"file_id"` // Offset from which downloaded prefix size needs to be calculated - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` } // Returns file downloaded prefix size from a given offset, in bytes -func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSizeRequest) (*Count, error) { +func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSizeRequest) (*FileDownloadedPrefixSize, error) { result, err := client.Send(Request{ meta: meta{ Type: "getFileDownloadedPrefixSize", @@ -6265,7 +7781,7 @@ func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSi return nil, buildResponseError(result.Data) } - return UnmarshalCount(result.Data) + return UnmarshalFileDownloadedPrefixSize(result.Data) } type CancelDownloadFileRequest struct { @@ -6326,20 +7842,20 @@ func (client *Client) GetSuggestedFileName(req *GetSuggestedFileNameRequest) (*T return UnmarshalText(result.Data) } -type UploadFileRequest struct { +type PreliminaryUploadFileRequest struct { // File to upload File InputFile `json:"file"` // File type; pass null if unknown FileType FileType `json:"file_type"` - // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first + // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first Priority int32 `json:"priority"` } -// Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message -func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) { +// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ - Type: "uploadFile", + Type: "preliminaryUploadFile", }, Data: map[string]interface{}{ "file": req.File, @@ -6358,16 +7874,16 @@ func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) { return UnmarshalFile(result.Data) } -type CancelUploadFileRequest struct { +type CancelPreliminaryUploadFileRequest struct { // Identifier of the file to stop uploading FileId int32 `json:"file_id"` } -// Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined -func (client *Client) CancelUploadFile(req *CancelUploadFileRequest) (*Ok, error) { +// Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined +func (client *Client) CancelPreliminaryUploadFile(req *CancelPreliminaryUploadFileRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "cancelUploadFile", + Type: "cancelPreliminaryUploadFile", }, Data: map[string]interface{}{ "file_id": req.FileId, @@ -6388,7 +7904,7 @@ type WriteGeneratedFilePartRequest struct { // The identifier of the generation process GenerationId JsonInt64 `json:"generation_id"` // The offset from which to write the data to the file - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // The data to write Data []byte `json:"data"` } @@ -6420,9 +7936,9 @@ type SetFileGenerationProgressRequest struct { // The identifier of the generation process GenerationId JsonInt64 `json:"generation_id"` // Expected size of the generated file, in bytes; 0 if unknown - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` // The number of bytes already generated - LocalPrefixSize int32 `json:"local_prefix_size"` + LocalPrefixSize int64 `json:"local_prefix_size"` } // Informs TDLib on a file generation progress @@ -6481,9 +7997,9 @@ type ReadFilePartRequest struct { // Identifier of the file. The file must be located in the TDLib file cache FileId int32 `json:"file_id"` // The offset from which to read the file - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position - Count int32 `json:"count"` + Count int64 `json:"count"` } // Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file @@ -6535,12 +8051,201 @@ func (client *Client) DeleteFile(req *DeleteFileRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type AddFileToDownloadsRequest struct { + // Identifier of the file to download + FileId int32 `json:"file_id"` + // Chat identifier of the message with the file + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first + Priority int32 `json:"priority"` +} + +// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +func (client *Client) AddFileToDownloads(req *AddFileToDownloadsRequest) (*File, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addFileToDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "priority": req.Priority, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFile(result.Data) +} + +type ToggleDownloadIsPausedRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true if the download is paused + IsPaused bool `json:"is_paused"` +} + +// Changes pause state of a file in the file download list +func (client *Client) ToggleDownloadIsPaused(req *ToggleDownloadIsPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleDownloadIsPaused", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "is_paused": req.IsPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleAllDownloadsArePausedRequest struct { + // Pass true to pause all downloads; pass false to unpause them + ArePaused bool `json:"are_paused"` +} + +// Changes pause state of all files in the file download list +func (client *Client) ToggleAllDownloadsArePaused(req *ToggleAllDownloadsArePausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleAllDownloadsArePaused", + }, + Data: map[string]interface{}{ + "are_paused": req.ArePaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveFileFromDownloadsRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes a file from the file download list +func (client *Client) RemoveFileFromDownloads(req *RemoveFileFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeFileFromDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveAllFilesFromDownloadsRequest struct { + // Pass true to remove only active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to remove only completed downloads + OnlyCompleted bool `json:"only_completed"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes all files from the file download list +func (client *Client) RemoveAllFilesFromDownloads(req *RemoveAllFilesFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeAllFilesFromDownloads", + }, + Data: map[string]interface{}{ + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchFileDownloadsRequest struct { + // Query to search for; may be empty to return all downloaded files + Query string `json:"query"` + // Pass true to search only for active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to search only for completed downloads + OnlyCompleted bool `json:"only_completed"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of files to be returned + Limit int32 `json:"limit"` +} + +// Searches for files in the file download list or recently downloaded files from the list +func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*FoundFileDownloads, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchFileDownloads", + }, + Data: map[string]interface{}{ + "query": req.Query, + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundFileDownloads(result.Data) +} + type GetMessageFileTypeRequest struct { // Beginning of the message file; up to 100 first lines MessageFileHead string `json:"message_file_head"` } -// Returns information about a file with messages exported from another app +// Returns information about a file with messages exported from another application func (client *Client) GetMessageFileType(req *GetMessageFileTypeRequest) (MessageFileType, error) { result, err := client.Send(Request{ meta: meta{ @@ -6666,7 +8371,7 @@ type CreateChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -6706,7 +8411,7 @@ type EditChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -6985,7 +8690,7 @@ type JoinChatByInviteLinkRequest struct { InviteLink string `json:"invite_link"` } -// Uses an invite link to add the current user to the chat if possible +// 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) { result, err := client.Send(Request{ meta: meta{ @@ -7049,7 +8754,7 @@ type ProcessChatJoinRequestRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user that sent the request UserId int64 `json:"user_id"` - // True, if the request is approved. Otherwise the request is declived + // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` } @@ -7081,7 +8786,7 @@ type ProcessChatJoinRequestsRequest struct { ChatId int64 `json:"chat_id"` // Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links InviteLink string `json:"invite_link"` - // True, if the requests are approved. Otherwise the requests are declived + // Pass true to approve all requests; pass false to decline them Approve bool `json:"approve"` } @@ -7113,7 +8818,7 @@ type CreateCallRequest struct { UserId int64 `json:"user_id"` // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` - // True, if a video call needs to be created + // Pass true to create a video call IsVideo bool `json:"is_video"` } @@ -7201,11 +8906,11 @@ func (client *Client) SendCallSignalingData(req *SendCallSignalingDataRequest) ( type DiscardCallRequest struct { // Call identifier CallId int32 `json:"call_id"` - // True, if the user was disconnected + // Pass true if the user was disconnected IsDisconnected bool `json:"is_disconnected"` // The call duration, in seconds Duration int32 `json:"duration"` - // True, if the call was a video call + // Pass true if the call was a video call IsVideo bool `json:"is_video"` // Identifier of the connection used during the call ConnectionId JsonInt64 `json:"connection_id"` @@ -7278,7 +8983,7 @@ type SendCallDebugInformationRequest struct { DebugInformation string `json:"debug_information"` } -// Sends debug information for a call +// Sends debug information for a call to Telegram servers func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7300,6 +9005,35 @@ func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequ return UnmarshalOk(result.Data) } +type SendCallLogRequest struct { + // Call identifier + CallId int32 `json:"call_id"` + // Call log file. Only inputFileLocal and inputFileGenerated are supported + LogFile InputFile `json:"log_file"` +} + +// Sends log file for a call to Telegram servers +func (client *Client) SendCallLog(req *SendCallLogRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendCallLog", + }, + Data: map[string]interface{}{ + "call_id": req.CallId, + "log_file": req.LogFile, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetVideoChatAvailableParticipantsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -7356,12 +9090,14 @@ func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultPar } type CreateVideoChatRequest struct { - // Chat identifier, in which the video chat will be created + // Identifier of a chat in which the video chat will be created ChatId int64 `json:"chat_id"` // Group call title; if empty, chat title will be used Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future StartDate int32 `json:"start_date"` + // Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges + IsRtmpStream bool `json:"is_rtmp_stream"` } // Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights @@ -7371,9 +9107,10 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId Type: "createVideoChat", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "title": req.Title, - "start_date": req.StartDate, + "chat_id": req.ChatId, + "title": req.Title, + "start_date": req.StartDate, + "is_rtmp_stream": req.IsRtmpStream, }, }) if err != nil { @@ -7387,6 +9124,58 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId return UnmarshalGroupCallId(result.Data) } +type GetVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + +type ReplaceVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Replaces the current RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -7477,9 +9266,9 @@ type JoinGroupCallRequest struct { AudioSourceId int32 `json:"audio_source_id"` // Group call join payload; received from tgcalls Payload string `json:"payload"` - // True, if the user's microphone is muted + // Pass true to join the call with muted microphone IsMuted bool `json:"is_muted"` - // True, if the user's video is enabled + // Pass true if the user's video is enabled IsMyVideoEnabled bool `json:"is_my_video_enabled"` // If non-empty, invite hash to be used to join the group call without being muted by administrators InviteHash string `json:"invite_hash"` @@ -7547,7 +9336,7 @@ func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenShari type ToggleGroupCallScreenSharingIsPausedRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // True if screen sharing is paused + // Pass true to pause screen sharing; pass false to unpause it IsPaused bool `json:"is_paused"` } @@ -7865,7 +9654,7 @@ type SetGroupCallParticipantIsSpeakingRequest struct { GroupCallId int32 `json:"group_call_id"` // Group call participant's synchronization audio source identifier, or 0 for the current user AudioSource int32 `json:"audio_source"` - // True, if the user is speaking + // Pass true if the user is speaking IsSpeaking bool `json:"is_speaking"` } @@ -7897,7 +9686,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true if the user must be muted and false otherwise + // Pass true to mute the user; pass false to unmute the them IsMuted bool `json:"is_muted"` } @@ -8069,6 +9858,32 @@ func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetGroupCallStreamsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about available group call streams +func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCallStreams", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallStreams(result.Data) +} + type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -8139,11 +9954,11 @@ func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlo type BlockMessageSenderFromRepliesRequest struct { // The identifier of an incoming message in the Replies chat MessageId int64 `json:"message_id"` - // Pass true if the message must be deleted + // Pass true to delete the message DeleteMessage bool `json:"delete_message"` - // Pass true if all messages from the same sender must be deleted + // Pass true to delete all messages from the same sender DeleteAllMessages bool `json:"delete_all_messages"` - // Pass true if the sender must be reported to the Telegram moderators + // Pass true to report the sender to the Telegram moderators ReportSpam bool `json:"report_spam"` } @@ -8201,9 +10016,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored + // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored Contact *Contact `json:"contact"` - // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number + // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -8393,6 +10208,90 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +type SetUserPersonalProfilePhotoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function + Photo InputChatPhoto `json:"photo"` +} + +// Changes a personal profile photo of a contact user +func (client *Client) SetUserPersonalProfilePhoto(req *SetUserPersonalProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUserPersonalProfilePhoto", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SuggestUserProfilePhotoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function + Photo InputChatPhoto `json:"photo"` +} + +// Suggests a profile photo to another regular user with common messages +func (client *Client) SuggestUserProfilePhoto(req *SuggestUserProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "suggestUserProfilePhoto", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchUserByPhoneNumberRequest struct { + // Phone number to search for + PhoneNumber string `json:"phone_number"` +} + +// Searches a user by their phone number. Returns a 404 error if the user can't be found +func (client *Client) SearchUserByPhoneNumber(req *SearchUserByPhoneNumberRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchUserByPhoneNumber", + }, + Data: map[string]interface{}{ + "phone_number": req.PhoneNumber, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type SharePhoneNumberRequest struct { // Identifier of the user with whom to share the phone number. The user must be a mutual contact UserId int64 `json:"user_id"` @@ -8428,7 +10327,7 @@ type GetUserProfilePhotosRequest struct { Limit int32 `json:"limit"` } -// Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already +// Returns the profile photos of a user. Personal and public photo aren't returned func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*ChatPhotos, error) { result, err := client.Send(Request{ meta: meta{ @@ -8452,21 +10351,27 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C } type GetStickersRequest struct { - // String representation of emoji. If empty, returns all known installed stickers - Emoji string `json:"emoji"` + // Type of the stickers to return + StickerType StickerType `json:"sticker_type"` + // Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers + Query string `json:"query"` // The maximum number of stickers to be returned Limit int32 `json:"limit"` + // Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats + ChatId int64 `json:"chat_id"` } -// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned +// Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ Type: "getStickers", }, Data: map[string]interface{}{ - "emoji": req.Emoji, - "limit": req.Limit, + "sticker_type": req.StickerType, + "query": req.Query, + "limit": req.Limit, + "chat_id": req.ChatId, }, }) if err != nil { @@ -8483,7 +10388,7 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { type SearchStickersRequest struct { // String representation of emoji; must be non-empty Emoji string `json:"emoji"` - // The maximum number of stickers to be returned + // The maximum number of stickers to be returned; 0-100 Limit int32 `json:"limit"` } @@ -8509,9 +10414,35 @@ func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, err return UnmarshalStickers(result.Data) } +type GetPremiumStickersRequest struct { + // The maximum number of stickers to be returned; 0-100 + Limit int32 `json:"limit"` +} + +// Returns premium stickers from regular sticker sets +func (client *Client) GetPremiumStickers(req *GetPremiumStickersRequest) (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumStickers", + }, + Data: map[string]interface{}{ + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + type GetInstalledStickerSetsRequest struct { - // Pass true to return mask sticker sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` } // Returns a list of installed sticker sets @@ -8521,7 +10452,7 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques Type: "getInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, }, }) if err != nil { @@ -8536,8 +10467,8 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques } type GetArchivedStickerSetsRequest struct { - // Pass true to return mask stickers sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // Identifier of the sticker set from which to return the result OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` // The maximum number of sticker sets to return; up to 100 @@ -8551,7 +10482,7 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) Type: "getArchivedStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, "offset_sticker_set_id": req.OffsetStickerSetId, "limit": req.Limit, }, @@ -8568,6 +10499,8 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) } type GetTrendingStickerSetsRequest struct { + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // The offset from which to return the sticker sets; must be non-negative Offset int32 `json:"offset"` // The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached @@ -8575,14 +10508,15 @@ type GetTrendingStickerSetsRequest struct { } // Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib -func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*StickerSets, error) { +func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*TrendingStickerSets, error) { result, err := client.Send(Request{ meta: meta{ Type: "getTrendingStickerSets", }, Data: map[string]interface{}{ - "offset": req.Offset, - "limit": req.Limit, + "sticker_type": req.StickerType, + "offset": req.Offset, + "limit": req.Limit, }, }) if err != nil { @@ -8593,7 +10527,7 @@ func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) return nil, buildResponseError(result.Data) } - return UnmarshalStickerSets(result.Data) + return UnmarshalTrendingStickerSets(result.Data) } type GetAttachedStickerSetsRequest struct { @@ -8601,7 +10535,7 @@ type GetAttachedStickerSetsRequest struct { FileId int32 `json:"file_id"` } -// Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets +// Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets func (client *Client) GetAttachedStickerSets(req *GetAttachedStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ @@ -8675,8 +10609,8 @@ func (client *Client) SearchStickerSet(req *SearchStickerSetRequest) (*StickerSe } type SearchInstalledStickerSetsRequest struct { - // Pass true to return mask sticker sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to search for + StickerType StickerType `json:"sticker_type"` // Query to search for Query string `json:"query"` // The maximum number of sticker sets to return @@ -8690,9 +10624,9 @@ func (client *Client) SearchInstalledStickerSets(req *SearchInstalledStickerSets Type: "searchInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, - "query": req.Query, - "limit": req.Limit, + "sticker_type": req.StickerType, + "query": req.Query, + "limit": req.Limit, }, }) if err != nil { @@ -8791,8 +10725,8 @@ func (client *Client) ViewTrendingStickerSets(req *ViewTrendingStickerSetsReques } type ReorderInstalledStickerSetsRequest struct { - // Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to reorder + StickerType StickerType `json:"sticker_type"` // Identifiers of installed sticker sets in the new correct order StickerSetIds []JsonInt64 `json:"sticker_set_ids"` } @@ -8804,7 +10738,7 @@ func (client *Client) ReorderInstalledStickerSets(req *ReorderInstalledStickerSe Type: "reorderInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, "sticker_set_ids": req.StickerSetIds, }, }) @@ -8852,7 +10786,7 @@ type AddRecentStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list +// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -8953,7 +10887,7 @@ type AddFavoriteStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list +// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9029,7 +10963,7 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e type SearchEmojisRequest struct { // Text to search for Text string `json:"text"` - // True, if only emojis, which exactly match text needs to be returned + // Pass true if only emojis, which exactly match the text, needs to be returned ExactMatch bool `json:"exact_match"` // List of possible IETF language tags of the user's input language; may be empty if unknown InputLanguageCodes []string `json:"input_language_codes"` @@ -9110,6 +11044,32 @@ func (client *Client) GetEmojiSuggestionsUrl(req *GetEmojiSuggestionsUrlRequest) return UnmarshalHttpUrl(result.Data) } +type GetCustomEmojiStickersRequest struct { + // Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` +} + +// Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned +func (client *Client) GetCustomEmojiStickers(req *GetCustomEmojiStickersRequest) (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCustomEmojiStickers", + }, + Data: map[string]interface{}{ + "custom_emoji_ids": req.CustomEmojiIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + // Returns saved animations func (client *Client) GetSavedAnimations() (*Animations, error) { result, err := client.Send(Request{ @@ -9284,7 +11244,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage type GetWebPageInstantViewRequest struct { // The web page URL Url string `json:"url"` - // If true, the full instant view for the web page will be returned + // Pass true to get full instant view for the web page ForceFull bool `json:"force_full"` } @@ -9313,6 +11273,8 @@ func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) ( type SetProfilePhotoRequest struct { // Profile photo to set Photo InputChatPhoto `json:"photo"` + // Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings + IsPublic bool `json:"is_public"` } // Changes a profile photo for the current user @@ -9322,7 +11284,8 @@ func (client *Client) SetProfilePhoto(req *SetProfilePhotoRequest) (*Ok, error) Type: "setProfilePhoto", }, Data: map[string]interface{}{ - "photo": req.Photo, + "photo": req.Photo, + "is_public": req.IsPublic, }, }) if err != nil { @@ -9392,7 +11355,7 @@ func (client *Client) SetName(req *SetNameRequest) (*Ok, error) { } type SetBioRequest struct { - // The new value of the user bio; 0-70 characters without line feeds + // The new value of the user bio; 0-getOption("bio_length_max") characters without line feeds Bio string `json:"bio"` } @@ -9418,11 +11381,11 @@ func (client *Client) SetBio(req *SetBioRequest) (*Ok, error) { } type SetUsernameRequest struct { - // The new value of the username. Use an empty string to remove the username + // The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username Username string `json:"username"` } -// Changes the username of the current user +// Changes the editable username of the current user func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9443,12 +11406,96 @@ func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type ToggleUsernameIsActiveRequest struct { + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached +func (client *Client) ToggleUsernameIsActive(req *ToggleUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleUsernameIsActive", + }, + Data: map[string]interface{}{ + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderActiveUsernamesRequest struct { + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of the current user +func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderActiveUsernames", + }, + Data: map[string]interface{}{ + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetEmojiStatusRequest struct { + // New emoji status; pass null to switch to the default badge + EmojiStatus *EmojiStatus `json:"emoji_status"` + // Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually + Duration int32 `json:"duration"` +} + +// Changes the emoji status of the current user; for Telegram Premium users only +func (client *Client) SetEmojiStatus(req *SetEmojiStatusRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setEmojiStatus", + }, + Data: map[string]interface{}{ + "emoji_status": req.EmojiStatus, + "duration": req.Duration, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetLocationRequest struct { // The new location of the user Location *Location `json:"location"` } -// Changes the location of the current user. Needs to be called if GetOption("is_location_visible") is true and location changes for more than 1 kilometer +// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9498,7 +11545,7 @@ func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*Authent return UnmarshalAuthenticationCodeInfo(result.Data) } -// Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +// Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -9543,10 +11590,55 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode return UnmarshalOk(result.Data) } +// Returns an HTTPS link, which can be used to get information about the current user +func (client *Client) GetUserLink() (*UserLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserLink", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserLink(result.Data) +} + +type SearchUserByTokenRequest struct { + // Token to search for + Token string `json:"token"` +} + +// Searches a user by a token from the user's link +func (client *Client) SearchUserByToken(req *SearchUserByTokenRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchUserByToken", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type SetCommandsRequest struct { // The scope to which the commands are relevant; pass null to change commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands + // A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands LanguageCode string `json:"language_code"` // List of the bot's commands Commands []*BotCommand `json:"commands"` @@ -9578,7 +11670,7 @@ func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { type DeleteCommandsRequest struct { // The scope to which the commands are relevant; pass null to delete commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } @@ -9607,7 +11699,7 @@ func (client *Client) DeleteCommands(req *DeleteCommandsRequest) (*Ok, error) { type GetCommandsRequest struct { // The scope to which the commands are relevant; pass null to get commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } @@ -9633,6 +11725,113 @@ func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) return UnmarshalBotCommands(result.Data) } +type SetMenuButtonRequest struct { + // Identifier of the user or 0 to set menu button for all users + UserId int64 `json:"user_id"` + // New menu button + MenuButton *BotMenuButton `json:"menu_button"` +} + +// Sets menu button for the given user or for all users; for bots only +func (client *Client) SetMenuButton(req *SetMenuButtonRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "menu_button": req.MenuButton, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMenuButtonRequest struct { + // Identifier of the user or 0 to get the default menu button + UserId int64 `json:"user_id"` +} + +// Returns menu button set by the bot for the given user; for bots only +func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMenuButton(result.Data) +} + +type SetDefaultGroupAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only +func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultGroupAdministratorRights", + }, + Data: map[string]interface{}{ + "default_group_administrator_rights": req.DefaultGroupAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetDefaultChannelAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to channel chats; for bots only +func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChannelAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultChannelAdministratorRights", + }, + Data: map[string]interface{}{ + "default_channel_administrator_rights": req.DefaultChannelAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -9700,7 +11899,7 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { type ToggleSessionCanAcceptCallsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming calls can be accepted by the session + // Pass true to allow accepting incoming calls by the session; pass false otherwise CanAcceptCalls bool `json:"can_accept_calls"` } @@ -9729,7 +11928,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming secret chats can be accepted by the session + // Pass true to allow accepring secret chats by the session; pass false otherwise CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -9848,11 +12047,11 @@ func (client *Client) DisconnectAllWebsites() (*Ok, error) { type SetSupergroupUsernameRequest struct { // Identifier of the supergroup or channel SupergroupId int64 `json:"supergroup_id"` - // New value of the username. Use an empty string to remove the username + // New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username Username string `json:"username"` } -// Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel +// Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9874,6 +12073,93 @@ func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) ( return UnmarshalOk(result.Data) } +type ToggleSupergroupUsernameIsActiveRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached +func (client *Client) ToggleSupergroupUsernameIsActive(req *ToggleSupergroupUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupUsernameIsActive", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DisableAllSupergroupUsernamesRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` +} + +// Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel +func (client *Client) DisableAllSupergroupUsernames(req *DisableAllSupergroupUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "disableAllSupergroupUsernames", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderSupergroupActiveUsernamesRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel +func (client *Client) ReorderSupergroupActiveUsernames(req *ReorderSupergroupActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderSupergroupActiveUsernames", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetSupergroupStickerSetRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -9932,6 +12218,64 @@ func (client *Client) ToggleSupergroupSignMessages(req *ToggleSupergroupSignMess return UnmarshalOk(result.Data) } +type ToggleSupergroupJoinToSendMessagesRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of join_to_send_messages + JoinToSendMessages bool `json:"join_to_send_messages"` +} + +// Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right +func (client *Client) ToggleSupergroupJoinToSendMessages(req *ToggleSupergroupJoinToSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupJoinToSendMessages", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "join_to_send_messages": req.JoinToSendMessages, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupJoinByRequestRequest struct { + // Identifier of the channel + SupergroupId int64 `json:"supergroup_id"` + // New value of join_by_request + JoinByRequest bool `json:"join_by_request"` +} + +// Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right +func (client *Client) ToggleSupergroupJoinByRequest(req *ToggleSupergroupJoinByRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupJoinByRequest", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "join_by_request": req.JoinByRequest, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupIsAllHistoryAvailableRequest struct { // The identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -9961,6 +12305,93 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou return UnmarshalOk(result.Data) } +type ToggleSupergroupHasHiddenMembersRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of has_hidden_members + HasHiddenMembers bool `json:"has_hidden_members"` +} + +// Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true +func (client *Client) ToggleSupergroupHasHiddenMembers(req *ToggleSupergroupHasHiddenMembersRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupHasHiddenMembers", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "has_hidden_members": req.HasHiddenMembers, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupHasAggressiveAntiSpamEnabledRequest struct { + // The identifier of the supergroup, which isn't a broadcast group + SupergroupId int64 `json:"supergroup_id"` + // The new value of has_aggressive_anti_spam_enabled + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` +} + +// Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true +func (client *Client) ToggleSupergroupHasAggressiveAntiSpamEnabled(req *ToggleSupergroupHasAggressiveAntiSpamEnabledRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupHasAggressiveAntiSpamEnabled", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "has_aggressive_anti_spam_enabled": req.HasAggressiveAntiSpamEnabled, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupIsForumRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of is_forum. A supergroup can be converted to a forum, only if it has at least getOption("forum_member_count_min") members + IsForum bool `json:"is_forum"` +} + +// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup +func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupIsForum", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "is_forum": req.IsForum, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupIsBroadcastGroupRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -10016,6 +12447,35 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O return UnmarshalOk(result.Data) } +type ReportSupergroupAntiSpamFalsePositiveRequest struct { + // Supergroup identifier + SupergroupId int64 `json:"supergroup_id"` + // Identifier of the erroneously deleted message + MessageId int64 `json:"message_id"` +} + +// Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true +func (client *Client) ReportSupergroupAntiSpamFalsePositive(req *ReportSupergroupAntiSpamFalsePositiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportSupergroupAntiSpamFalsePositive", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetSupergroupMembersRequest struct { // Identifier of the supergroup or channel SupergroupId int64 `json:"supergroup_id"` @@ -10092,7 +12552,7 @@ type GetChatEventLogRequest struct { UserIds []int64 `json:"user_ids"` } -// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) +// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, error) { result, err := client.Send(Request{ meta: meta{ @@ -10119,12 +12579,10 @@ func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, } type GetPaymentFormRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // Preferred payment form theme; pass null to use the default theme - Theme *PaymentFormTheme `json:"theme"` + Theme *ThemeParameters `json:"theme"` } // Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy @@ -10134,9 +12592,8 @@ func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, Type: "getPaymentForm", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "theme": req.Theme, + "input_invoice": req.InputInvoice, + "theme": req.Theme, }, }) if err != nil { @@ -10151,13 +12608,11 @@ func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, } type ValidateOrderInfoRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // The order information, provided by the user; pass null if empty OrderInfo *OrderInfo `json:"order_info"` - // True, if the order information can be saved + // Pass true to save the order information AllowSave bool `json:"allow_save"` } @@ -10168,10 +12623,9 @@ func (client *Client) ValidateOrderInfo(req *ValidateOrderInfoRequest) (*Validat Type: "validateOrderInfo", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "order_info": req.OrderInfo, - "allow_save": req.AllowSave, + "input_invoice": req.InputInvoice, + "order_info": req.OrderInfo, + "allow_save": req.AllowSave, }, }) if err != nil { @@ -10186,10 +12640,8 @@ func (client *Client) ValidateOrderInfo(req *ValidateOrderInfoRequest) (*Validat } type SendPaymentFormRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // Payment form identifier returned by getPaymentForm PaymentFormId JsonInt64 `json:"payment_form_id"` // Identifier returned by validateOrderInfo, or an empty string @@ -10209,8 +12661,7 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu Type: "sendPaymentForm", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, + "input_invoice": req.InputInvoice, "payment_form_id": req.PaymentFormId, "order_info_id": req.OrderInfoId, "shipping_option_id": req.ShippingOptionId, @@ -10230,7 +12681,7 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu } type GetPaymentReceiptRequest struct { - // Chat identifier of the PaymentSuccessful message + // Chat identifier of the messagePaymentSuccessful message ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` @@ -10258,7 +12709,7 @@ func (client *Client) GetPaymentReceipt(req *GetPaymentReceiptRequest) (*Payment return UnmarshalPaymentReceipt(result.Data) } -// Returns saved order info, if any +// Returns saved order information. Returns a 404 error if there is no saved order information func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -10277,7 +12728,7 @@ func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { return UnmarshalOrderInfo(result.Data) } -// Deletes saved order info +// Deletes saved order information func (client *Client) DeleteSavedOrderInfo() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10315,6 +12766,32 @@ func (client *Client) DeleteSavedCredentials() (*Ok, error) { return UnmarshalOk(result.Data) } +type CreateInvoiceLinkRequest struct { + // Information about the invoice of the type inputMessageInvoice + Invoice InputMessageContent `json:"invoice"` +} + +// Creates a link for the given invoice; for bots only +func (client *Client) CreateInvoiceLink(req *CreateInvoiceLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createInvoiceLink", + }, + Data: map[string]interface{}{ + "invoice": req.Invoice, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + // Returns a user that can be contacted to get support func (client *Client) GetSupportUser() (*User, error) { result, err := client.Send(Request{ @@ -10335,7 +12812,7 @@ func (client *Client) GetSupportUser() (*User, error) { } type GetBackgroundsRequest struct { - // True, if the backgrounds must be ordered for dark theme + // Pass true to order returned backgrounds for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10420,7 +12897,7 @@ type SetBackgroundRequest struct { Background InputBackground `json:"background"` // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` - // True, if the background is chosen for dark theme + // Pass true if the background is changed for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10493,7 +12970,7 @@ func (client *Client) ResetBackgrounds() (*Ok, error) { } type GetLocalizationTargetInfoRequest struct { - // If true, returns only locally available information without sending network requests + // Pass true to get only locally available information without sending network requests OnlyLocal bool `json:"only_local"` } @@ -10902,9 +13379,9 @@ type GetOptionRequest struct { Name string `json:"name"` } -// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization +// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash" func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { - result, err := client.Send(Request{ + result, err := client.jsonClient.Execute(Request{ meta: meta{ Type: "getOption", }, @@ -11015,6 +13492,8 @@ func (client *Client) GetAccountTtl() (*AccountTtl, error) { type DeleteAccountRequest struct { // The reason why the account was deleted; optional Reason string `json:"reason"` + // The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week + Password string `json:"password"` } // Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword @@ -11024,7 +13503,8 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) { Type: "deleteAccount", }, Data: map[string]interface{}{ - "reason": req.Reason, + "reason": req.Reason, + "password": req.Password, }, }) if err != nil { @@ -11038,6 +13518,51 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetDefaultMessageAutoDeleteTimeRequest struct { + // New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime *MessageAutoDeleteTime `json:"message_auto_delete_time"` +} + +// Changes the default message auto-delete time for new chats +func (client *Client) SetDefaultMessageAutoDeleteTime(req *SetDefaultMessageAutoDeleteTimeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultMessageAutoDeleteTime", + }, + Data: map[string]interface{}{ + "message_auto_delete_time": req.MessageAutoDeleteTime, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns default message auto-delete time setting for new chats +func (client *Client) GetDefaultMessageAutoDeleteTime() (*MessageAutoDeleteTime, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultMessageAutoDeleteTime", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageAutoDeleteTime(result.Data) +} + type RemoveChatActionBarRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11067,7 +13592,7 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of reported messages, if any + // Identifiers of reported messages; may be empty to report the whole chat MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat Reason ChatReportReason `json:"reason"` @@ -11134,6 +13659,38 @@ func (client *Client) ReportChatPhoto(req *ReportChatPhotoRequest) (*Ok, error) return UnmarshalOk(result.Data) } +type ReportMessageReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Identifier of the sender, which added the reaction + SenderId MessageSender `json:"sender_id"` +} + +// Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions +func (client *Client) ReportMessageReactions(req *ReportMessageReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportMessageReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "sender_id": req.SenderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11317,7 +13874,7 @@ type OptimizeStorageRequest struct { Size int64 `json:"size"` // Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit Ttl int32 `json:"ttl"` - // Limit on the total count of files after deletion. Pass -1 to use the default limit + // Limit on the total number of files after deletion. Pass -1 to use the default limit Count int32 `json:"count"` // The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value ImmunityDelay int32 `json:"immunity_delay"` @@ -11389,7 +13946,7 @@ func (client *Client) SetNetworkType(req *SetNetworkTypeRequest) (*Ok, error) { } type GetNetworkStatisticsRequest struct { - // If true, returns only data for the current library launch + // Pass true to get statistics only for the current library launch OnlyCurrent bool `json:"only_current"` } @@ -11536,7 +14093,7 @@ func (client *Client) GetBankCardInfo(req *GetBankCardInfoRequest) (*BankCardInf type GetPassportElementRequest struct { // Telegram Passport element type Type PassportElementType `json:"type"` - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11605,7 +14162,7 @@ func (client *Client) GetPassportElement(req *GetPassportElementRequest) (Passpo } type GetAllPassportElementsRequest struct { - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11633,7 +14190,7 @@ func (client *Client) GetAllPassportElements(req *GetAllPassportElementsRequest) type SetPassportElementRequest struct { // Input Telegram Passport element Element InputPassportElement `json:"element"` - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11811,7 +14368,7 @@ func (client *Client) SendPhoneNumberVerificationCode(req *SendPhoneNumberVerifi return UnmarshalAuthenticationCodeInfo(result.Data) } -// Re-sends the code to verify a phone number to be added to a user's Telegram Passport +// Resends the code to verify a phone number to be added to a user's Telegram Passport func (client *Client) ResendPhoneNumberVerificationCode() (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11882,7 +14439,7 @@ func (client *Client) SendEmailAddressVerificationCode(req *SendEmailAddressVeri return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) } -// Re-sends the code to verify an email address to be added to a user's Telegram Passport +// Resends the code to verify an email address to be added to a user's Telegram Passport func (client *Client) ResendEmailAddressVerificationCode() (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11964,8 +14521,8 @@ func (client *Client) GetPassportAuthorizationForm(req *GetPassportAuthorization type GetPassportAuthorizationFormAvailableElementsRequest struct { // Authorization form identifier - AutorizationFormId int32 `json:"autorization_form_id"` - // Password of the current user + AuthorizationFormId int32 `json:"authorization_form_id"` + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11976,8 +14533,8 @@ func (client *Client) GetPassportAuthorizationFormAvailableElements(req *GetPass Type: "getPassportAuthorizationFormAvailableElements", }, Data: map[string]interface{}{ - "autorization_form_id": req.AutorizationFormId, - "password": req.Password, + "authorization_form_id": req.AuthorizationFormId, + "password": req.Password, }, }) if err != nil { @@ -11993,7 +14550,7 @@ func (client *Client) GetPassportAuthorizationFormAvailableElements(req *GetPass type SendPassportAuthorizationFormRequest struct { // Authorization form identifier - AutorizationFormId int32 `json:"autorization_form_id"` + AuthorizationFormId int32 `json:"authorization_form_id"` // Types of Telegram Passport elements chosen by user to complete the authorization form Types []PassportElementType `json:"types"` } @@ -12005,8 +14562,8 @@ func (client *Client) SendPassportAuthorizationForm(req *SendPassportAuthorizati Type: "sendPassportAuthorizationForm", }, Data: map[string]interface{}{ - "autorization_form_id": req.AutorizationFormId, - "types": req.Types, + "authorization_form_id": req.AuthorizationFormId, + "types": req.Types, }, }) if err != nil { @@ -12130,7 +14687,7 @@ type UploadStickerFileRequest struct { // Sticker file owner; ignored for regular users UserId int64 `json:"user_id"` // Sticker file to upload - Sticker InputSticker `json:"sticker"` + Sticker *InputSticker `json:"sticker"` } // Uploads a file with a sticker; returns the uploaded file @@ -12226,10 +14783,10 @@ type CreateNewStickerSetRequest struct { Title string `json:"title"` // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters Name string `json:"name"` - // True, if stickers are masks. Animated stickers can't be masks - IsMasks bool `json:"is_masks"` - // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown - Stickers []InputSticker `json:"stickers"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` + // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown + Stickers []*InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` } @@ -12241,12 +14798,12 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti Type: "createNewStickerSet", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "title": req.Title, - "name": req.Name, - "is_masks": req.IsMasks, - "stickers": req.Stickers, - "source": req.Source, + "user_id": req.UserId, + "title": req.Title, + "name": req.Name, + "sticker_type": req.StickerType, + "stickers": req.Stickers, + "source": req.Source, }, }) if err != nil { @@ -12266,7 +14823,7 @@ type AddStickerToSetRequest struct { // Sticker set name Name string `json:"name"` // Sticker to add to the set - Sticker InputSticker `json:"sticker"` + Sticker *InputSticker `json:"sticker"` } // Adds a new sticker to a set; for bots only. Returns the sticker set @@ -12297,7 +14854,7 @@ type SetStickerSetThumbnailRequest struct { UserId int64 `json:"user_id"` // Sticker set name Name string `json:"name"` - // Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them + // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set Thumbnail InputFile `json:"thumbnail"` } @@ -12327,7 +14884,7 @@ func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) type SetStickerPositionInSetRequest struct { // Sticker Sticker InputFile `json:"sticker"` - // New position of the sticker in the set, zero-based + // New position of the sticker in the set, 0-based Position int32 `json:"position"` } @@ -12390,7 +14947,7 @@ type GetMapThumbnailFileRequest struct { Height int32 `json:"height"` // Map scale; 1-3 Scale int32 `json:"scale"` - // Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown + // Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown ChatId int64 `json:"chat_id"` } @@ -12420,6 +14977,231 @@ func (client *Client) GetMapThumbnailFile(req *GetMapThumbnailFileRequest) (*Fil return UnmarshalFile(result.Data) } +type GetPremiumLimitRequest struct { + // Type of the limit + LimitType PremiumLimitType `json:"limit_type"` +} + +// Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown +func (client *Client) GetPremiumLimit(req *GetPremiumLimitRequest) (*PremiumLimit, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumLimit", + }, + Data: map[string]interface{}{ + "limit_type": req.LimitType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumLimit(result.Data) +} + +type GetPremiumFeaturesRequest struct { + // Source of the request; pass null if the method is called from some non-standard source + Source PremiumSource `json:"source"` +} + +// Returns information about features, available to Premium users +func (client *Client) GetPremiumFeatures(req *GetPremiumFeaturesRequest) (*PremiumFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumFeatures", + }, + Data: map[string]interface{}{ + "source": req.Source, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumFeatures(result.Data) +} + +// Returns examples of premium stickers for demonstration purposes +func (client *Client) GetPremiumStickerExamples() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumStickerExamples", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type ViewPremiumFeatureRequest struct { + // The viewed premium feature + Feature PremiumFeature `json:"feature"` +} + +// Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen +func (client *Client) ViewPremiumFeature(req *ViewPremiumFeatureRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "viewPremiumFeature", + }, + Data: map[string]interface{}{ + "feature": req.Feature, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Informs TDLib that the user clicked Premium subscription button on the Premium features screen +func (client *Client) ClickPremiumSubscriptionButton() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickPremiumSubscriptionButton", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns state of Telegram Premium subscription and promotion videos for Premium features +func (client *Client) GetPremiumState() (*PremiumState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumState", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumState(result.Data) +} + +type CanPurchasePremiumRequest struct { + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase +func (client *Client) CanPurchasePremium(req *CanPurchasePremiumRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canPurchasePremium", + }, + Data: map[string]interface{}{ + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AssignAppStoreTransactionRequest struct { + // App Store receipt + Receipt []byte `json:"receipt"` + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Informs server about a purchase through App Store. For official applications only +func (client *Client) AssignAppStoreTransaction(req *AssignAppStoreTransactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "assignAppStoreTransaction", + }, + Data: map[string]interface{}{ + "receipt": req.Receipt, + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AssignGooglePlayTransactionRequest struct { + // Application package name + PackageName string `json:"package_name"` + // Identifier of the purchased store product + StoreProductId string `json:"store_product_id"` + // Google Play purchase token + PurchaseToken string `json:"purchase_token"` + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Informs server about a purchase through Google Play. For official applications only +func (client *Client) AssignGooglePlayTransaction(req *AssignGooglePlayTransactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "assignGooglePlayTransaction", + }, + Data: map[string]interface{}{ + "package_name": req.PackageName, + "store_product_id": req.StoreProductId, + "purchase_token": req.PurchaseToken, + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type AcceptTermsOfServiceRequest struct { // Terms of service identifier TermsOfServiceId string `json:"terms_of_service_id"` @@ -12595,7 +15377,7 @@ func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*Phone } type GetPhoneNumberInfoSyncRequest struct { - // A two-letter ISO 639-1 country code for country information localization + // A two-letter ISO 639-1 language code for country information localization LanguageCode string `json:"language_code"` // The phone number prefix PhoneNumberPrefix string `json:"phone_number_prefix"` @@ -12745,7 +15527,7 @@ type AddProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -12782,7 +15564,7 @@ type EditProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -13160,6 +15942,61 @@ func (client *Client) AddLogMessage(req *AddLogMessageRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetUserSupportInfoRequest struct { + // User identifier + UserId int64 `json:"user_id"` +} + +// Returns support information for the given user; for Telegram support only +func (client *Client) GetUserSupportInfo(req *GetUserSupportInfoRequest) (*UserSupportInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserSupportInfo", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserSupportInfo(result.Data) +} + +type SetUserSupportInfoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // New information message + Message *FormattedText `json:"message"` +} + +// Sets support information for the given user; for Telegram support only +func (client *Client) SetUserSupportInfo(req *SetUserSupportInfoRequest) (*UserSupportInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUserSupportInfo", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "message": req.Message, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserSupportInfo(result.Data) +} + // Does nothing; for testing only. This is an offline method. Can be called before authorization func (client *Client) TestCallEmpty() (*Ok, error) { result, err := client.Send(Request{ @@ -13387,7 +16224,7 @@ type TestProxyRequest struct { Port int32 `json:"port"` // Proxy type Type ProxyType `json:"type"` - // Identifier of a datacenter, with which to test connection + // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request Timeout float64 `json:"timeout"` @@ -13487,6 +16324,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(result.Data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(result.Data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(result.Data) @@ -13517,14 +16357,17 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(result.Data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(result.Data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(result.Data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(result.Data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(result.Data) @@ -13541,6 +16384,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(result.Data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(result.Data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(result.Data) @@ -13565,6 +16411,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(result.Data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(result.Data) @@ -13622,6 +16471,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(result.Data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(result.Data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(result.Data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(result.Data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(result.Data) + case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) @@ -13664,6 +16525,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(result.Data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(result.Data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(result.Data) @@ -13682,6 +16546,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(result.Data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(result.Data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(result.Data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) diff --git a/client/type.go b/client/type.go index 0022c59..7e11c16 100755 --- a/client/type.go +++ b/client/type.go @@ -8,10 +8,14 @@ import ( const ( ClassAuthenticationCodeType = "AuthenticationCodeType" + ClassEmailAddressAuthentication = "EmailAddressAuthentication" ClassAuthorizationState = "AuthorizationState" ClassInputFile = "InputFile" ClassThumbnailFormat = "ThumbnailFormat" ClassMaskPoint = "MaskPoint" + ClassStickerFormat = "StickerFormat" + ClassStickerType = "StickerType" + ClassStickerFullType = "StickerFullType" ClassPollType = "PollType" ClassUserType = "UserType" ClassInputChatPhoto = "InputChatPhoto" @@ -21,11 +25,13 @@ const ( ClassSecretChatState = "SecretChatState" ClassMessageSender = "MessageSender" ClassMessageForwardOrigin = "MessageForwardOrigin" + ClassReactionType = "ReactionType" ClassMessageSendingState = "MessageSendingState" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassChatType = "ChatType" ClassChatList = "ChatList" ClassChatSource = "ChatSource" + ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" ClassKeyboardButtonType = "KeyboardButtonType" @@ -37,6 +43,9 @@ const ( ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" ClassPageBlock = "PageBlock" ClassInputCredentials = "InputCredentials" + ClassPaymentProvider = "PaymentProvider" + ClassInputInvoice = "InputInvoice" + ClassMessageExtendedMedia = "MessageExtendedMedia" ClassPassportElementType = "PassportElementType" ClassPassportElement = "PassportElement" ClassInputPassportElement = "InputPassportElement" @@ -55,11 +64,16 @@ const ( ClassGroupCallVideoQuality = "GroupCallVideoQuality" ClassCallProblem = "CallProblem" ClassDiceStickers = "DiceStickers" + ClassSpeechRecognitionResult = "SpeechRecognitionResult" ClassInputInlineQueryResult = "InputInlineQueryResult" ClassInlineQueryResult = "InlineQueryResult" ClassCallbackQueryPayload = "CallbackQueryPayload" ClassChatEventAction = "ChatEventAction" ClassLanguagePackStringValue = "LanguagePackStringValue" + ClassPremiumLimitType = "PremiumLimitType" + ClassPremiumFeature = "PremiumFeature" + ClassPremiumSource = "PremiumSource" + ClassStorePaymentPurpose = "StorePaymentPurpose" ClassDeviceToken = "DeviceToken" ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" @@ -76,7 +90,9 @@ const ( ClassJsonValue = "JsonValue" ClassUserPrivacySettingRule = "UserPrivacySettingRule" ClassUserPrivacySetting = "UserPrivacySetting" + ClassSessionType = "SessionType" ClassChatReportReason = "ChatReportReason" + ClassTargetChat = "TargetChat" ClassInternalLinkType = "InternalLinkType" ClassFileType = "FileType" ClassNetworkType = "NetworkType" @@ -87,7 +103,6 @@ const ( ClassSuggestedAction = "SuggestedAction" ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" - ClassInputSticker = "InputSticker" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" @@ -96,7 +111,6 @@ const ( ClassLogStream = "LogStream" ClassError = "Error" ClassOk = "Ok" - ClassTdlibParameters = "TdlibParameters" ClassAuthenticationCodeInfo = "AuthenticationCodeInfo" ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo" ClassTextEntity = "TextEntity" @@ -133,16 +147,23 @@ const ( ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" ClassBotCommands = "BotCommands" + ClassBotMenuButton = "BotMenuButton" ClassChatLocation = "ChatLocation" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" ClassChatPhotos = "ChatPhotos" + ClassChatPermissions = "ChatPermissions" + ClassChatAdministratorRights = "ChatAdministratorRights" + ClassPremiumPaymentOption = "PremiumPaymentOption" + ClassEmojiStatus = "EmojiStatus" + ClassEmojiStatuses = "EmojiStatuses" + ClassUsernames = "Usernames" ClassUser = "User" + ClassBotInfo = "BotInfo" ClassUserFullInfo = "UserFullInfo" ClassUsers = "Users" ClassChatAdministrator = "ChatAdministrator" ClassChatAdministrators = "ChatAdministrators" - ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" ClassChatInviteLink = "ChatInviteLink" @@ -161,17 +182,26 @@ const ( ClassSupergroupFullInfo = "SupergroupFullInfo" ClassSecretChat = "SecretChat" ClassMessageSenders = "MessageSenders" + ClassChatMessageSender = "ChatMessageSender" + ClassChatMessageSenders = "ChatMessageSenders" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageReplyInfo = "MessageReplyInfo" + ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" + ClassUnreadReaction = "UnreadReaction" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" + ClassFoundChatMessages = "FoundChatMessages" ClassMessagePosition = "MessagePosition" ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" ClassSponsoredMessage = "SponsoredMessage" + ClassSponsoredMessages = "SponsoredMessages" + ClassFileDownload = "FileDownload" + ClassDownloadedFileCounts = "DownloadedFileCounts" + ClassFoundFileDownloads = "FoundFileDownloads" ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" @@ -188,7 +218,12 @@ const ( ClassChatsNearby = "ChatsNearby" ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" + ClassWebAppInfo = "WebAppInfo" ClassMessageThreadInfo = "MessageThreadInfo" + ClassForumTopicIcon = "ForumTopicIcon" + ClassForumTopicInfo = "ForumTopicInfo" + ClassForumTopic = "ForumTopic" + ClassForumTopics = "ForumTopics" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" @@ -201,13 +236,13 @@ const ( ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" + ClassThemeParameters = "ThemeParameters" ClassLabeledPricePart = "LabeledPricePart" ClassInvoice = "Invoice" ClassOrderInfo = "OrderInfo" ClassShippingOption = "ShippingOption" ClassSavedCredentials = "SavedCredentials" - ClassPaymentsProviderStripe = "PaymentsProviderStripe" - ClassPaymentFormTheme = "PaymentFormTheme" + ClassPaymentOption = "PaymentOption" ClassPaymentForm = "PaymentForm" ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" @@ -236,10 +271,14 @@ const ( ClassStickerSet = "StickerSet" ClassStickerSetInfo = "StickerSetInfo" ClassStickerSets = "StickerSets" + ClassTrendingStickerSets = "TrendingStickerSets" ClassCallProtocol = "CallProtocol" ClassCallServer = "CallServer" ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" + ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" @@ -247,9 +286,18 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" + ClassAddedReaction = "AddedReaction" + ClassAddedReactions = "AddedReactions" + ClassAvailableReaction = "AvailableReaction" + ClassAvailableReactions = "AvailableReactions" + ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" ClassImportedContacts = "ImportedContacts" + ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" + ClassAttachmentMenuBot = "AttachmentMenuBot" + ClassSentWebAppMessage = "SentWebAppMessage" ClassHttpUrl = "HttpUrl" + ClassUserLink = "UserLink" ClassInlineQueryResults = "InlineQueryResults" ClassCallbackQueryAnswer = "CallbackQueryAnswer" ClassCustomRequestResult = "CustomRequestResult" @@ -262,17 +310,24 @@ const ( ClassLanguagePackStrings = "LanguagePackStrings" ClassLanguagePackInfo = "LanguagePackInfo" ClassLocalizationTargetInfo = "LocalizationTargetInfo" + ClassPremiumLimit = "PremiumLimit" + ClassPremiumFeatures = "PremiumFeatures" + ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" + ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" ClassBackground = "Background" ClassBackgrounds = "Backgrounds" ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" + ClassNotificationSound = "NotificationSound" + ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassAccountTtl = "AccountTtl" + ClassMessageAutoDeleteTime = "MessageAutoDeleteTime" ClassSession = "Session" ClassSessions = "Sessions" ClassConnectedWebsite = "ConnectedWebsite" @@ -293,9 +348,11 @@ const ( ClassCount = "Count" ClassText = "Text" ClassSeconds = "Seconds" + ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassDeepLinkInfo = "DeepLinkInfo" ClassProxy = "Proxy" ClassProxies = "Proxies" + ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" @@ -307,6 +364,7 @@ const ( ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" ClassLogTags = "LogTags" + ClassUserSupportInfo = "UserSupportInfo" ClassTestInt = "TestInt" ClassTestString = "TestString" ClassTestBytes = "TestBytes" @@ -317,956 +375,1134 @@ const ( ) const ( - TypeError = "error" - TypeOk = "ok" - TypeTdlibParameters = "tdlibParameters" - TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" - TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" - TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" - TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" - TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" - TypeAuthenticationCodeInfo = "authenticationCodeInfo" - TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" - TypeTextEntity = "textEntity" - TypeTextEntities = "textEntities" - TypeFormattedText = "formattedText" - TypeTermsOfService = "termsOfService" - TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" - TypeAuthorizationStateWaitEncryptionKey = "authorizationStateWaitEncryptionKey" - TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" - TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" - TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation" - TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration" - TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword" - TypeAuthorizationStateReady = "authorizationStateReady" - TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut" - TypeAuthorizationStateClosing = "authorizationStateClosing" - TypeAuthorizationStateClosed = "authorizationStateClosed" - TypePasswordState = "passwordState" - TypeRecoveryEmailAddress = "recoveryEmailAddress" - TypeTemporaryPasswordState = "temporaryPasswordState" - TypeLocalFile = "localFile" - TypeRemoteFile = "remoteFile" - TypeFile = "file" - TypeInputFileId = "inputFileId" - TypeInputFileRemote = "inputFileRemote" - TypeInputFileLocal = "inputFileLocal" - TypeInputFileGenerated = "inputFileGenerated" - TypePhotoSize = "photoSize" - TypeMinithumbnail = "minithumbnail" - TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" - TypeThumbnailFormatPng = "thumbnailFormatPng" - TypeThumbnailFormatWebp = "thumbnailFormatWebp" - TypeThumbnailFormatGif = "thumbnailFormatGif" - TypeThumbnailFormatTgs = "thumbnailFormatTgs" - TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" - TypeThumbnail = "thumbnail" - TypeMaskPointForehead = "maskPointForehead" - TypeMaskPointEyes = "maskPointEyes" - TypeMaskPointMouth = "maskPointMouth" - TypeMaskPointChin = "maskPointChin" - TypeMaskPosition = "maskPosition" - TypeClosedVectorPath = "closedVectorPath" - TypePollOption = "pollOption" - TypePollTypeRegular = "pollTypeRegular" - TypePollTypeQuiz = "pollTypeQuiz" - TypeAnimation = "animation" - TypeAudio = "audio" - TypeDocument = "document" - TypePhoto = "photo" - TypeSticker = "sticker" - TypeVideo = "video" - TypeVideoNote = "videoNote" - TypeVoiceNote = "voiceNote" - TypeAnimatedEmoji = "animatedEmoji" - TypeContact = "contact" - TypeLocation = "location" - TypeVenue = "venue" - TypeGame = "game" - TypePoll = "poll" - TypeProfilePhoto = "profilePhoto" - TypeChatPhotoInfo = "chatPhotoInfo" - TypeUserTypeRegular = "userTypeRegular" - TypeUserTypeDeleted = "userTypeDeleted" - TypeUserTypeBot = "userTypeBot" - TypeUserTypeUnknown = "userTypeUnknown" - TypeBotCommand = "botCommand" - TypeBotCommands = "botCommands" - TypeChatLocation = "chatLocation" - TypeAnimatedChatPhoto = "animatedChatPhoto" - TypeChatPhoto = "chatPhoto" - TypeChatPhotos = "chatPhotos" - TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" - TypeInputChatPhotoStatic = "inputChatPhotoStatic" - TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" - TypeUser = "user" - TypeUserFullInfo = "userFullInfo" - TypeUsers = "users" - TypeChatAdministrator = "chatAdministrator" - TypeChatAdministrators = "chatAdministrators" - TypeChatPermissions = "chatPermissions" - TypeChatMemberStatusCreator = "chatMemberStatusCreator" - TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" - TypeChatMemberStatusMember = "chatMemberStatusMember" - TypeChatMemberStatusRestricted = "chatMemberStatusRestricted" - TypeChatMemberStatusLeft = "chatMemberStatusLeft" - TypeChatMemberStatusBanned = "chatMemberStatusBanned" - TypeChatMember = "chatMember" - TypeChatMembers = "chatMembers" - TypeChatMembersFilterContacts = "chatMembersFilterContacts" - TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators" - TypeChatMembersFilterMembers = "chatMembersFilterMembers" - TypeChatMembersFilterMention = "chatMembersFilterMention" - TypeChatMembersFilterRestricted = "chatMembersFilterRestricted" - TypeChatMembersFilterBanned = "chatMembersFilterBanned" - TypeChatMembersFilterBots = "chatMembersFilterBots" - TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent" - TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts" - TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators" - TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch" - TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted" - TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" - TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" - TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" - TypeChatInviteLink = "chatInviteLink" - TypeChatInviteLinks = "chatInviteLinks" - TypeChatInviteLinkCount = "chatInviteLinkCount" - TypeChatInviteLinkCounts = "chatInviteLinkCounts" - TypeChatInviteLinkMember = "chatInviteLinkMember" - TypeChatInviteLinkMembers = "chatInviteLinkMembers" - TypeChatInviteLinkInfo = "chatInviteLinkInfo" - TypeChatJoinRequest = "chatJoinRequest" - TypeChatJoinRequests = "chatJoinRequests" - TypeChatJoinRequestsInfo = "chatJoinRequestsInfo" - TypeBasicGroup = "basicGroup" - TypeBasicGroupFullInfo = "basicGroupFullInfo" - TypeSupergroup = "supergroup" - TypeSupergroupFullInfo = "supergroupFullInfo" - TypeSecretChatStatePending = "secretChatStatePending" - TypeSecretChatStateReady = "secretChatStateReady" - TypeSecretChatStateClosed = "secretChatStateClosed" - TypeSecretChat = "secretChat" - TypeMessageSenderUser = "messageSenderUser" - TypeMessageSenderChat = "messageSenderChat" - TypeMessageSenders = "messageSenders" - TypeMessageForwardOriginUser = "messageForwardOriginUser" - TypeMessageForwardOriginChat = "messageForwardOriginChat" - TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" - TypeMessageForwardOriginChannel = "messageForwardOriginChannel" - TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" - TypeMessageForwardInfo = "messageForwardInfo" - TypeMessageReplyInfo = "messageReplyInfo" - TypeMessageInteractionInfo = "messageInteractionInfo" - TypeMessageSendingStatePending = "messageSendingStatePending" - TypeMessageSendingStateFailed = "messageSendingStateFailed" - TypeMessage = "message" - TypeMessages = "messages" - TypeFoundMessages = "foundMessages" - TypeMessagePosition = "messagePosition" - TypeMessagePositions = "messagePositions" - TypeMessageCalendarDay = "messageCalendarDay" - TypeMessageCalendar = "messageCalendar" - TypeSponsoredMessage = "sponsoredMessage" - TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" - TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" - TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" - TypeChatNotificationSettings = "chatNotificationSettings" - TypeScopeNotificationSettings = "scopeNotificationSettings" - TypeDraftMessage = "draftMessage" - TypeChatTypePrivate = "chatTypePrivate" - TypeChatTypeBasicGroup = "chatTypeBasicGroup" - TypeChatTypeSupergroup = "chatTypeSupergroup" - TypeChatTypeSecret = "chatTypeSecret" - TypeChatFilter = "chatFilter" - TypeChatFilterInfo = "chatFilterInfo" - TypeRecommendedChatFilter = "recommendedChatFilter" - TypeRecommendedChatFilters = "recommendedChatFilters" - TypeChatListMain = "chatListMain" - TypeChatListArchive = "chatListArchive" - TypeChatListFilter = "chatListFilter" - TypeChatLists = "chatLists" - TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" - TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" - TypeChatPosition = "chatPosition" - TypeVideoChat = "videoChat" - TypeChat = "chat" - TypeChats = "chats" - TypeChatNearby = "chatNearby" - TypeChatsNearby = "chatsNearby" - TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" - TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" - TypeChatActionBarReportSpam = "chatActionBarReportSpam" - TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" - TypeChatActionBarInviteMembers = "chatActionBarInviteMembers" - TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" - TypeChatActionBarAddContact = "chatActionBarAddContact" - TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" - TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" - TypeKeyboardButtonTypeText = "keyboardButtonTypeText" - TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" - TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" - TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" - TypeKeyboardButton = "keyboardButton" - TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" - TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" - TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" - TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" - TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" - TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" - TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" - TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" - TypeInlineKeyboardButton = "inlineKeyboardButton" - TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" - TypeReplyMarkupForceReply = "replyMarkupForceReply" - TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard" - TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" - TypeLoginUrlInfoOpen = "loginUrlInfoOpen" - TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" - TypeMessageThreadInfo = "messageThreadInfo" - TypeRichTextPlain = "richTextPlain" - TypeRichTextBold = "richTextBold" - TypeRichTextItalic = "richTextItalic" - TypeRichTextUnderline = "richTextUnderline" - TypeRichTextStrikethrough = "richTextStrikethrough" - TypeRichTextFixed = "richTextFixed" - TypeRichTextUrl = "richTextUrl" - TypeRichTextEmailAddress = "richTextEmailAddress" - TypeRichTextSubscript = "richTextSubscript" - TypeRichTextSuperscript = "richTextSuperscript" - TypeRichTextMarked = "richTextMarked" - TypeRichTextPhoneNumber = "richTextPhoneNumber" - TypeRichTextIcon = "richTextIcon" - TypeRichTextReference = "richTextReference" - TypeRichTextAnchor = "richTextAnchor" - TypeRichTextAnchorLink = "richTextAnchorLink" - TypeRichTexts = "richTexts" - TypePageBlockCaption = "pageBlockCaption" - TypePageBlockListItem = "pageBlockListItem" - TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft" - TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter" - TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight" - TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop" - TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle" - TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom" - TypePageBlockTableCell = "pageBlockTableCell" - TypePageBlockRelatedArticle = "pageBlockRelatedArticle" - TypePageBlockTitle = "pageBlockTitle" - TypePageBlockSubtitle = "pageBlockSubtitle" - TypePageBlockAuthorDate = "pageBlockAuthorDate" - TypePageBlockHeader = "pageBlockHeader" - TypePageBlockSubheader = "pageBlockSubheader" - TypePageBlockKicker = "pageBlockKicker" - TypePageBlockParagraph = "pageBlockParagraph" - TypePageBlockPreformatted = "pageBlockPreformatted" - TypePageBlockFooter = "pageBlockFooter" - TypePageBlockDivider = "pageBlockDivider" - TypePageBlockAnchor = "pageBlockAnchor" - TypePageBlockList = "pageBlockList" - TypePageBlockBlockQuote = "pageBlockBlockQuote" - TypePageBlockPullQuote = "pageBlockPullQuote" - TypePageBlockAnimation = "pageBlockAnimation" - TypePageBlockAudio = "pageBlockAudio" - TypePageBlockPhoto = "pageBlockPhoto" - TypePageBlockVideo = "pageBlockVideo" - TypePageBlockVoiceNote = "pageBlockVoiceNote" - TypePageBlockCover = "pageBlockCover" - TypePageBlockEmbedded = "pageBlockEmbedded" - TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost" - TypePageBlockCollage = "pageBlockCollage" - TypePageBlockSlideshow = "pageBlockSlideshow" - TypePageBlockChatLink = "pageBlockChatLink" - TypePageBlockTable = "pageBlockTable" - TypePageBlockDetails = "pageBlockDetails" - TypePageBlockRelatedArticles = "pageBlockRelatedArticles" - TypePageBlockMap = "pageBlockMap" - TypeWebPageInstantView = "webPageInstantView" - TypeWebPage = "webPage" - TypeCountryInfo = "countryInfo" - TypeCountries = "countries" - TypePhoneNumberInfo = "phoneNumberInfo" - TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" - TypeBankCardInfo = "bankCardInfo" - TypeAddress = "address" - TypeLabeledPricePart = "labeledPricePart" - TypeInvoice = "invoice" - TypeOrderInfo = "orderInfo" - TypeShippingOption = "shippingOption" - TypeSavedCredentials = "savedCredentials" - TypeInputCredentialsSaved = "inputCredentialsSaved" - TypeInputCredentialsNew = "inputCredentialsNew" - TypeInputCredentialsApplePay = "inputCredentialsApplePay" - TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" - TypePaymentsProviderStripe = "paymentsProviderStripe" - TypePaymentFormTheme = "paymentFormTheme" - TypePaymentForm = "paymentForm" - TypeValidatedOrderInfo = "validatedOrderInfo" - TypePaymentResult = "paymentResult" - TypePaymentReceipt = "paymentReceipt" - TypeDatedFile = "datedFile" - TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails" - TypePassportElementTypePassport = "passportElementTypePassport" - TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense" - TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard" - TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport" - TypePassportElementTypeAddress = "passportElementTypeAddress" - TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill" - TypePassportElementTypeBankStatement = "passportElementTypeBankStatement" - TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement" - TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration" - TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration" - TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber" - TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress" - TypeDate = "date" - TypePersonalDetails = "personalDetails" - TypeIdentityDocument = "identityDocument" - TypeInputIdentityDocument = "inputIdentityDocument" - TypePersonalDocument = "personalDocument" - TypeInputPersonalDocument = "inputPersonalDocument" - TypePassportElementPersonalDetails = "passportElementPersonalDetails" - TypePassportElementPassport = "passportElementPassport" - TypePassportElementDriverLicense = "passportElementDriverLicense" - TypePassportElementIdentityCard = "passportElementIdentityCard" - TypePassportElementInternalPassport = "passportElementInternalPassport" - TypePassportElementAddress = "passportElementAddress" - TypePassportElementUtilityBill = "passportElementUtilityBill" - TypePassportElementBankStatement = "passportElementBankStatement" - TypePassportElementRentalAgreement = "passportElementRentalAgreement" - TypePassportElementPassportRegistration = "passportElementPassportRegistration" - TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration" - TypePassportElementPhoneNumber = "passportElementPhoneNumber" - TypePassportElementEmailAddress = "passportElementEmailAddress" - TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails" - TypeInputPassportElementPassport = "inputPassportElementPassport" - TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense" - TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard" - TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport" - TypeInputPassportElementAddress = "inputPassportElementAddress" - TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill" - TypeInputPassportElementBankStatement = "inputPassportElementBankStatement" - TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement" - TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration" - TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration" - TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber" - TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress" - TypePassportElements = "passportElements" - TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified" - TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField" - TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide" - TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide" - TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie" - TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile" - TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles" - TypePassportElementErrorSourceFile = "passportElementErrorSourceFile" - TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles" - TypePassportElementError = "passportElementError" - TypePassportSuitableElement = "passportSuitableElement" - TypePassportRequiredElement = "passportRequiredElement" - TypePassportAuthorizationForm = "passportAuthorizationForm" - TypePassportElementsWithErrors = "passportElementsWithErrors" - TypeEncryptedCredentials = "encryptedCredentials" - TypeEncryptedPassportElement = "encryptedPassportElement" - TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified" - TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField" - TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide" - TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide" - TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie" - TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile" - TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles" - TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile" - TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles" - TypeInputPassportElementError = "inputPassportElementError" - TypeMessageText = "messageText" - TypeMessageAnimation = "messageAnimation" - TypeMessageAudio = "messageAudio" - TypeMessageDocument = "messageDocument" - TypeMessagePhoto = "messagePhoto" - TypeMessageExpiredPhoto = "messageExpiredPhoto" - TypeMessageSticker = "messageSticker" - TypeMessageVideo = "messageVideo" - TypeMessageExpiredVideo = "messageExpiredVideo" - TypeMessageVideoNote = "messageVideoNote" - TypeMessageVoiceNote = "messageVoiceNote" - TypeMessageLocation = "messageLocation" - TypeMessageVenue = "messageVenue" - TypeMessageContact = "messageContact" - TypeMessageAnimatedEmoji = "messageAnimatedEmoji" - TypeMessageDice = "messageDice" - TypeMessageGame = "messageGame" - TypeMessagePoll = "messagePoll" - TypeMessageInvoice = "messageInvoice" - TypeMessageCall = "messageCall" - TypeMessageVideoChatScheduled = "messageVideoChatScheduled" - TypeMessageVideoChatStarted = "messageVideoChatStarted" - TypeMessageVideoChatEnded = "messageVideoChatEnded" - TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" - TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" - TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" - TypeMessageChatChangeTitle = "messageChatChangeTitle" - TypeMessageChatChangePhoto = "messageChatChangePhoto" - TypeMessageChatDeletePhoto = "messageChatDeletePhoto" - TypeMessageChatAddMembers = "messageChatAddMembers" - TypeMessageChatJoinByLink = "messageChatJoinByLink" - TypeMessageChatJoinByRequest = "messageChatJoinByRequest" - TypeMessageChatDeleteMember = "messageChatDeleteMember" - TypeMessageChatUpgradeTo = "messageChatUpgradeTo" - TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" - TypeMessagePinMessage = "messagePinMessage" - TypeMessageScreenshotTaken = "messageScreenshotTaken" - TypeMessageChatSetTheme = "messageChatSetTheme" - TypeMessageChatSetTtl = "messageChatSetTtl" - TypeMessageCustomServiceAction = "messageCustomServiceAction" - TypeMessageGameScore = "messageGameScore" - TypeMessagePaymentSuccessful = "messagePaymentSuccessful" - TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" - TypeMessageContactRegistered = "messageContactRegistered" - TypeMessageWebsiteConnected = "messageWebsiteConnected" - TypeMessagePassportDataSent = "messagePassportDataSent" - TypeMessagePassportDataReceived = "messagePassportDataReceived" - TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" - TypeMessageUnsupported = "messageUnsupported" - TypeTextEntityTypeMention = "textEntityTypeMention" - TypeTextEntityTypeHashtag = "textEntityTypeHashtag" - TypeTextEntityTypeCashtag = "textEntityTypeCashtag" - TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand" - TypeTextEntityTypeUrl = "textEntityTypeUrl" - TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" - TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" - TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" - TypeTextEntityTypeBold = "textEntityTypeBold" - TypeTextEntityTypeItalic = "textEntityTypeItalic" - TypeTextEntityTypeUnderline = "textEntityTypeUnderline" - TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" - TypeTextEntityTypeCode = "textEntityTypeCode" - TypeTextEntityTypePre = "textEntityTypePre" - TypeTextEntityTypePreCode = "textEntityTypePreCode" - TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" - TypeTextEntityTypeMentionName = "textEntityTypeMentionName" - TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" - TypeInputThumbnail = "inputThumbnail" - TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" - TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" - TypeMessageSendOptions = "messageSendOptions" - TypeMessageCopyOptions = "messageCopyOptions" - TypeInputMessageText = "inputMessageText" - TypeInputMessageAnimation = "inputMessageAnimation" - TypeInputMessageAudio = "inputMessageAudio" - TypeInputMessageDocument = "inputMessageDocument" - TypeInputMessagePhoto = "inputMessagePhoto" - TypeInputMessageSticker = "inputMessageSticker" - TypeInputMessageVideo = "inputMessageVideo" - TypeInputMessageVideoNote = "inputMessageVideoNote" - TypeInputMessageVoiceNote = "inputMessageVoiceNote" - TypeInputMessageLocation = "inputMessageLocation" - TypeInputMessageVenue = "inputMessageVenue" - TypeInputMessageContact = "inputMessageContact" - TypeInputMessageDice = "inputMessageDice" - TypeInputMessageGame = "inputMessageGame" - TypeInputMessageInvoice = "inputMessageInvoice" - TypeInputMessagePoll = "inputMessagePoll" - TypeInputMessageForwarded = "inputMessageForwarded" - TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" - TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" - TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" - TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument" - TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto" - TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo" - TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote" - TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" - TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" - TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" - TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" - TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" - TypeSearchMessagesFilterMention = "searchMessagesFilterMention" - TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" - TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" - TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" - TypeChatActionTyping = "chatActionTyping" - TypeChatActionRecordingVideo = "chatActionRecordingVideo" - TypeChatActionUploadingVideo = "chatActionUploadingVideo" - TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote" - TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote" - TypeChatActionUploadingPhoto = "chatActionUploadingPhoto" - TypeChatActionUploadingDocument = "chatActionUploadingDocument" - TypeChatActionChoosingSticker = "chatActionChoosingSticker" - TypeChatActionChoosingLocation = "chatActionChoosingLocation" - TypeChatActionChoosingContact = "chatActionChoosingContact" - TypeChatActionStartPlayingGame = "chatActionStartPlayingGame" - TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote" - TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote" - TypeChatActionWatchingAnimations = "chatActionWatchingAnimations" - TypeChatActionCancel = "chatActionCancel" - TypeUserStatusEmpty = "userStatusEmpty" - TypeUserStatusOnline = "userStatusOnline" - TypeUserStatusOffline = "userStatusOffline" - TypeUserStatusRecently = "userStatusRecently" - TypeUserStatusLastWeek = "userStatusLastWeek" - TypeUserStatusLastMonth = "userStatusLastMonth" - TypeStickers = "stickers" - TypeEmojis = "emojis" - TypeStickerSet = "stickerSet" - TypeStickerSetInfo = "stickerSetInfo" - TypeStickerSets = "stickerSets" - TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty" - TypeCallDiscardReasonMissed = "callDiscardReasonMissed" - TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" - TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" - TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" - TypeCallProtocol = "callProtocol" - TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" - TypeCallServerTypeWebrtc = "callServerTypeWebrtc" - TypeCallServer = "callServer" - TypeCallId = "callId" - TypeGroupCallId = "groupCallId" - TypeCallStatePending = "callStatePending" - TypeCallStateExchangingKeys = "callStateExchangingKeys" - TypeCallStateReady = "callStateReady" - TypeCallStateHangingUp = "callStateHangingUp" - TypeCallStateDiscarded = "callStateDiscarded" - TypeCallStateError = "callStateError" - TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" - TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" - TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" - TypeGroupCall = "groupCall" - TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" - TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" - TypeGroupCallParticipant = "groupCallParticipant" - TypeCallProblemEcho = "callProblemEcho" - TypeCallProblemNoise = "callProblemNoise" - TypeCallProblemInterruptions = "callProblemInterruptions" - TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech" - TypeCallProblemSilentLocal = "callProblemSilentLocal" - TypeCallProblemSilentRemote = "callProblemSilentRemote" - TypeCallProblemDropped = "callProblemDropped" - TypeCallProblemDistortedVideo = "callProblemDistortedVideo" - TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" - TypeCall = "call" - TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" - TypeAnimations = "animations" - TypeDiceStickersRegular = "diceStickersRegular" - TypeDiceStickersSlotMachine = "diceStickersSlotMachine" - TypeImportedContacts = "importedContacts" - TypeHttpUrl = "httpUrl" - TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" - TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" - TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio" - TypeInputInlineQueryResultContact = "inputInlineQueryResultContact" - TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument" - TypeInputInlineQueryResultGame = "inputInlineQueryResultGame" - TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation" - TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto" - TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker" - TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue" - TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo" - TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote" - TypeInlineQueryResultArticle = "inlineQueryResultArticle" - TypeInlineQueryResultContact = "inlineQueryResultContact" - TypeInlineQueryResultLocation = "inlineQueryResultLocation" - TypeInlineQueryResultVenue = "inlineQueryResultVenue" - TypeInlineQueryResultGame = "inlineQueryResultGame" - TypeInlineQueryResultAnimation = "inlineQueryResultAnimation" - TypeInlineQueryResultAudio = "inlineQueryResultAudio" - TypeInlineQueryResultDocument = "inlineQueryResultDocument" - TypeInlineQueryResultPhoto = "inlineQueryResultPhoto" - TypeInlineQueryResultSticker = "inlineQueryResultSticker" - TypeInlineQueryResultVideo = "inlineQueryResultVideo" - TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote" - TypeInlineQueryResults = "inlineQueryResults" - TypeCallbackQueryPayloadData = "callbackQueryPayloadData" - TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" - TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" - TypeCallbackQueryAnswer = "callbackQueryAnswer" - TypeCustomRequestResult = "customRequestResult" - TypeGameHighScore = "gameHighScore" - TypeGameHighScores = "gameHighScores" - TypeChatEventMessageEdited = "chatEventMessageEdited" - TypeChatEventMessageDeleted = "chatEventMessageDeleted" - TypeChatEventPollStopped = "chatEventPollStopped" - TypeChatEventMessagePinned = "chatEventMessagePinned" - TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" - TypeChatEventMemberJoined = "chatEventMemberJoined" - TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" - TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" - TypeChatEventMemberLeft = "chatEventMemberLeft" - TypeChatEventMemberInvited = "chatEventMemberInvited" - TypeChatEventMemberPromoted = "chatEventMemberPromoted" - TypeChatEventMemberRestricted = "chatEventMemberRestricted" - TypeChatEventTitleChanged = "chatEventTitleChanged" - TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" - TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" - TypeChatEventUsernameChanged = "chatEventUsernameChanged" - TypeChatEventPhotoChanged = "chatEventPhotoChanged" - TypeChatEventInvitesToggled = "chatEventInvitesToggled" - TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" - TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" - TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" - TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" - TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" - TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" - TypeChatEventLocationChanged = "chatEventLocationChanged" - TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" - TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" - TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" - TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" - TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" - TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" - TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" - TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" - TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" - TypeChatEvent = "chatEvent" - TypeChatEvents = "chatEvents" - TypeChatEventLogFilters = "chatEventLogFilters" - TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" - TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" - TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" - TypeLanguagePackString = "languagePackString" - TypeLanguagePackStrings = "languagePackStrings" - TypeLanguagePackInfo = "languagePackInfo" - TypeLocalizationTargetInfo = "localizationTargetInfo" - TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" - TypeDeviceTokenApplePush = "deviceTokenApplePush" - TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" - TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush" - TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush" - TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP" - TypeDeviceTokenWebPush = "deviceTokenWebPush" - TypeDeviceTokenSimplePush = "deviceTokenSimplePush" - TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush" - TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" - TypeDeviceTokenTizenPush = "deviceTokenTizenPush" - TypePushReceiverId = "pushReceiverId" - TypeBackgroundFillSolid = "backgroundFillSolid" - TypeBackgroundFillGradient = "backgroundFillGradient" - TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" - TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" - TypeBackgroundTypePattern = "backgroundTypePattern" - TypeBackgroundTypeFill = "backgroundTypeFill" - TypeBackground = "background" - TypeBackgrounds = "backgrounds" - TypeInputBackgroundLocal = "inputBackgroundLocal" - TypeInputBackgroundRemote = "inputBackgroundRemote" - TypeThemeSettings = "themeSettings" - TypeChatTheme = "chatTheme" - TypeHashtags = "hashtags" - TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" - TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" - TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" - TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" - TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" - TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" - TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" - TypeCheckChatUsernameResultPublicChatsTooMuch = "checkChatUsernameResultPublicChatsTooMuch" - TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable" - TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk" - TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid" - TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied" - TypeResetPasswordResultOk = "resetPasswordResultOk" - TypeResetPasswordResultPending = "resetPasswordResultPending" - TypeResetPasswordResultDeclined = "resetPasswordResultDeclined" - TypeMessageFileTypePrivate = "messageFileTypePrivate" - TypeMessageFileTypeGroup = "messageFileTypeGroup" - TypeMessageFileTypeUnknown = "messageFileTypeUnknown" - TypePushMessageContentHidden = "pushMessageContentHidden" - TypePushMessageContentAnimation = "pushMessageContentAnimation" - TypePushMessageContentAudio = "pushMessageContentAudio" - TypePushMessageContentContact = "pushMessageContentContact" - TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered" - TypePushMessageContentDocument = "pushMessageContentDocument" - TypePushMessageContentGame = "pushMessageContentGame" - TypePushMessageContentGameScore = "pushMessageContentGameScore" - TypePushMessageContentInvoice = "pushMessageContentInvoice" - TypePushMessageContentLocation = "pushMessageContentLocation" - TypePushMessageContentPhoto = "pushMessageContentPhoto" - TypePushMessageContentPoll = "pushMessageContentPoll" - TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" - TypePushMessageContentSticker = "pushMessageContentSticker" - TypePushMessageContentText = "pushMessageContentText" - TypePushMessageContentVideo = "pushMessageContentVideo" - TypePushMessageContentVideoNote = "pushMessageContentVideoNote" - TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" - TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate" - TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" - TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" - TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" - TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" - TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" - TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" - TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" - TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" - TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" - TypeNotificationTypeNewMessage = "notificationTypeNewMessage" - TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" - TypeNotificationTypeNewCall = "notificationTypeNewCall" - TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" - TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" - TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" - TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" - TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" - TypeNotification = "notification" - TypeNotificationGroup = "notificationGroup" - TypeOptionValueBoolean = "optionValueBoolean" - TypeOptionValueEmpty = "optionValueEmpty" - TypeOptionValueInteger = "optionValueInteger" - TypeOptionValueString = "optionValueString" - TypeJsonObjectMember = "jsonObjectMember" - TypeJsonValueNull = "jsonValueNull" - TypeJsonValueBoolean = "jsonValueBoolean" - TypeJsonValueNumber = "jsonValueNumber" - TypeJsonValueString = "jsonValueString" - TypeJsonValueArray = "jsonValueArray" - TypeJsonValueObject = "jsonValueObject" - TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" - TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" - TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" - TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" - TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" - TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts" - TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers" - TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers" - TypeUserPrivacySettingRules = "userPrivacySettingRules" - TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus" - TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" - TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" - TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" - TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" - TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" - TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" - TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" - TypeAccountTtl = "accountTtl" - TypeSession = "session" - TypeSessions = "sessions" - TypeConnectedWebsite = "connectedWebsite" - TypeConnectedWebsites = "connectedWebsites" - TypeChatReportReasonSpam = "chatReportReasonSpam" - TypeChatReportReasonViolence = "chatReportReasonViolence" - TypeChatReportReasonPornography = "chatReportReasonPornography" - TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" - TypeChatReportReasonCopyright = "chatReportReasonCopyright" - TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" - TypeChatReportReasonFake = "chatReportReasonFake" - TypeChatReportReasonCustom = "chatReportReasonCustom" - TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" - TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" - TypeInternalLinkTypeBackground = "internalLinkTypeBackground" - TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" - TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" - TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" - TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" - TypeInternalLinkTypeGame = "internalLinkTypeGame" - TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeMessage = "internalLinkTypeMessage" - TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" - TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypeProxy = "internalLinkTypeProxy" - TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" - TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" - TypeInternalLinkTypeSettings = "internalLinkTypeSettings" - TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" - TypeInternalLinkTypeTheme = "internalLinkTypeTheme" - TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" - TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" - TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" - TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" - TypeMessageLink = "messageLink" - TypeMessageLinkInfo = "messageLinkInfo" - TypeFilePart = "filePart" - TypeFileTypeNone = "fileTypeNone" - TypeFileTypeAnimation = "fileTypeAnimation" - TypeFileTypeAudio = "fileTypeAudio" - TypeFileTypeDocument = "fileTypeDocument" - TypeFileTypePhoto = "fileTypePhoto" - TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" - TypeFileTypeSecret = "fileTypeSecret" - TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" - TypeFileTypeSecure = "fileTypeSecure" - TypeFileTypeSticker = "fileTypeSticker" - TypeFileTypeThumbnail = "fileTypeThumbnail" - TypeFileTypeUnknown = "fileTypeUnknown" - TypeFileTypeVideo = "fileTypeVideo" - TypeFileTypeVideoNote = "fileTypeVideoNote" - TypeFileTypeVoiceNote = "fileTypeVoiceNote" - TypeFileTypeWallpaper = "fileTypeWallpaper" - TypeStorageStatisticsByFileType = "storageStatisticsByFileType" - TypeStorageStatisticsByChat = "storageStatisticsByChat" - TypeStorageStatistics = "storageStatistics" - TypeStorageStatisticsFast = "storageStatisticsFast" - TypeDatabaseStatistics = "databaseStatistics" - TypeNetworkTypeNone = "networkTypeNone" - TypeNetworkTypeMobile = "networkTypeMobile" - TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming" - TypeNetworkTypeWiFi = "networkTypeWiFi" - TypeNetworkTypeOther = "networkTypeOther" - TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile" - TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall" - TypeNetworkStatistics = "networkStatistics" - TypeAutoDownloadSettings = "autoDownloadSettings" - TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets" - TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" - TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" - TypeConnectionStateConnecting = "connectionStateConnecting" - TypeConnectionStateUpdating = "connectionStateUpdating" - TypeConnectionStateReady = "connectionStateReady" - TypeTopChatCategoryUsers = "topChatCategoryUsers" - TypeTopChatCategoryBots = "topChatCategoryBots" - TypeTopChatCategoryGroups = "topChatCategoryGroups" - TypeTopChatCategoryChannels = "topChatCategoryChannels" - TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" - TypeTopChatCategoryCalls = "topChatCategoryCalls" - TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" - TypeTMeUrlTypeUser = "tMeUrlTypeUser" - TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" - TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" - TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" - TypeTMeUrl = "tMeUrl" - TypeTMeUrls = "tMeUrls" - TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" - TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" - TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" - TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" - TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" - TypeSuggestedActionSetPassword = "suggestedActionSetPassword" - TypeCount = "count" - TypeText = "text" - TypeSeconds = "seconds" - TypeDeepLinkInfo = "deepLinkInfo" - TypeTextParseModeMarkdown = "textParseModeMarkdown" - TypeTextParseModeHTML = "textParseModeHTML" - TypeProxyTypeSocks5 = "proxyTypeSocks5" - TypeProxyTypeHttp = "proxyTypeHttp" - TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeProxy = "proxy" - TypeProxies = "proxies" - TypeInputStickerStatic = "inputStickerStatic" - TypeInputStickerAnimated = "inputStickerAnimated" - TypeDateRange = "dateRange" - TypeStatisticalValue = "statisticalValue" - TypeStatisticalGraphData = "statisticalGraphData" - TypeStatisticalGraphAsync = "statisticalGraphAsync" - TypeStatisticalGraphError = "statisticalGraphError" - TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo" - TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" - TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" - TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" - TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" - TypeChatStatisticsChannel = "chatStatisticsChannel" - TypeMessageStatistics = "messageStatistics" - TypePoint = "point" - TypeVectorPathCommandLine = "vectorPathCommandLine" - TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" - TypeBotCommandScopeDefault = "botCommandScopeDefault" - TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats" - TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats" - TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators" - TypeBotCommandScopeChat = "botCommandScopeChat" - TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" - TypeBotCommandScopeChatMember = "botCommandScopeChatMember" - TypeUpdateAuthorizationState = "updateAuthorizationState" - TypeUpdateNewMessage = "updateNewMessage" - TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" - TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded" - TypeUpdateMessageSendFailed = "updateMessageSendFailed" - TypeUpdateMessageContent = "updateMessageContent" - TypeUpdateMessageEdited = "updateMessageEdited" - TypeUpdateMessageIsPinned = "updateMessageIsPinned" - TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" - TypeUpdateMessageContentOpened = "updateMessageContentOpened" - TypeUpdateMessageMentionRead = "updateMessageMentionRead" - TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" - TypeUpdateNewChat = "updateNewChat" - TypeUpdateChatTitle = "updateChatTitle" - TypeUpdateChatPhoto = "updateChatPhoto" - TypeUpdateChatPermissions = "updateChatPermissions" - TypeUpdateChatLastMessage = "updateChatLastMessage" - TypeUpdateChatPosition = "updateChatPosition" - TypeUpdateChatReadInbox = "updateChatReadInbox" - TypeUpdateChatReadOutbox = "updateChatReadOutbox" - TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatDraftMessage = "updateChatDraftMessage" - TypeUpdateChatMessageSender = "updateChatMessageSender" - TypeUpdateChatMessageTtl = "updateChatMessageTtl" - TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" - TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" - TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" - TypeUpdateChatTheme = "updateChatTheme" - TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" - TypeUpdateChatVideoChat = "updateChatVideoChat" - TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" - TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" - TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" - TypeUpdateChatIsBlocked = "updateChatIsBlocked" - TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatFilters = "updateChatFilters" - TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" - TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" - TypeUpdateNotification = "updateNotification" - TypeUpdateNotificationGroup = "updateNotificationGroup" - TypeUpdateActiveNotifications = "updateActiveNotifications" - TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" - TypeUpdateDeleteMessages = "updateDeleteMessages" - TypeUpdateChatAction = "updateChatAction" - TypeUpdateUserStatus = "updateUserStatus" - TypeUpdateUser = "updateUser" - TypeUpdateBasicGroup = "updateBasicGroup" - TypeUpdateSupergroup = "updateSupergroup" - TypeUpdateSecretChat = "updateSecretChat" - TypeUpdateUserFullInfo = "updateUserFullInfo" - TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo" - TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo" - TypeUpdateServiceNotification = "updateServiceNotification" - TypeUpdateFile = "updateFile" - TypeUpdateFileGenerationStart = "updateFileGenerationStart" - TypeUpdateFileGenerationStop = "updateFileGenerationStop" - TypeUpdateCall = "updateCall" - TypeUpdateGroupCall = "updateGroupCall" - TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" - TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" - TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" - TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" - TypeUpdateUnreadChatCount = "updateUnreadChatCount" - TypeUpdateOption = "updateOption" - TypeUpdateStickerSet = "updateStickerSet" - TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" - TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" - TypeUpdateRecentStickers = "updateRecentStickers" - TypeUpdateFavoriteStickers = "updateFavoriteStickers" - TypeUpdateSavedAnimations = "updateSavedAnimations" - TypeUpdateSelectedBackground = "updateSelectedBackground" - TypeUpdateChatThemes = "updateChatThemes" - TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" - TypeUpdateConnectionState = "updateConnectionState" - TypeUpdateTermsOfService = "updateTermsOfService" - TypeUpdateUsersNearby = "updateUsersNearby" - TypeUpdateDiceEmojis = "updateDiceEmojis" - TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" - TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" - TypeUpdateSuggestedActions = "updateSuggestedActions" - TypeUpdateNewInlineQuery = "updateNewInlineQuery" - TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" - TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" - TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" - TypeUpdateNewShippingQuery = "updateNewShippingQuery" - TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" - TypeUpdateNewCustomEvent = "updateNewCustomEvent" - TypeUpdateNewCustomQuery = "updateNewCustomQuery" - TypeUpdatePoll = "updatePoll" - TypeUpdatePollAnswer = "updatePollAnswer" - TypeUpdateChatMember = "updateChatMember" - TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" - TypeUpdates = "updates" - TypeLogStreamDefault = "logStreamDefault" - TypeLogStreamFile = "logStreamFile" - TypeLogStreamEmpty = "logStreamEmpty" - TypeLogVerbosityLevel = "logVerbosityLevel" - TypeLogTags = "logTags" - TypeTestInt = "testInt" - TypeTestString = "testString" - TypeTestBytes = "testBytes" - TypeTestVectorInt = "testVectorInt" - TypeTestVectorIntObject = "testVectorIntObject" - TypeTestVectorString = "testVectorString" - TypeTestVectorStringObject = "testVectorStringObject" + TypeError = "error" + TypeOk = "ok" + TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" + TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" + TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" + TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" + TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" + TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment" + TypeAuthenticationCodeInfo = "authenticationCodeInfo" + TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" + TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode" + TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId" + TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId" + TypeTextEntity = "textEntity" + TypeTextEntities = "textEntities" + TypeFormattedText = "formattedText" + TypeTermsOfService = "termsOfService" + TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" + TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" + TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress" + TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode" + TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" + TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation" + TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration" + TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword" + TypeAuthorizationStateReady = "authorizationStateReady" + TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut" + TypeAuthorizationStateClosing = "authorizationStateClosing" + TypeAuthorizationStateClosed = "authorizationStateClosed" + TypePasswordState = "passwordState" + TypeRecoveryEmailAddress = "recoveryEmailAddress" + TypeTemporaryPasswordState = "temporaryPasswordState" + TypeLocalFile = "localFile" + TypeRemoteFile = "remoteFile" + TypeFile = "file" + TypeInputFileId = "inputFileId" + TypeInputFileRemote = "inputFileRemote" + TypeInputFileLocal = "inputFileLocal" + TypeInputFileGenerated = "inputFileGenerated" + TypePhotoSize = "photoSize" + TypeMinithumbnail = "minithumbnail" + TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" + TypeThumbnailFormatGif = "thumbnailFormatGif" + TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" + TypeThumbnailFormatPng = "thumbnailFormatPng" + TypeThumbnailFormatTgs = "thumbnailFormatTgs" + TypeThumbnailFormatWebm = "thumbnailFormatWebm" + TypeThumbnailFormatWebp = "thumbnailFormatWebp" + TypeThumbnail = "thumbnail" + TypeMaskPointForehead = "maskPointForehead" + TypeMaskPointEyes = "maskPointEyes" + TypeMaskPointMouth = "maskPointMouth" + TypeMaskPointChin = "maskPointChin" + TypeMaskPosition = "maskPosition" + TypeStickerFormatWebp = "stickerFormatWebp" + TypeStickerFormatTgs = "stickerFormatTgs" + TypeStickerFormatWebm = "stickerFormatWebm" + TypeStickerTypeRegular = "stickerTypeRegular" + TypeStickerTypeMask = "stickerTypeMask" + TypeStickerTypeCustomEmoji = "stickerTypeCustomEmoji" + TypeStickerFullTypeRegular = "stickerFullTypeRegular" + TypeStickerFullTypeMask = "stickerFullTypeMask" + TypeStickerFullTypeCustomEmoji = "stickerFullTypeCustomEmoji" + TypeClosedVectorPath = "closedVectorPath" + TypePollOption = "pollOption" + TypePollTypeRegular = "pollTypeRegular" + TypePollTypeQuiz = "pollTypeQuiz" + TypeAnimation = "animation" + TypeAudio = "audio" + TypeDocument = "document" + TypePhoto = "photo" + TypeSticker = "sticker" + TypeVideo = "video" + TypeVideoNote = "videoNote" + TypeVoiceNote = "voiceNote" + TypeAnimatedEmoji = "animatedEmoji" + TypeContact = "contact" + TypeLocation = "location" + TypeVenue = "venue" + TypeGame = "game" + TypePoll = "poll" + TypeProfilePhoto = "profilePhoto" + TypeChatPhotoInfo = "chatPhotoInfo" + TypeUserTypeRegular = "userTypeRegular" + TypeUserTypeDeleted = "userTypeDeleted" + TypeUserTypeBot = "userTypeBot" + TypeUserTypeUnknown = "userTypeUnknown" + TypeBotCommand = "botCommand" + TypeBotCommands = "botCommands" + TypeBotMenuButton = "botMenuButton" + TypeChatLocation = "chatLocation" + TypeAnimatedChatPhoto = "animatedChatPhoto" + TypeChatPhoto = "chatPhoto" + TypeChatPhotos = "chatPhotos" + TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" + TypeInputChatPhotoStatic = "inputChatPhotoStatic" + TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" + TypeChatPermissions = "chatPermissions" + TypeChatAdministratorRights = "chatAdministratorRights" + TypePremiumPaymentOption = "premiumPaymentOption" + TypeEmojiStatus = "emojiStatus" + TypeEmojiStatuses = "emojiStatuses" + TypeUsernames = "usernames" + TypeUser = "user" + TypeBotInfo = "botInfo" + TypeUserFullInfo = "userFullInfo" + TypeUsers = "users" + TypeChatAdministrator = "chatAdministrator" + TypeChatAdministrators = "chatAdministrators" + TypeChatMemberStatusCreator = "chatMemberStatusCreator" + TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" + TypeChatMemberStatusMember = "chatMemberStatusMember" + TypeChatMemberStatusRestricted = "chatMemberStatusRestricted" + TypeChatMemberStatusLeft = "chatMemberStatusLeft" + TypeChatMemberStatusBanned = "chatMemberStatusBanned" + TypeChatMember = "chatMember" + TypeChatMembers = "chatMembers" + TypeChatMembersFilterContacts = "chatMembersFilterContacts" + TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators" + TypeChatMembersFilterMembers = "chatMembersFilterMembers" + TypeChatMembersFilterMention = "chatMembersFilterMention" + TypeChatMembersFilterRestricted = "chatMembersFilterRestricted" + TypeChatMembersFilterBanned = "chatMembersFilterBanned" + TypeChatMembersFilterBots = "chatMembersFilterBots" + TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent" + TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts" + TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators" + TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch" + TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted" + TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" + TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" + TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" + TypeChatInviteLink = "chatInviteLink" + TypeChatInviteLinks = "chatInviteLinks" + TypeChatInviteLinkCount = "chatInviteLinkCount" + TypeChatInviteLinkCounts = "chatInviteLinkCounts" + TypeChatInviteLinkMember = "chatInviteLinkMember" + TypeChatInviteLinkMembers = "chatInviteLinkMembers" + TypeChatInviteLinkInfo = "chatInviteLinkInfo" + TypeChatJoinRequest = "chatJoinRequest" + TypeChatJoinRequests = "chatJoinRequests" + TypeChatJoinRequestsInfo = "chatJoinRequestsInfo" + TypeBasicGroup = "basicGroup" + TypeBasicGroupFullInfo = "basicGroupFullInfo" + TypeSupergroup = "supergroup" + TypeSupergroupFullInfo = "supergroupFullInfo" + TypeSecretChatStatePending = "secretChatStatePending" + TypeSecretChatStateReady = "secretChatStateReady" + TypeSecretChatStateClosed = "secretChatStateClosed" + TypeSecretChat = "secretChat" + TypeMessageSenderUser = "messageSenderUser" + TypeMessageSenderChat = "messageSenderChat" + TypeMessageSenders = "messageSenders" + TypeChatMessageSender = "chatMessageSender" + TypeChatMessageSenders = "chatMessageSenders" + TypeMessageForwardOriginUser = "messageForwardOriginUser" + TypeMessageForwardOriginChat = "messageForwardOriginChat" + TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" + TypeMessageForwardOriginChannel = "messageForwardOriginChannel" + TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" + TypeReactionTypeEmoji = "reactionTypeEmoji" + TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji" + TypeMessageForwardInfo = "messageForwardInfo" + TypeMessageReplyInfo = "messageReplyInfo" + TypeMessageReaction = "messageReaction" + TypeMessageInteractionInfo = "messageInteractionInfo" + TypeUnreadReaction = "unreadReaction" + TypeMessageSendingStatePending = "messageSendingStatePending" + TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeMessage = "message" + TypeMessages = "messages" + TypeFoundMessages = "foundMessages" + TypeFoundChatMessages = "foundChatMessages" + TypeMessagePosition = "messagePosition" + TypeMessagePositions = "messagePositions" + TypeMessageCalendarDay = "messageCalendarDay" + TypeMessageCalendar = "messageCalendar" + TypeSponsoredMessage = "sponsoredMessage" + TypeSponsoredMessages = "sponsoredMessages" + TypeFileDownload = "fileDownload" + TypeDownloadedFileCounts = "downloadedFileCounts" + TypeFoundFileDownloads = "foundFileDownloads" + TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" + TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" + TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" + TypeChatNotificationSettings = "chatNotificationSettings" + TypeScopeNotificationSettings = "scopeNotificationSettings" + TypeDraftMessage = "draftMessage" + TypeChatTypePrivate = "chatTypePrivate" + TypeChatTypeBasicGroup = "chatTypeBasicGroup" + TypeChatTypeSupergroup = "chatTypeSupergroup" + TypeChatTypeSecret = "chatTypeSecret" + TypeChatFilter = "chatFilter" + TypeChatFilterInfo = "chatFilterInfo" + TypeRecommendedChatFilter = "recommendedChatFilter" + TypeRecommendedChatFilters = "recommendedChatFilters" + TypeChatListMain = "chatListMain" + TypeChatListArchive = "chatListArchive" + TypeChatListFilter = "chatListFilter" + TypeChatLists = "chatLists" + TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" + TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" + TypeChatPosition = "chatPosition" + TypeChatAvailableReactionsAll = "chatAvailableReactionsAll" + TypeChatAvailableReactionsSome = "chatAvailableReactionsSome" + TypeVideoChat = "videoChat" + TypeChat = "chat" + TypeChats = "chats" + TypeChatNearby = "chatNearby" + TypeChatsNearby = "chatsNearby" + TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" + TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" + TypeChatActionBarReportSpam = "chatActionBarReportSpam" + TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" + TypeChatActionBarInviteMembers = "chatActionBarInviteMembers" + TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" + TypeChatActionBarAddContact = "chatActionBarAddContact" + TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" + TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" + TypeKeyboardButtonTypeText = "keyboardButtonTypeText" + TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" + TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" + TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" + TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" + TypeKeyboardButton = "keyboardButton" + TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" + TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" + TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" + TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" + TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" + TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" + TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" + TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" + TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" + TypeInlineKeyboardButton = "inlineKeyboardButton" + TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" + TypeReplyMarkupForceReply = "replyMarkupForceReply" + TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard" + TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" + TypeLoginUrlInfoOpen = "loginUrlInfoOpen" + TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" + TypeWebAppInfo = "webAppInfo" + TypeMessageThreadInfo = "messageThreadInfo" + TypeForumTopicIcon = "forumTopicIcon" + TypeForumTopicInfo = "forumTopicInfo" + TypeForumTopic = "forumTopic" + TypeForumTopics = "forumTopics" + TypeRichTextPlain = "richTextPlain" + TypeRichTextBold = "richTextBold" + TypeRichTextItalic = "richTextItalic" + TypeRichTextUnderline = "richTextUnderline" + TypeRichTextStrikethrough = "richTextStrikethrough" + TypeRichTextFixed = "richTextFixed" + TypeRichTextUrl = "richTextUrl" + TypeRichTextEmailAddress = "richTextEmailAddress" + TypeRichTextSubscript = "richTextSubscript" + TypeRichTextSuperscript = "richTextSuperscript" + TypeRichTextMarked = "richTextMarked" + TypeRichTextPhoneNumber = "richTextPhoneNumber" + TypeRichTextIcon = "richTextIcon" + TypeRichTextReference = "richTextReference" + TypeRichTextAnchor = "richTextAnchor" + TypeRichTextAnchorLink = "richTextAnchorLink" + TypeRichTexts = "richTexts" + TypePageBlockCaption = "pageBlockCaption" + TypePageBlockListItem = "pageBlockListItem" + TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft" + TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter" + TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight" + TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop" + TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle" + TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom" + TypePageBlockTableCell = "pageBlockTableCell" + TypePageBlockRelatedArticle = "pageBlockRelatedArticle" + TypePageBlockTitle = "pageBlockTitle" + TypePageBlockSubtitle = "pageBlockSubtitle" + TypePageBlockAuthorDate = "pageBlockAuthorDate" + TypePageBlockHeader = "pageBlockHeader" + TypePageBlockSubheader = "pageBlockSubheader" + TypePageBlockKicker = "pageBlockKicker" + TypePageBlockParagraph = "pageBlockParagraph" + TypePageBlockPreformatted = "pageBlockPreformatted" + TypePageBlockFooter = "pageBlockFooter" + TypePageBlockDivider = "pageBlockDivider" + TypePageBlockAnchor = "pageBlockAnchor" + TypePageBlockList = "pageBlockList" + TypePageBlockBlockQuote = "pageBlockBlockQuote" + TypePageBlockPullQuote = "pageBlockPullQuote" + TypePageBlockAnimation = "pageBlockAnimation" + TypePageBlockAudio = "pageBlockAudio" + TypePageBlockPhoto = "pageBlockPhoto" + TypePageBlockVideo = "pageBlockVideo" + TypePageBlockVoiceNote = "pageBlockVoiceNote" + TypePageBlockCover = "pageBlockCover" + TypePageBlockEmbedded = "pageBlockEmbedded" + TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost" + TypePageBlockCollage = "pageBlockCollage" + TypePageBlockSlideshow = "pageBlockSlideshow" + TypePageBlockChatLink = "pageBlockChatLink" + TypePageBlockTable = "pageBlockTable" + TypePageBlockDetails = "pageBlockDetails" + TypePageBlockRelatedArticles = "pageBlockRelatedArticles" + TypePageBlockMap = "pageBlockMap" + TypeWebPageInstantView = "webPageInstantView" + TypeWebPage = "webPage" + TypeCountryInfo = "countryInfo" + TypeCountries = "countries" + TypePhoneNumberInfo = "phoneNumberInfo" + TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" + TypeBankCardInfo = "bankCardInfo" + TypeAddress = "address" + TypeThemeParameters = "themeParameters" + TypeLabeledPricePart = "labeledPricePart" + TypeInvoice = "invoice" + TypeOrderInfo = "orderInfo" + TypeShippingOption = "shippingOption" + TypeSavedCredentials = "savedCredentials" + TypeInputCredentialsSaved = "inputCredentialsSaved" + TypeInputCredentialsNew = "inputCredentialsNew" + TypeInputCredentialsApplePay = "inputCredentialsApplePay" + TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" + TypePaymentProviderSmartGlocal = "paymentProviderSmartGlocal" + TypePaymentProviderStripe = "paymentProviderStripe" + TypePaymentProviderOther = "paymentProviderOther" + TypePaymentOption = "paymentOption" + TypePaymentForm = "paymentForm" + TypeValidatedOrderInfo = "validatedOrderInfo" + TypePaymentResult = "paymentResult" + TypePaymentReceipt = "paymentReceipt" + TypeInputInvoiceMessage = "inputInvoiceMessage" + TypeInputInvoiceName = "inputInvoiceName" + TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview" + TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto" + TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo" + TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported" + TypeDatedFile = "datedFile" + TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails" + TypePassportElementTypePassport = "passportElementTypePassport" + TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense" + TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard" + TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport" + TypePassportElementTypeAddress = "passportElementTypeAddress" + TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill" + TypePassportElementTypeBankStatement = "passportElementTypeBankStatement" + TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement" + TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration" + TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration" + TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber" + TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress" + TypeDate = "date" + TypePersonalDetails = "personalDetails" + TypeIdentityDocument = "identityDocument" + TypeInputIdentityDocument = "inputIdentityDocument" + TypePersonalDocument = "personalDocument" + TypeInputPersonalDocument = "inputPersonalDocument" + TypePassportElementPersonalDetails = "passportElementPersonalDetails" + TypePassportElementPassport = "passportElementPassport" + TypePassportElementDriverLicense = "passportElementDriverLicense" + TypePassportElementIdentityCard = "passportElementIdentityCard" + TypePassportElementInternalPassport = "passportElementInternalPassport" + TypePassportElementAddress = "passportElementAddress" + TypePassportElementUtilityBill = "passportElementUtilityBill" + TypePassportElementBankStatement = "passportElementBankStatement" + TypePassportElementRentalAgreement = "passportElementRentalAgreement" + TypePassportElementPassportRegistration = "passportElementPassportRegistration" + TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration" + TypePassportElementPhoneNumber = "passportElementPhoneNumber" + TypePassportElementEmailAddress = "passportElementEmailAddress" + TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails" + TypeInputPassportElementPassport = "inputPassportElementPassport" + TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense" + TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard" + TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport" + TypeInputPassportElementAddress = "inputPassportElementAddress" + TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill" + TypeInputPassportElementBankStatement = "inputPassportElementBankStatement" + TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement" + TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration" + TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration" + TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber" + TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress" + TypePassportElements = "passportElements" + TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified" + TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField" + TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide" + TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide" + TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie" + TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile" + TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles" + TypePassportElementErrorSourceFile = "passportElementErrorSourceFile" + TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles" + TypePassportElementError = "passportElementError" + TypePassportSuitableElement = "passportSuitableElement" + TypePassportRequiredElement = "passportRequiredElement" + TypePassportAuthorizationForm = "passportAuthorizationForm" + TypePassportElementsWithErrors = "passportElementsWithErrors" + TypeEncryptedCredentials = "encryptedCredentials" + TypeEncryptedPassportElement = "encryptedPassportElement" + TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified" + TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField" + TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide" + TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide" + TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie" + TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile" + TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles" + TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile" + TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles" + TypeInputPassportElementError = "inputPassportElementError" + TypeMessageText = "messageText" + TypeMessageAnimation = "messageAnimation" + TypeMessageAudio = "messageAudio" + TypeMessageDocument = "messageDocument" + TypeMessagePhoto = "messagePhoto" + TypeMessageExpiredPhoto = "messageExpiredPhoto" + TypeMessageSticker = "messageSticker" + TypeMessageVideo = "messageVideo" + TypeMessageExpiredVideo = "messageExpiredVideo" + TypeMessageVideoNote = "messageVideoNote" + TypeMessageVoiceNote = "messageVoiceNote" + TypeMessageLocation = "messageLocation" + TypeMessageVenue = "messageVenue" + TypeMessageContact = "messageContact" + TypeMessageAnimatedEmoji = "messageAnimatedEmoji" + TypeMessageDice = "messageDice" + TypeMessageGame = "messageGame" + TypeMessagePoll = "messagePoll" + TypeMessageInvoice = "messageInvoice" + TypeMessageCall = "messageCall" + TypeMessageVideoChatScheduled = "messageVideoChatScheduled" + TypeMessageVideoChatStarted = "messageVideoChatStarted" + TypeMessageVideoChatEnded = "messageVideoChatEnded" + TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" + TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" + TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" + TypeMessageChatChangeTitle = "messageChatChangeTitle" + TypeMessageChatChangePhoto = "messageChatChangePhoto" + TypeMessageChatDeletePhoto = "messageChatDeletePhoto" + TypeMessageChatAddMembers = "messageChatAddMembers" + TypeMessageChatJoinByLink = "messageChatJoinByLink" + TypeMessageChatJoinByRequest = "messageChatJoinByRequest" + TypeMessageChatDeleteMember = "messageChatDeleteMember" + TypeMessageChatUpgradeTo = "messageChatUpgradeTo" + TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" + TypeMessagePinMessage = "messagePinMessage" + TypeMessageScreenshotTaken = "messageScreenshotTaken" + TypeMessageChatSetTheme = "messageChatSetTheme" + TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime" + TypeMessageForumTopicCreated = "messageForumTopicCreated" + TypeMessageForumTopicEdited = "messageForumTopicEdited" + TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" + TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" + TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" + TypeMessageCustomServiceAction = "messageCustomServiceAction" + TypeMessageGameScore = "messageGameScore" + TypeMessagePaymentSuccessful = "messagePaymentSuccessful" + TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" + TypeMessageGiftedPremium = "messageGiftedPremium" + TypeMessageContactRegistered = "messageContactRegistered" + TypeMessageWebsiteConnected = "messageWebsiteConnected" + TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" + TypeMessageWebAppDataSent = "messageWebAppDataSent" + TypeMessageWebAppDataReceived = "messageWebAppDataReceived" + TypeMessagePassportDataSent = "messagePassportDataSent" + TypeMessagePassportDataReceived = "messagePassportDataReceived" + TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" + TypeMessageUnsupported = "messageUnsupported" + TypeTextEntityTypeMention = "textEntityTypeMention" + TypeTextEntityTypeHashtag = "textEntityTypeHashtag" + TypeTextEntityTypeCashtag = "textEntityTypeCashtag" + TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand" + TypeTextEntityTypeUrl = "textEntityTypeUrl" + TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" + TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" + TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" + TypeTextEntityTypeBold = "textEntityTypeBold" + TypeTextEntityTypeItalic = "textEntityTypeItalic" + TypeTextEntityTypeUnderline = "textEntityTypeUnderline" + TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" + TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler" + TypeTextEntityTypeCode = "textEntityTypeCode" + TypeTextEntityTypePre = "textEntityTypePre" + TypeTextEntityTypePreCode = "textEntityTypePreCode" + TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" + TypeTextEntityTypeMentionName = "textEntityTypeMentionName" + TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" + TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" + TypeInputThumbnail = "inputThumbnail" + TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" + TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" + TypeMessageSendOptions = "messageSendOptions" + TypeMessageCopyOptions = "messageCopyOptions" + TypeInputMessageText = "inputMessageText" + TypeInputMessageAnimation = "inputMessageAnimation" + TypeInputMessageAudio = "inputMessageAudio" + TypeInputMessageDocument = "inputMessageDocument" + TypeInputMessagePhoto = "inputMessagePhoto" + TypeInputMessageSticker = "inputMessageSticker" + TypeInputMessageVideo = "inputMessageVideo" + TypeInputMessageVideoNote = "inputMessageVideoNote" + TypeInputMessageVoiceNote = "inputMessageVoiceNote" + TypeInputMessageLocation = "inputMessageLocation" + TypeInputMessageVenue = "inputMessageVenue" + TypeInputMessageContact = "inputMessageContact" + TypeInputMessageDice = "inputMessageDice" + TypeInputMessageGame = "inputMessageGame" + TypeInputMessageInvoice = "inputMessageInvoice" + TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageForwarded = "inputMessageForwarded" + TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" + TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" + TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" + TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument" + TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto" + TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo" + TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote" + TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" + TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" + TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" + TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" + TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" + TypeSearchMessagesFilterMention = "searchMessagesFilterMention" + TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" + TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction" + TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" + TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" + TypeChatActionTyping = "chatActionTyping" + TypeChatActionRecordingVideo = "chatActionRecordingVideo" + TypeChatActionUploadingVideo = "chatActionUploadingVideo" + TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote" + TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote" + TypeChatActionUploadingPhoto = "chatActionUploadingPhoto" + TypeChatActionUploadingDocument = "chatActionUploadingDocument" + TypeChatActionChoosingSticker = "chatActionChoosingSticker" + TypeChatActionChoosingLocation = "chatActionChoosingLocation" + TypeChatActionChoosingContact = "chatActionChoosingContact" + TypeChatActionStartPlayingGame = "chatActionStartPlayingGame" + TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote" + TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote" + TypeChatActionWatchingAnimations = "chatActionWatchingAnimations" + TypeChatActionCancel = "chatActionCancel" + TypeUserStatusEmpty = "userStatusEmpty" + TypeUserStatusOnline = "userStatusOnline" + TypeUserStatusOffline = "userStatusOffline" + TypeUserStatusRecently = "userStatusRecently" + TypeUserStatusLastWeek = "userStatusLastWeek" + TypeUserStatusLastMonth = "userStatusLastMonth" + TypeStickers = "stickers" + TypeEmojis = "emojis" + TypeStickerSet = "stickerSet" + TypeStickerSetInfo = "stickerSetInfo" + TypeStickerSets = "stickerSets" + TypeTrendingStickerSets = "trendingStickerSets" + TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty" + TypeCallDiscardReasonMissed = "callDiscardReasonMissed" + TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" + TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" + TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" + TypeCallProtocol = "callProtocol" + TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" + TypeCallServerTypeWebrtc = "callServerTypeWebrtc" + TypeCallServer = "callServer" + TypeCallId = "callId" + TypeGroupCallId = "groupCallId" + TypeCallStatePending = "callStatePending" + TypeCallStateExchangingKeys = "callStateExchangingKeys" + TypeCallStateReady = "callStateReady" + TypeCallStateHangingUp = "callStateHangingUp" + TypeCallStateDiscarded = "callStateDiscarded" + TypeCallStateError = "callStateError" + TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" + TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" + TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" + TypeRtmpUrl = "rtmpUrl" + TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" + TypeGroupCall = "groupCall" + TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" + TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" + TypeGroupCallParticipant = "groupCallParticipant" + TypeCallProblemEcho = "callProblemEcho" + TypeCallProblemNoise = "callProblemNoise" + TypeCallProblemInterruptions = "callProblemInterruptions" + TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech" + TypeCallProblemSilentLocal = "callProblemSilentLocal" + TypeCallProblemSilentRemote = "callProblemSilentRemote" + TypeCallProblemDropped = "callProblemDropped" + TypeCallProblemDistortedVideo = "callProblemDistortedVideo" + TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" + TypeCall = "call" + TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" + TypeAddedReaction = "addedReaction" + TypeAddedReactions = "addedReactions" + TypeAvailableReaction = "availableReaction" + TypeAvailableReactions = "availableReactions" + TypeEmojiReaction = "emojiReaction" + TypeAnimations = "animations" + TypeDiceStickersRegular = "diceStickersRegular" + TypeDiceStickersSlotMachine = "diceStickersSlotMachine" + TypeImportedContacts = "importedContacts" + TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" + TypeSpeechRecognitionResultText = "speechRecognitionResultText" + TypeSpeechRecognitionResultError = "speechRecognitionResultError" + TypeAttachmentMenuBotColor = "attachmentMenuBotColor" + TypeAttachmentMenuBot = "attachmentMenuBot" + TypeSentWebAppMessage = "sentWebAppMessage" + TypeHttpUrl = "httpUrl" + TypeUserLink = "userLink" + TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" + TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" + TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio" + TypeInputInlineQueryResultContact = "inputInlineQueryResultContact" + TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument" + TypeInputInlineQueryResultGame = "inputInlineQueryResultGame" + TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation" + TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto" + TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker" + TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue" + TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo" + TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote" + TypeInlineQueryResultArticle = "inlineQueryResultArticle" + TypeInlineQueryResultContact = "inlineQueryResultContact" + TypeInlineQueryResultLocation = "inlineQueryResultLocation" + TypeInlineQueryResultVenue = "inlineQueryResultVenue" + TypeInlineQueryResultGame = "inlineQueryResultGame" + TypeInlineQueryResultAnimation = "inlineQueryResultAnimation" + TypeInlineQueryResultAudio = "inlineQueryResultAudio" + TypeInlineQueryResultDocument = "inlineQueryResultDocument" + TypeInlineQueryResultPhoto = "inlineQueryResultPhoto" + TypeInlineQueryResultSticker = "inlineQueryResultSticker" + TypeInlineQueryResultVideo = "inlineQueryResultVideo" + TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote" + TypeInlineQueryResults = "inlineQueryResults" + TypeCallbackQueryPayloadData = "callbackQueryPayloadData" + TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" + TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" + TypeCallbackQueryAnswer = "callbackQueryAnswer" + TypeCustomRequestResult = "customRequestResult" + TypeGameHighScore = "gameHighScore" + TypeGameHighScores = "gameHighScores" + TypeChatEventMessageEdited = "chatEventMessageEdited" + TypeChatEventMessageDeleted = "chatEventMessageDeleted" + TypeChatEventMessagePinned = "chatEventMessagePinned" + TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" + TypeChatEventPollStopped = "chatEventPollStopped" + TypeChatEventMemberJoined = "chatEventMemberJoined" + TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" + TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" + TypeChatEventMemberInvited = "chatEventMemberInvited" + TypeChatEventMemberLeft = "chatEventMemberLeft" + TypeChatEventMemberPromoted = "chatEventMemberPromoted" + TypeChatEventMemberRestricted = "chatEventMemberRestricted" + TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged" + TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" + TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" + TypeChatEventLocationChanged = "chatEventLocationChanged" + TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged" + TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventPhotoChanged = "chatEventPhotoChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventTitleChanged = "chatEventTitleChanged" + TypeChatEventUsernameChanged = "chatEventUsernameChanged" + TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventInvitesToggled = "chatEventInvitesToggled" + TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled" + TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" + TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" + TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" + TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" + TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" + TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" + TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" + TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" + TypeChatEventIsForumToggled = "chatEventIsForumToggled" + TypeChatEventForumTopicCreated = "chatEventForumTopicCreated" + TypeChatEventForumTopicEdited = "chatEventForumTopicEdited" + TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed" + TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden" + TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted" + TypeChatEventForumTopicPinned = "chatEventForumTopicPinned" + TypeChatEvent = "chatEvent" + TypeChatEvents = "chatEvents" + TypeChatEventLogFilters = "chatEventLogFilters" + TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" + TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" + TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" + TypeLanguagePackString = "languagePackString" + TypeLanguagePackStrings = "languagePackStrings" + TypeLanguagePackInfo = "languagePackInfo" + TypeLocalizationTargetInfo = "localizationTargetInfo" + TypePremiumLimitTypeSupergroupCount = "premiumLimitTypeSupergroupCount" + TypePremiumLimitTypePinnedChatCount = "premiumLimitTypePinnedChatCount" + TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount" + TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount" + TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount" + TypePremiumLimitTypeChatFilterCount = "premiumLimitTypeChatFilterCount" + TypePremiumLimitTypeChatFilterChosenChatCount = "premiumLimitTypeChatFilterChosenChatCount" + TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" + TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" + TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" + TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" + TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" + TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" + TypePremiumFeatureVoiceRecognition = "premiumFeatureVoiceRecognition" + TypePremiumFeatureDisabledAds = "premiumFeatureDisabledAds" + TypePremiumFeatureUniqueReactions = "premiumFeatureUniqueReactions" + TypePremiumFeatureUniqueStickers = "premiumFeatureUniqueStickers" + TypePremiumFeatureCustomEmoji = "premiumFeatureCustomEmoji" + TypePremiumFeatureAdvancedChatManagement = "premiumFeatureAdvancedChatManagement" + TypePremiumFeatureProfileBadge = "premiumFeatureProfileBadge" + TypePremiumFeatureEmojiStatus = "premiumFeatureEmojiStatus" + TypePremiumFeatureAnimatedProfilePhoto = "premiumFeatureAnimatedProfilePhoto" + TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon" + TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" + TypePremiumLimit = "premiumLimit" + TypePremiumFeatures = "premiumFeatures" + TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" + TypePremiumSourceFeature = "premiumSourceFeature" + TypePremiumSourceLink = "premiumSourceLink" + TypePremiumSourceSettings = "premiumSourceSettings" + TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" + TypePremiumState = "premiumState" + TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" + TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" + TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" + TypeDeviceTokenApplePush = "deviceTokenApplePush" + TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" + TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush" + TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush" + TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP" + TypeDeviceTokenWebPush = "deviceTokenWebPush" + TypeDeviceTokenSimplePush = "deviceTokenSimplePush" + TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush" + TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" + TypeDeviceTokenTizenPush = "deviceTokenTizenPush" + TypePushReceiverId = "pushReceiverId" + TypeBackgroundFillSolid = "backgroundFillSolid" + TypeBackgroundFillGradient = "backgroundFillGradient" + TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" + TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" + TypeBackgroundTypePattern = "backgroundTypePattern" + TypeBackgroundTypeFill = "backgroundTypeFill" + TypeBackground = "background" + TypeBackgrounds = "backgrounds" + TypeInputBackgroundLocal = "inputBackgroundLocal" + TypeInputBackgroundRemote = "inputBackgroundRemote" + TypeThemeSettings = "themeSettings" + TypeChatTheme = "chatTheme" + TypeHashtags = "hashtags" + TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" + TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" + TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" + TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" + TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" + TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" + TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" + TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable" + TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany" + TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable" + TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk" + TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid" + TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied" + TypeResetPasswordResultOk = "resetPasswordResultOk" + TypeResetPasswordResultPending = "resetPasswordResultPending" + TypeResetPasswordResultDeclined = "resetPasswordResultDeclined" + TypeMessageFileTypePrivate = "messageFileTypePrivate" + TypeMessageFileTypeGroup = "messageFileTypeGroup" + TypeMessageFileTypeUnknown = "messageFileTypeUnknown" + TypePushMessageContentHidden = "pushMessageContentHidden" + TypePushMessageContentAnimation = "pushMessageContentAnimation" + TypePushMessageContentAudio = "pushMessageContentAudio" + TypePushMessageContentContact = "pushMessageContentContact" + TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered" + TypePushMessageContentDocument = "pushMessageContentDocument" + TypePushMessageContentGame = "pushMessageContentGame" + TypePushMessageContentGameScore = "pushMessageContentGameScore" + TypePushMessageContentInvoice = "pushMessageContentInvoice" + TypePushMessageContentLocation = "pushMessageContentLocation" + TypePushMessageContentPhoto = "pushMessageContentPhoto" + TypePushMessageContentPoll = "pushMessageContentPoll" + TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" + TypePushMessageContentSticker = "pushMessageContentSticker" + TypePushMessageContentText = "pushMessageContentText" + TypePushMessageContentVideo = "pushMessageContentVideo" + TypePushMessageContentVideoNote = "pushMessageContentVideoNote" + TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" + TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate" + TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" + TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" + TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" + TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" + TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" + TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" + TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" + TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" + TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" + TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" + TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" + TypeNotificationTypeNewMessage = "notificationTypeNewMessage" + TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" + TypeNotificationTypeNewCall = "notificationTypeNewCall" + TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" + TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" + TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" + TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" + TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" + TypeNotificationSound = "notificationSound" + TypeNotificationSounds = "notificationSounds" + TypeNotification = "notification" + TypeNotificationGroup = "notificationGroup" + TypeOptionValueBoolean = "optionValueBoolean" + TypeOptionValueEmpty = "optionValueEmpty" + TypeOptionValueInteger = "optionValueInteger" + TypeOptionValueString = "optionValueString" + TypeJsonObjectMember = "jsonObjectMember" + TypeJsonValueNull = "jsonValueNull" + TypeJsonValueBoolean = "jsonValueBoolean" + TypeJsonValueNumber = "jsonValueNumber" + TypeJsonValueString = "jsonValueString" + TypeJsonValueArray = "jsonValueArray" + TypeJsonValueObject = "jsonValueObject" + TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" + TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" + TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" + TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" + TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" + TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts" + TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers" + TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers" + TypeUserPrivacySettingRules = "userPrivacySettingRules" + TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus" + TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" + TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" + TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" + TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" + TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" + TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" + TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" + TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages" + 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" + TypeSession = "session" + TypeSessions = "sessions" + TypeConnectedWebsite = "connectedWebsite" + TypeConnectedWebsites = "connectedWebsites" + TypeChatReportReasonSpam = "chatReportReasonSpam" + TypeChatReportReasonViolence = "chatReportReasonViolence" + TypeChatReportReasonPornography = "chatReportReasonPornography" + TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" + TypeChatReportReasonCopyright = "chatReportReasonCopyright" + TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" + TypeChatReportReasonFake = "chatReportReasonFake" + TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs" + TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails" + TypeChatReportReasonCustom = "chatReportReasonCustom" + TypeTargetChatCurrent = "targetChatCurrent" + TypeTargetChatChosen = "targetChatChosen" + TypeTargetChatInternalLink = "targetChatInternalLink" + TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" + TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" + TypeInternalLinkTypeBackground = "internalLinkTypeBackground" + TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" + TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" + TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" + TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" + TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" + TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" + TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" + TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" + TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" + TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeMessage = "internalLinkTypeMessage" + TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" + TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" + TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" + TypeInternalLinkTypeProxy = "internalLinkTypeProxy" + TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" + TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" + TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" + TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" + TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" + TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" + TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" + TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" + TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" + TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" + TypeMessageLink = "messageLink" + TypeMessageLinkInfo = "messageLinkInfo" + TypeFilePart = "filePart" + TypeFileTypeNone = "fileTypeNone" + TypeFileTypeAnimation = "fileTypeAnimation" + TypeFileTypeAudio = "fileTypeAudio" + TypeFileTypeDocument = "fileTypeDocument" + TypeFileTypeNotificationSound = "fileTypeNotificationSound" + TypeFileTypePhoto = "fileTypePhoto" + TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" + TypeFileTypeSecret = "fileTypeSecret" + TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" + TypeFileTypeSecure = "fileTypeSecure" + TypeFileTypeSticker = "fileTypeSticker" + TypeFileTypeThumbnail = "fileTypeThumbnail" + TypeFileTypeUnknown = "fileTypeUnknown" + TypeFileTypeVideo = "fileTypeVideo" + TypeFileTypeVideoNote = "fileTypeVideoNote" + TypeFileTypeVoiceNote = "fileTypeVoiceNote" + TypeFileTypeWallpaper = "fileTypeWallpaper" + TypeStorageStatisticsByFileType = "storageStatisticsByFileType" + TypeStorageStatisticsByChat = "storageStatisticsByChat" + TypeStorageStatistics = "storageStatistics" + TypeStorageStatisticsFast = "storageStatisticsFast" + TypeDatabaseStatistics = "databaseStatistics" + TypeNetworkTypeNone = "networkTypeNone" + TypeNetworkTypeMobile = "networkTypeMobile" + TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming" + TypeNetworkTypeWiFi = "networkTypeWiFi" + TypeNetworkTypeOther = "networkTypeOther" + TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile" + TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall" + TypeNetworkStatistics = "networkStatistics" + TypeAutoDownloadSettings = "autoDownloadSettings" + TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets" + TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" + TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" + TypeConnectionStateConnecting = "connectionStateConnecting" + TypeConnectionStateUpdating = "connectionStateUpdating" + TypeConnectionStateReady = "connectionStateReady" + TypeTopChatCategoryUsers = "topChatCategoryUsers" + TypeTopChatCategoryBots = "topChatCategoryBots" + TypeTopChatCategoryGroups = "topChatCategoryGroups" + TypeTopChatCategoryChannels = "topChatCategoryChannels" + TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" + TypeTopChatCategoryCalls = "topChatCategoryCalls" + TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" + TypeTMeUrlTypeUser = "tMeUrlTypeUser" + TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" + TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" + TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" + TypeTMeUrl = "tMeUrl" + TypeTMeUrls = "tMeUrls" + TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" + TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" + TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" + TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" + TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" + TypeSuggestedActionSetPassword = "suggestedActionSetPassword" + TypeCount = "count" + TypeText = "text" + TypeSeconds = "seconds" + TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize" + TypeDeepLinkInfo = "deepLinkInfo" + TypeTextParseModeMarkdown = "textParseModeMarkdown" + TypeTextParseModeHTML = "textParseModeHTML" + TypeProxyTypeSocks5 = "proxyTypeSocks5" + TypeProxyTypeHttp = "proxyTypeHttp" + TypeProxyTypeMtproto = "proxyTypeMtproto" + TypeProxy = "proxy" + TypeProxies = "proxies" + TypeInputSticker = "inputSticker" + TypeDateRange = "dateRange" + TypeStatisticalValue = "statisticalValue" + TypeStatisticalGraphData = "statisticalGraphData" + TypeStatisticalGraphAsync = "statisticalGraphAsync" + TypeStatisticalGraphError = "statisticalGraphError" + TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo" + TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" + TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" + TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" + TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" + TypeChatStatisticsChannel = "chatStatisticsChannel" + TypeMessageStatistics = "messageStatistics" + TypePoint = "point" + TypeVectorPathCommandLine = "vectorPathCommandLine" + TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" + TypeBotCommandScopeDefault = "botCommandScopeDefault" + TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats" + TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats" + TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators" + TypeBotCommandScopeChat = "botCommandScopeChat" + TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" + TypeBotCommandScopeChatMember = "botCommandScopeChatMember" + TypeUpdateAuthorizationState = "updateAuthorizationState" + TypeUpdateNewMessage = "updateNewMessage" + TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" + TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded" + TypeUpdateMessageSendFailed = "updateMessageSendFailed" + TypeUpdateMessageContent = "updateMessageContent" + TypeUpdateMessageEdited = "updateMessageEdited" + TypeUpdateMessageIsPinned = "updateMessageIsPinned" + TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" + TypeUpdateMessageContentOpened = "updateMessageContentOpened" + TypeUpdateMessageMentionRead = "updateMessageMentionRead" + TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions" + TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" + TypeUpdateNewChat = "updateNewChat" + TypeUpdateChatTitle = "updateChatTitle" + TypeUpdateChatPhoto = "updateChatPhoto" + TypeUpdateChatPermissions = "updateChatPermissions" + TypeUpdateChatLastMessage = "updateChatLastMessage" + TypeUpdateChatPosition = "updateChatPosition" + TypeUpdateChatReadInbox = "updateChatReadInbox" + TypeUpdateChatReadOutbox = "updateChatReadOutbox" + TypeUpdateChatActionBar = "updateChatActionBar" + TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" + TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatMessageSender = "updateChatMessageSender" + TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime" + TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" + TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" + TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" + TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" + TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" + TypeUpdateChatVideoChat = "updateChatVideoChat" + TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" + TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatIsBlocked = "updateChatIsBlocked" + TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" + TypeUpdateChatFilters = "updateChatFilters" + TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" + TypeUpdateForumTopicInfo = "updateForumTopicInfo" + TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" + TypeUpdateNotification = "updateNotification" + TypeUpdateNotificationGroup = "updateNotificationGroup" + TypeUpdateActiveNotifications = "updateActiveNotifications" + TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" + TypeUpdateDeleteMessages = "updateDeleteMessages" + TypeUpdateChatAction = "updateChatAction" + TypeUpdateUserStatus = "updateUserStatus" + TypeUpdateUser = "updateUser" + TypeUpdateBasicGroup = "updateBasicGroup" + TypeUpdateSupergroup = "updateSupergroup" + TypeUpdateSecretChat = "updateSecretChat" + TypeUpdateUserFullInfo = "updateUserFullInfo" + TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo" + TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo" + TypeUpdateServiceNotification = "updateServiceNotification" + TypeUpdateFile = "updateFile" + TypeUpdateFileGenerationStart = "updateFileGenerationStart" + TypeUpdateFileGenerationStop = "updateFileGenerationStop" + TypeUpdateFileDownloads = "updateFileDownloads" + TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads" + TypeUpdateFileDownload = "updateFileDownload" + TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads" + TypeUpdateCall = "updateCall" + TypeUpdateGroupCall = "updateGroupCall" + TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" + TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" + TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" + TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" + TypeUpdateUnreadChatCount = "updateUnreadChatCount" + TypeUpdateOption = "updateOption" + TypeUpdateStickerSet = "updateStickerSet" + TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" + TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" + TypeUpdateRecentStickers = "updateRecentStickers" + TypeUpdateFavoriteStickers = "updateFavoriteStickers" + TypeUpdateSavedAnimations = "updateSavedAnimations" + TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" + TypeUpdateSelectedBackground = "updateSelectedBackground" + TypeUpdateChatThemes = "updateChatThemes" + TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" + TypeUpdateConnectionState = "updateConnectionState" + TypeUpdateTermsOfService = "updateTermsOfService" + TypeUpdateUsersNearby = "updateUsersNearby" + TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" + TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" + TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" + TypeUpdateDefaultReactionType = "updateDefaultReactionType" + TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" + TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" + TypeUpdateSuggestedActions = "updateSuggestedActions" + TypeUpdateNewInlineQuery = "updateNewInlineQuery" + TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" + TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" + TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" + TypeUpdateNewShippingQuery = "updateNewShippingQuery" + TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" + TypeUpdateNewCustomEvent = "updateNewCustomEvent" + TypeUpdateNewCustomQuery = "updateNewCustomQuery" + TypeUpdatePoll = "updatePoll" + TypeUpdatePollAnswer = "updatePollAnswer" + TypeUpdateChatMember = "updateChatMember" + TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" + TypeUpdates = "updates" + TypeLogStreamDefault = "logStreamDefault" + TypeLogStreamFile = "logStreamFile" + TypeLogStreamEmpty = "logStreamEmpty" + TypeLogVerbosityLevel = "logVerbosityLevel" + TypeLogTags = "logTags" + TypeUserSupportInfo = "userSupportInfo" + TypeTestInt = "testInt" + TypeTestString = "testString" + TypeTestBytes = "testBytes" + TypeTestVectorInt = "testVectorInt" + TypeTestVectorIntObject = "testVectorIntObject" + TypeTestVectorString = "testVectorString" + TypeTestVectorStringObject = "testVectorStringObject" ) // Provides information about the method by which an authentication code is delivered to the user @@ -1274,6 +1510,11 @@ type AuthenticationCodeType interface { AuthenticationCodeTypeType() string } +// Contains authentication data for a email address +type EmailAddressAuthentication interface { + EmailAddressAuthenticationType() string +} + // Represents the current authorization state of the TDLib client type AuthorizationState interface { AuthorizationStateType() string @@ -1284,7 +1525,7 @@ type InputFile interface { InputFileType() string } -// Describes format of the thumbnail +// Describes format of a thumbnail type ThumbnailFormat interface { ThumbnailFormatType() string } @@ -1294,6 +1535,21 @@ type MaskPoint interface { MaskPointType() string } +// Describes format of a sticker +type StickerFormat interface { + StickerFormatType() string +} + +// Describes type of a sticker +type StickerType interface { + StickerTypeType() string +} + +// Contains full information about sticker type +type StickerFullType interface { + StickerFullTypeType() string +} + // Describes the type of a poll type PollType interface { PollTypeType() string @@ -1339,6 +1595,11 @@ type MessageForwardOrigin interface { MessageForwardOriginType() string } +// Describes type of message reaction +type ReactionType interface { + ReactionTypeType() string +} + // Contains information about the sending state of the message type MessageSendingState interface { MessageSendingStateType() string @@ -1364,6 +1625,11 @@ type ChatSource interface { ChatSourceType() string } +// Describes reactions available in the chat +type ChatAvailableReactions interface { + ChatAvailableReactionsType() string +} + // Describes a type of public chats type PublicChatType interface { PublicChatTypeType() string @@ -1419,6 +1685,21 @@ type InputCredentials interface { InputCredentialsType() string } +// Contains information about a payment provider +type PaymentProvider interface { + PaymentProviderType() string +} + +// Describes an invoice to process +type InputInvoice interface { + InputInvoiceType() string +} + +// Describes a media, which is attached to an invoice +type MessageExtendedMedia interface { + MessageExtendedMediaType() string +} + // Contains the type of a Telegram Passport element type PassportElementType interface { PassportElementTypeType() string @@ -1509,6 +1790,11 @@ type DiceStickers interface { DiceStickersType() string } +// Describes result of speech recognition in a voice note +type SpeechRecognitionResult interface { + SpeechRecognitionResultType() string +} + // Represents a single result of an inline query; for bots only type InputInlineQueryResult interface { InputInlineQueryResultType() string @@ -1534,6 +1820,26 @@ type LanguagePackStringValue interface { LanguagePackStringValueType() string } +// Describes type of a limit, increased for Premium users +type PremiumLimitType interface { + PremiumLimitTypeType() string +} + +// Describes a feature available to Premium users +type PremiumFeature interface { + PremiumFeatureType() string +} + +// Describes a source from which the Premium features screen is opened +type PremiumSource interface { + PremiumSourceType() string +} + +// Describes a purpose of an in-store payment +type StorePaymentPurpose interface { + StorePaymentPurposeType() string +} + // Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org type DeviceToken interface { DeviceTokenType() string @@ -1614,12 +1920,22 @@ type UserPrivacySetting interface { UserPrivacySettingType() string } +// Represents the type of a session +type SessionType interface { + SessionTypeType() string +} + // Describes the reason why a chat is reported type ChatReportReason interface { ChatReportReasonType() string } -// Describes an internal https://t.me or tg: link, which must be processed by the app in a special way +// Describes the target chat to be opened +type TargetChat interface { + TargetChatType() string +} + +// Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { InternalLinkTypeType() string } @@ -1659,7 +1975,7 @@ type SuggestedAction interface { SuggestedActionType() string } -// Describes the way the text needs to be parsed for TextEntities +// Describes the way the text needs to be parsed for text entities type TextParseMode interface { TextParseModeType() string } @@ -1669,11 +1985,6 @@ type ProxyType interface { ProxyTypeType() string } -// Describes a sticker that needs to be added to a sticker set -type InputSticker interface { - InputStickerType() string -} - // Describes a statistical graph type StatisticalGraph interface { StatisticalGraphType() string @@ -1750,57 +2061,6 @@ func (*Ok) GetType() string { return TypeOk } -// Contains parameters for TDLib initialization -type TdlibParameters struct { - meta - // If set to true, the Telegram test environment will be used instead of the production environment - UseTestDc bool `json:"use_test_dc"` - // The path to the directory for the persistent database; if empty, the current working directory will be used - DatabaseDirectory string `json:"database_directory"` - // The path to the directory for storing files; if empty, database_directory will be used - FilesDirectory string `json:"files_directory"` - // If set to true, information about downloaded and uploaded files will be saved between application restarts - UseFileDatabase bool `json:"use_file_database"` - // If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database - UseChatInfoDatabase bool `json:"use_chat_info_database"` - // If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database - UseMessageDatabase bool `json:"use_message_database"` - // If set to true, support for secret chats will be enabled - UseSecretChats bool `json:"use_secret_chats"` - // Application identifier for Telegram API access, which can be obtained at https://my.telegram.org - ApiId int32 `json:"api_id"` - // Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org - ApiHash string `json:"api_hash"` - // IETF language tag of the user's operating system language; must be non-empty - SystemLanguageCode string `json:"system_language_code"` - // Model of the device the application is being run on; must be non-empty - DeviceModel string `json:"device_model"` - // Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib - SystemVersion string `json:"system_version"` - // Application version; must be non-empty - ApplicationVersion string `json:"application_version"` - // If set to true, old files will automatically be deleted - EnableStorageOptimizer bool `json:"enable_storage_optimizer"` - // If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name - IgnoreFileNames bool `json:"ignore_file_names"` -} - -func (entity *TdlibParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TdlibParameters - - return json.Marshal((*stub)(entity)) -} - -func (*TdlibParameters) GetClass() string { - return ClassTdlibParameters -} - -func (*TdlibParameters) GetType() string { - return TypeTdlibParameters -} - // An authentication code is delivered via a private Telegram message, which can be viewed from another active session type AuthenticationCodeTypeTelegramMessage struct { meta @@ -1938,6 +2198,35 @@ func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeMissedCall } +// An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT +type AuthenticationCodeTypeFragment struct { + meta + // URL to open to receive the code + Url string `json:"url"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFragment) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFragment + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFragment) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFragment) GetType() string { + return TypeAuthenticationCodeTypeFragment +} + +func (*AuthenticationCodeTypeFragment) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFragment +} + // Information about the authentication code that was sent type AuthenticationCodeInfo struct { meta @@ -2017,6 +2306,87 @@ func (*EmailAddressAuthenticationCodeInfo) GetType() string { return TypeEmailAddressAuthenticationCodeInfo } +// An authentication code delivered to a user's email address +type EmailAddressAuthenticationCode struct { + meta + // The code + Code string `json:"code"` +} + +func (entity *EmailAddressAuthenticationCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationCode + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationCode) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationCode) GetType() string { + return TypeEmailAddressAuthenticationCode +} + +func (*EmailAddressAuthenticationCode) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationCode +} + +// An authentication token received through Apple ID +type EmailAddressAuthenticationAppleId struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *EmailAddressAuthenticationAppleId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationAppleId + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationAppleId) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationAppleId) GetType() string { + return TypeEmailAddressAuthenticationAppleId +} + +func (*EmailAddressAuthenticationAppleId) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationAppleId +} + +// An authentication token received through Google ID +type EmailAddressAuthenticationGoogleId struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *EmailAddressAuthenticationGoogleId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationGoogleId + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationGoogleId) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationGoogleId) GetType() string { + return TypeEmailAddressAuthenticationGoogleId +} + +func (*EmailAddressAuthenticationGoogleId) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationGoogleId +} + // Represents a part of the text that needs to be formatted in some unusual way type TextEntity struct { meta @@ -2093,7 +2463,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other 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 Entities []*TextEntity `json:"entities"` } @@ -2118,7 +2488,7 @@ type TermsOfService struct { meta // Text of the terms of service Text *FormattedText `json:"text"` - // The minimum age of a user to be able to accept the terms; 0 if any + // The minimum age of a user to be able to accept the terms; 0 if age isn't restricted MinUserAge int32 `json:"min_user_age"` // True, if a blocking popup with terms of service must be shown to the user ShowPopup bool `json:"show_popup"` @@ -2140,7 +2510,7 @@ func (*TermsOfService) GetType() string { return TypeTermsOfService } -// TDLib needs TdlibParameters for initialization +// Initializetion parameters are needed. Call setTdlibParameters to provide them type AuthorizationStateWaitTdlibParameters struct { meta } @@ -2165,34 +2535,7 @@ func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { return TypeAuthorizationStateWaitTdlibParameters } -// TDLib needs an encryption key to decrypt the local database -type AuthorizationStateWaitEncryptionKey struct { - meta - // True, if the database is currently encrypted - IsEncrypted bool `json:"is_encrypted"` -} - -func (entity *AuthorizationStateWaitEncryptionKey) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AuthorizationStateWaitEncryptionKey - - return json.Marshal((*stub)(entity)) -} - -func (*AuthorizationStateWaitEncryptionKey) GetClass() string { - return ClassAuthorizationState -} - -func (*AuthorizationStateWaitEncryptionKey) GetType() string { - return TypeAuthorizationStateWaitEncryptionKey -} - -func (*AuthorizationStateWaitEncryptionKey) AuthorizationStateType() string { - return TypeAuthorizationStateWaitEncryptionKey -} - -// TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options +// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct { meta } @@ -2217,7 +2560,69 @@ func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string { return TypeAuthorizationStateWaitPhoneNumber } -// TDLib needs the user's authentication code to authorize +// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed +type AuthorizationStateWaitEmailAddress struct { + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` +} + +func (entity *AuthorizationStateWaitEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthorizationStateWaitEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*AuthorizationStateWaitEmailAddress) GetClass() string { + return ClassAuthorizationState +} + +func (*AuthorizationStateWaitEmailAddress) GetType() string { + return TypeAuthorizationStateWaitEmailAddress +} + +func (*AuthorizationStateWaitEmailAddress) AuthorizationStateType() string { + return TypeAuthorizationStateWaitEmailAddress +} + +// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code +type AuthorizationStateWaitEmailCode struct { + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` + // Information about the sent authentication code + CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` + // Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown + NextPhoneNumberAuthorizationDate int32 `json:"next_phone_number_authorization_date"` +} + +func (entity *AuthorizationStateWaitEmailCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthorizationStateWaitEmailCode + + return json.Marshal((*stub)(entity)) +} + +func (*AuthorizationStateWaitEmailCode) GetClass() string { + return ClassAuthorizationState +} + +func (*AuthorizationStateWaitEmailCode) GetType() string { + return TypeAuthorizationStateWaitEmailCode +} + +func (*AuthorizationStateWaitEmailCode) AuthorizationStateType() string { + return TypeAuthorizationStateWaitEmailCode +} + +// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code type AuthorizationStateWaitCode struct { meta // Information about the authorization code that was sent @@ -2271,7 +2676,7 @@ func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() s return TypeAuthorizationStateWaitOtherDeviceConfirmation } -// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration +// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data type AuthorizationStateWaitRegistration struct { meta // Telegram terms of service @@ -2298,7 +2703,7 @@ func (*AuthorizationStateWaitRegistration) AuthorizationStateType() string { return TypeAuthorizationStateWaitRegistration } -// The user has been authorized, but needs to enter a password to start using the application +// The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week type AuthorizationStateWaitPassword struct { meta // Hint for the password; may be empty @@ -2329,7 +2734,7 @@ func (*AuthorizationStateWaitPassword) AuthorizationStateType() string { return TypeAuthorizationStateWaitPassword } -// The user has been successfully authorized. TDLib is now ready to answer queries +// The user has been successfully authorized. TDLib is now ready to answer general requests type AuthorizationStateReady struct { meta } @@ -2442,7 +2847,9 @@ type PasswordState struct { HasPassportData bool `json:"has_passport_data"` // Information about the recovery email address to which the confirmation email was sent; may be null RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"` - // If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword + // Pattern of the email address set up for logging in + LoginEmailAddressPattern string `json:"login_email_address_pattern"` + // If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword PendingResetDate int32 `json:"pending_reset_date"` } @@ -2524,11 +2931,11 @@ type LocalFile struct { // True, if the local copy is fully available IsDownloadingCompleted bool `json:"is_downloading_completed"` // Download will be started from this offset. downloaded_prefix_size is calculated from this offset - DownloadOffset int32 `json:"download_offset"` + DownloadOffset int64 `json:"download_offset"` // If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes - DownloadedPrefixSize int32 `json:"downloaded_prefix_size"` + DownloadedPrefixSize int64 `json:"downloaded_prefix_size"` // Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage - DownloadedSize int32 `json:"downloaded_size"` + DownloadedSize int64 `json:"downloaded_size"` } func (entity *LocalFile) MarshalJSON() ([]byte, error) { @@ -2550,7 +2957,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location + // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location Id string `json:"id"` // Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time UniqueId string `json:"unique_id"` @@ -2559,7 +2966,7 @@ type RemoteFile struct { // True, if a remote copy is fully available IsUploadingCompleted bool `json:"is_uploading_completed"` // Size of the remote available part of the file, in bytes; 0 if unknown - UploadedSize int32 `json:"uploaded_size"` + UploadedSize int64 `json:"uploaded_size"` } func (entity *RemoteFile) MarshalJSON() ([]byte, error) { @@ -2584,9 +2991,9 @@ type File struct { // Unique file identifier Id int32 `json:"id"` // File size, in bytes; 0 if unknown - Size int32 `json:"size"` + Size int64 `json:"size"` // Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` // Information about the local copy of the file Local *LocalFile `json:"local"` // Information about the remote copy of the file @@ -2698,7 +3105,7 @@ type InputFileGenerated struct { // String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage Conversion string `json:"conversion"` // Expected size of the generated file, in bytes; 0 if unknown - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` } func (entity *InputFileGenerated) MarshalJSON() ([]byte, error) { @@ -2804,56 +3211,6 @@ func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { return TypeThumbnailFormatJpeg } -// The thumbnail is in PNG format. It will be used only for background patterns -type ThumbnailFormatPng struct { - meta -} - -func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatPng - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatPng) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatPng) GetType() string { - return TypeThumbnailFormatPng -} - -func (*ThumbnailFormatPng) ThumbnailFormatType() string { - return TypeThumbnailFormatPng -} - -// The thumbnail is in WEBP format. It will be used only for some stickers -type ThumbnailFormatWebp struct { - meta -} - -func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatWebp - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatWebp) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatWebp) GetType() string { - return TypeThumbnailFormatWebp -} - -func (*ThumbnailFormatWebp) ThumbnailFormatType() string { - return TypeThumbnailFormatWebp -} - // The thumbnail is in static GIF format. It will be used only for some bot inline results type ThumbnailFormatGif struct { meta @@ -2879,7 +3236,57 @@ func (*ThumbnailFormatGif) ThumbnailFormatType() string { return TypeThumbnailFormatGif } -// The thumbnail is in TGS format. It will be used only for animated sticker sets +// The thumbnail is in MPEG4 format. It will be used only for some animations and videos +type ThumbnailFormatMpeg4 struct { + meta +} + +func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatMpeg4 + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatMpeg4) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatMpeg4) GetType() string { + return TypeThumbnailFormatMpeg4 +} + +func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { + return TypeThumbnailFormatMpeg4 +} + +// The thumbnail is in PNG format. It will be used only for background patterns +type ThumbnailFormatPng struct { + meta +} + +func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatPng + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatPng) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatPng) GetType() string { + return TypeThumbnailFormatPng +} + +func (*ThumbnailFormatPng) ThumbnailFormatType() string { + return TypeThumbnailFormatPng +} + +// The thumbnail is in TGS format. It will be used only for TGS sticker sets type ThumbnailFormatTgs struct { meta } @@ -2904,29 +3311,54 @@ func (*ThumbnailFormatTgs) ThumbnailFormatType() string { return TypeThumbnailFormatTgs } -// The thumbnail is in MPEG4 format. It will be used only for some animations and videos -type ThumbnailFormatMpeg4 struct { +// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +type ThumbnailFormatWebm struct { meta } -func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { +func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ThumbnailFormatMpeg4 + type stub ThumbnailFormatWebm return json.Marshal((*stub)(entity)) } -func (*ThumbnailFormatMpeg4) GetClass() string { +func (*ThumbnailFormatWebm) GetClass() string { return ClassThumbnailFormat } -func (*ThumbnailFormatMpeg4) GetType() string { - return TypeThumbnailFormatMpeg4 +func (*ThumbnailFormatWebm) GetType() string { + return TypeThumbnailFormatWebm } -func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { - return TypeThumbnailFormatMpeg4 +func (*ThumbnailFormatWebm) ThumbnailFormatType() string { + return TypeThumbnailFormatWebm +} + +// The thumbnail is in WEBP format. It will be used only for some stickers +type ThumbnailFormatWebp struct { + meta +} + +func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatWebp) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatWebp) GetType() string { + return TypeThumbnailFormatWebp +} + +func (*ThumbnailFormatWebp) ThumbnailFormatType() string { + return TypeThumbnailFormatWebp } // Represents a thumbnail @@ -3133,6 +3565,239 @@ func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { return nil } +// The sticker is an image in WEBP format +type StickerFormatWebp struct { + meta +} + +func (entity *StickerFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatWebp) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatWebp) GetType() string { + return TypeStickerFormatWebp +} + +func (*StickerFormatWebp) StickerFormatType() string { + return TypeStickerFormatWebp +} + +// The sticker is an animation in TGS format +type StickerFormatTgs struct { + meta +} + +func (entity *StickerFormatTgs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatTgs + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatTgs) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatTgs) GetType() string { + return TypeStickerFormatTgs +} + +func (*StickerFormatTgs) StickerFormatType() string { + return TypeStickerFormatTgs +} + +// The sticker is a video in WEBM format +type StickerFormatWebm struct { + meta +} + +func (entity *StickerFormatWebm) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatWebm + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatWebm) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatWebm) GetType() string { + return TypeStickerFormatWebm +} + +func (*StickerFormatWebm) StickerFormatType() string { + return TypeStickerFormatWebm +} + +// The sticker is a regular sticker +type StickerTypeRegular struct { + meta +} + +func (entity *StickerTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeRegular) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeRegular) GetType() string { + return TypeStickerTypeRegular +} + +func (*StickerTypeRegular) StickerTypeType() string { + return TypeStickerTypeRegular +} + +// The sticker is a mask in WEBP format to be placed on photos or videos +type StickerTypeMask struct { + meta +} + +func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeMask + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeMask) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeMask) GetType() string { + return TypeStickerTypeMask +} + +func (*StickerTypeMask) StickerTypeType() string { + return TypeStickerTypeMask +} + +// The sticker is a custom emoji to be used inside message text and caption +type StickerTypeCustomEmoji struct { + meta +} + +func (entity *StickerTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeCustomEmoji) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeCustomEmoji) GetType() string { + return TypeStickerTypeCustomEmoji +} + +func (*StickerTypeCustomEmoji) StickerTypeType() string { + return TypeStickerTypeCustomEmoji +} + +// The sticker is a regular sticker +type StickerFullTypeRegular struct { + meta + // Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker + PremiumAnimation *File `json:"premium_animation"` +} + +func (entity *StickerFullTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeRegular) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeRegular) GetType() string { + return TypeStickerFullTypeRegular +} + +func (*StickerFullTypeRegular) StickerFullTypeType() string { + return TypeStickerFullTypeRegular +} + +// The sticker is a mask in WEBP format to be placed on photos or videos +type StickerFullTypeMask struct { + meta + // Position where the mask is placed; may be null + MaskPosition *MaskPosition `json:"mask_position"` +} + +func (entity *StickerFullTypeMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeMask + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeMask) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeMask) GetType() string { + return TypeStickerFullTypeMask +} + +func (*StickerFullTypeMask) StickerFullTypeType() string { + return TypeStickerFullTypeMask +} + +// The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji +type StickerFullTypeCustomEmoji struct { + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places + NeedsRepainting bool `json:"needs_repainting"` +} + +func (entity *StickerFullTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeCustomEmoji) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeCustomEmoji) GetType() string { + return TypeStickerFullTypeCustomEmoji +} + +func (*StickerFullTypeCustomEmoji) StickerFullTypeType() string { + return TypeStickerFullTypeCustomEmoji +} + // Represents a closed vector path. The path begins at the end point of the last command type ClosedVectorPath struct { meta @@ -3313,8 +3978,10 @@ type Audio struct { MimeType string `json:"mime_type"` // The minithumbnail of the album cover; may be null AlbumCoverMinithumbnail *Minithumbnail `json:"album_cover_minithumbnail"` - // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null + // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` + // Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate + ExternalAlbumCovers []*Thumbnail `json:"external_album_covers"` // File containing the audio Audio *File `json:"audio"` } @@ -3404,12 +4071,10 @@ type Sticker struct { Height int32 `json:"height"` // Emoji corresponding to the sticker Emoji string `json:"emoji"` - // True, if the sticker is an animated sticker in TGS format - IsAnimated bool `json:"is_animated"` - // True, if the sticker is a mask - IsMask bool `json:"is_mask"` - // Position where the mask is placed; may be null - MaskPosition *MaskPosition `json:"mask_position"` + // Sticker format + Format StickerFormat `json:"format"` + // Sticker's full type + FullType StickerFullType `json:"full_type"` // Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner Outline []*ClosedVectorPath `json:"outline"` // Sticker thumbnail in WEBP or JPEG format; may be null @@ -3434,6 +4099,41 @@ func (*Sticker) GetType() string { return TypeSticker } +func (sticker *Sticker) UnmarshalJSON(data []byte) error { + var tmp struct { + SetId JsonInt64 `json:"set_id"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Emoji string `json:"emoji"` + Format json.RawMessage `json:"format"` + FullType json.RawMessage `json:"full_type"` + Outline []*ClosedVectorPath `json:"outline"` + Thumbnail *Thumbnail `json:"thumbnail"` + Sticker *File `json:"sticker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sticker.SetId = tmp.SetId + sticker.Width = tmp.Width + sticker.Height = tmp.Height + sticker.Emoji = tmp.Emoji + sticker.Outline = tmp.Outline + sticker.Thumbnail = tmp.Thumbnail + sticker.Sticker = tmp.Sticker + + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + sticker.Format = fieldFormat + + fieldFullType, _ := UnmarshalStickerFullType(tmp.FullType) + sticker.FullType = fieldFullType + + return nil +} + // Describes a video file type Video struct { meta @@ -3480,12 +4180,16 @@ type VideoNote struct { meta // Duration of the video, in seconds; as defined by the sender Duration int32 `json:"duration"` + // A waveform representation of the video note's audio in 5-bit format; may be empty if unknown + Waveform []byte `json:"waveform"` // Video width and height; as defined by the sender Length int32 `json:"length"` // Video minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` // Video thumbnail in JPEG format; as defined by the sender; may be null Thumbnail *Thumbnail `json:"thumbnail"` + // Result of speech recognition in the video note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` // File containing the video Video *File `json:"video"` } @@ -3506,6 +4210,35 @@ func (*VideoNote) GetType() string { return TypeVideoNote } +func (videoNote *VideoNote) UnmarshalJSON(data []byte) error { + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + Length int32 `json:"length"` + Minithumbnail *Minithumbnail `json:"minithumbnail"` + Thumbnail *Thumbnail `json:"thumbnail"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Video *File `json:"video"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + videoNote.Duration = tmp.Duration + videoNote.Waveform = tmp.Waveform + videoNote.Length = tmp.Length + videoNote.Minithumbnail = tmp.Minithumbnail + videoNote.Thumbnail = tmp.Thumbnail + videoNote.Video = tmp.Video + + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + videoNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + + return nil +} + // Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel type VoiceNote struct { meta @@ -3515,6 +4248,8 @@ type VoiceNote struct { Waveform []byte `json:"waveform"` // MIME type of the file; as defined by the sender MimeType string `json:"mime_type"` + // Result of speech recognition in the voice note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` // File containing the voice note Voice *File `json:"voice"` } @@ -3535,14 +4270,43 @@ func (*VoiceNote) GetType() string { return TypeVoiceNote } -// Describes an animated representation of an emoji +func (voiceNote *VoiceNote) UnmarshalJSON(data []byte) error { + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + MimeType string `json:"mime_type"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Voice *File `json:"voice"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + voiceNote.Duration = tmp.Duration + voiceNote.Waveform = tmp.Waveform + voiceNote.MimeType = tmp.MimeType + voiceNote.Voice = tmp.Voice + + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + voiceNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + + return nil +} + +// Describes an animated or custom representation of an emoji type AnimatedEmoji struct { meta - // Animated sticker for the emoji + // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs Sticker *Sticker `json:"sticker"` + // Expected width of the sticker, which can be used if the sticker is null + StickerWidth int32 `json:"sticker_width"` + // Expected height of the sticker, which can be used if the sticker is null + StickerHeight int32 `json:"sticker_height"` // Emoji modifier fitzpatrick type; 0-6; 0 if none FitzpatrickType int32 `json:"fitzpatrick_type"` - // File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + // File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container Sound *File `json:"sound"` } @@ -3656,7 +4420,7 @@ func (*Venue) GetType() string { // Describes a game type Game struct { meta - // Game ID + // Unique game identifier Id JsonInt64 `json:"id"` // Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} ShortName string `json:"short_name"` @@ -3777,6 +4541,8 @@ type ProfilePhoto struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` } func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) { @@ -3806,6 +4572,8 @@ type ChatPhotoInfo struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` } func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) { @@ -3887,6 +4655,8 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // 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 can be added to attachment menu + CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` } func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { @@ -3984,6 +4754,31 @@ func (*BotCommands) GetType() string { return TypeBotCommands } +// Describes a button to be shown instead of bot commands menu button +type BotMenuButton struct { + meta + // Text of the button + Text string `json:"text"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMenuButton + + return json.Marshal((*stub)(entity)) +} + +func (*BotMenuButton) GetClass() string { + return ClassBotMenuButton +} + +func (*BotMenuButton) GetType() string { + return TypeBotMenuButton +} + // Represents a location to which a chat is connected type ChatLocation struct { meta @@ -4047,8 +4842,10 @@ type ChatPhoto struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // Available variants of the photo in JPEG format, in different size Sizes []*PhotoSize `json:"sizes"` - // Animated variant of the photo in MPEG4 format; may be null + // A big (640x640) animated variant of the photo in MPEG4 format; may be null Animation *AnimatedChatPhoto `json:"animation"` + // A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available + SmallAnimation *AnimatedChatPhoto `json:"small_animation"` } func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { @@ -4210,6 +5007,223 @@ func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byt return nil } +// 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, locations, and venues + CanSendMessages bool `json:"can_send_messages"` + // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions + CanSendMediaMessages bool `json:"can_send_media_messages"` + // True, if the user can send polls. Implies can_send_messages permissions + CanSendPolls bool `json:"can_send_polls"` + // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions + CanSendOtherMessages bool `json:"can_send_other_messages"` + // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions + CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` + // True, if the user can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the user can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the user can pin messages + CanPinMessages bool `json:"can_pin_messages"` + // True, if the user can manage topics + CanManageTopics bool `json:"can_manage_topics"` +} + +func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPermissions) GetClass() string { + return ClassChatPermissions +} + +func (*ChatPermissions) GetType() string { + return TypeChatPermissions +} + +// Describes rights of the administrator +type ChatAdministratorRights struct { + meta + // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + CanManageChat bool `json:"can_manage_chat"` + // True, if the administrator can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the administrator can create channel posts; applicable to channels only + CanPostMessages bool `json:"can_post_messages"` + // True, if the administrator can edit messages of other users and pin messages; applicable to channels only + CanEditMessages bool `json:"can_edit_messages"` + // True, if the administrator can delete messages of other users + CanDeleteMessages bool `json:"can_delete_messages"` + // True, if the administrator can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the administrator can restrict, ban, or unban chat members; always true for channels + CanRestrictMembers bool `json:"can_restrict_members"` + // True, if the administrator can pin messages; applicable to basic groups and supergroups only + CanPinMessages bool `json:"can_pin_messages"` + // True, if the administrator can manage 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 + CanPromoteMembers bool `json:"can_promote_members"` + // True, if the administrator can manage video chats + CanManageVideoChats bool `json:"can_manage_video_chats"` + // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only + IsAnonymous bool `json:"is_anonymous"` +} + +func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministratorRights + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministratorRights) GetClass() string { + return ClassChatAdministratorRights +} + +func (*ChatAdministratorRights) GetType() string { + return TypeChatAdministratorRights +} + +// Describes an option for buying Telegram Premium to a user +type PremiumPaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium subscription payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // The discount associated with this option, as a percentage + DiscountPercentage int32 `json:"discount_percentage"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option + StoreProductId string `json:"store_product_id"` + // An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumPaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumPaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumPaymentOption) GetClass() string { + return ClassPremiumPaymentOption +} + +func (*PremiumPaymentOption) GetType() string { + return TypePremiumPaymentOption +} + +func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) error { + var tmp struct { + Currency string `json:"currency"` + Amount int64 `json:"amount"` + DiscountPercentage int32 `json:"discount_percentage"` + MonthCount int32 `json:"month_count"` + StoreProductId string `json:"store_product_id"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumPaymentOption.Currency = tmp.Currency + premiumPaymentOption.Amount = tmp.Amount + premiumPaymentOption.DiscountPercentage = tmp.DiscountPercentage + premiumPaymentOption.MonthCount = tmp.MonthCount + premiumPaymentOption.StoreProductId = tmp.StoreProductId + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumPaymentOption.PaymentLink = fieldPaymentLink + + return nil +} + +// Describes a custom emoji to be shown instead of the Telegram Premium badge +type EmojiStatus struct { + meta + // Identifier of the custom emoji in stickerFormatTgs format + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *EmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatus) GetClass() string { + return ClassEmojiStatus +} + +func (*EmojiStatus) GetType() string { + return TypeEmojiStatus +} + +// Contains a list of emoji statuses +type EmojiStatuses struct { + meta + // The list of emoji statuses + EmojiStatuses []*EmojiStatus `json:"emoji_statuses"` +} + +func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatuses + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatuses) GetClass() string { + return ClassEmojiStatuses +} + +func (*EmojiStatuses) GetType() string { + return TypeEmojiStatuses +} + +// Describes usernames assigned to a user, a supergroup, or a channel +type Usernames struct { + meta + // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames + ActiveUsernames []string `json:"active_usernames"` + // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive + DisabledUsernames []string `json:"disabled_usernames"` + // The active username, which can be changed with setUsername/setSupergroupUsername + EditableUsername string `json:"editable_username"` +} + +func (entity *Usernames) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Usernames + + return json.Marshal((*stub)(entity)) +} + +func (*Usernames) GetClass() string { + return ClassUsernames +} + +func (*Usernames) GetType() string { + return TypeUsernames +} + // Represents a user type User struct { meta @@ -4219,20 +5233,24 @@ type User struct { FirstName string `json:"first_name"` // Last name of the user LastName string `json:"last_name"` - // Username of the user - Username string `json:"username"` + // Usernames of the user; may be null + Usernames *Usernames `json:"usernames"` // Phone number of the user PhoneNumber string `json:"phone_number"` // Current online status of the user Status UserStatus `json:"status"` // Profile photo of the user; may be null ProfilePhoto *ProfilePhoto `json:"profile_photo"` + // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only + EmojiStatus *EmojiStatus `json:"emoji_status"` // The user is a contact of the current user IsContact bool `json:"is_contact"` // The user is a contact of the current user and the current user is a contact of the user IsMutualContact bool `json:"is_mutual_contact"` // True, if the user is verified IsVerified bool `json:"is_verified"` + // True, if the user is a Telegram Premium user + IsPremium bool `json:"is_premium"` // True, if the user is Telegram support account IsSupport bool `json:"is_support"` // If non-empty, it contains a human-readable description of the reason why access to this user must be restricted @@ -4241,12 +5259,14 @@ type User struct { IsScam bool `json:"is_scam"` // True, if many users reported this user as a fake account IsFake bool `json:"is_fake"` - // If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser + // If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method HaveAccess bool `json:"have_access"` // Type of the user Type UserType `json:"type"` // IETF language tag of the user's language; only available to bots LanguageCode string `json:"language_code"` + // True, if the user added the current bot to attachment menu; only available to bots + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` } func (entity *User) MarshalJSON() ([]byte, error) { @@ -4267,23 +5287,26 @@ func (*User) GetType() string { func (user *User) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Username string `json:"username"` - PhoneNumber string `json:"phone_number"` - Status json.RawMessage `json:"status"` - ProfilePhoto *ProfilePhoto `json:"profile_photo"` - IsContact bool `json:"is_contact"` - IsMutualContact bool `json:"is_mutual_contact"` - IsVerified bool `json:"is_verified"` - IsSupport bool `json:"is_support"` - RestrictionReason string `json:"restriction_reason"` - IsScam bool `json:"is_scam"` - IsFake bool `json:"is_fake"` - HaveAccess bool `json:"have_access"` - Type json.RawMessage `json:"type"` - LanguageCode string `json:"language_code"` + Id int64 `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Usernames *Usernames `json:"usernames"` + PhoneNumber string `json:"phone_number"` + Status json.RawMessage `json:"status"` + ProfilePhoto *ProfilePhoto `json:"profile_photo"` + EmojiStatus *EmojiStatus `json:"emoji_status"` + IsContact bool `json:"is_contact"` + IsMutualContact bool `json:"is_mutual_contact"` + IsVerified bool `json:"is_verified"` + IsPremium bool `json:"is_premium"` + IsSupport bool `json:"is_support"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HaveAccess bool `json:"have_access"` + Type json.RawMessage `json:"type"` + LanguageCode string `json:"language_code"` + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` } err := json.Unmarshal(data, &tmp) @@ -4294,18 +5317,21 @@ func (user *User) UnmarshalJSON(data []byte) error { user.Id = tmp.Id user.FirstName = tmp.FirstName user.LastName = tmp.LastName - user.Username = tmp.Username + user.Usernames = tmp.Usernames user.PhoneNumber = tmp.PhoneNumber user.ProfilePhoto = tmp.ProfilePhoto + user.EmojiStatus = tmp.EmojiStatus user.IsContact = tmp.IsContact user.IsMutualContact = tmp.IsMutualContact user.IsVerified = tmp.IsVerified + user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport user.RestrictionReason = tmp.RestrictionReason user.IsScam = tmp.IsScam user.IsFake = tmp.IsFake user.HaveAccess = tmp.HaveAccess user.LanguageCode = tmp.LanguageCode + user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu fieldStatus, _ := UnmarshalUserStatus(tmp.Status) user.Status = fieldStatus @@ -4316,11 +5342,52 @@ func (user *User) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a bot +type BotInfo struct { + meta + // The text that is shown on the bot's profile page and is sent together with the link when users share the bot + ShareText string `json:"share_text"` + // The text shown in the chat with the bot if the chat is empty + Description string `json:"description"` + // Photo shown in the chat with the bot if the chat is empty; may be null + Photo *Photo `json:"photo"` + // Animation shown in the chat with the bot if the chat is empty; may be null + Animation *Animation `json:"animation"` + // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown + MenuButton *BotMenuButton `json:"menu_button"` + // List of the bot commands + Commands []*BotCommand `json:"commands"` + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` +} + +func (entity *BotInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BotInfo) GetClass() string { + return ClassBotInfo +} + +func (*BotInfo) GetType() string { + return TypeBotInfo +} + // Contains full information about a user type UserFullInfo struct { meta - // User profile photo; may be null + // User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-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 + PersonalPhoto *ChatPhoto `json:"personal_photo"` + // User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo 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 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"` // True, if the user is blocked by the current user IsBlocked bool `json:"is_blocked"` // True, if the user can be called @@ -4331,18 +5398,18 @@ type UserFullInfo struct { HasPrivateCalls bool `json:"has_private_calls"` // True, if the user can't be linked in forwarded messages due to their privacy settings HasPrivateForwards bool `json:"has_private_forwards"` + // True, if voice and video notes can't be sent or forwarded to the user + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` - // A short user bio - Bio string `json:"bio"` - // For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot - ShareText string `json:"share_text"` - // For bots, the text shown in the chat with the bot if the chat is empty - Description string `json:"description"` + // A short user bio; may be null for bots + Bio *FormattedText `json:"bio"` + // The list of available options for gifting Telegram Premium to the user + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // For bots, list of the bot commands - Commands []*BotCommand `json:"commands"` + // For bots, information about the bot; may be null + BotInfo *BotInfo `json:"bot_info"` } func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { @@ -4364,7 +5431,7 @@ func (*UserFullInfo) GetType() string { // Represents a list of users type Users struct { meta - // Approximate total count of users found + // Approximate total number of users found TotalCount int32 `json:"total_count"` // A list of user identifiers UserIds []int64 `json:"user_ids"` @@ -4436,43 +5503,6 @@ func (*ChatAdministrators) GetType() string { return TypeChatAdministrators } -// 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, locations, and venues - CanSendMessages bool `json:"can_send_messages"` - // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions - CanSendMediaMessages bool `json:"can_send_media_messages"` - // True, if the user can send polls. Implies can_send_messages permissions - CanSendPolls bool `json:"can_send_polls"` - // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions - CanSendOtherMessages bool `json:"can_send_other_messages"` - // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions - CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` - // True, if the user can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the user can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the user can pin messages - CanPinMessages bool `json:"can_pin_messages"` -} - -func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPermissions - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPermissions) GetClass() string { - return ClassChatPermissions -} - -func (*ChatPermissions) GetType() string { - return TypeChatPermissions -} - // The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta @@ -4511,28 +5541,8 @@ type ChatMemberStatusAdministrator struct { CustomTitle string `json:"custom_title"` // True, if the current user can edit the administrator privileges for the called user CanBeEdited bool `json:"can_be_edited"` - // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only - CanManageChat bool `json:"can_manage_chat"` - // True, if the administrator can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts; applicable to channels only - CanPostMessages bool `json:"can_post_messages"` - // True, if the administrator can edit messages of other users and pin messages; applicable to channels only - CanEditMessages bool `json:"can_edit_messages"` - // True, if the administrator can delete messages of other users - CanDeleteMessages bool `json:"can_delete_messages"` - // True, if the administrator can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members; always true for channels - CanRestrictMembers bool `json:"can_restrict_members"` - // True, if the administrator can pin messages; applicable to basic groups and supergroups only - CanPinMessages bool `json:"can_pin_messages"` - // 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 manage video chats - CanManageVideoChats bool `json:"can_manage_video_chats"` - // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only - IsAnonymous bool `json:"is_anonymous"` + // Rights of the administrator + Rights *ChatAdministratorRights `json:"rights"` } func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { @@ -4670,7 +5680,7 @@ type ChatMember struct { MemberId MessageSender `json:"member_id"` // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int64 `json:"inviter_user_id"` - // Point in time (Unix timestamp) when the user joined the chat + // Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat JoinedChatDate int32 `json:"joined_chat_date"` // Status of the member in the chat Status ChatMemberStatus `json:"status"` @@ -4720,7 +5730,7 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { // Contains a list of chat members type ChatMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` // A list of chat members Members []*ChatMember `json:"members"` @@ -5179,7 +6189,7 @@ func (*ChatInviteLink) GetType() string { // Contains a list of chat invite links type ChatInviteLinks struct { meta - // Approximate total count of chat invite links found + // Approximate total number of chat invite links found TotalCount int32 `json:"total_count"` // List of invite links InviteLinks []*ChatInviteLink `json:"invite_links"` @@ -5281,7 +6291,7 @@ func (*ChatInviteLinkMember) GetType() string { // Contains a list of chat members joined a chat via an invite link type ChatInviteLinkMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` // List of chat members, joined a chat via an invite link Members []*ChatInviteLinkMember `json:"members"` @@ -5409,7 +6419,7 @@ func (*ChatJoinRequest) GetType() string { // Contains a list of requests to join a chat type ChatJoinRequests struct { meta - // Approximate total count of requests found + // Approximate total number of requests found TotalCount int32 `json:"total_count"` // List of the requests Requests []*ChatJoinRequest `json:"requests"` @@ -5515,7 +6525,7 @@ func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { // Contains full information about a basic group type BasicGroupFullInfo struct { meta - // Chat photo; may be null + // 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"` // Group description. Updated only after the basic group is opened Description string `json:"description"` @@ -5523,6 +6533,10 @@ type BasicGroupFullInfo struct { CreatorUserId int64 `json:"creator_user_id"` // Group members Members []*ChatMember `json:"members"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup + CanHideMembers bool `json:"can_hide_members"` + // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` // Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group @@ -5550,11 +6564,11 @@ type Supergroup struct { meta // Supergroup or channel identifier Id int64 `json:"id"` - // Username of the supergroup or channel; empty for private supergroups or channels - Username string `json:"username"` + // Usernames of the supergroup or channel; may be null + Usernames *Usernames `json:"usernames"` // Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member Date int32 `json:"date"` - // Status of the current user in the supergroup or channel; custom title will be always empty + // Status of the current user in the supergroup or channel; custom title will always be empty Status ChatMemberStatus `json:"status"` // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules MemberCount int32 `json:"member_count"` @@ -5564,12 +6578,18 @@ type Supergroup struct { HasLocation bool `json:"has_location"` // True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels SignMessages bool `json:"sign_messages"` + // True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups + JoinToSendMessages bool `json:"join_to_send_messages"` + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat + 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 IsChannel bool `json:"is_channel"` // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members IsBroadcastGroup bool `json:"is_broadcast_group"` + // True, if the supergroup must be shown as a forum by default + IsForum bool `json:"is_forum"` // True, if the supergroup or channel is verified IsVerified bool `json:"is_verified"` // If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted @@ -5598,21 +6618,24 @@ func (*Supergroup) GetType() string { func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - Username string `json:"username"` - Date int32 `json:"date"` - Status json.RawMessage `json:"status"` - MemberCount int32 `json:"member_count"` - HasLinkedChat bool `json:"has_linked_chat"` - HasLocation bool `json:"has_location"` - SignMessages bool `json:"sign_messages"` - IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` - IsChannel bool `json:"is_channel"` - IsBroadcastGroup bool `json:"is_broadcast_group"` - IsVerified bool `json:"is_verified"` - RestrictionReason string `json:"restriction_reason"` - IsScam bool `json:"is_scam"` - IsFake bool `json:"is_fake"` + Id int64 `json:"id"` + Usernames *Usernames `json:"usernames"` + Date int32 `json:"date"` + Status json.RawMessage `json:"status"` + MemberCount int32 `json:"member_count"` + HasLinkedChat bool `json:"has_linked_chat"` + HasLocation bool `json:"has_location"` + SignMessages bool `json:"sign_messages"` + JoinToSendMessages bool `json:"join_to_send_messages"` + JoinByRequest bool `json:"join_by_request"` + IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` + IsChannel bool `json:"is_channel"` + IsBroadcastGroup bool `json:"is_broadcast_group"` + IsForum bool `json:"is_forum"` + IsVerified bool `json:"is_verified"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` } err := json.Unmarshal(data, &tmp) @@ -5621,15 +6644,18 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { } supergroup.Id = tmp.Id - supergroup.Username = tmp.Username + supergroup.Usernames = tmp.Usernames supergroup.Date = tmp.Date supergroup.MemberCount = tmp.MemberCount supergroup.HasLinkedChat = tmp.HasLinkedChat supergroup.HasLocation = tmp.HasLocation supergroup.SignMessages = tmp.SignMessages + supergroup.JoinToSendMessages = tmp.JoinToSendMessages + supergroup.JoinByRequest = tmp.JoinByRequest supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled supergroup.IsChannel = tmp.IsChannel supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup + supergroup.IsForum = tmp.IsForum supergroup.IsVerified = tmp.IsVerified supergroup.RestrictionReason = tmp.RestrictionReason supergroup.IsScam = tmp.IsScam @@ -5644,7 +6670,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { // Contains full information about a supergroup or channel type SupergroupFullInfo struct { meta - // Chat photo; may be null + // 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"` // Supergroup or channel description Description string `json:"description"` @@ -5662,8 +6688,12 @@ type SupergroupFullInfo struct { SlowModeDelay int32 `json:"slow_mode_delay"` // Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"` - // True, if members of the chat can be retrieved + // True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers CanGetMembers bool `json:"can_get_members"` + // True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers + HasHiddenMembers bool `json:"has_hidden_members"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators + CanHideMembers bool `json:"can_hide_members"` // True, if the chat username can be changed CanSetUsername bool `json:"can_set_username"` // True, if the supergroup sticker set can be changed @@ -5672,13 +6702,17 @@ type SupergroupFullInfo struct { CanSetLocation bool `json:"can_set_location"` // True, if the supergroup or channel statistics are available CanGetStatistics bool `json:"can_get_statistics"` - // True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators + // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` + // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators IsAllHistoryAvailable bool `json:"is_all_history_available"` + // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` // Identifier of the supergroup sticker set; 0 if none StickerSetId JsonInt64 `json:"sticker_set_id"` // Location to which the supergroup is connected; may be null Location *ChatLocation `json:"location"` - // Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only + // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group BotCommands []*BotCommands `json:"bot_commands"` @@ -5792,7 +6826,7 @@ type SecretChat struct { IsOutbound bool `json:"is_outbound"` // Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers KeyHash []byte `json:"key_hash"` - // Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 + // Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 Layer int32 `json:"layer"` } @@ -5896,7 +6930,7 @@ func (*MessageSenderChat) MessageSenderType() string { // Represents a list of message senders type MessageSenders struct { meta - // Approximate total count of messages senders found + // Approximate total number of messages senders found TotalCount int32 `json:"total_count"` // List of message senders Senders []MessageSender `json:"senders"` @@ -5937,6 +6971,73 @@ func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { return nil } +// Represents a message sender, which can be used to send messages in a chat +type ChatMessageSender struct { + meta + // Available message senders + Sender MessageSender `json:"sender"` + // True, if Telegram Premium is needed to use the message sender + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *ChatMessageSender) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSender + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSender) GetClass() string { + return ClassChatMessageSender +} + +func (*ChatMessageSender) GetType() string { + return TypeChatMessageSender +} + +func (chatMessageSender *ChatMessageSender) UnmarshalJSON(data []byte) error { + var tmp struct { + Sender json.RawMessage `json:"sender"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatMessageSender.NeedsPremium = tmp.NeedsPremium + + fieldSender, _ := UnmarshalMessageSender(tmp.Sender) + chatMessageSender.Sender = fieldSender + + return nil +} + +// Represents a list of message senders, which can be used to send messages in a chat +type ChatMessageSenders struct { + meta + // List of available message senders + Senders []*ChatMessageSender `json:"senders"` +} + +func (entity *ChatMessageSenders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSenders + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSenders) GetClass() string { + return ClassChatMessageSenders +} + +func (*ChatMessageSenders) GetType() string { + return TypeChatMessageSenders +} + // The message was originally sent by a known user type MessageForwardOriginUser struct { meta @@ -6078,6 +7179,60 @@ func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string { return TypeMessageForwardOriginMessageImport } +// A reaction with an emoji +type ReactionTypeEmoji struct { + meta + // Text representation of the reaction + Emoji string `json:"emoji"` +} + +func (entity *ReactionTypeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionTypeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionTypeEmoji) GetClass() string { + return ClassReactionType +} + +func (*ReactionTypeEmoji) GetType() string { + return TypeReactionTypeEmoji +} + +func (*ReactionTypeEmoji) ReactionTypeType() string { + return TypeReactionTypeEmoji +} + +// A reaction with a custom emoji +type ReactionTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionTypeCustomEmoji) GetClass() string { + return ClassReactionType +} + +func (*ReactionTypeCustomEmoji) GetType() string { + return TypeReactionTypeCustomEmoji +} + +func (*ReactionTypeCustomEmoji) ReactionTypeType() string { + return TypeReactionTypeCustomEmoji +} + // Contains information about a forwarded message type MessageForwardInfo struct { meta @@ -6190,6 +7345,60 @@ func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a reaction to a message +type MessageReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if the reaction is chosen by the current user + IsChosen bool `json:"is_chosen"` + // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats + RecentSenderIds []MessageSender `json:"recent_sender_ids"` +} + +func (entity *MessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReaction) GetClass() string { + return ClassMessageReaction +} + +func (*MessageReaction) GetType() string { + return TypeMessageReaction +} + +func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + TotalCount int32 `json:"total_count"` + IsChosen bool `json:"is_chosen"` + RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReaction.TotalCount = tmp.TotalCount + messageReaction.IsChosen = tmp.IsChosen + + fieldType, _ := UnmarshalReactionType(tmp.Type) + messageReaction.Type = fieldType + + fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) + messageReaction.RecentSenderIds = fieldRecentSenderIds + + return nil +} + // Contains information about interactions with a message type MessageInteractionInfo struct { meta @@ -6199,6 +7408,8 @@ type MessageInteractionInfo struct { ForwardCount int32 `json:"forward_count"` // Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself ReplyInfo *MessageReplyInfo `json:"reply_info"` + // The list of reactions added to the message + Reactions []*MessageReaction `json:"reactions"` } func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { @@ -6217,6 +7428,56 @@ func (*MessageInteractionInfo) GetType() string { return TypeMessageInteractionInfo } +// Contains information about an unread reaction to a message +type UnreadReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Identifier of the sender, added the reaction + SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added with a big animation + IsBig bool `json:"is_big"` +} + +func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UnreadReaction) GetClass() string { + return ClassUnreadReaction +} + +func (*UnreadReaction) GetType() string { + return TypeUnreadReaction +} + +func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + IsBig bool `json:"is_big"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + unreadReaction.IsBig = tmp.IsBig + + fieldType, _ := UnmarshalReactionType(tmp.Type) + unreadReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + unreadReaction.SenderId = fieldSenderId + + return nil +} + // The message is being sent now, but has not yet been delivered to the server type MessageSendingStatePending struct { meta @@ -6304,18 +7565,24 @@ type Message struct { CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the message statistics are available + // True, if the list of added reactions is available through getMessageAddedReactions + CanGetAddedReactions bool `json:"can_get_added_reactions"` + // True, if the message statistics are available through getMessageStatistics CanGetStatistics bool `json:"can_get_statistics"` - // True, if the message thread info is available + // True, if information about the message thread is available through getMessageThread and getMessageThreadHistory CanGetMessageThread bool `json:"can_get_message_thread"` // True, if chat members already viewed the message can be received through getMessageViewers CanGetViewers bool `json:"can_get_viewers"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + // True, if reactions on the message can be reported through reportMessageReactions + CanReportReactions bool `json:"can_report_reactions"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` // True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts IsChannelPost bool `json:"is_channel_post"` + // True, if the message is a forum topic message + IsTopicMessage bool `json:"is_topic_message"` // True, if the message contains an unread mention for the current user ContainsUnreadMention bool `json:"contains_unread_mention"` // Point in time (Unix timestamp) when the message was sent @@ -6326,16 +7593,20 @@ type Message struct { ForwardInfo *MessageForwardInfo `json:"forward_info"` // Information about interactions with the message; may be null InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + // Information about unread reactions added to the message + UnreadReactions []*UnreadReaction `json:"unread_reactions"` // If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id ReplyInChatId int64 `json:"reply_in_chat_id"` // If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message ReplyToMessageId int64 `json:"reply_to_message_id"` // If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs MessageThreadId int64 `json:"message_thread_id"` - // For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires - Ttl int32 `json:"ttl"` - // Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field - TtlExpiresIn float64 `json:"ttl_expires_in"` + // The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires + SelfDestructTime int32 `json:"self_destruct_time"` + // Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field + SelfDestructIn float64 `json:"self_destruct_in"` + // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires + AutoDeleteIn float64 `json:"auto_delete_in"` // If non-zero, the user identifier of the bot through which this message was sent ViaBotUserId int64 `json:"via_bot_user_id"` // For channel posts and anonymous group messages, optional author signature @@ -6380,22 +7651,27 @@ func (message *Message) UnmarshalJSON(data []byte) error { CanBeSaved bool `json:"can_be_saved"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` + CanGetAddedReactions bool `json:"can_get_added_reactions"` CanGetStatistics bool `json:"can_get_statistics"` CanGetMessageThread bool `json:"can_get_message_thread"` CanGetViewers bool `json:"can_get_viewers"` CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + CanReportReactions bool `json:"can_report_reactions"` HasTimestampedMedia bool `json:"has_timestamped_media"` IsChannelPost bool `json:"is_channel_post"` + IsTopicMessage bool `json:"is_topic_message"` ContainsUnreadMention bool `json:"contains_unread_mention"` Date int32 `json:"date"` EditDate int32 `json:"edit_date"` ForwardInfo *MessageForwardInfo `json:"forward_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + UnreadReactions []*UnreadReaction `json:"unread_reactions"` ReplyInChatId int64 `json:"reply_in_chat_id"` ReplyToMessageId int64 `json:"reply_to_message_id"` MessageThreadId int64 `json:"message_thread_id"` - Ttl int32 `json:"ttl"` - TtlExpiresIn float64 `json:"ttl_expires_in"` + SelfDestructTime int32 `json:"self_destruct_time"` + SelfDestructIn float64 `json:"self_destruct_in"` + AutoDeleteIn float64 `json:"auto_delete_in"` ViaBotUserId int64 `json:"via_bot_user_id"` AuthorSignature string `json:"author_signature"` MediaAlbumId JsonInt64 `json:"media_album_id"` @@ -6418,22 +7694,27 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers + message.CanGetAddedReactions = tmp.CanGetAddedReactions message.CanGetStatistics = tmp.CanGetStatistics message.CanGetMessageThread = tmp.CanGetMessageThread message.CanGetViewers = tmp.CanGetViewers message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks + message.CanReportReactions = tmp.CanReportReactions message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost + message.IsTopicMessage = tmp.IsTopicMessage message.ContainsUnreadMention = tmp.ContainsUnreadMention message.Date = tmp.Date message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo message.InteractionInfo = tmp.InteractionInfo + message.UnreadReactions = tmp.UnreadReactions message.ReplyInChatId = tmp.ReplyInChatId message.ReplyToMessageId = tmp.ReplyToMessageId message.MessageThreadId = tmp.MessageThreadId - message.Ttl = tmp.Ttl - message.TtlExpiresIn = tmp.TtlExpiresIn + message.SelfDestructTime = tmp.SelfDestructTime + message.SelfDestructIn = tmp.SelfDestructIn + message.AutoDeleteIn = tmp.AutoDeleteIn message.ViaBotUserId = tmp.ViaBotUserId message.AuthorSignature = tmp.AuthorSignature message.MediaAlbumId = tmp.MediaAlbumId @@ -6460,7 +7741,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { // Contains a list of messages type Messages struct { meta - // Approximate total count of messages found + // Approximate total number of messages found TotalCount int32 `json:"total_count"` // List of messages; messages may be null Messages []*Message `json:"messages"` @@ -6485,7 +7766,7 @@ func (*Messages) GetType() string { // Contains a list of messages found by a search type FoundMessages struct { meta - // Approximate total count of messages found; -1 if unknown + // Approximate total number of messages found; -1 if unknown TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` @@ -6509,6 +7790,33 @@ func (*FoundMessages) GetType() string { return TypeFoundMessages } +// Contains a list of messages found by a search in a given chat +type FoundChatMessages struct { + meta + // Approximate total number of messages found; -1 if unknown + TotalCount int32 `json:"total_count"` + // List of messages + Messages []*Message `json:"messages"` + // The offset for the next request. If 0, there are no more results + NextFromMessageId int64 `json:"next_from_message_id"` +} + +func (entity *FoundChatMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatMessages + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatMessages) GetClass() string { + return ClassFoundChatMessages +} + +func (*FoundChatMessages) GetType() string { + return TypeFoundChatMessages +} + // Contains information about a message in a specific position type MessagePosition struct { meta @@ -6539,7 +7847,7 @@ func (*MessagePosition) GetType() string { // Contains a list of message positions type MessagePositions struct { meta - // Total count of messages found + // Total number of messages found TotalCount int32 `json:"total_count"` // List of message positions Positions []*MessagePosition `json:"positions"` @@ -6616,9 +7924,15 @@ type SponsoredMessage struct { meta // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages MessageId int64 `json:"message_id"` - // Chat identifier + // True, if the message needs to be labeled as "recommended" instead of "sponsored" + IsRecommended bool `json:"is_recommended"` + // Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link SponsorChatId int64 `json:"sponsor_chat_id"` - // An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead + // Information about the sponsor chat; may be null unless sponsor_chat_id == 0 + SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` + // True, if the sponsor's chat photo must be shown + ShowChatPhoto bool `json:"show_chat_photo"` + // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead Link InternalLinkType `json:"link"` // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` @@ -6642,10 +7956,13 @@ func (*SponsoredMessage) GetType() string { func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { - MessageId int64 `json:"message_id"` - SponsorChatId int64 `json:"sponsor_chat_id"` - Link json.RawMessage `json:"link"` - Content json.RawMessage `json:"content"` + MessageId int64 `json:"message_id"` + IsRecommended bool `json:"is_recommended"` + SponsorChatId int64 `json:"sponsor_chat_id"` + SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` + ShowChatPhoto bool `json:"show_chat_photo"` + Link json.RawMessage `json:"link"` + Content json.RawMessage `json:"content"` } err := json.Unmarshal(data, &tmp) @@ -6654,7 +7971,10 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { } sponsoredMessage.MessageId = tmp.MessageId + sponsoredMessage.IsRecommended = tmp.IsRecommended sponsoredMessage.SponsorChatId = tmp.SponsorChatId + sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo + sponsoredMessage.ShowChatPhoto = tmp.ShowChatPhoto fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) sponsoredMessage.Link = fieldLink @@ -6665,6 +7985,116 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { return nil } +// Contains a list of sponsored messages +type SponsoredMessages struct { + meta + // List of sponsored messages + Messages []*SponsoredMessage `json:"messages"` + // The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages + MessagesBetween int32 `json:"messages_between"` +} + +func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SponsoredMessages + + return json.Marshal((*stub)(entity)) +} + +func (*SponsoredMessages) GetClass() string { + return ClassSponsoredMessages +} + +func (*SponsoredMessages) GetType() string { + return TypeSponsoredMessages +} + +// Describes a file added to file download list +type FileDownload struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // The message with the file + Message *Message `json:"message"` + // Point in time (Unix timestamp) when the file was added to the download list + AddDate int32 `json:"add_date"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` +} + +func (entity *FileDownload) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileDownload + + return json.Marshal((*stub)(entity)) +} + +func (*FileDownload) GetClass() string { + return ClassFileDownload +} + +func (*FileDownload) GetType() string { + return TypeFileDownload +} + +// Contains number of being downloaded and recently downloaded files found +type DownloadedFileCounts struct { + meta + // Number of active file downloads found, including paused + ActiveCount int32 `json:"active_count"` + // Number of paused file downloads found + PausedCount int32 `json:"paused_count"` + // Number of completed file downloads found + CompletedCount int32 `json:"completed_count"` +} + +func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DownloadedFileCounts + + return json.Marshal((*stub)(entity)) +} + +func (*DownloadedFileCounts) GetClass() string { + return ClassDownloadedFileCounts +} + +func (*DownloadedFileCounts) GetType() string { + return TypeDownloadedFileCounts +} + +// Contains a list of downloaded files, found by a search +type FoundFileDownloads struct { + meta + // Total number of suitable files, ignoring offset + TotalCounts *DownloadedFileCounts `json:"total_counts"` + // The list of files + Files []*FileDownload `json:"files"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*FoundFileDownloads) GetClass() string { + return ClassFoundFileDownloads +} + +func (*FoundFileDownloads) GetType() string { + return TypeFoundFileDownloads +} + // Notification settings applied to all private and secret chats when the corresponding chat setting has a default value type NotificationSettingsScopePrivateChats struct { meta @@ -6690,7 +8120,7 @@ func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopePrivateChats } -// Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value type NotificationSettingsScopeGroupChats struct { meta } @@ -6715,7 +8145,7 @@ func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() stri return TypeNotificationSettingsScopeGroupChats } -// Notification settings applied to all channels when the corresponding chat setting has a default value +// Notification settings applied to all channel chats when the corresponding chat setting has a default value type NotificationSettingsScopeChannelChats struct { meta } @@ -6740,26 +8170,26 @@ func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopeChannelChats } -// Contains information about notification settings for a chat +// Contains information about notification settings for a chat or a froum topic type ChatNotificationSettings struct { meta - // If true, mute_for is ignored and the value for the relevant type of chat is used instead + // If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultMuteFor bool `json:"use_default_mute_for"` // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // If true, sound is ignored and the value for the relevant type of chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of sound_id UseDefaultSound bool `json:"use_default_sound"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` - // If true, show_preview is ignored and the value for the relevant type of chat is used instead + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` + // If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` - // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead + // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` // If true, notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` - // If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead + // If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"` // If true, notifications for messages with mentions will be created as for an ordinary unread message DisableMentionNotifications bool `json:"disable_mention_notifications"` @@ -6786,8 +8216,8 @@ type ScopeNotificationSettings struct { meta // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message @@ -6815,7 +8245,7 @@ func (*ScopeNotificationSettings) GetType() string { // Contains information about a message draft type DraftMessage struct { meta - // Identifier of the message to reply to; 0 if none + // Identifier of the replied message; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` @@ -6977,13 +8407,13 @@ type ChatFilter struct { meta // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter + // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". If empty, use getChatFilterDefaultIconName to get default icon name for the filter IconName string `json:"icon_name"` - // The chat identifiers of pinned chats in the filtered chat list + // The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium PinnedChatIds []int64 `json:"pinned_chat_ids"` - // The chat identifiers of always included chats in the filtered chat list + // The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium IncludedChatIds []int64 `json:"included_chat_ids"` - // The chat identifiers of always excluded chats in the filtered chat list + // The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium ExcludedChatIds []int64 `json:"excluded_chat_ids"` // True, if muted chats need to be excluded ExcludeMuted bool `json:"exclude_muted"` @@ -7026,7 +8456,7 @@ type ChatFilterInfo struct { Id int32 `json:"id"` // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" + // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" IconName string `json:"icon_name"` } @@ -7318,6 +8748,74 @@ func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { return nil } +// All reactions are available in the chat +type ChatAvailableReactionsAll struct { + meta +} + +func (entity *ChatAvailableReactionsAll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsAll + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsAll) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsAll) GetType() string { + return TypeChatAvailableReactionsAll +} + +func (*ChatAvailableReactionsAll) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsAll +} + +// Only specific reactions are available in the chat +type ChatAvailableReactionsSome struct { + meta + // The list of reactions + Reactions []ReactionType `json:"reactions"` +} + +func (entity *ChatAvailableReactionsSome) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsSome + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsSome) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsSome) GetType() string { + return TypeChatAvailableReactionsSome +} + +func (*ChatAvailableReactionsSome) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsSome +} + +func (chatAvailableReactionsSome *ChatAvailableReactionsSome) UnmarshalJSON(data []byte) error { + var tmp struct { + Reactions []json.RawMessage `json:"reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReactions, _ := UnmarshalListOfReactionType(tmp.Reactions) + chatAvailableReactionsSome.Reactions = fieldReactions + + return nil +} + // Describes a video chat type VideoChat struct { meta @@ -7409,10 +8907,14 @@ type Chat struct { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` // Number of unread messages with a mention/reply in the chat UnreadMentionCount int32 `json:"unread_mention_count"` - // Notification settings for this chat + // Number of messages with unread reactions in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats - MessageTtl int32 `json:"message_ttl"` + // Types of reaction, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` + // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` // If non-empty, name of a theme, set for the chat ThemeName string `json:"theme_name"` // Information about actions which must be possible to do through the chat action bar; may be null @@ -7467,8 +8969,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` + UnreadReactionCount int32 `json:"unread_reaction_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - MessageTtl int32 `json:"message_ttl"` + AvailableReactions json.RawMessage `json:"available_reactions"` + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -7501,8 +9005,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount + chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings - chat.MessageTtl = tmp.MessageTtl + chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -7516,6 +9021,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) chat.MessageSenderId = fieldMessageSenderId + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + chat.AvailableReactions = fieldAvailableReactions + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -7525,7 +9033,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { // Represents a list of chats type Chats struct { meta - // Approximate total count of chats found + // Approximate total number of chats found TotalCount int32 `json:"total_count"` // List of chat identifiers ChatIds []int64 `json:"chat_ids"` @@ -7597,7 +9105,7 @@ func (*ChatsNearby) GetType() string { return TypeChatsNearby } -// The chat is public, because it has username +// The chat is public, because it has an active username type PublicChatTypeHasUsername struct { meta } @@ -7647,7 +9155,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam +// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportSpam struct { meta // If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings @@ -7724,7 +9232,7 @@ func (*ChatActionBarInviteMembers) ChatActionBarType() string { return TypeChatActionBarInviteMembers } -// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact +// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportAddBlock struct { meta // If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings @@ -7938,6 +9446,33 @@ func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestPoll } +// A button that opens a Web App by calling getWebAppUrl +type KeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeWebApp) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeWebApp) GetType() string { + return TypeKeyboardButtonTypeWebApp +} + +func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeWebApp +} + // Represents a single button in a bot keyboard type KeyboardButton struct { meta @@ -8009,10 +9544,10 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically authorize the current user if allowed to do so +// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo type InlineKeyboardButtonTypeLoginUrl struct { meta - // An HTTP URL to open + // An HTTP URL to pass to getLoginUrlInfo Url string `json:"url"` // Unique button identifier Id int64 `json:"id"` @@ -8040,6 +9575,33 @@ func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeLoginUrl } +// A button that opens a Web App by calling openWebApp +type InlineKeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to openWebApp + Url string `json:"url"` +} + +func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeWebApp) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeWebApp) GetType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + +func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + // A button that sends a callback query to a bot type InlineKeyboardButtonTypeCallback struct { meta @@ -8067,7 +9629,7 @@ func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeCallback } -// A button that asks for password of the current user and then sends a callback query to a bot +// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot type InlineKeyboardButtonTypeCallbackWithPassword struct { meta // Data to be sent to the bot via a callback query @@ -8244,7 +9806,7 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err return nil } -// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent +// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent type ReplyMarkupRemoveKeyboard struct { meta // True, if the keyboard is removed only for the mentioned users or the target user of a reply @@ -8305,6 +9867,8 @@ type ReplyMarkupShowKeyboard struct { meta // A list of rows of bot keyboard buttons Rows [][]*KeyboardButton `json:"rows"` + // True, if the keyboard is supposed to be always shown when the ordinary keyboard is hidden + IsPersistent bool `json:"is_persistent"` // True, if the application needs to resize the keyboard vertically ResizeKeyboard bool `json:"resize_keyboard"` // True, if the application needs to hide the keyboard after use @@ -8424,6 +9988,31 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { return TypeLoginUrlInfoRequestConfirmation } +// 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 a message thread type MessageThreadInfo struct { meta @@ -8431,7 +10020,7 @@ type MessageThreadInfo struct { ChatId int64 `json:"chat_id"` // Message thread identifier, unique within the chat MessageThreadId int64 `json:"message_thread_id"` - // Information about the message thread + // Information about the message thread; may be null for forum topic threads ReplyInfo *MessageReplyInfo `json:"reply_info"` // Approximate number of unread messages in the message thread UnreadMessageCount int32 `json:"unread_message_count"` @@ -8457,6 +10046,175 @@ func (*MessageThreadInfo) GetType() string { return TypeMessageThreadInfo } +// Describes a forum topic icon +type ForumTopicIcon struct { + meta + // Color of the topic icon in RGB format + Color int32 `json:"color"` + // Unique identifier of the custom emoji shown on the topic icon; 0 if none + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicIcon) GetClass() string { + return ClassForumTopicIcon +} + +func (*ForumTopicIcon) GetType() string { + return TypeForumTopicIcon +} + +// Contains basic information about a forum topic +type ForumTopicInfo struct { + meta + // Message thread identifier of the topic + MessageThreadId int64 `json:"message_thread_id"` + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` + // Date the topic was created + CreationDate int32 `json:"creation_date"` + // Identifier of the creator of the topic + CreatorId MessageSender `json:"creator_id"` + // True, if the topic is the General topic list + IsGeneral bool `json:"is_general"` + // True, if the topic was created by the current user + IsOutgoing bool `json:"is_outgoing"` + // True, if the topic is closed + IsClosed bool `json:"is_closed"` + // True, if the topic is hidden above the topic list and closed; for General topic only + IsHidden bool `json:"is_hidden"` +} + +func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicInfo) GetClass() string { + return ClassForumTopicInfo +} + +func (*ForumTopicInfo) GetType() string { + return TypeForumTopicInfo +} + +func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageThreadId int64 `json:"message_thread_id"` + Name string `json:"name"` + Icon *ForumTopicIcon `json:"icon"` + CreationDate int32 `json:"creation_date"` + CreatorId json.RawMessage `json:"creator_id"` + IsGeneral bool `json:"is_general"` + IsOutgoing bool `json:"is_outgoing"` + IsClosed bool `json:"is_closed"` + IsHidden bool `json:"is_hidden"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + forumTopicInfo.MessageThreadId = tmp.MessageThreadId + forumTopicInfo.Name = tmp.Name + forumTopicInfo.Icon = tmp.Icon + forumTopicInfo.CreationDate = tmp.CreationDate + forumTopicInfo.IsGeneral = tmp.IsGeneral + forumTopicInfo.IsOutgoing = tmp.IsOutgoing + forumTopicInfo.IsClosed = tmp.IsClosed + forumTopicInfo.IsHidden = tmp.IsHidden + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + forumTopicInfo.CreatorId = fieldCreatorId + + return nil +} + +// Describes a forum topic +type ForumTopic struct { + meta + // Basic information about the topic + Info *ForumTopicInfo `json:"info"` + // Last message in the topic; may be null if unknown + LastMessage *Message `json:"last_message"` + // True, if the topic is pinned in the topic list + IsPinned bool `json:"is_pinned"` + // Number of unread messages in the topic + UnreadCount int32 `json:"unread_count"` + // Identifier of the last read incoming message + LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` + // Identifier of the last read outgoing message + LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` + // Number of unread messages with a mention/reply in the topic + UnreadMentionCount int32 `json:"unread_mention_count"` + // Number of messages with unread reactions in the topic + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the topic + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // A draft of a message in the topic; may be null + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *ForumTopic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopic + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopic) GetClass() string { + return ClassForumTopic +} + +func (*ForumTopic) GetType() string { + return TypeForumTopic +} + +// Describes a list of forum topics +type ForumTopics struct { + meta + // Approximate total number of forum topics found + TotalCount int32 `json:"total_count"` + // List of forum topics + Topics []*ForumTopic `json:"topics"` + // Offset date for the next getForumTopics request + NextOffsetDate int32 `json:"next_offset_date"` + // Offset message identifier for the next getForumTopics request + NextOffsetMessageId int64 `json:"next_offset_message_id"` + // Offset message thread identifier for the next getForumTopics request + NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` +} + +func (entity *ForumTopics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopics + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopics) GetClass() string { + return ClassForumTopics +} + +func (*ForumTopics) GetType() string { + return TypeForumTopics +} + // A plain text type RichTextPlain struct { meta @@ -10495,7 +12253,7 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` - // Chat username, by which all other information about the chat can be resolved + // Chat username by which all other information about the chat can be resolved Username string `json:"username"` } @@ -10817,7 +12575,7 @@ type WebPage struct { VideoNote *VideoNote `json:"video_note"` // Preview of the content as a voice note, if available; may be null VoiceNote *VoiceNote `json:"voice_note"` - // Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none + // Version of web page instant view (currently, can be 1 or 2); 0 if none InstantViewVersion int32 `json:"instant_view_version"` } @@ -10900,6 +12658,8 @@ type PhoneNumberInfo struct { CountryCallingCode string `json:"country_calling_code"` // The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user FormattedPhoneNumber string `json:"formatted_phone_number"` + // True, if the phone number was bought on Fragment and isn't tied to a SIM card + IsAnonymous bool `json:"is_anonymous"` } func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) { @@ -11001,6 +12761,41 @@ func (*Address) GetType() string { return TypeAddress } +// Contains parameters of the application theme +type ThemeParameters struct { + meta + // A color of the background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A secondary color for the background in the RGB24 format + SecondaryBackgroundColor int32 `json:"secondary_background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // A color of hints in the RGB24 format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB24 format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB24 format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB24 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 +} + // Portion of the price of a product (e.g., "delivery cost", "tax amount") type LabeledPricePart struct { meta @@ -11037,6 +12832,8 @@ type Invoice struct { MaxTipAmount int64 `json:"max_tip_amount"` // Suggested amounts of tip in the smallest units of the currency SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"` + // An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay + RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"` // True, if the payment is a test payment IsTest bool `json:"is_test"` // True, if the user's name is needed for payment @@ -11127,7 +12924,7 @@ func (*ShippingOption) GetType() string { return TypeShippingOption } -// Contains information about saved card credentials +// Contains information about saved payment credentials type SavedCredentials struct { meta // Unique identifier of the saved credentials @@ -11262,8 +13059,35 @@ func (*InputCredentialsGooglePay) InputCredentialsType() string { return TypeInputCredentialsGooglePay } +// Smart Glocal payment provider +type PaymentProviderSmartGlocal struct { + meta + // Public payment token + PublicToken string `json:"public_token"` +} + +func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentProviderSmartGlocal + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentProviderSmartGlocal) GetClass() string { + return ClassPaymentProvider +} + +func (*PaymentProviderSmartGlocal) GetType() string { + return TypePaymentProviderSmartGlocal +} + +func (*PaymentProviderSmartGlocal) PaymentProviderType() string { + return TypePaymentProviderSmartGlocal +} + // Stripe payment provider -type PaymentsProviderStripe struct { +type PaymentProviderStripe struct { meta // Stripe API publishable key PublishableKey string `json:"publishable_key"` @@ -11275,53 +13099,76 @@ type PaymentsProviderStripe struct { NeedCardholderName bool `json:"need_cardholder_name"` } -func (entity *PaymentsProviderStripe) MarshalJSON() ([]byte, error) { +func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PaymentsProviderStripe + type stub PaymentProviderStripe return json.Marshal((*stub)(entity)) } -func (*PaymentsProviderStripe) GetClass() string { - return ClassPaymentsProviderStripe +func (*PaymentProviderStripe) GetClass() string { + return ClassPaymentProvider } -func (*PaymentsProviderStripe) GetType() string { - return TypePaymentsProviderStripe +func (*PaymentProviderStripe) GetType() string { + return TypePaymentProviderStripe } -// Theme colors for a payment form -type PaymentFormTheme struct { +func (*PaymentProviderStripe) PaymentProviderType() string { + return TypePaymentProviderStripe +} + +// Some other payment provider, for which a web payment form must be shown +type PaymentProviderOther struct { meta - // A color of the payment form background in the RGB24 format - BackgroundColor int32 `json:"background_color"` - // A color of text in the RGB24 format - TextColor int32 `json:"text_color"` - // A color of hints in the RGB24 format - HintColor int32 `json:"hint_color"` - // A color of links in the RGB24 format - LinkColor int32 `json:"link_color"` - // A color of the buttons in the RGB24 format - ButtonColor int32 `json:"button_color"` - // A color of text on the buttons in the RGB24 format - ButtonTextColor int32 `json:"button_text_color"` + // Payment form URL + Url string `json:"url"` } -func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) { +func (entity *PaymentProviderOther) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PaymentFormTheme + type stub PaymentProviderOther return json.Marshal((*stub)(entity)) } -func (*PaymentFormTheme) GetClass() string { - return ClassPaymentFormTheme +func (*PaymentProviderOther) GetClass() string { + return ClassPaymentProvider } -func (*PaymentFormTheme) GetType() string { - return TypePaymentFormTheme +func (*PaymentProviderOther) GetType() string { + return TypePaymentProviderOther +} + +func (*PaymentProviderOther) PaymentProviderType() string { + return TypePaymentProviderOther +} + +// Describes an additional payment option +type PaymentOption struct { + meta + // Title for the payment option + Title string `json:"title"` + // Payment form URL to be opened in a web view + Url string `json:"url"` +} + +func (entity *PaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentOption) GetClass() string { + return ClassPaymentOption +} + +func (*PaymentOption) GetType() string { + return TypePaymentOption } // Contains information about an invoice payment form @@ -11329,24 +13176,30 @@ type PaymentForm struct { meta // The payment form identifier Id JsonInt64 `json:"id"` - // Full information of the invoice + // Full information about the invoice Invoice *Invoice `json:"invoice"` - // Payment form URL - Url string `json:"url"` // User identifier of the seller bot SellerBotUserId int64 `json:"seller_bot_user_id"` // User identifier of the payment provider bot - PaymentsProviderUserId int64 `json:"payments_provider_user_id"` - // Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null - PaymentsProvider *PaymentsProviderStripe `json:"payments_provider"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + // Information about the payment provider + PaymentProvider PaymentProvider `json:"payment_provider"` + // The list of additional payment options + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` // Saved server-side order information; may be null SavedOrderInfo *OrderInfo `json:"saved_order_info"` - // Information about saved card credentials; may be null - SavedCredentials *SavedCredentials `json:"saved_credentials"` + // The list of saved payment credentials + SavedCredentials []*SavedCredentials `json:"saved_credentials"` // True, if the user can choose to save credentials CanSaveCredentials bool `json:"can_save_credentials"` - // True, if the user will be able to save credentials protected by a password they set up + // True, if the user will be able to save credentials, if sets up a 2-step verification password NeedPassword bool `json:"need_password"` + // Product title + ProductTitle string `json:"product_title"` + // Product description + ProductDescription *FormattedText `json:"product_description"` + // Product photo; may be null + ProductPhoto *Photo `json:"product_photo"` } func (entity *PaymentForm) MarshalJSON() ([]byte, error) { @@ -11365,6 +13218,47 @@ func (*PaymentForm) GetType() string { return TypePaymentForm } +func (paymentForm *PaymentForm) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Invoice *Invoice `json:"invoice"` + SellerBotUserId int64 `json:"seller_bot_user_id"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + PaymentProvider json.RawMessage `json:"payment_provider"` + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` + SavedOrderInfo *OrderInfo `json:"saved_order_info"` + SavedCredentials []*SavedCredentials `json:"saved_credentials"` + CanSaveCredentials bool `json:"can_save_credentials"` + NeedPassword bool `json:"need_password"` + ProductTitle string `json:"product_title"` + ProductDescription *FormattedText `json:"product_description"` + ProductPhoto *Photo `json:"product_photo"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + paymentForm.Id = tmp.Id + paymentForm.Invoice = tmp.Invoice + paymentForm.SellerBotUserId = tmp.SellerBotUserId + paymentForm.PaymentProviderUserId = tmp.PaymentProviderUserId + paymentForm.AdditionalPaymentOptions = tmp.AdditionalPaymentOptions + paymentForm.SavedOrderInfo = tmp.SavedOrderInfo + paymentForm.SavedCredentials = tmp.SavedCredentials + paymentForm.CanSaveCredentials = tmp.CanSaveCredentials + paymentForm.NeedPassword = tmp.NeedPassword + paymentForm.ProductTitle = tmp.ProductTitle + paymentForm.ProductDescription = tmp.ProductDescription + paymentForm.ProductPhoto = tmp.ProductPhoto + + fieldPaymentProvider, _ := UnmarshalPaymentProvider(tmp.PaymentProvider) + paymentForm.PaymentProvider = fieldPaymentProvider + + return nil +} + // Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options type ValidatedOrderInfo struct { meta @@ -11421,7 +13315,7 @@ type PaymentReceipt struct { // Product title Title string `json:"title"` // Product description - Description string `json:"description"` + Description *FormattedText `json:"description"` // Product photo; may be null Photo *Photo `json:"photo"` // Point in time (Unix timestamp) when the payment was made @@ -11429,7 +13323,7 @@ type PaymentReceipt struct { // User identifier of the seller bot SellerBotUserId int64 `json:"seller_bot_user_id"` // User identifier of the payment provider bot - PaymentsProviderUserId int64 `json:"payments_provider_user_id"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` // Information about the invoice Invoice *Invoice `json:"invoice"` // Order information; may be null @@ -11458,6 +13352,182 @@ func (*PaymentReceipt) GetType() string { return TypePaymentReceipt } +// An invoice from a message of the type messageInvoice +type InputInvoiceMessage struct { + meta + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` +} + +func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceMessage) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceMessage) GetType() string { + return TypeInputInvoiceMessage +} + +func (*InputInvoiceMessage) InputInvoiceType() string { + return TypeInputInvoiceMessage +} + +// An invoice from a link of the type internalLinkTypeInvoice +type InputInvoiceName struct { + meta + // Name of the invoice + Name string `json:"name"` +} + +func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceName + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceName) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceName) GetType() string { + return TypeInputInvoiceName +} + +func (*InputInvoiceName) InputInvoiceType() string { + return TypeInputInvoiceName +} + +// The media is hidden until the invoice is paid +type MessageExtendedMediaPreview struct { + meta + // Media width; 0 if unknown + Width int32 `json:"width"` + // Media height; 0 if unknown + Height int32 `json:"height"` + // Media duration; 0 if unknown + Duration int32 `json:"duration"` + // Media minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPreview + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPreview) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPreview) GetType() string { + return TypeMessageExtendedMediaPreview +} + +func (*MessageExtendedMediaPreview) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPreview +} + +// The media is a photo +type MessageExtendedMediaPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPhoto) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPhoto) GetType() string { + return TypeMessageExtendedMediaPhoto +} + +func (*MessageExtendedMediaPhoto) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPhoto +} + +// The media is a video +type MessageExtendedMediaVideo struct { + meta + // The video + Video *Video `json:"video"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaVideo) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaVideo) GetType() string { + return TypeMessageExtendedMediaVideo +} + +func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaVideo +} + +// The media is unuspported +type MessageExtendedMediaUnsupported struct { + meta + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaUnsupported) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaUnsupported) GetType() string { + return TypeMessageExtendedMediaUnsupported +} + +func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaUnsupported +} + // File with the date it was uploaded type DatedFile struct { meta @@ -13643,6 +15713,8 @@ type MessageAnimation struct { Animation *Animation `json:"animation"` // Animation caption Caption *FormattedText `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the animation thumbnail must be blurred and the animation must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13728,10 +15800,12 @@ func (*MessageDocument) MessageContentType() string { // A photo message type MessagePhoto struct { meta - // The photo description + // The photo Photo *Photo `json:"photo"` // Photo caption Caption *FormattedText `json:"caption"` + // True, if the photo preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the photo must be blurred and must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13756,7 +15830,7 @@ func (*MessagePhoto) MessageContentType() string { return TypeMessagePhoto } -// An expired photo message (self-destructed after TTL has elapsed) +// A self-destructed photo message type MessageExpiredPhoto struct { meta } @@ -13786,6 +15860,8 @@ type MessageSticker struct { meta // The sticker description Sticker *Sticker `json:"sticker"` + // True, if premium animation of the sticker must be played + IsPremium bool `json:"is_premium"` } func (entity *MessageSticker) MarshalJSON() ([]byte, error) { @@ -13815,6 +15891,8 @@ type MessageVideo struct { Video *Video `json:"video"` // Video caption Caption *FormattedText `json:"caption"` + // True, if the video preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the video thumbnail must be blurred and the video must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13839,7 +15917,7 @@ func (*MessageVideo) MessageContentType() string { return TypeMessageVideo } -// An expired video message (self-destructed after TTL has elapsed) +// A self-destructed video message type MessageExpiredVideo struct { meta } @@ -13937,7 +16015,7 @@ type MessageLocation struct { 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 for the message sender + // 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"` } @@ -14166,7 +16244,7 @@ type MessageInvoice struct { // Product title Title string `json:"title"` // Product description - Description string `json:"description"` + Description *FormattedText `json:"description"` // Product photo; may be null Photo *Photo `json:"photo"` // Currency for the product price @@ -14181,6 +16259,8 @@ type MessageInvoice struct { NeedShippingAddress bool `json:"need_shipping_address"` // The identifier of the message with the receipt, after the product has been purchased ReceiptMessageId int64 `json:"receipt_message_id"` + // Extended media attached to the invoice; may be null + ExtendedMedia MessageExtendedMedia `json:"extended_media"` } func (entity *MessageInvoice) MarshalJSON() ([]byte, error) { @@ -14203,6 +16283,41 @@ func (*MessageInvoice) MessageContentType() string { return TypeMessageInvoice } +func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Title string `json:"title"` + Description *FormattedText `json:"description"` + Photo *Photo `json:"photo"` + Currency string `json:"currency"` + TotalAmount int64 `json:"total_amount"` + StartParameter string `json:"start_parameter"` + IsTest bool `json:"is_test"` + NeedShippingAddress bool `json:"need_shipping_address"` + ReceiptMessageId int64 `json:"receipt_message_id"` + ExtendedMedia json.RawMessage `json:"extended_media"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageInvoice.Title = tmp.Title + messageInvoice.Description = tmp.Description + messageInvoice.Photo = tmp.Photo + messageInvoice.Currency = tmp.Currency + messageInvoice.TotalAmount = tmp.TotalAmount + messageInvoice.StartParameter = tmp.StartParameter + messageInvoice.IsTest = tmp.IsTest + messageInvoice.NeedShippingAddress = tmp.NeedShippingAddress + messageInvoice.ReceiptMessageId = tmp.ReceiptMessageId + + fieldExtendedMedia, _ := UnmarshalMessageExtendedMedia(tmp.ExtendedMedia) + messageInvoice.ExtendedMedia = fieldExtendedMedia + + return nil +} + // A message with information about an ended call type MessageCall struct { meta @@ -14741,31 +16856,174 @@ func (*MessageChatSetTheme) MessageContentType() string { return TypeMessageChatSetTheme } -// The TTL (Time To Live) setting for messages in the chat has been changed -type MessageChatSetTtl struct { +// The auto-delete or self-destruct timer for messages in the chat has been changed +type MessageChatSetMessageAutoDeleteTime struct { meta - // New message TTL - Ttl int32 `json:"ttl"` + // New value auto-delete or self-destruct time, in seconds; 0 if disabled + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // If not 0, a user identifier, which default setting was automatically applied + FromUserId int64 `json:"from_user_id"` } -func (entity *MessageChatSetTtl) MarshalJSON() ([]byte, error) { +func (entity *MessageChatSetMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageChatSetTtl + type stub MessageChatSetMessageAutoDeleteTime return json.Marshal((*stub)(entity)) } -func (*MessageChatSetTtl) GetClass() string { +func (*MessageChatSetMessageAutoDeleteTime) GetClass() string { return ClassMessageContent } -func (*MessageChatSetTtl) GetType() string { - return TypeMessageChatSetTtl +func (*MessageChatSetMessageAutoDeleteTime) GetType() string { + return TypeMessageChatSetMessageAutoDeleteTime } -func (*MessageChatSetTtl) MessageContentType() string { - return TypeMessageChatSetTtl +func (*MessageChatSetMessageAutoDeleteTime) MessageContentType() string { + return TypeMessageChatSetMessageAutoDeleteTime +} + +// A forum topic has been created +type MessageForumTopicCreated struct { + meta + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` +} + +func (entity *MessageForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicCreated) GetType() string { + return TypeMessageForumTopicCreated +} + +func (*MessageForumTopicCreated) MessageContentType() string { + return TypeMessageForumTopicCreated +} + +// A forum topic has been edited +type MessageForumTopicEdited struct { + meta + // If non-empty, the new name of the topic + Name string `json:"name"` + // True, if icon's custom_emoji_id is changed + EditIconCustomEmojiId bool `json:"edit_icon_custom_emoji_id"` + // New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` +} + +func (entity *MessageForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicEdited) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicEdited) GetType() string { + return TypeMessageForumTopicEdited +} + +func (*MessageForumTopicEdited) MessageContentType() string { + return TypeMessageForumTopicEdited +} + +// A forum topic has been closed or opened +type MessageForumTopicIsClosedToggled struct { + meta + // True, if the topic was closed, otherwise the topic was reopened + IsClosed bool `json:"is_closed"` +} + +func (entity *MessageForumTopicIsClosedToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsClosedToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsClosedToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsClosedToggled) GetType() string { + return TypeMessageForumTopicIsClosedToggled +} + +func (*MessageForumTopicIsClosedToggled) MessageContentType() string { + return TypeMessageForumTopicIsClosedToggled +} + +// A General forum topic has been hidden or unhidden +type MessageForumTopicIsHiddenToggled struct { + meta + // True, if the topic was hidden, otherwise the topic was unhidden + IsHidden bool `json:"is_hidden"` +} + +func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsHiddenToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsHiddenToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsHiddenToggled) GetType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +func (*MessageForumTopicIsHiddenToggled) MessageContentType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +// A profile photo was suggested to a user in a private chat +type MessageSuggestProfilePhoto struct { + meta + // The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo + Photo *ChatPhoto `json:"photo"` +} + +func (entity *MessageSuggestProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSuggestProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSuggestProfilePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageSuggestProfilePhoto) GetType() string { + return TypeMessageSuggestProfilePhoto +} + +func (*MessageSuggestProfilePhoto) MessageContentType() string { + return TypeMessageSuggestProfilePhoto } // A non-standard action has happened in the chat @@ -14829,14 +17087,20 @@ func (*MessageGameScore) MessageContentType() string { // A payment has been completed type MessagePaymentSuccessful struct { meta - // Identifier of the chat, containing the corresponding invoice message; 0 if unknown + // Identifier of the chat, containing the corresponding invoice message InvoiceChatId int64 `json:"invoice_chat_id"` - // Identifier of the message with the corresponding invoice; can be an identifier of a deleted message + // Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for the price of the product Currency string `json:"currency"` // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` + // Name of the invoice; may be empty if unknown + InvoiceName string `json:"invoice_name"` } func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) { @@ -14866,6 +17130,10 @@ type MessagePaymentSuccessfulBot struct { Currency string `json:"currency"` // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` // Invoice payload InvoicePayload []byte `json:"invoice_payload"` // Identifier of the shipping option chosen by the user; may be empty if not applicable @@ -14898,6 +17166,39 @@ func (*MessagePaymentSuccessfulBot) MessageContentType() string { return TypeMessagePaymentSuccessfulBot } +// Telegram Premium was gifted to the user +type MessageGiftedPremium struct { + meta + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessageGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGiftedPremium) GetClass() string { + return ClassMessageContent +} + +func (*MessageGiftedPremium) GetType() string { + return TypeMessageGiftedPremium +} + +func (*MessageGiftedPremium) MessageContentType() string { + return TypeMessageGiftedPremium +} + // A contact has registered with Telegram type MessageContactRegistered struct { meta @@ -14950,7 +17251,88 @@ func (*MessageWebsiteConnected) MessageContentType() string { return TypeMessageWebsiteConnected } -// Telegram Passport data has been sent +// The user allowed the bot to send messages +type MessageBotWriteAccessAllowed struct { + meta +} + +func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageBotWriteAccessAllowed + + return json.Marshal((*stub)(entity)) +} + +func (*MessageBotWriteAccessAllowed) GetClass() string { + return ClassMessageContent +} + +func (*MessageBotWriteAccessAllowed) GetType() string { + return TypeMessageBotWriteAccessAllowed +} + +func (*MessageBotWriteAccessAllowed) MessageContentType() string { + return TypeMessageBotWriteAccessAllowed +} + +// Data from a Web App has been sent to a bot +type MessageWebAppDataSent struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` +} + +func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataSent + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataSent) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataSent) GetType() string { + return TypeMessageWebAppDataSent +} + +func (*MessageWebAppDataSent) MessageContentType() string { + return TypeMessageWebAppDataSent +} + +// Data from a Web App has been received; for bots only +type MessageWebAppDataReceived struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` + // Received data + Data string `json:"data"` +} + +func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataReceived + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataReceived) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataReceived) GetType() string { + return TypeMessageWebAppDataReceived +} + +func (*MessageWebAppDataReceived) MessageContentType() string { + return TypeMessageWebAppDataReceived +} + +// Telegram Passport data has been sent to a bot type MessagePassportDataSent struct { meta // List of Telegram Passport element types sent @@ -15101,7 +17483,7 @@ func (*MessageUnsupported) MessageContentType() string { return TypeMessageUnsupported } -// A mention of a user by their username +// A mention of a user, a supergroup, or a channel by their username type TextEntityTypeMention struct { meta } @@ -15401,6 +17783,31 @@ func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { return TypeTextEntityTypeStrikethrough } +// A spoiler text +type TextEntityTypeSpoiler struct { + meta +} + +func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeSpoiler + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeSpoiler) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeSpoiler) GetType() string { + return TypeTextEntityTypeSpoiler +} + +func (*TextEntityTypeSpoiler) TextEntityTypeType() string { + return TypeTextEntityTypeSpoiler +} + // Text that must be formatted as if inside a code HTML tag type TextEntityTypeCode struct { meta @@ -15532,6 +17939,33 @@ func (*TextEntityTypeMentionName) TextEntityTypeType() string { return TypeTextEntityTypeMentionName } +// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji +type TextEntityTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *TextEntityTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeCustomEmoji) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeCustomEmoji) GetType() string { + return TypeTextEntityTypeCustomEmoji +} + +func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { + return TypeTextEntityTypeCustomEmoji +} + // A media timestamp type TextEntityTypeMediaTimestamp struct { meta @@ -15666,6 +18100,10 @@ type MessageSendOptions struct { DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` + // Pass true if the content of the message must be protected from forwarding and saving; for bots only + ProtectContent bool `json:"protect_content"` + // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` } @@ -15688,9 +18126,11 @@ func (*MessageSendOptions) GetType() string { func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { - DisableNotification bool `json:"disable_notification"` - FromBackground bool `json:"from_background"` - SchedulingState json.RawMessage `json:"scheduling_state"` + DisableNotification bool `json:"disable_notification"` + FromBackground bool `json:"from_background"` + ProtectContent bool `json:"protect_content"` + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` + SchedulingState json.RawMessage `json:"scheduling_state"` } err := json.Unmarshal(data, &tmp) @@ -15700,6 +18140,8 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground + messageSendOptions.ProtectContent = tmp.ProtectContent + messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) messageSendOptions.SchedulingState = fieldSchedulingState @@ -15737,7 +18179,7 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` // True, if rich web page previews for URLs in the message text must be disabled DisableWebPagePreview bool `json:"disable_web_page_preview"` @@ -15780,8 +18222,10 @@ type InputMessageAnimation struct { Width int32 `json:"width"` // Height of the animation; may be replaced by the server Height int32 `json:"height"` - // Animation caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) { @@ -15813,6 +18257,7 @@ func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) e Width int32 `json:"width"` Height int32 `json:"height"` Caption *FormattedText `json:"caption"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -15826,6 +18271,7 @@ func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) e inputMessageAnimation.Width = tmp.Width inputMessageAnimation.Height = tmp.Height inputMessageAnimation.Caption = tmp.Caption + inputMessageAnimation.HasSpoiler = tmp.HasSpoiler fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) inputMessageAnimation.Animation = fieldAnimation @@ -15846,7 +18292,7 @@ type InputMessageAudio struct { Title string `json:"title"` // Performer of the audio; 0-64 characters, may be replaced by the server Performer string `json:"performer"` - // Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -15904,9 +18350,9 @@ type InputMessageDocument struct { Document InputFile `json:"document"` // Document thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` - // If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats + // If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats DisableContentTypeDetection bool `json:"disable_content_type_detection"` - // Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -15956,7 +18402,7 @@ func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) err // A photo message type InputMessagePhoto struct { meta - // Photo to send + // 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"` @@ -15966,10 +18412,12 @@ type InputMessagePhoto struct { Width int32 `json:"width"` // Photo height Height int32 `json:"height"` - // Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` - // Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats - Ttl int32 `json:"ttl"` + // Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats + SelfDestructTime int32 `json:"self_destruct_time"` + // True, if the photo preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) { @@ -16000,7 +18448,8 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { Width int32 `json:"width"` Height int32 `json:"height"` Caption *FormattedText `json:"caption"` - Ttl int32 `json:"ttl"` + SelfDestructTime int32 `json:"self_destruct_time"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -16013,7 +18462,8 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { inputMessagePhoto.Width = tmp.Width inputMessagePhoto.Height = tmp.Height inputMessagePhoto.Caption = tmp.Caption - inputMessagePhoto.Ttl = tmp.Ttl + inputMessagePhoto.SelfDestructTime = tmp.SelfDestructTime + inputMessagePhoto.HasSpoiler = tmp.HasSpoiler fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) inputMessagePhoto.Photo = fieldPhoto @@ -16098,10 +18548,12 @@ type InputMessageVideo struct { Height int32 `json:"height"` // True, if the video is supposed to be streamed SupportsStreaming bool `json:"supports_streaming"` - // Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` - // Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats - Ttl int32 `json:"ttl"` + // Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats + SelfDestructTime int32 `json:"self_destruct_time"` + // True, if the video preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) { @@ -16134,7 +18586,8 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { Height int32 `json:"height"` SupportsStreaming bool `json:"supports_streaming"` Caption *FormattedText `json:"caption"` - Ttl int32 `json:"ttl"` + SelfDestructTime int32 `json:"self_destruct_time"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -16149,7 +18602,8 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { inputMessageVideo.Height = tmp.Height inputMessageVideo.SupportsStreaming = tmp.SupportsStreaming inputMessageVideo.Caption = tmp.Caption - inputMessageVideo.Ttl = tmp.Ttl + inputMessageVideo.SelfDestructTime = tmp.SelfDestructTime + inputMessageVideo.HasSpoiler = tmp.HasSpoiler fieldVideo, _ := UnmarshalInputFile(tmp.Video) inputMessageVideo.Video = fieldVideo @@ -16220,9 +18674,9 @@ type InputMessageVoiceNote struct { 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 representation of the voice note in 5-bit format Waveform []byte `json:"waveform"` - // Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -16439,6 +18893,8 @@ type InputMessageInvoice struct { ProviderData string `json:"provider_data"` // Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message StartParameter string `json:"start_parameter"` + // The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo + ExtendedMediaContent InputMessageContent `json:"extended_media_content"` } func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) { @@ -16461,6 +18917,45 @@ func (*InputMessageInvoice) InputMessageContentType() string { return TypeInputMessageInvoice } +func (inputMessageInvoice *InputMessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Invoice *Invoice `json:"invoice"` + Title string `json:"title"` + Description string `json:"description"` + PhotoUrl string `json:"photo_url"` + PhotoSize int32 `json:"photo_size"` + PhotoWidth int32 `json:"photo_width"` + PhotoHeight int32 `json:"photo_height"` + Payload []byte `json:"payload"` + ProviderToken string `json:"provider_token"` + ProviderData string `json:"provider_data"` + StartParameter string `json:"start_parameter"` + ExtendedMediaContent json.RawMessage `json:"extended_media_content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageInvoice.Invoice = tmp.Invoice + inputMessageInvoice.Title = tmp.Title + inputMessageInvoice.Description = tmp.Description + inputMessageInvoice.PhotoUrl = tmp.PhotoUrl + inputMessageInvoice.PhotoSize = tmp.PhotoSize + inputMessageInvoice.PhotoWidth = tmp.PhotoWidth + inputMessageInvoice.PhotoHeight = tmp.PhotoHeight + inputMessageInvoice.Payload = tmp.Payload + inputMessageInvoice.ProviderToken = tmp.ProviderToken + inputMessageInvoice.ProviderData = tmp.ProviderData + inputMessageInvoice.StartParameter = tmp.StartParameter + + fieldExtendedMediaContent, _ := UnmarshalInputMessageContent(tmp.ExtendedMediaContent) + inputMessageInvoice.ExtendedMediaContent = fieldExtendedMediaContent + + return nil +} + // A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot type InputMessagePoll struct { meta @@ -16912,6 +19407,31 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } +// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +type SearchMessagesFilterUnreadReaction struct { + meta +} + +func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadReaction) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadReaction) GetType() string { + return TypeSearchMessagesFilterUnreadReaction +} + +func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadReaction +} + // Returns only failed to send messages. This filter can be used only if the message database is used type SearchMessagesFilterFailedToSend struct { meta @@ -17558,7 +20078,7 @@ type StickerSet struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17568,10 +20088,10 @@ type StickerSet struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Format of the stickers in the set + StickerFormat StickerFormat `json:"sticker_format"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -17596,6 +20116,49 @@ func (*StickerSet) GetType() string { return TypeStickerSet } +func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + IsViewed bool `json:"is_viewed"` + Stickers []*Sticker `json:"stickers"` + Emojis []*Emojis `json:"emojis"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSet.Id = tmp.Id + stickerSet.Title = tmp.Title + stickerSet.Name = tmp.Name + stickerSet.Thumbnail = tmp.Thumbnail + stickerSet.ThumbnailOutline = tmp.ThumbnailOutline + stickerSet.IsInstalled = tmp.IsInstalled + stickerSet.IsArchived = tmp.IsArchived + stickerSet.IsOfficial = tmp.IsOfficial + stickerSet.IsViewed = tmp.IsViewed + stickerSet.Stickers = tmp.Stickers + stickerSet.Emojis = tmp.Emojis + + fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) + stickerSet.StickerFormat = fieldStickerFormat + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSet.StickerType = fieldStickerType + + return nil +} + // Represents short information about a sticker set type StickerSetInfo struct { meta @@ -17605,7 +20168,7 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17615,10 +20178,10 @@ type StickerSetInfo struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Format of the stickers in the set + StickerFormat StickerFormat `json:"sticker_format"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -17643,6 +20206,49 @@ func (*StickerSetInfo) GetType() string { return TypeStickerSetInfo } +func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + IsViewed bool `json:"is_viewed"` + Size int32 `json:"size"` + Covers []*Sticker `json:"covers"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSetInfo.Id = tmp.Id + stickerSetInfo.Title = tmp.Title + stickerSetInfo.Name = tmp.Name + stickerSetInfo.Thumbnail = tmp.Thumbnail + stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline + stickerSetInfo.IsInstalled = tmp.IsInstalled + stickerSetInfo.IsArchived = tmp.IsArchived + stickerSetInfo.IsOfficial = tmp.IsOfficial + stickerSetInfo.IsViewed = tmp.IsViewed + stickerSetInfo.Size = tmp.Size + stickerSetInfo.Covers = tmp.Covers + + fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) + stickerSetInfo.StickerFormat = fieldStickerFormat + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSetInfo.StickerType = fieldStickerType + + return nil +} + // Represents a list of sticker sets type StickerSets struct { meta @@ -17668,6 +20274,33 @@ func (*StickerSets) GetType() string { return TypeStickerSets } +// Represents a list of trending sticker sets +type TrendingStickerSets struct { + meta + // Approximate total number of trending sticker sets + TotalCount int32 `json:"total_count"` + // List of trending sticker sets + Sets []*StickerSetInfo `json:"sets"` + // True, if the list contains sticker sets with premium stickers + IsPremium bool `json:"is_premium"` +} + +func (entity *TrendingStickerSets) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TrendingStickerSets + + return json.Marshal((*stub)(entity)) +} + +func (*TrendingStickerSets) GetClass() string { + return ClassTrendingStickerSets +} + +func (*TrendingStickerSets) GetType() string { + return TypeTrendingStickerSets +} + // The call wasn't discarded, or the reason is unknown type CallDiscardReasonEmpty struct { meta @@ -17829,6 +20462,8 @@ type CallServerTypeTelegramReflector struct { meta // A peer tag to be used with the reflector PeerTag []byte `json:"peer_tag"` + // True, if the server uses TCP instead of UDP + IsTcp bool `json:"is_tcp"` } func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) { @@ -18111,6 +20746,8 @@ type CallStateDiscarded struct { NeedRating bool `json:"need_rating"` // True, if the call debug information must be sent to the server NeedDebugInformation bool `json:"need_debug_information"` + // True, if the call log must be sent to the server + NeedLog bool `json:"need_log"` } func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) { @@ -18138,6 +20775,7 @@ func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { Reason json.RawMessage `json:"reason"` NeedRating bool `json:"need_rating"` NeedDebugInformation bool `json:"need_debug_information"` + NeedLog bool `json:"need_log"` } err := json.Unmarshal(data, &tmp) @@ -18147,6 +20785,7 @@ func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { callStateDiscarded.NeedRating = tmp.NeedRating callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation + callStateDiscarded.NeedLog = tmp.NeedLog fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason) callStateDiscarded.Reason = fieldReason @@ -18256,6 +20895,81 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } +// Describes an available stream in a group call +type GroupCallStream struct { + meta + // Identifier of an audio/video channel + ChannelId int32 `json:"channel_id"` + // Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds + Scale int32 `json:"scale"` + // Point in time when the stream currently ends; Unix timestamp in milliseconds + TimeOffset int64 `json:"time_offset"` +} + +func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStream + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStream) GetClass() string { + return ClassGroupCallStream +} + +func (*GroupCallStream) GetType() string { + return TypeGroupCallStream +} + +// Represents a list of group call streams +type GroupCallStreams struct { + meta + // A list of group call streams + Streams []*GroupCallStream `json:"streams"` +} + +func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStreams + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStreams) GetClass() string { + return ClassGroupCallStreams +} + +func (*GroupCallStreams) GetType() string { + return TypeGroupCallStreams +} + +// Represents an RTMP url +type RtmpUrl struct { + meta + // The URL + Url string `json:"url"` + // Stream key + StreamKey string `json:"stream_key"` +} + +func (entity *RtmpUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RtmpUrl + + return json.Marshal((*stub)(entity)) +} + +func (*RtmpUrl) GetClass() string { + return ClassRtmpUrl +} + +func (*RtmpUrl) GetType() string { + return TypeRtmpUrl +} + // Describes a recently speaking participant in a group call type GroupCallRecentSpeaker struct { meta @@ -18313,6 +21027,8 @@ type GroupCall struct { EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active IsActive bool `json:"is_active"` + // True, if the chat is an RTMP stream instead of an ordinary video chat + IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` // True, if user was kicked from the call because of network loss and the call needs to be rejoined @@ -18321,6 +21037,8 @@ type GroupCall struct { CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` + // True, if group call participants, which are muted, aren't returned in participant list + HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` // At most 3 recently speaking users in the group call @@ -18391,7 +21109,7 @@ type GroupCallParticipantVideoInfo struct { SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"` // Video channel endpoint identifier EndpointId string `json:"endpoint_id"` - // True if the video is paused. This flag needs to be ignored, if new video frames are received + // True, if the video is paused. This flag needs to be ignored, if new video frames are received IsPaused bool `json:"is_paused"` } @@ -18831,6 +21549,192 @@ func (*PhoneNumberAuthenticationSettings) GetType() string { return TypePhoneNumberAuthenticationSettings } +// Represents a reaction applied to a message +type AddedReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Identifier of the chat member, applied the reaction + SenderId MessageSender `json:"sender_id"` +} + +func (entity *AddedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReaction) GetClass() string { + return ClassAddedReaction +} + +func (*AddedReaction) GetType() string { + return TypeAddedReaction +} + +func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldType, _ := UnmarshalReactionType(tmp.Type) + addedReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + addedReaction.SenderId = fieldSenderId + + return nil +} + +// Represents a list of reactions added to a message +type AddedReactions struct { + meta + // The total number of found reactions + TotalCount int32 `json:"total_count"` + // The list of added reactions + Reactions []*AddedReaction `json:"reactions"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *AddedReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReactions) GetClass() string { + return ClassAddedReactions +} + +func (*AddedReactions) GetType() string { + return TypeAddedReactions +} + +// Represents an available reaction +type AvailableReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // True, if Telegram Premium is needed to send the reaction + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *AvailableReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReaction) GetClass() string { + return ClassAvailableReaction +} + +func (*AvailableReaction) GetType() string { + return TypeAvailableReaction +} + +func (availableReaction *AvailableReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + availableReaction.NeedsPremium = tmp.NeedsPremium + + fieldType, _ := UnmarshalReactionType(tmp.Type) + availableReaction.Type = fieldType + + return nil +} + +// Represents a list of reactions that can be added to a message +type AvailableReactions struct { + meta + // List of reactions to be shown at the top + TopReactions []*AvailableReaction `json:"top_reactions"` + // List of recently used reactions + RecentReactions []*AvailableReaction `json:"recent_reactions"` + // List of popular reactions + PopularReactions []*AvailableReaction `json:"popular_reactions"` + // True, if custom emoji reactions could be added by Telegram Premium subscribers + AllowCustomEmoji bool `json:"allow_custom_emoji"` +} + +func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReactions) GetClass() string { + return ClassAvailableReactions +} + +func (*AvailableReactions) GetType() string { + return TypeAvailableReactions +} + +// Contains information about a emoji reaction +type EmojiReaction struct { + meta + // Text representation of the reaction + Emoji string `json:"emoji"` + // Reaction title + Title string `json:"title"` + // True, if the reaction can be added to new messages and enabled in chats + IsActive bool `json:"is_active"` + // Static icon for the reaction + StaticIcon *Sticker `json:"static_icon"` + // Appear animation for the reaction + AppearAnimation *Sticker `json:"appear_animation"` + // Select animation for the reaction + SelectAnimation *Sticker `json:"select_animation"` + // Activate animation for the reaction + ActivateAnimation *Sticker `json:"activate_animation"` + // Effect animation for the reaction + EffectAnimation *Sticker `json:"effect_animation"` + // Around animation for the reaction; may be null + AroundAnimation *Sticker `json:"around_animation"` + // Center animation for the reaction; may be null + CenterAnimation *Sticker `json:"center_animation"` +} + +func (entity *EmojiReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiReaction + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiReaction) GetClass() string { + return ClassEmojiReaction +} + +func (*EmojiReaction) GetType() string { + return TypeEmojiReaction +} + // Represents a list of animations type Animations struct { meta @@ -18916,7 +21820,7 @@ func (*DiceStickersSlotMachine) DiceStickersType() string { return TypeDiceStickersSlotMachine } -// Represents the result of an ImportContacts request +// Represents the result of an importContacts request type ImportedContacts struct { meta // User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user @@ -18941,6 +21845,190 @@ func (*ImportedContacts) GetType() string { return TypeImportedContacts } +// The speech recognition is ongoing +type SpeechRecognitionResultPending struct { + meta + // Partially recognized text + PartialText string `json:"partial_text"` +} + +func (entity *SpeechRecognitionResultPending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultPending + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultPending) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultPending) GetType() string { + return TypeSpeechRecognitionResultPending +} + +func (*SpeechRecognitionResultPending) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultPending +} + +// The speech recognition successfully finished +type SpeechRecognitionResultText struct { + meta + // Recognized text + Text string `json:"text"` +} + +func (entity *SpeechRecognitionResultText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultText + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultText) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultText) GetType() string { + return TypeSpeechRecognitionResultText +} + +func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultText +} + +// The speech recognition failed +type SpeechRecognitionResultError struct { + meta + // Received error + Error *Error `json:"error"` +} + +func (entity *SpeechRecognitionResultError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultError + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultError) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultError) GetType() string { + return TypeSpeechRecognitionResultError +} + +func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultError +} + +// Describes a color to highlight a bot added to attachment menu +type AttachmentMenuBotColor struct { + meta + // Color in the RGB24 format for light themes + LightColor int32 `json:"light_color"` + // Color in the RGB24 format for dark themes + DarkColor int32 `json:"dark_color"` +} + +func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBotColor + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBotColor) GetClass() string { + return ClassAttachmentMenuBotColor +} + +func (*AttachmentMenuBotColor) GetType() string { + return TypeAttachmentMenuBotColor +} + +// Represents a bot, which can be added to attachment menu +type AttachmentMenuBot struct { + meta + // User identifier of the bot added to attachment menu + BotUserId int64 `json:"bot_user_id"` + // True, if the bot supports opening from attachment menu in the chat with the bot + SupportsSelfChat bool `json:"supports_self_chat"` + // True, if the bot supports opening from attachment menu in private chats with ordinary users + SupportsUserChats bool `json:"supports_user_chats"` + // True, if the bot supports opening from attachment menu in private chats with other bots + SupportsBotChats bool `json:"supports_bot_chats"` + // True, if the bot supports opening from attachment menu in basic group and supergroup chats + SupportsGroupChats bool `json:"supports_group_chats"` + // True, if the bot supports opening from attachment menu in channel chats + SupportsChannelChats bool `json:"supports_channel_chats"` + // True, if the bot supports "settings_button_pressed" event + SupportsSettings bool `json:"supports_settings"` + // True, if the user needs to be requested to give the permission to the bot to send them messages + RequestWriteAccess bool `json:"request_write_access"` + // Name for the bot in attachment menu + Name string `json:"name"` + // Color to highlight selected name of the bot if appropriate; may be null + NameColor *AttachmentMenuBotColor `json:"name_color"` + // Default attachment menu icon for the bot in SVG format; may be null + DefaultIcon *File `json:"default_icon"` + // Attachment menu icon for the bot in SVG format for the official iOS app; may be null + IosStaticIcon *File `json:"ios_static_icon"` + // Attachment menu icon for the bot in TGS format for the official iOS app; may be null + IosAnimatedIcon *File `json:"ios_animated_icon"` + // Attachment menu icon for the bot in TGS format for the official Android app; may be null + AndroidIcon *File `json:"android_icon"` + // Attachment menu icon for the bot in TGS format for the official native macOS app; may be null + MacosIcon *File `json:"macos_icon"` + // Color to highlight selected icon of the bot if appropriate; may be null + IconColor *AttachmentMenuBotColor `json:"icon_color"` + // Default placeholder for opened Web Apps in SVG format; may be null + WebAppPlaceholder *File `json:"web_app_placeholder"` +} + +func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBot) GetClass() string { + return ClassAttachmentMenuBot +} + +func (*AttachmentMenuBot) GetType() string { + return TypeAttachmentMenuBot +} + +// Information about the message sent by answerWebAppQuery +type SentWebAppMessage struct { + meta + // Identifier of the sent inline message, if known + InlineMessageId string `json:"inline_message_id"` +} + +func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SentWebAppMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SentWebAppMessage) GetClass() string { + return ClassSentWebAppMessage +} + +func (*SentWebAppMessage) GetType() string { + return TypeSentWebAppMessage +} + // Contains an HTTP URL type HttpUrl struct { meta @@ -18964,6 +22052,31 @@ func (*HttpUrl) GetType() string { return TypeHttpUrl } +// Contains an HTTPS URL, which can be used to get information about a user +type UserLink struct { + meta + // The URL + Url string `json:"url"` + // Left time for which the link is valid, in seconds; 0 if the link is a public username link + ExpiresIn int32 `json:"expires_in"` +} + +func (entity *UserLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserLink + + return json.Marshal((*stub)(entity)) +} + +func (*UserLink) GetClass() string { + return ClassUserLink +} + +func (*UserLink) GetType() string { + return TypeUserLink +} + // Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video type InputInlineQueryResultAnimation struct { meta @@ -19562,14 +22675,14 @@ func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(da return nil } -// Represents a link to a WEBP or TGS sticker +// Represents a link to a WEBP, TGS, or WEBM sticker type InputInlineQueryResultSticker struct { meta // Unique identifier of the query result Id string `json:"id"` // URL of the sticker thumbnail, if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) + // The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) StickerUrl string `json:"sticker_url"` // Width of the sticker StickerWidth int32 `json:"sticker_width"` @@ -20320,7 +23433,7 @@ func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string { // The payload for a callback button requiring password type CallbackQueryPayloadDataWithPassword struct { meta - // The password for the current user + // The 2-step verification password for the current user Password string `json:"password"` // Data that was attached to the callback button Data []byte `json:"data"` @@ -20507,6 +23620,8 @@ type ChatEventMessageDeleted struct { meta // Deleted message Message *Message `json:"message"` + // True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive + CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"` } func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) { @@ -20529,33 +23644,6 @@ func (*ChatEventMessageDeleted) ChatEventActionType() string { return TypeChatEventMessageDeleted } -// A poll in a message was stopped -type ChatEventPollStopped struct { - meta - // The message with the poll - Message *Message `json:"message"` -} - -func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPollStopped - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPollStopped) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPollStopped) GetType() string { - return TypeChatEventPollStopped -} - -func (*ChatEventPollStopped) ChatEventActionType() string { - return TypeChatEventPollStopped -} - // A message was pinned type ChatEventMessagePinned struct { meta @@ -20610,6 +23698,33 @@ func (*ChatEventMessageUnpinned) ChatEventActionType() string { return TypeChatEventMessageUnpinned } +// A poll in a message was stopped +type ChatEventPollStopped struct { + meta + // The message with the poll + Message *Message `json:"message"` +} + +func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPollStopped + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPollStopped) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPollStopped) GetType() string { + return TypeChatEventPollStopped +} + +func (*ChatEventPollStopped) ChatEventActionType() string { + return TypeChatEventPollStopped +} + // A new member joined the chat type ChatEventMemberJoined struct { meta @@ -20691,31 +23806,6 @@ func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { return TypeChatEventMemberJoinedByRequest } -// A member left the chat -type ChatEventMemberLeft struct { - meta -} - -func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberLeft) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberLeft) GetType() string { - return TypeChatEventMemberLeft -} - -func (*ChatEventMemberLeft) ChatEventActionType() string { - return TypeChatEventMemberLeft -} - // A new chat member was invited type ChatEventMemberInvited struct { meta @@ -20764,6 +23854,31 @@ func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) return nil } +// A member left the chat +type ChatEventMemberLeft struct { + meta +} + +func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberLeft) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberLeft) GetType() string { + return TypeChatEventMemberLeft +} + +func (*ChatEventMemberLeft) ChatEventActionType() string { + return TypeChatEventMemberLeft +} + // A chat member has gained/lost administrator status, or the list of their administrator privileges has changed type ChatEventMemberPromoted struct { meta @@ -20873,62 +23988,53 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [ return nil } -// The chat title was changed -type ChatEventTitleChanged struct { +// The chat available reactions were changed +type ChatEventAvailableReactionsChanged struct { meta - // Previous chat title - OldTitle string `json:"old_title"` - // New chat title - NewTitle string `json:"new_title"` + // Previous chat available reactions + OldAvailableReactions ChatAvailableReactions `json:"old_available_reactions"` + // New chat available reactions + NewAvailableReactions ChatAvailableReactions `json:"new_available_reactions"` } -func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventTitleChanged + type stub ChatEventAvailableReactionsChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventTitleChanged) GetClass() string { +func (*ChatEventAvailableReactionsChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventTitleChanged) GetType() string { - return TypeChatEventTitleChanged +func (*ChatEventAvailableReactionsChanged) GetType() string { + return TypeChatEventAvailableReactionsChanged } -func (*ChatEventTitleChanged) ChatEventActionType() string { - return TypeChatEventTitleChanged +func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { + return TypeChatEventAvailableReactionsChanged } -// The chat permissions was changed -type ChatEventPermissionsChanged struct { - meta - // Previous chat permissions - OldPermissions *ChatPermissions `json:"old_permissions"` - // New chat permissions - NewPermissions *ChatPermissions `json:"new_permissions"` -} +func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) UnmarshalJSON(data []byte) error { + var tmp struct { + OldAvailableReactions json.RawMessage `json:"old_available_reactions"` + NewAvailableReactions json.RawMessage `json:"new_available_reactions"` + } -func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - type stub ChatEventPermissionsChanged + fieldOldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.OldAvailableReactions) + chatEventAvailableReactionsChanged.OldAvailableReactions = fieldOldAvailableReactions - return json.Marshal((*stub)(entity)) -} + fieldNewAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.NewAvailableReactions) + chatEventAvailableReactionsChanged.NewAvailableReactions = fieldNewAvailableReactions -func (*ChatEventPermissionsChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPermissionsChanged) GetType() string { - return TypeChatEventPermissionsChanged -} - -func (*ChatEventPermissionsChanged) ChatEventActionType() string { - return TypeChatEventPermissionsChanged + return nil } // The chat description was changed @@ -20960,91 +24066,6 @@ func (*ChatEventDescriptionChanged) ChatEventActionType() string { return TypeChatEventDescriptionChanged } -// The chat username was changed -type ChatEventUsernameChanged struct { - meta - // Previous chat username - OldUsername string `json:"old_username"` - // New chat username - NewUsername string `json:"new_username"` -} - -func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventUsernameChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventUsernameChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventUsernameChanged) GetType() string { - return TypeChatEventUsernameChanged -} - -func (*ChatEventUsernameChanged) ChatEventActionType() string { - return TypeChatEventUsernameChanged -} - -// The chat photo was changed -type ChatEventPhotoChanged struct { - meta - // Previous chat photo value; may be null - OldPhoto *ChatPhoto `json:"old_photo"` - // New chat photo value; may be null - NewPhoto *ChatPhoto `json:"new_photo"` -} - -func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPhotoChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPhotoChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPhotoChanged) GetType() string { - return TypeChatEventPhotoChanged -} - -func (*ChatEventPhotoChanged) ChatEventActionType() string { - return TypeChatEventPhotoChanged -} - -// The can_invite_users permission of a supergroup chat was toggled -type ChatEventInvitesToggled struct { - meta - // New value of can_invite_users permission - CanInviteUsers bool `json:"can_invite_users"` -} - -func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInvitesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInvitesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInvitesToggled) GetType() string { - return TypeChatEventInvitesToggled -} - -func (*ChatEventInvitesToggled) ChatEventActionType() string { - return TypeChatEventInvitesToggled -} - // The linked chat of a supergroup was changed type ChatEventLinkedChatChanged struct { meta @@ -21074,147 +24095,6 @@ func (*ChatEventLinkedChatChanged) ChatEventActionType() string { return TypeChatEventLinkedChatChanged } -// The slow_mode_delay setting of a supergroup was changed -type ChatEventSlowModeDelayChanged struct { - meta - // Previous value of slow_mode_delay, in seconds - OldSlowModeDelay int32 `json:"old_slow_mode_delay"` - // New value of slow_mode_delay, in seconds - NewSlowModeDelay int32 `json:"new_slow_mode_delay"` -} - -func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSlowModeDelayChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSlowModeDelayChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSlowModeDelayChanged) GetType() string { - return TypeChatEventSlowModeDelayChanged -} - -func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { - return TypeChatEventSlowModeDelayChanged -} - -// The message TTL was changed -type ChatEventMessageTtlChanged struct { - meta - // Previous value of message_ttl - OldMessageTtl int32 `json:"old_message_ttl"` - // New value of message_ttl - NewMessageTtl int32 `json:"new_message_ttl"` -} - -func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageTtlChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageTtlChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageTtlChanged) GetType() string { - return TypeChatEventMessageTtlChanged -} - -func (*ChatEventMessageTtlChanged) ChatEventActionType() string { - return TypeChatEventMessageTtlChanged -} - -// The sign_messages setting of a channel was toggled -type ChatEventSignMessagesToggled struct { - meta - // New value of sign_messages - SignMessages bool `json:"sign_messages"` -} - -func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSignMessagesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSignMessagesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSignMessagesToggled) GetType() string { - return TypeChatEventSignMessagesToggled -} - -func (*ChatEventSignMessagesToggled) ChatEventActionType() string { - return TypeChatEventSignMessagesToggled -} - -// The has_protected_content setting of a channel was toggled -type ChatEventHasProtectedContentToggled struct { - meta - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` -} - -func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventHasProtectedContentToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventHasProtectedContentToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventHasProtectedContentToggled) GetType() string { - return TypeChatEventHasProtectedContentToggled -} - -func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { - return TypeChatEventHasProtectedContentToggled -} - -// The supergroup sticker set was changed -type ChatEventStickerSetChanged struct { - meta - // Previous identifier of the chat sticker set; 0 if none - OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` - // New identifier of the chat sticker set; 0 if none - NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` -} - -func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventStickerSetChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventStickerSetChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventStickerSetChanged) GetType() string { - return TypeChatEventStickerSetChanged -} - -func (*ChatEventStickerSetChanged) ChatEventActionType() string { - return TypeChatEventStickerSetChanged -} - // The supergroup location was changed type ChatEventLocationChanged struct { meta @@ -21244,6 +24124,292 @@ func (*ChatEventLocationChanged) ChatEventActionType() string { return TypeChatEventLocationChanged } +// The message auto-delete timer was changed +type ChatEventMessageAutoDeleteTimeChanged struct { + meta + // Previous value of message_auto_delete_time + OldMessageAutoDeleteTime int32 `json:"old_message_auto_delete_time"` + // New value of message_auto_delete_time + NewMessageAutoDeleteTime int32 `json:"new_message_auto_delete_time"` +} + +func (entity *ChatEventMessageAutoDeleteTimeChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageAutoDeleteTimeChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +// The chat permissions was changed +type ChatEventPermissionsChanged struct { + meta + // Previous chat permissions + OldPermissions *ChatPermissions `json:"old_permissions"` + // New chat permissions + NewPermissions *ChatPermissions `json:"new_permissions"` +} + +func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPermissionsChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPermissionsChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPermissionsChanged) GetType() string { + return TypeChatEventPermissionsChanged +} + +func (*ChatEventPermissionsChanged) ChatEventActionType() string { + return TypeChatEventPermissionsChanged +} + +// The chat photo was changed +type ChatEventPhotoChanged struct { + meta + // Previous chat photo value; may be null + OldPhoto *ChatPhoto `json:"old_photo"` + // New chat photo value; may be null + NewPhoto *ChatPhoto `json:"new_photo"` +} + +func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPhotoChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPhotoChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPhotoChanged) GetType() string { + return TypeChatEventPhotoChanged +} + +func (*ChatEventPhotoChanged) ChatEventActionType() string { + return TypeChatEventPhotoChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + meta + // Previous value of slow_mode_delay, in seconds + OldSlowModeDelay int32 `json:"old_slow_mode_delay"` + // New value of slow_mode_delay, in seconds + NewSlowModeDelay int32 `json:"new_slow_mode_delay"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + +// The supergroup sticker set was changed +type ChatEventStickerSetChanged struct { + meta + // Previous identifier of the chat sticker set; 0 if none + OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` + // New identifier of the chat sticker set; 0 if none + NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` +} + +func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventStickerSetChanged) GetType() string { + return TypeChatEventStickerSetChanged +} + +func (*ChatEventStickerSetChanged) ChatEventActionType() string { + return TypeChatEventStickerSetChanged +} + +// The chat title was changed +type ChatEventTitleChanged struct { + meta + // Previous chat title + OldTitle string `json:"old_title"` + // New chat title + NewTitle string `json:"new_title"` +} + +func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventTitleChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventTitleChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventTitleChanged) GetType() string { + return TypeChatEventTitleChanged +} + +func (*ChatEventTitleChanged) ChatEventActionType() string { + return TypeChatEventTitleChanged +} + +// The chat editable username was changed +type ChatEventUsernameChanged struct { + meta + // Previous chat username + OldUsername string `json:"old_username"` + // New chat username + NewUsername string `json:"new_username"` +} + +func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventUsernameChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventUsernameChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventUsernameChanged) GetType() string { + return TypeChatEventUsernameChanged +} + +func (*ChatEventUsernameChanged) ChatEventActionType() string { + return TypeChatEventUsernameChanged +} + +// The chat active usernames were changed +type ChatEventActiveUsernamesChanged struct { + meta + // Previous list of active usernames + OldUsernames []string `json:"old_usernames"` + // New list of active usernames + NewUsernames []string `json:"new_usernames"` +} + +func (entity *ChatEventActiveUsernamesChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventActiveUsernamesChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventActiveUsernamesChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventActiveUsernamesChanged) GetType() string { + return TypeChatEventActiveUsernamesChanged +} + +func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { + return TypeChatEventActiveUsernamesChanged +} + +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + +// The can_invite_users permission of a supergroup chat was toggled +type ChatEventInvitesToggled struct { + meta + // New value of can_invite_users permission + CanInviteUsers bool `json:"can_invite_users"` +} + +func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInvitesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInvitesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInvitesToggled) GetType() string { + return TypeChatEventInvitesToggled +} + +func (*ChatEventInvitesToggled) ChatEventActionType() string { + return TypeChatEventInvitesToggled +} + // The is_all_history_available setting of a supergroup was toggled type ChatEventIsAllHistoryAvailableToggled struct { meta @@ -21271,6 +24437,60 @@ func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { return TypeChatEventIsAllHistoryAvailableToggled } +// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled +type ChatEventHasAggressiveAntiSpamEnabledToggled struct { + meta + // New value of has_aggressive_anti_spam_enabled + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` +} + +func (entity *ChatEventHasAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasAggressiveAntiSpamEnabledToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) ChatEventActionType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +// The sign_messages setting of a channel was toggled +type ChatEventSignMessagesToggled struct { + meta + // New value of sign_messages + SignMessages bool `json:"sign_messages"` +} + +func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSignMessagesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSignMessagesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSignMessagesToggled) GetType() string { + return TypeChatEventSignMessagesToggled +} + +func (*ChatEventSignMessagesToggled) ChatEventActionType() string { + return TypeChatEventSignMessagesToggled +} + // A chat invite link was edited type ChatEventInviteLinkEdited struct { meta @@ -21408,6 +24628,33 @@ func (*ChatEventVideoChatEnded) ChatEventActionType() string { return TypeChatEventVideoChatEnded } +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + // A video chat participant was muted or unmuted type ChatEventVideoChatParticipantIsMutedToggled struct { meta @@ -21504,31 +24751,197 @@ func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatPartici return nil } -// The mute_new_participants setting of a video chat was toggled -type ChatEventVideoChatMuteNewParticipantsToggled struct { +// The is_forum setting of a channel was toggled +type ChatEventIsForumToggled struct { meta - // New value of the mute_new_participants setting - MuteNewParticipants bool `json:"mute_new_participants"` + // New value of is_forum + IsForum bool `json:"is_forum"` } -func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { +func (entity *ChatEventIsForumToggled) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventVideoChatMuteNewParticipantsToggled + type stub ChatEventIsForumToggled return json.Marshal((*stub)(entity)) } -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { +func (*ChatEventIsForumToggled) GetClass() string { return ClassChatEventAction } -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled +func (*ChatEventIsForumToggled) GetType() string { + return TypeChatEventIsForumToggled } -func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled +func (*ChatEventIsForumToggled) ChatEventActionType() string { + return TypeChatEventIsForumToggled +} + +// A new forum topic was created +type ChatEventForumTopicCreated struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicCreated) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicCreated) GetType() string { + return TypeChatEventForumTopicCreated +} + +func (*ChatEventForumTopicCreated) ChatEventActionType() string { + return TypeChatEventForumTopicCreated +} + +// A forum topic was edited +type ChatEventForumTopicEdited struct { + meta + // Old information about the topic + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // New information about the topic + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicEdited) GetType() string { + return TypeChatEventForumTopicEdited +} + +func (*ChatEventForumTopicEdited) ChatEventActionType() string { + return TypeChatEventForumTopicEdited +} + +// A forum topic was closed or reopened +type ChatEventForumTopicToggleIsClosed struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsClosed + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsClosed) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsClosed) GetType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +// The General forum topic was hidden or unhidden +type ChatEventForumTopicToggleIsHidden struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsHidden + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsHidden) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsHidden) GetType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +// A forum topic was deleted +type ChatEventForumTopicDeleted struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicDeleted) GetType() string { + return TypeChatEventForumTopicDeleted +} + +func (*ChatEventForumTopicDeleted) ChatEventActionType() string { + return TypeChatEventForumTopicDeleted +} + +// A pinned forum topic was changed +type ChatEventForumTopicPinned struct { + meta + // Information about the old pinned topic; may be null + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // Information about the new pinned topic; may be null + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicPinned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicPinned) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicPinned) GetType() string { + return TypeChatEventForumTopicPinned +} + +func (*ChatEventForumTopicPinned) ChatEventActionType() string { + return TypeChatEventForumTopicPinned } // Represents a chat event @@ -21635,6 +25048,8 @@ type ChatEventLogFilters struct { InviteLinkChanges bool `json:"invite_link_changes"` // True, if video chat actions need to be returned VideoChatChanges bool `json:"video_chat_changes"` + // True, if forum-related actions need to be returned + ForumChanges bool `json:"forum_changes"` } func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) { @@ -21680,7 +25095,7 @@ func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { return TypeLanguagePackStringValueOrdinary } -// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info +// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information type LanguagePackStringValuePluralized struct { meta // Value for zero objects @@ -21820,7 +25235,7 @@ type LanguagePackInfo struct { Name string `json:"name"` // Name of the language in that language NativeName string `json:"native_name"` - // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info + // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information PluralCode string `json:"plural_code"` // True, if the language pack is official IsOfficial bool `json:"is_official"` @@ -21879,6 +25294,971 @@ func (*LocalizationTargetInfo) GetType() string { return TypeLocalizationTargetInfo } +// The maximum number of joined supergroups and channels +type PremiumLimitTypeSupergroupCount struct { + meta +} + +func (entity *PremiumLimitTypeSupergroupCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSupergroupCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSupergroupCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSupergroupCount) GetType() string { + return TypePremiumLimitTypeSupergroupCount +} + +func (*PremiumLimitTypeSupergroupCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSupergroupCount +} + +// The maximum number of pinned chats in the main chat list +type PremiumLimitTypePinnedChatCount struct { + meta +} + +func (entity *PremiumLimitTypePinnedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedChatCount) GetType() string { + return TypePremiumLimitTypePinnedChatCount +} + +func (*PremiumLimitTypePinnedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedChatCount +} + +// The maximum number of created public chats +type PremiumLimitTypeCreatedPublicChatCount struct { + meta +} + +func (entity *PremiumLimitTypeCreatedPublicChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCreatedPublicChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +func (*PremiumLimitTypeCreatedPublicChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +// The maximum number of saved animations +type PremiumLimitTypeSavedAnimationCount struct { + meta +} + +func (entity *PremiumLimitTypeSavedAnimationCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSavedAnimationCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSavedAnimationCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSavedAnimationCount) GetType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +func (*PremiumLimitTypeSavedAnimationCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +// The maximum number of favorite stickers +type PremiumLimitTypeFavoriteStickerCount struct { + meta +} + +func (entity *PremiumLimitTypeFavoriteStickerCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeFavoriteStickerCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +// The maximum number of chat filters +type PremiumLimitTypeChatFilterCount struct { + meta +} + +func (entity *PremiumLimitTypeChatFilterCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFilterCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFilterCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFilterCount) GetType() string { + return TypePremiumLimitTypeChatFilterCount +} + +func (*PremiumLimitTypeChatFilterCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFilterCount +} + +// The maximum number of pinned and always included, or always excluded chats in a chat filter +type PremiumLimitTypeChatFilterChosenChatCount struct { + meta +} + +func (entity *PremiumLimitTypeChatFilterChosenChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFilterChosenChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFilterChosenChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFilterChosenChatCount) GetType() string { + return TypePremiumLimitTypeChatFilterChosenChatCount +} + +func (*PremiumLimitTypeChatFilterChosenChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFilterChosenChatCount +} + +// The maximum number of pinned chats in the archive chat list +type PremiumLimitTypePinnedArchivedChatCount struct { + meta +} + +func (entity *PremiumLimitTypePinnedArchivedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedArchivedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +func (*PremiumLimitTypePinnedArchivedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +// The maximum length of sent media caption +type PremiumLimitTypeCaptionLength struct { + meta +} + +func (entity *PremiumLimitTypeCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCaptionLength) GetType() string { + return TypePremiumLimitTypeCaptionLength +} + +func (*PremiumLimitTypeCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCaptionLength +} + +// The maximum length of the user's bio +type PremiumLimitTypeBioLength struct { + meta +} + +func (entity *PremiumLimitTypeBioLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeBioLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeBioLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeBioLength) GetType() string { + return TypePremiumLimitTypeBioLength +} + +func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeBioLength +} + +// Increased limits +type PremiumFeatureIncreasedLimits struct { + meta +} + +func (entity *PremiumFeatureIncreasedLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedLimits + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedLimits) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedLimits) GetType() string { + return TypePremiumFeatureIncreasedLimits +} + +func (*PremiumFeatureIncreasedLimits) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedLimits +} + +// Increased maximum upload file size +type PremiumFeatureIncreasedUploadFileSize struct { + meta +} + +func (entity *PremiumFeatureIncreasedUploadFileSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedUploadFileSize + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +func (*PremiumFeatureIncreasedUploadFileSize) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +// Improved download speed +type PremiumFeatureImprovedDownloadSpeed struct { + meta +} + +func (entity *PremiumFeatureImprovedDownloadSpeed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureImprovedDownloadSpeed + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +func (*PremiumFeatureImprovedDownloadSpeed) PremiumFeatureType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +// The ability to convert voice notes to text +type PremiumFeatureVoiceRecognition struct { + meta +} + +func (entity *PremiumFeatureVoiceRecognition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureVoiceRecognition + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureVoiceRecognition) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureVoiceRecognition) GetType() string { + return TypePremiumFeatureVoiceRecognition +} + +func (*PremiumFeatureVoiceRecognition) PremiumFeatureType() string { + return TypePremiumFeatureVoiceRecognition +} + +// Disabled ads +type PremiumFeatureDisabledAds struct { + meta +} + +func (entity *PremiumFeatureDisabledAds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureDisabledAds + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureDisabledAds) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureDisabledAds) GetType() string { + return TypePremiumFeatureDisabledAds +} + +func (*PremiumFeatureDisabledAds) PremiumFeatureType() string { + return TypePremiumFeatureDisabledAds +} + +// Allowed to use more reactions +type PremiumFeatureUniqueReactions struct { + meta +} + +func (entity *PremiumFeatureUniqueReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueReactions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueReactions) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueReactions) GetType() string { + return TypePremiumFeatureUniqueReactions +} + +func (*PremiumFeatureUniqueReactions) PremiumFeatureType() string { + return TypePremiumFeatureUniqueReactions +} + +// Allowed to use premium stickers with unique effects +type PremiumFeatureUniqueStickers struct { + meta +} + +func (entity *PremiumFeatureUniqueStickers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueStickers + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueStickers) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueStickers) GetType() string { + return TypePremiumFeatureUniqueStickers +} + +func (*PremiumFeatureUniqueStickers) PremiumFeatureType() string { + return TypePremiumFeatureUniqueStickers +} + +// Allowed to use custom emoji stickers in message texts and captions +type PremiumFeatureCustomEmoji struct { + meta +} + +func (entity *PremiumFeatureCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureCustomEmoji) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureCustomEmoji) GetType() string { + return TypePremiumFeatureCustomEmoji +} + +func (*PremiumFeatureCustomEmoji) PremiumFeatureType() string { + return TypePremiumFeatureCustomEmoji +} + +// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram +type PremiumFeatureAdvancedChatManagement struct { + meta +} + +func (entity *PremiumFeatureAdvancedChatManagement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAdvancedChatManagement + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAdvancedChatManagement) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAdvancedChatManagement) GetType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +func (*PremiumFeatureAdvancedChatManagement) PremiumFeatureType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +// A badge in the user's profile +type PremiumFeatureProfileBadge struct { + meta +} + +func (entity *PremiumFeatureProfileBadge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureProfileBadge + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureProfileBadge) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureProfileBadge) GetType() string { + return TypePremiumFeatureProfileBadge +} + +func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { + return TypePremiumFeatureProfileBadge +} + +// A emoji status shown along with the user's name +type PremiumFeatureEmojiStatus struct { + meta +} + +func (entity *PremiumFeatureEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureEmojiStatus) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureEmojiStatus) GetType() string { + return TypePremiumFeatureEmojiStatus +} + +func (*PremiumFeatureEmojiStatus) PremiumFeatureType() string { + return TypePremiumFeatureEmojiStatus +} + +// Profile photo animation on message and chat screens +type PremiumFeatureAnimatedProfilePhoto struct { + meta +} + +func (entity *PremiumFeatureAnimatedProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAnimatedProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +func (*PremiumFeatureAnimatedProfilePhoto) PremiumFeatureType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +// The ability to set a custom emoji as a forum topic icon +type PremiumFeatureForumTopicIcon struct { + meta +} + +func (entity *PremiumFeatureForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureForumTopicIcon) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureForumTopicIcon) GetType() string { + return TypePremiumFeatureForumTopicIcon +} + +func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { + return TypePremiumFeatureForumTopicIcon +} + +// Allowed to set a premium appllication icons +type PremiumFeatureAppIcons struct { + meta +} + +func (entity *PremiumFeatureAppIcons) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAppIcons + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAppIcons) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAppIcons) GetType() string { + return TypePremiumFeatureAppIcons +} + +func (*PremiumFeatureAppIcons) PremiumFeatureType() string { + return TypePremiumFeatureAppIcons +} + +// Contains information about a limit, increased for Premium users +type PremiumLimit struct { + meta + // The type of the limit + Type PremiumLimitType `json:"type"` + // Default value of the limit + DefaultValue int32 `json:"default_value"` + // Value of the limit for Premium users + PremiumValue int32 `json:"premium_value"` +} + +func (entity *PremiumLimit) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimit + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimit) GetClass() string { + return ClassPremiumLimit +} + +func (*PremiumLimit) GetType() string { + return TypePremiumLimit +} + +func (premiumLimit *PremiumLimit) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + DefaultValue int32 `json:"default_value"` + PremiumValue int32 `json:"premium_value"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumLimit.DefaultValue = tmp.DefaultValue + premiumLimit.PremiumValue = tmp.PremiumValue + + fieldType, _ := UnmarshalPremiumLimitType(tmp.Type) + premiumLimit.Type = fieldType + + return nil +} + +// Contains information about features, available to Premium users +type PremiumFeatures struct { + meta + // The list of available features + Features []PremiumFeature `json:"features"` + // The list of limits, increased for Premium users + Limits []*PremiumLimit `json:"limits"` + // An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatures) GetClass() string { + return ClassPremiumFeatures +} + +func (*PremiumFeatures) GetType() string { + return TypePremiumFeatures +} + +func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error { + var tmp struct { + Features []json.RawMessage `json:"features"` + Limits []*PremiumLimit `json:"limits"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeatures.Limits = tmp.Limits + + fieldFeatures, _ := UnmarshalListOfPremiumFeature(tmp.Features) + premiumFeatures.Features = fieldFeatures + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumFeatures.PaymentLink = fieldPaymentLink + + return nil +} + +// A limit was exceeded +type PremiumSourceLimitExceeded struct { + meta + // Type of the exceeded limit + LimitType PremiumLimitType `json:"limit_type"` +} + +func (entity *PremiumSourceLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLimitExceeded) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLimitExceeded) GetType() string { + return TypePremiumSourceLimitExceeded +} + +func (*PremiumSourceLimitExceeded) PremiumSourceType() string { + return TypePremiumSourceLimitExceeded +} + +func (premiumSourceLimitExceeded *PremiumSourceLimitExceeded) UnmarshalJSON(data []byte) error { + var tmp struct { + LimitType json.RawMessage `json:"limit_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldLimitType, _ := UnmarshalPremiumLimitType(tmp.LimitType) + premiumSourceLimitExceeded.LimitType = fieldLimitType + + return nil +} + +// A user tried to use a Premium feature +type PremiumSourceFeature struct { + meta + // The used feature + Feature PremiumFeature `json:"feature"` +} + +func (entity *PremiumSourceFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceFeature) GetType() string { + return TypePremiumSourceFeature +} + +func (*PremiumSourceFeature) PremiumSourceType() string { + return TypePremiumSourceFeature +} + +func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumSourceFeature.Feature = fieldFeature + + return nil +} + +// A user opened an internal link of the type internalLinkTypePremiumFeatures +type PremiumSourceLink struct { + meta + // The referrer from the link + Referrer string `json:"referrer"` +} + +func (entity *PremiumSourceLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLink + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLink) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLink) GetType() string { + return TypePremiumSourceLink +} + +func (*PremiumSourceLink) PremiumSourceType() string { + return TypePremiumSourceLink +} + +// A user opened the Premium features screen from settings +type PremiumSourceSettings struct { + meta +} + +func (entity *PremiumSourceSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceSettings + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceSettings) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceSettings) GetType() string { + return TypePremiumSourceSettings +} + +func (*PremiumSourceSettings) PremiumSourceType() string { + return TypePremiumSourceSettings +} + +// Describes a promotion animation for a Premium feature +type PremiumFeaturePromotionAnimation struct { + meta + // Premium feature + Feature PremiumFeature `json:"feature"` + // Promotion animation for the feature + Animation *Animation `json:"animation"` +} + +func (entity *PremiumFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeaturePromotionAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeaturePromotionAnimation) GetClass() string { + return ClassPremiumFeaturePromotionAnimation +} + +func (*PremiumFeaturePromotionAnimation) GetType() string { + return TypePremiumFeaturePromotionAnimation +} + +func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + Animation *Animation `json:"animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeaturePromotionAnimation.Animation = tmp.Animation + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumFeaturePromotionAnimation.Feature = fieldFeature + + return nil +} + +// Contains state of Telegram Premium subscription and promotion videos for Premium features +type PremiumState struct { + meta + // Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription + State *FormattedText `json:"state"` + // The list of available options for buying Telegram Premium + PaymentOptions []*PremiumPaymentOption `json:"payment_options"` + // The list of available promotion animations for Premium features + Animations []*PremiumFeaturePromotionAnimation `json:"animations"` +} + +func (entity *PremiumState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumState + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumState) GetClass() string { + return ClassPremiumState +} + +func (*PremiumState) GetType() string { + return TypePremiumState +} + +// The user subscribed to Telegram Premium +type StorePaymentPurposePremiumSubscription struct { + meta + // Pass true if this is a restore of a Telegram Premium purchase; only for App Store + IsRestore bool `json:"is_restore"` +} + +func (entity *StorePaymentPurposePremiumSubscription) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumSubscription + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumSubscription) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumSubscription) GetType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +// The user gifted Telegram Premium to another user +type StorePaymentPurposeGiftedPremium struct { + meta + // Identifier of the user for which Premium was gifted + UserId int64 `json:"user_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` +} + +func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposeGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposeGiftedPremium) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposeGiftedPremium) GetType() string { + return TypeStorePaymentPurposeGiftedPremium +} + +func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string { + return TypeStorePaymentPurposeGiftedPremium +} + // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta @@ -22245,7 +26625,7 @@ type BackgroundFillGradient struct { TopColor int32 `json:"top_color"` // A bottom color of the background in the RGB24 format BottomColor int32 `json:"bottom_color"` - // Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 + // Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45 RotationAngle int32 `json:"rotation_angle"` } @@ -22862,29 +27242,54 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The user has too much chats with username, one of them must be made private first -type CheckChatUsernameResultPublicChatsTooMuch struct { +// The username can be purchased at fragment.com +type CheckChatUsernameResultUsernamePurchasable struct { meta } -func (entity *CheckChatUsernameResultPublicChatsTooMuch) MarshalJSON() ([]byte, error) { +func (entity *CheckChatUsernameResultUsernamePurchasable) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultPublicChatsTooMuch + type stub CheckChatUsernameResultUsernamePurchasable return json.Marshal((*stub)(entity)) } -func (*CheckChatUsernameResultPublicChatsTooMuch) GetClass() string { +func (*CheckChatUsernameResultUsernamePurchasable) GetClass() string { return ClassCheckChatUsernameResult } -func (*CheckChatUsernameResultPublicChatsTooMuch) GetType() string { - return TypeCheckChatUsernameResultPublicChatsTooMuch +func (*CheckChatUsernameResultUsernamePurchasable) GetType() string { + return TypeCheckChatUsernameResultUsernamePurchasable } -func (*CheckChatUsernameResultPublicChatsTooMuch) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultPublicChatsTooMuch +func (*CheckChatUsernameResultUsernamePurchasable) CheckChatUsernameResultType() string { + return TypeCheckChatUsernameResultUsernamePurchasable +} + +// The user has too many chats with username, one of them must be made private first +type CheckChatUsernameResultPublicChatsTooMany struct { + meta +} + +func (entity *CheckChatUsernameResultPublicChatsTooMany) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CheckChatUsernameResultPublicChatsTooMany + + return json.Marshal((*stub)(entity)) +} + +func (*CheckChatUsernameResultPublicChatsTooMany) GetClass() string { + return ClassCheckChatUsernameResult +} + +func (*CheckChatUsernameResultPublicChatsTooMany) GetType() string { + return TypeCheckChatUsernameResultPublicChatsTooMany +} + +func (*CheckChatUsernameResultPublicChatsTooMany) CheckChatUsernameResultType() string { + return TypeCheckChatUsernameResultPublicChatsTooMany } // The user can't be a member of a public supergroup @@ -23889,6 +28294,58 @@ func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string { return TypePushMessageContentChatJoinByRequest } +// A new recurrent payment was made by the current user +type PushMessageContentRecurringPayment struct { + meta + // The paid amount + Amount string `json:"amount"` +} + +func (entity *PushMessageContentRecurringPayment) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentRecurringPayment + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentRecurringPayment) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentRecurringPayment) GetType() string { + return TypePushMessageContentRecurringPayment +} + +func (*PushMessageContentRecurringPayment) PushMessageContentType() string { + return TypePushMessageContentRecurringPayment +} + +// A profile photo was suggested to the user +type PushMessageContentSuggestProfilePhoto struct { + meta +} + +func (entity *PushMessageContentSuggestProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentSuggestProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentSuggestProfilePhoto) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentSuggestProfilePhoto) GetType() string { + return TypePushMessageContentSuggestProfilePhoto +} + +func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string { + return TypePushMessageContentSuggestProfilePhoto +} + // A forwarded messages type PushMessageContentMessageForwards struct { meta @@ -23923,7 +28380,7 @@ type PushMessageContentMediaAlbum struct { TotalCount int32 `json:"total_count"` // True, if the album has at least one photo HasPhotos bool `json:"has_photos"` - // True, if the album has at least one video + // True, if the album has at least one video file HasVideos bool `json:"has_videos"` // True, if the album has at least one audio file HasAudios bool `json:"has_audios"` @@ -23956,6 +28413,8 @@ type NotificationTypeNewMessage struct { meta // The message Message *Message `json:"message"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` } func (entity *NotificationTypeNewMessage) MarshalJSON() ([]byte, error) { @@ -24192,6 +28651,62 @@ func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string { return TypeNotificationGroupTypeCalls } +// Describes a notification sound in MP3 format +type NotificationSound struct { + meta + // Unique identifier of the notification sound + Id JsonInt64 `json:"id"` + // Duration of the sound, in seconds + Duration int32 `json:"duration"` + // Point in time (Unix timestamp) when the sound was created + Date int32 `json:"date"` + // Title of the notification sound + Title string `json:"title"` + // Arbitrary data, defined while the sound was uploaded + Data string `json:"data"` + // File containing the sound + Sound *File `json:"sound"` +} + +func (entity *NotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSound) GetClass() string { + return ClassNotificationSound +} + +func (*NotificationSound) GetType() string { + return TypeNotificationSound +} + +// Contains a list of notification sounds +type NotificationSounds struct { + meta + // A list of notification sounds + NotificationSounds []*NotificationSound `json:"notification_sounds"` +} + +func (entity *NotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSounds) GetClass() string { + return ClassNotificationSounds +} + +func (*NotificationSounds) GetType() string { + return TypeNotificationSounds +} + // Contains information about a notification type Notification struct { meta @@ -24199,7 +28714,7 @@ type Notification struct { Id int32 `json:"id"` // Notification date Date int32 `json:"date"` - // True, if the notification was initially silent + // True, if the notification was explicitly sent without sound IsSilent bool `json:"is_silent"` // Notification type Type NotificationType `json:"type"` @@ -25073,6 +29588,31 @@ func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() str return TypeUserPrivacySettingAllowFindingByPhoneNumber } +// A privacy setting for managing whether the user can receive voice and video messages in private chats +type UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages struct { + meta +} + +func (entity *UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetType() string { + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) UserPrivacySettingType() string { + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +} + // Contains information about the period of inactivity after which the current user's account will automatically be deleted type AccountTtl struct { meta @@ -25096,6 +29636,454 @@ func (*AccountTtl) GetType() string { return TypeAccountTtl } +// Contains default auto-delete timer setting for new chats +type MessageAutoDeleteTime struct { + meta + // Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically + Time int32 `json:"time"` +} + +func (entity *MessageAutoDeleteTime) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAutoDeleteTime + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAutoDeleteTime) GetClass() string { + return ClassMessageAutoDeleteTime +} + +func (*MessageAutoDeleteTime) GetType() string { + return TypeMessageAutoDeleteTime +} + +// The session is running on an Android device +type SessionTypeAndroid struct { + meta +} + +func (entity *SessionTypeAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeAndroid) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeAndroid) GetType() string { + return TypeSessionTypeAndroid +} + +func (*SessionTypeAndroid) SessionTypeType() string { + return TypeSessionTypeAndroid +} + +// The session is running on a generic Apple device +type SessionTypeApple struct { + meta +} + +func (entity *SessionTypeApple) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeApple + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeApple) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeApple) GetType() string { + return TypeSessionTypeApple +} + +func (*SessionTypeApple) SessionTypeType() string { + return TypeSessionTypeApple +} + +// The session is running on the Brave browser +type SessionTypeBrave struct { + meta +} + +func (entity *SessionTypeBrave) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeBrave + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeBrave) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeBrave) GetType() string { + return TypeSessionTypeBrave +} + +func (*SessionTypeBrave) SessionTypeType() string { + return TypeSessionTypeBrave +} + +// The session is running on the Chrome browser +type SessionTypeChrome struct { + meta +} + +func (entity *SessionTypeChrome) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeChrome + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeChrome) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeChrome) GetType() string { + return TypeSessionTypeChrome +} + +func (*SessionTypeChrome) SessionTypeType() string { + return TypeSessionTypeChrome +} + +// The session is running on the Edge browser +type SessionTypeEdge struct { + meta +} + +func (entity *SessionTypeEdge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeEdge + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeEdge) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeEdge) GetType() string { + return TypeSessionTypeEdge +} + +func (*SessionTypeEdge) SessionTypeType() string { + return TypeSessionTypeEdge +} + +// The session is running on the Firefox browser +type SessionTypeFirefox struct { + meta +} + +func (entity *SessionTypeFirefox) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeFirefox + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeFirefox) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeFirefox) GetType() string { + return TypeSessionTypeFirefox +} + +func (*SessionTypeFirefox) SessionTypeType() string { + return TypeSessionTypeFirefox +} + +// The session is running on an iPad device +type SessionTypeIpad struct { + meta +} + +func (entity *SessionTypeIpad) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeIpad + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeIpad) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeIpad) GetType() string { + return TypeSessionTypeIpad +} + +func (*SessionTypeIpad) SessionTypeType() string { + return TypeSessionTypeIpad +} + +// The session is running on an iPhone device +type SessionTypeIphone struct { + meta +} + +func (entity *SessionTypeIphone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeIphone + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeIphone) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeIphone) GetType() string { + return TypeSessionTypeIphone +} + +func (*SessionTypeIphone) SessionTypeType() string { + return TypeSessionTypeIphone +} + +// The session is running on a Linux device +type SessionTypeLinux struct { + meta +} + +func (entity *SessionTypeLinux) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeLinux + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeLinux) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeLinux) GetType() string { + return TypeSessionTypeLinux +} + +func (*SessionTypeLinux) SessionTypeType() string { + return TypeSessionTypeLinux +} + +// The session is running on a Mac device +type SessionTypeMac struct { + meta +} + +func (entity *SessionTypeMac) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeMac + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeMac) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeMac) GetType() string { + return TypeSessionTypeMac +} + +func (*SessionTypeMac) SessionTypeType() string { + return TypeSessionTypeMac +} + +// The session is running on the Opera browser +type SessionTypeOpera struct { + meta +} + +func (entity *SessionTypeOpera) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeOpera + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeOpera) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeOpera) GetType() string { + return TypeSessionTypeOpera +} + +func (*SessionTypeOpera) SessionTypeType() string { + return TypeSessionTypeOpera +} + +// The session is running on the Safari browser +type SessionTypeSafari struct { + meta +} + +func (entity *SessionTypeSafari) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeSafari + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeSafari) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeSafari) GetType() string { + return TypeSessionTypeSafari +} + +func (*SessionTypeSafari) SessionTypeType() string { + return TypeSessionTypeSafari +} + +// The session is running on an Ubuntu device +type SessionTypeUbuntu struct { + meta +} + +func (entity *SessionTypeUbuntu) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeUbuntu + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeUbuntu) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeUbuntu) GetType() string { + return TypeSessionTypeUbuntu +} + +func (*SessionTypeUbuntu) SessionTypeType() string { + return TypeSessionTypeUbuntu +} + +// The session is running on an unknown type of device +type SessionTypeUnknown struct { + meta +} + +func (entity *SessionTypeUnknown) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeUnknown + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeUnknown) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeUnknown) GetType() string { + return TypeSessionTypeUnknown +} + +func (*SessionTypeUnknown) SessionTypeType() string { + return TypeSessionTypeUnknown +} + +// The session is running on the Vivaldi browser +type SessionTypeVivaldi struct { + meta +} + +func (entity *SessionTypeVivaldi) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeVivaldi + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeVivaldi) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeVivaldi) GetType() string { + return TypeSessionTypeVivaldi +} + +func (*SessionTypeVivaldi) SessionTypeType() string { + return TypeSessionTypeVivaldi +} + +// The session is running on a Windows device +type SessionTypeWindows struct { + meta +} + +func (entity *SessionTypeWindows) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeWindows + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeWindows) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeWindows) GetType() string { + return TypeSessionTypeWindows +} + +func (*SessionTypeWindows) SessionTypeType() string { + return TypeSessionTypeWindows +} + +// The session is running on an Xbox console +type SessionTypeXbox struct { + meta +} + +func (entity *SessionTypeXbox) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeXbox + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeXbox) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeXbox) GetType() string { + return TypeSessionTypeXbox +} + +func (*SessionTypeXbox) SessionTypeType() string { + return TypeSessionTypeXbox +} + // 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 type Session struct { meta @@ -25103,12 +30091,14 @@ type Session struct { Id JsonInt64 `json:"id"` // True, if this session is the current session IsCurrent bool `json:"is_current"` - // True, if a password is needed to complete authorization of the session + // True, if a 2-step verification password is needed to complete authorization of the session IsPasswordPending bool `json:"is_password_pending"` // True, if incoming secret chats can be accepted by the session 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"` // Telegram API identifier, as provided by the application ApiId int32 `json:"api_id"` // Name of the application, as provided by the application @@ -25151,6 +30141,57 @@ func (*Session) GetType() string { return TypeSession } +func (session *Session) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + IsCurrent bool `json:"is_current"` + IsPasswordPending bool `json:"is_password_pending"` + CanAcceptSecretChats bool `json:"can_accept_secret_chats"` + CanAcceptCalls bool `json:"can_accept_calls"` + Type json.RawMessage `json:"type"` + ApiId int32 `json:"api_id"` + ApplicationName string `json:"application_name"` + ApplicationVersion string `json:"application_version"` + IsOfficialApplication bool `json:"is_official_application"` + DeviceModel string `json:"device_model"` + Platform string `json:"platform"` + SystemVersion string `json:"system_version"` + LogInDate int32 `json:"log_in_date"` + LastActiveDate int32 `json:"last_active_date"` + Ip string `json:"ip"` + Country string `json:"country"` + Region string `json:"region"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + session.Id = tmp.Id + session.IsCurrent = tmp.IsCurrent + session.IsPasswordPending = tmp.IsPasswordPending + session.CanAcceptSecretChats = tmp.CanAcceptSecretChats + session.CanAcceptCalls = tmp.CanAcceptCalls + session.ApiId = tmp.ApiId + session.ApplicationName = tmp.ApplicationName + session.ApplicationVersion = tmp.ApplicationVersion + session.IsOfficialApplication = tmp.IsOfficialApplication + session.DeviceModel = tmp.DeviceModel + session.Platform = tmp.Platform + session.SystemVersion = tmp.SystemVersion + session.LogInDate = tmp.LogInDate + session.LastActiveDate = tmp.LastActiveDate + session.Ip = tmp.Ip + session.Country = tmp.Country + session.Region = tmp.Region + + fieldType, _ := UnmarshalSessionType(tmp.Type) + session.Type = fieldType + + return nil +} + // Contains a list of sessions type Sessions struct { meta @@ -25195,7 +30236,7 @@ type ConnectedWebsite struct { LastActiveDate int32 `json:"last_active_date"` // IP address from which the user was logged in, in human-readable format Ip string `json:"ip"` - // Human-readable description of a country and a region, from which the user was logged in, based on the IP address + // Human-readable description of a country and a region from which the user was logged in, based on the IP address Location string `json:"location"` } @@ -25413,6 +30454,56 @@ func (*ChatReportReasonFake) ChatReportReasonType() string { return TypeChatReportReasonFake } +// The chat has illegal drugs related content +type ChatReportReasonIllegalDrugs struct { + meta +} + +func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonIllegalDrugs + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonIllegalDrugs) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonIllegalDrugs) GetType() string { + return TypeChatReportReasonIllegalDrugs +} + +func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string { + return TypeChatReportReasonIllegalDrugs +} + +// The chat contains messages with personal details +type ChatReportReasonPersonalDetails struct { + meta +} + +func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonPersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonPersonalDetails) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonPersonalDetails) GetType() string { + return TypeChatReportReasonPersonalDetails +} + +func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string { + return TypeChatReportReasonPersonalDetails +} + // A custom reason provided by the user type ChatReportReasonCustom struct { meta @@ -25438,7 +30529,108 @@ func (*ChatReportReasonCustom) ChatReportReasonType() string { return TypeChatReportReasonCustom } -// The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link +// The currently opened chat needs to be kept +type TargetChatCurrent struct { + meta +} + +func (entity *TargetChatCurrent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatCurrent + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatCurrent) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatCurrent) GetType() string { + return TypeTargetChatCurrent +} + +func (*TargetChatCurrent) TargetChatType() string { + return TypeTargetChatCurrent +} + +// The chat needs to be chosen by the user among chats of the specified types +type TargetChatChosen struct { + meta + // True, if private chats with ordinary users are allowed + AllowUserChats bool `json:"allow_user_chats"` + // True, if private chats with other bots are allowed + AllowBotChats bool `json:"allow_bot_chats"` + // True, if basic group and supergroup chats are allowed + AllowGroupChats bool `json:"allow_group_chats"` + // True, if channel chats are allowed + AllowChannelChats bool `json:"allow_channel_chats"` +} + +func (entity *TargetChatChosen) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatChosen + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatChosen) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatChosen) GetType() string { + return TypeTargetChatChosen +} + +func (*TargetChatChosen) TargetChatType() string { + return TypeTargetChatChosen +} + +// The chat needs to be open with the provided internal link +type TargetChatInternalLink struct { + meta + // An internal link pointing to the chat + Link InternalLinkType `json:"link"` +} + +func (entity *TargetChatInternalLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatInternalLink + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatInternalLink) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatInternalLink) GetType() string { + return TypeTargetChatInternalLink +} + +func (*TargetChatInternalLink) TargetChatType() string { + return TypeTargetChatInternalLink +} + +func (targetChatInternalLink *TargetChatInternalLink) UnmarshalJSON(data []byte) error { + var tmp struct { + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + targetChatInternalLink.Link = fieldLink + + return nil +} + +// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link type InternalLinkTypeActiveSessions struct { meta } @@ -25463,6 +30655,58 @@ func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { return TypeInternalLinkTypeActiveSessions } +// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL +type InternalLinkTypeAttachmentMenuBot struct { + meta + // Target chat to be opened + TargetChat TargetChat `json:"target_chat"` + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeAttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeAttachmentMenuBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeAttachmentMenuBot) GetType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error { + var tmp struct { + TargetChat json.RawMessage `json:"target_chat"` + BotUsername string `json:"bot_username"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername + internalLinkTypeAttachmentMenuBot.Url = tmp.Url + + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + internalLinkTypeAttachmentMenuBot.TargetChat = fieldTargetChat + + return nil +} + // The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode type InternalLinkTypeAuthenticationCode struct { meta @@ -25524,6 +30768,8 @@ type InternalLinkTypeBotStart struct { BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` + // True, if sendBotStartMessage must be called automatically without showing the START button + Autostart bool `json:"autostart"` } func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) { @@ -25546,13 +30792,15 @@ func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStart } -// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. type InternalLinkTypeBotStartInGroup struct { meta // Username of the bot BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` + // Expected administrator rights for the bot; may be null + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` } func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { @@ -25575,6 +30823,35 @@ func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStartInGroup } +// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights +type InternalLinkTypeBotAddToChannel struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // Expected administrator rights for the bot + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` +} + +func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotAddToChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotAddToChannel) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotAddToChannel) GetType() string { + return TypeInternalLinkTypeBotAddToChannel +} + +func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotAddToChannel +} + // The link is a link to the change phone number section of the app type InternalLinkTypeChangePhoneNumber struct { meta @@ -25627,7 +30904,57 @@ func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatInvite } -// The link is a link to the filter settings section of the app +// The link is a link to the default message auto-delete timer settings section of the app settings +type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct { + meta +} + +func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +} + +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +} + +// The link is a link to the edit profile section of the app settings +type InternalLinkTypeEditProfileSettings struct { + meta +} + +func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeEditProfileSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeEditProfileSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeEditProfileSettings) GetType() string { + return TypeInternalLinkTypeEditProfileSettings +} + +func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeEditProfileSettings +} + +// The link is a link to the filter section of the app settings type InternalLinkTypeFilterSettings struct { meta } @@ -25681,6 +31008,62 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string { return TypeInternalLinkTypeGame } +// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link +type InternalLinkTypeInstantView struct { + meta + // URL to be passed to getWebPageInstantView + Url string `json:"url"` + // An URL to open if getWebPageInstantView fails + FallbackUrl string `json:"fallback_url"` +} + +func (entity *InternalLinkTypeInstantView) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeInstantView + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeInstantView) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeInstantView) GetType() string { + return TypeInternalLinkTypeInstantView +} + +func (*InternalLinkTypeInstantView) InternalLinkTypeType() string { + return TypeInternalLinkTypeInstantView +} + +// The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link +type InternalLinkTypeInvoice struct { + meta + // Name of the invoice + InvoiceName string `json:"invoice_name"` +} + +func (entity *InternalLinkTypeInvoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeInvoice + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeInvoice) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeInvoice) GetType() string { + return TypeInternalLinkTypeInvoice +} + +func (*InternalLinkTypeInvoice) InternalLinkTypeType() string { + return TypeInternalLinkTypeInvoice +} + // The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link type InternalLinkTypeLanguagePack struct { meta @@ -25708,7 +31091,32 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link +// The link is a link to the language section of the app settings +type InternalLinkTypeLanguageSettings struct { + meta +} + +func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeLanguageSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeLanguageSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeLanguageSettings) GetType() string { + return TypeInternalLinkTypeLanguageSettings +} + +func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeLanguageSettings +} + +// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link type InternalLinkTypeMessage struct { meta // URL to be passed to getMessageLinkInfo @@ -25764,7 +31172,7 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { return TypeInternalLinkTypeMessageDraft } -// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it +// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application, otherwise ignore it type InternalLinkTypePassportDataRequest struct { meta // User identifier of the service's bot @@ -25828,6 +31236,58 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { return TypeInternalLinkTypePhoneNumberConfirmation } +// The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link +type InternalLinkTypePremiumFeatures struct { + meta + // Referrer specified in the link + Referrer string `json:"referrer"` +} + +func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumFeatures) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumFeatures) GetType() string { + return TypeInternalLinkTypePremiumFeatures +} + +func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumFeatures +} + +// The link is a link to the privacy and security section of the app settings +type InternalLinkTypePrivacyAndSecuritySettings struct { + meta +} + +func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePrivacyAndSecuritySettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta @@ -25932,7 +31392,32 @@ func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string { return TypeInternalLinkTypeQrCodeAuthentication } -// The link is a link to app settings +// The link forces restore of App Store purchases when opened. For official iOS application only +type InternalLinkTypeRestorePurchases struct { + meta +} + +func (entity *InternalLinkTypeRestorePurchases) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeRestorePurchases + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeRestorePurchases) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeRestorePurchases) GetType() string { + return TypeInternalLinkTypeRestorePurchases +} + +func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { + return TypeInternalLinkTypeRestorePurchases +} + +// The link is a link to application settings type InternalLinkTypeSettings struct { meta } @@ -25962,6 +31447,8 @@ type InternalLinkTypeStickerSet struct { meta // Name of the sticker set StickerSetName string `json:"sticker_set_name"` + // True, if the sticker set is expected to contain custom emoji + ExpectCustomEmoji bool `json:"expect_custom_emoji"` } func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) { @@ -26011,7 +31498,7 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } -// The link is a link to the theme settings section of the app +// The link is a link to the theme section of the app settings type InternalLinkTypeThemeSettings struct { meta } @@ -26088,7 +31575,61 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link +type InternalLinkTypeUserPhoneNumber struct { + meta + // Phone number of the user + PhoneNumber string `json:"phone_number"` +} + +func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUserPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUserPhoneNumber) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUserPhoneNumber) GetType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link +type InternalLinkTypeUserToken struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUserToken + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUserToken) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUserToken) GetType() string { + return TypeInternalLinkTypeUserToken +} + +func (*InternalLinkTypeUserToken) InternalLinkTypeType() string { + return TypeInternalLinkTypeUserToken +} + +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link type InternalLinkTypeVideoChat struct { meta // Username of the chat with the video chat @@ -26119,10 +31660,10 @@ func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { return TypeInternalLinkTypeVideoChat } -// Contains an HTTPS link to a message in a supergroup or channel +// Contains an HTTPS link to a message in a supergroup or channel, or a forum topic type MessageLink struct { meta - // Message link + // The link Link string `json:"link"` // True, if the link will work for non-members of the chat IsPublic bool `json:"is_public"` @@ -26144,21 +31685,21 @@ func (*MessageLink) GetType() string { return TypeMessageLink } -// Contains information about a link to a message in a chat +// Contains information about a link to a message or a forum topic in a chat type MessageLinkInfo struct { meta - // True, if the link is a public link for a message in a chat + // True, if the link is a public link for a message or a forum topic in a chat IsPublic bool `json:"is_public"` - // If found, identifier of the chat to which the message belongs, 0 otherwise + // If found, identifier of the chat to which the link points, 0 otherwise ChatId int64 `json:"chat_id"` + // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing + MessageThreadId int64 `json:"message_thread_id"` // If found, the linked message; may be null Message *Message `json:"message"` // Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview MediaTimestamp int32 `json:"media_timestamp"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` - // True, if the message is linked as a channel post comment or from a message thread - ForComment bool `json:"for_comment"` } func (entity *MessageLinkInfo) MarshalJSON() ([]byte, error) { @@ -26300,6 +31841,31 @@ func (*FileTypeDocument) FileTypeType() string { return TypeFileTypeDocument } +// The file is a notification sound +type FileTypeNotificationSound struct { + meta +} + +func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeNotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeNotificationSound) GetClass() string { + return ClassFileType +} + +func (*FileTypeNotificationSound) GetType() string { + return TypeFileTypeNotificationSound +} + +func (*FileTypeNotificationSound) FileTypeType() string { + return TypeFileTypeNotificationSound +} + // The file is a photo type FileTypePhoto struct { meta @@ -27049,9 +32615,9 @@ type AutoDownloadSettings struct { // The maximum size of a photo file to be auto-downloaded, in bytes MaxPhotoFileSize int32 `json:"max_photo_file_size"` // The maximum size of a video file to be auto-downloaded, in bytes - MaxVideoFileSize int32 `json:"max_video_file_size"` + MaxVideoFileSize int64 `json:"max_video_file_size"` // The maximum size of other file types to be auto-downloaded, in bytes - MaxOtherFileSize int32 `json:"max_other_file_size"` + MaxOtherFileSize int64 `json:"max_other_file_size"` // The maximum suggested bitrate for uploaded videos, in kbit/s VideoUploadBitrate int32 `json:"video_upload_bitrate"` // True, if the beginning of video files needs to be preloaded for instant playback @@ -27462,7 +33028,7 @@ func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string { // A chat invite link type TMeUrlTypeChatInvite struct { meta - // Chat invite link info + // Information about the chat invite link Info *ChatInviteLinkInfo `json:"info"` } @@ -27803,6 +33369,29 @@ func (*Seconds) GetType() string { return TypeSeconds } +// Contains size of downloaded prefix of a file +type FileDownloadedPrefixSize struct { + meta + // The prefix size, in bytes + Size int64 `json:"size"` +} + +func (entity *FileDownloadedPrefixSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileDownloadedPrefixSize + + return json.Marshal((*stub)(entity)) +} + +func (*FileDownloadedPrefixSize) GetClass() string { + return ClassFileDownloadedPrefixSize +} + +func (*FileDownloadedPrefixSize) GetType() string { + return TypeFileDownloadedPrefixSize +} + // Contains information about a tg: deep link type DeepLinkInfo struct { meta @@ -28050,41 +33639,40 @@ func (*Proxies) GetType() string { return TypeProxies } -// A static sticker in PNG format, which will be converted to WEBP server-side -type InputStickerStatic struct { +// A sticker to be added to a sticker set +type InputSticker struct { meta - // PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square + // File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` // Emojis corresponding to the sticker Emojis string `json:"emojis"` - // For masks, position where the mask is placed; pass null if unspecified + // Sticker format + Format StickerFormat `json:"format"` + // Position where the mask is placed; pass null if not specified MaskPosition *MaskPosition `json:"mask_position"` } -func (entity *InputStickerStatic) MarshalJSON() ([]byte, error) { +func (entity *InputSticker) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputStickerStatic + type stub InputSticker return json.Marshal((*stub)(entity)) } -func (*InputStickerStatic) GetClass() string { +func (*InputSticker) GetClass() string { return ClassInputSticker } -func (*InputStickerStatic) GetType() string { - return TypeInputStickerStatic +func (*InputSticker) GetType() string { + return TypeInputSticker } -func (*InputStickerStatic) InputStickerType() string { - return TypeInputStickerStatic -} - -func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { +func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { var tmp struct { Sticker json.RawMessage `json:"sticker"` Emojis string `json:"emojis"` + Format json.RawMessage `json:"format"` MaskPosition *MaskPosition `json:"mask_position"` } @@ -28093,59 +33681,14 @@ func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { return err } - inputStickerStatic.Emojis = tmp.Emojis - inputStickerStatic.MaskPosition = tmp.MaskPosition + inputSticker.Emojis = tmp.Emojis + inputSticker.MaskPosition = tmp.MaskPosition fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerStatic.Sticker = fieldSticker + inputSticker.Sticker = fieldSticker - return nil -} - -// An animated sticker in TGS format -type InputStickerAnimated struct { - meta - // File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements - Sticker InputFile `json:"sticker"` - // Emojis corresponding to the sticker - Emojis string `json:"emojis"` -} - -func (entity *InputStickerAnimated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputStickerAnimated - - return json.Marshal((*stub)(entity)) -} - -func (*InputStickerAnimated) GetClass() string { - return ClassInputSticker -} - -func (*InputStickerAnimated) GetType() string { - return TypeInputStickerAnimated -} - -func (*InputStickerAnimated) InputStickerType() string { - return TypeInputStickerAnimated -} - -func (inputStickerAnimated *InputStickerAnimated) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Emojis string `json:"emojis"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputStickerAnimated.Emojis = tmp.Emojis - - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerAnimated.Sticker = fieldSticker + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + inputSticker.Format = fieldFormat return nil } @@ -29263,7 +34806,7 @@ func (*UpdateMessageInteractionInfo) UpdateType() string { return TypeUpdateMessageInteractionInfo } -// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for self-destructing messages +// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer type UpdateMessageContentOpened struct { meta // Chat identifier @@ -29323,6 +34866,39 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } +// The list of unread reactions added to a message was changed +type UpdateMessageUnreadReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // The new list of unread reactions + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + // The new number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageUnreadReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageUnreadReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageUnreadReactions) GetType() string { + return TypeUpdateMessageUnreadReactions +} + +func (*UpdateMessageUnreadReactions) UpdateType() string { + return TypeUpdateMessageUnreadReactions +} + // A message with a live location was viewed. When the update is received, the application is supposed to update the live location type UpdateMessageLiveLocationViewed struct { meta @@ -29634,6 +35210,54 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } +// The chat available reactions were changed +type UpdateChatAvailableReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new reactions, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` +} + +func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAvailableReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAvailableReactions) GetType() string { + return TypeUpdateChatAvailableReactions +} + +func (*UpdateChatAvailableReactions) UpdateType() string { + return TypeUpdateChatAvailableReactions +} + +func (updateChatAvailableReactions *UpdateChatAvailableReactions) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + AvailableReactions json.RawMessage `json:"available_reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatAvailableReactions.ChatId = tmp.ChatId + + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + updateChatAvailableReactions.AvailableReactions = fieldAvailableReactions + + return nil +} + // A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied type UpdateChatDraftMessage struct { meta @@ -29713,33 +35337,33 @@ func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byt return nil } -// The message Time To Live setting for a chat was changed -type UpdateChatMessageTtl struct { +// The message auto-delete or self-destruct timer setting for a chat was changed +type UpdateChatMessageAutoDeleteTime struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of message_ttl - MessageTtl int32 `json:"message_ttl"` + // New value of message_auto_delete_time + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } -func (entity *UpdateChatMessageTtl) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatMessageTtl + type stub UpdateChatMessageAutoDeleteTime return json.Marshal((*stub)(entity)) } -func (*UpdateChatMessageTtl) GetClass() string { +func (*UpdateChatMessageAutoDeleteTime) GetClass() string { return ClassUpdate } -func (*UpdateChatMessageTtl) GetType() string { - return TypeUpdateChatMessageTtl +func (*UpdateChatMessageAutoDeleteTime) GetType() string { + return TypeUpdateChatMessageAutoDeleteTime } -func (*UpdateChatMessageTtl) UpdateType() string { - return TypeUpdateChatMessageTtl +func (*UpdateChatMessageAutoDeleteTime) UpdateType() string { + return TypeUpdateChatMessageAutoDeleteTime } // Notification settings for a chat were changed @@ -29887,6 +35511,35 @@ func (*UpdateChatUnreadMentionCount) UpdateType() string { return TypeUpdateChatUnreadMentionCount } +// The chat unread_reaction_count has changed +type UpdateChatUnreadReactionCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadReactionCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadReactionCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadReactionCount) GetType() string { + return TypeUpdateChatUnreadReactionCount +} + +func (*UpdateChatUnreadReactionCount) UpdateType() string { + return TypeUpdateChatUnreadReactionCount +} + // A chat video chat state has changed type UpdateChatVideoChat struct { meta @@ -30066,6 +35719,8 @@ type UpdateChatFilters struct { meta // The new list of chat filters ChatFilters []*ChatFilterInfo `json:"chat_filters"` + // Position of the main chat list among chat filters, 0-based + MainChatListPosition int32 `json:"main_chat_list_position"` } func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) { @@ -30088,7 +35743,7 @@ func (*UpdateChatFilters) UpdateType() string { return TypeUpdateChatFilters } -// The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed +// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed type UpdateChatOnlineMemberCount struct { meta // Identifier of the chat @@ -30117,6 +35772,35 @@ func (*UpdateChatOnlineMemberCount) UpdateType() string { return TypeUpdateChatOnlineMemberCount } +// Basic information about a topic in a forum chat was changed +type UpdateForumTopicInfo struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the topic + Info *ForumTopicInfo `json:"info"` +} + +func (entity *UpdateForumTopicInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateForumTopicInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateForumTopicInfo) GetClass() string { + return ClassUpdate +} + +func (*UpdateForumTopicInfo) GetType() string { + return TypeUpdateForumTopicInfo +} + +func (*UpdateForumTopicInfo) UpdateType() string { + return TypeUpdateForumTopicInfo +} + // Notification settings for some type of chats were updated type UpdateScopeNotificationSettings struct { meta @@ -30205,8 +35889,8 @@ type UpdateNotificationGroup struct { ChatId int64 `json:"chat_id"` // Chat identifier, which notification settings must be applied to the added notifications NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - // True, if the notifications must be shown without sound - IsSilent bool `json:"is_silent"` + // Identifier of the notification sound to be played; 0 if sound is disabled + NotificationSoundId JsonInt64 `json:"notification_sound_id"` // Total number of unread notifications in the group, can be bigger than number of active notifications TotalCount int32 `json:"total_count"` // List of added group notifications, sorted by notification ID @@ -30241,7 +35925,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt Type json.RawMessage `json:"type"` ChatId int64 `json:"chat_id"` NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - IsSilent bool `json:"is_silent"` + NotificationSoundId JsonInt64 `json:"notification_sound_id"` TotalCount int32 `json:"total_count"` AddedNotifications []*Notification `json:"added_notifications"` RemovedNotificationIds []int32 `json:"removed_notification_ids"` @@ -30255,7 +35939,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId updateNotificationGroup.ChatId = tmp.ChatId updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId - updateNotificationGroup.IsSilent = tmp.IsSilent + updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId updateNotificationGroup.TotalCount = tmp.TotalCount updateNotificationGroup.AddedNotifications = tmp.AddedNotifications updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds @@ -30791,6 +36475,128 @@ func (*UpdateFileGenerationStop) UpdateType() string { return TypeUpdateFileGenerationStop } +// The state of the file download list has changed +type UpdateFileDownloads struct { + meta + // Total size of files in the file download list, in bytes + TotalSize int64 `json:"total_size"` + // Total number of files in the file download list + TotalCount int32 `json:"total_count"` + // Total downloaded size of files in the file download list, in bytes + DownloadedSize int64 `json:"downloaded_size"` +} + +func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownloads) GetType() string { + return TypeUpdateFileDownloads +} + +func (*UpdateFileDownloads) UpdateType() string { + return TypeUpdateFileDownloads +} + +// A file was added to the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileAddedToDownloads struct { + meta + // The added file download + FileDownload *FileDownload `json:"file_download"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileAddedToDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileAddedToDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileAddedToDownloads) GetType() string { + return TypeUpdateFileAddedToDownloads +} + +func (*UpdateFileAddedToDownloads) UpdateType() string { + return TypeUpdateFileAddedToDownloads +} + +// A file download was changed. This update is sent only after file download list is loaded for the first time +type UpdateFileDownload struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownload + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownload) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownload) GetType() string { + return TypeUpdateFileDownload +} + +func (*UpdateFileDownload) UpdateType() string { + return TypeUpdateFileDownload +} + +// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileRemovedFromDownloads struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileRemovedFromDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileRemovedFromDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileRemovedFromDownloads) GetType() string { + return TypeUpdateFileRemovedFromDownloads +} + +func (*UpdateFileRemovedFromDownloads) UpdateType() string { + return TypeUpdateFileRemovedFromDownloads +} + // New call was created or information about a call was updated type UpdateCall struct { meta @@ -31145,8 +36951,8 @@ func (*UpdateStickerSet) UpdateType() string { // The list of installed sticker sets was updated type UpdateInstalledStickerSets struct { meta - // True, if the list of installed mask sticker sets was updated - IsMasks bool `json:"is_masks"` + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` // The new list of installed ordinary sticker sets StickerSetIds []JsonInt64 `json:"sticker_set_ids"` } @@ -31171,11 +36977,32 @@ func (*UpdateInstalledStickerSets) UpdateType() string { return TypeUpdateInstalledStickerSets } +func (updateInstalledStickerSets *UpdateInstalledStickerSets) UnmarshalJSON(data []byte) error { + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSetIds []JsonInt64 `json:"sticker_set_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateInstalledStickerSets.StickerSetIds = tmp.StickerSetIds + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateInstalledStickerSets.StickerType = fieldStickerType + + return nil +} + // The list of trending sticker sets was updated or some of them were viewed type UpdateTrendingStickerSets struct { meta + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` // The prefix of the list of trending sticker sets with the newest trending sticker sets - StickerSets *StickerSets `json:"sticker_sets"` + StickerSets *TrendingStickerSets `json:"sticker_sets"` } func (entity *UpdateTrendingStickerSets) MarshalJSON() ([]byte, error) { @@ -31198,6 +37025,25 @@ func (*UpdateTrendingStickerSets) UpdateType() string { return TypeUpdateTrendingStickerSets } +func (updateTrendingStickerSets *UpdateTrendingStickerSets) UnmarshalJSON(data []byte) error { + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSets *TrendingStickerSets `json:"sticker_sets"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateTrendingStickerSets.StickerSets = tmp.StickerSets + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateTrendingStickerSets.StickerType = fieldStickerType + + return nil +} + // The list of recently used stickers was updated type UpdateRecentStickers struct { meta @@ -31281,6 +37127,33 @@ func (*UpdateSavedAnimations) UpdateType() string { return TypeUpdateSavedAnimations } +// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time +type UpdateSavedNotificationSounds struct { + meta + // The new list of identifiers of saved notification sounds + NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` +} + +func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedNotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedNotificationSounds) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedNotificationSounds) GetType() string { + return TypeUpdateSavedNotificationSounds +} + +func (*UpdateSavedNotificationSounds) UpdateType() string { + return TypeUpdateSavedNotificationSounds +} + // The selected background has changed type UpdateSelectedBackground struct { meta @@ -31467,6 +37340,130 @@ func (*UpdateUsersNearby) UpdateType() string { return TypeUpdateUsersNearby } +// The list of bots added to attachment menu has changed +type UpdateAttachmentMenuBots struct { + meta + // The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen + Bots []*AttachmentMenuBot `json:"bots"` +} + +func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAttachmentMenuBots + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAttachmentMenuBots) GetClass() string { + return ClassUpdate +} + +func (*UpdateAttachmentMenuBots) GetType() string { + return TypeUpdateAttachmentMenuBots +} + +func (*UpdateAttachmentMenuBots) UpdateType() string { + return TypeUpdateAttachmentMenuBots +} + +// A message was sent by an opened Web App, so the Web App needs to be closed +type UpdateWebAppMessageSent struct { + meta + // Identifier of Web App launch + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebAppMessageSent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebAppMessageSent) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebAppMessageSent) GetType() string { + return TypeUpdateWebAppMessageSent +} + +func (*UpdateWebAppMessageSent) UpdateType() string { + return TypeUpdateWebAppMessageSent +} + +// The list of active emoji reactions has changed +type UpdateActiveEmojiReactions struct { + meta + // The new list of active emoji reactions + Emojis []string `json:"emojis"` +} + +func (entity *UpdateActiveEmojiReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateActiveEmojiReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateActiveEmojiReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateActiveEmojiReactions) GetType() string { + return TypeUpdateActiveEmojiReactions +} + +func (*UpdateActiveEmojiReactions) UpdateType() string { + return TypeUpdateActiveEmojiReactions +} + +// The type of default reaction has changed +type UpdateDefaultReactionType struct { + meta + // The new type of the default reaction + ReactionType ReactionType `json:"reaction_type"` +} + +func (entity *UpdateDefaultReactionType) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateDefaultReactionType + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateDefaultReactionType) GetClass() string { + return ClassUpdate +} + +func (*UpdateDefaultReactionType) GetType() string { + return TypeUpdateDefaultReactionType +} + +func (*UpdateDefaultReactionType) UpdateType() string { + return TypeUpdateDefaultReactionType +} + +func (updateDefaultReactionType *UpdateDefaultReactionType) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + updateDefaultReactionType.ReactionType = fieldReactionType + + return nil +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -31525,7 +37522,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 has changed type UpdateAnimationSearchParameters struct { meta // Name of the animation search provider @@ -31612,7 +37609,7 @@ type UpdateNewInlineQuery struct { SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` - // The type of the chat, from which the query originated; may be null if unknown + // The type of the chat from which the query originated; may be null if unknown ChatType ChatType `json:"chat_type"` // Text of the query Query string `json:"query"` @@ -31711,7 +37708,7 @@ type UpdateNewCallbackQuery struct { SenderUserId int64 `json:"sender_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` - // Identifier of the message, from which the query originated + // Identifier of the message from which the query originated MessageId int64 `json:"message_id"` // Identifier that uniquely corresponds to the chat to which the message was sent ChatInstance JsonInt64 `json:"chat_instance"` @@ -31773,7 +37770,7 @@ type UpdateNewInlineCallbackQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int64 `json:"sender_user_id"` - // Identifier of the inline message, from which the query originated + // Identifier of the inline message from which the query originated InlineMessageId string `json:"inline_message_id"` // An identifier uniquely corresponding to the chat a message was sent to ChatInstance JsonInt64 `json:"chat_instance"` @@ -32248,6 +38245,33 @@ func (*LogTags) GetType() string { return TypeLogTags } +// Contains custom information about the user +type UserSupportInfo struct { + meta + // Information message + Message *FormattedText `json:"message"` + // Information author + Author string `json:"author"` + // Information change date + Date int32 `json:"date"` +} + +func (entity *UserSupportInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserSupportInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UserSupportInfo) GetClass() string { + return ClassUserSupportInfo +} + +func (*UserSupportInfo) GetType() string { + return TypeUserSupportInfo +} + // A simple object containing a number; for testing only type TestInt struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 8c5bac0..10bec12 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -31,6 +31,9 @@ func UnmarshalAuthenticationCodeType(data json.RawMessage) (AuthenticationCodeTy case TypeAuthenticationCodeTypeMissedCall: return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -50,6 +53,43 @@ func UnmarshalListOfAuthenticationCodeType(dataList []json.RawMessage) ([]Authen return list, nil } +func UnmarshalEmailAddressAuthentication(data json.RawMessage) (EmailAddressAuthentication, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) + + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) + + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmailAddressAuthentication(dataList []json.RawMessage) ([]EmailAddressAuthentication, error) { + list := []EmailAddressAuthentication{} + + for _, data := range dataList { + entity, err := UnmarshalEmailAddressAuthentication(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, error) { var meta meta @@ -62,12 +102,15 @@ func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, erro case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) @@ -163,20 +206,23 @@ func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -237,6 +283,117 @@ func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) { return list, nil } +func UnmarshalStickerFormat(data json.RawMessage) (StickerFormat, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) + + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) + + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerFormat(dataList []json.RawMessage) ([]StickerFormat, error) { + list := []StickerFormat{} + + for _, data := range dataList { + entity, err := UnmarshalStickerFormat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerType(dataList []json.RawMessage) ([]StickerType, error) { + list := []StickerType{} + + for _, data := range dataList { + entity, err := UnmarshalStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStickerFullType(data json.RawMessage) (StickerFullType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) + + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) + + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerFullType(dataList []json.RawMessage) ([]StickerFullType, error) { + list := []StickerFullType{} + + for _, data := range dataList { + entity, err := UnmarshalStickerFullType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPollType(data json.RawMessage) (PollType, error) { var meta meta @@ -609,6 +766,40 @@ func UnmarshalListOfMessageForwardOrigin(dataList []json.RawMessage) ([]MessageF return list, nil } +func UnmarshalReactionType(data json.RawMessage) (ReactionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) + + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReactionType(dataList []json.RawMessage) ([]ReactionType, error) { + list := []ReactionType{} + + for _, data := range dataList { + entity, err := UnmarshalReactionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalMessageSendingState(data json.RawMessage) (MessageSendingState, error) { var meta meta @@ -791,6 +982,40 @@ func UnmarshalListOfChatSource(dataList []json.RawMessage) ([]ChatSource, error) return list, nil } +func UnmarshalChatAvailableReactions(data json.RawMessage) (ChatAvailableReactions, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) + + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatAvailableReactions(dataList []json.RawMessage) ([]ChatAvailableReactions, error) { + list := []ChatAvailableReactions{} + + for _, data := range dataList { + entity, err := UnmarshalChatAvailableReactions(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPublicChatType(data json.RawMessage) (PublicChatType, error) { var meta meta @@ -895,6 +1120,9 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -929,6 +1157,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -1348,6 +1579,117 @@ func UnmarshalListOfInputCredentials(dataList []json.RawMessage) ([]InputCredent return list, nil } +func UnmarshalPaymentProvider(data json.RawMessage) (PaymentProvider, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) + + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) + + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPaymentProvider(dataList []json.RawMessage) ([]PaymentProvider, error) { + list := []PaymentProvider{} + + for _, data := range dataList { + entity, err := UnmarshalPaymentProvider(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputInvoice(data json.RawMessage) (InputInvoice, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) + + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputInvoice(dataList []json.RawMessage) ([]InputInvoice, error) { + list := []InputInvoice{} + + for _, data := range dataList { + entity, err := UnmarshalInputInvoice(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageExtendedMedia(data json.RawMessage) (MessageExtendedMedia, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) + + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) + + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) + + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageExtendedMedia(dataList []json.RawMessage) ([]MessageExtendedMedia, error) { + list := []MessageExtendedMedia{} + + for _, data := range dataList { + entity, err := UnmarshalMessageExtendedMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) { var meta meta @@ -1782,8 +2124,23 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) - case TypeMessageChatSetTtl: - return UnmarshalMessageChatSetTtl(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) + + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) + + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) + + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) + + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -1797,12 +2154,24 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) + + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) + case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -1879,6 +2248,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -1894,6 +2266,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeTextEntityTypeMediaTimestamp: return UnmarshalTextEntityTypeMediaTimestamp(data) @@ -2080,6 +2455,9 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -2473,6 +2851,43 @@ func UnmarshalListOfDiceStickers(dataList []json.RawMessage) ([]DiceStickers, er return list, nil } +func UnmarshalSpeechRecognitionResult(data json.RawMessage) (SpeechRecognitionResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) + + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) + + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSpeechRecognitionResult(dataList []json.RawMessage) ([]SpeechRecognitionResult, error) { + list := []SpeechRecognitionResult{} + + for _, data := range dataList { + entity, err := UnmarshalSpeechRecognitionResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) { var meta meta @@ -2653,15 +3068,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -2671,60 +3086,69 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -2740,14 +3164,35 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) + + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) + + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) + + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) + + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) + + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) + + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -2805,6 +3250,208 @@ func UnmarshalListOfLanguagePackStringValue(dataList []json.RawMessage) ([]Langu return list, nil } +func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) + + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) + + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + + case TypePremiumLimitTypeChatFilterCount: + return UnmarshalPremiumLimitTypeChatFilterCount(data) + + case TypePremiumLimitTypeChatFilterChosenChatCount: + return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) + + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumLimitType(dataList []json.RawMessage) ([]PremiumLimitType, error) { + list := []PremiumLimitType{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumLimitType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) + + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) + + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) + + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) + + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) + + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) + + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) + + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) + + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) + + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) + + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumFeature(dataList []json.RawMessage) ([]PremiumFeature, error) { + list := []PremiumFeature{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) + + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) + + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) + + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumSource(dataList []json.RawMessage) ([]PremiumSource, error) { + list := []PremiumSource{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) + + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaymentPurpose, error) { + list := []StorePaymentPurpose{} + + for _, data := range dataList { + entity, err := UnmarshalStorePaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { var meta meta @@ -3032,8 +3679,11 @@ func UnmarshalCheckChatUsernameResult(data json.RawMessage) (CheckChatUsernameRe case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) @@ -3255,6 +3905,12 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChatJoinByRequest: return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) + + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -3531,6 +4187,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingAllowFindingByPhoneNumber: return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3550,6 +4209,85 @@ func UnmarshalListOfUserPrivacySetting(dataList []json.RawMessage) ([]UserPrivac return list, nil } +func UnmarshalSessionType(data json.RawMessage) (SessionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(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) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSessionType(dataList []json.RawMessage) ([]SessionType, error) { + list := []SessionType{} + + for _, data := range dataList { + entity, err := UnmarshalSessionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { var meta meta @@ -3580,6 +4318,12 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonIllegalDrugs: + return UnmarshalChatReportReasonIllegalDrugs(data) + + case TypeChatReportReasonPersonalDetails: + return UnmarshalChatReportReasonPersonalDetails(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -3602,6 +4346,43 @@ func UnmarshalListOfChatReportReason(dataList []json.RawMessage) ([]ChatReportRe return list, nil } +func UnmarshalTargetChat(data json.RawMessage) (TargetChat, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) + + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) + + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTargetChat(dataList []json.RawMessage) ([]TargetChat, error) { + list := []TargetChat{} + + for _, data := range dataList { + entity, err := UnmarshalTargetChat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { var meta meta @@ -3614,6 +4395,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -3626,21 +4410,39 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypeInternalLinkTypeFilterSettings: return UnmarshalInternalLinkTypeFilterSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -3653,6 +4455,12 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -3662,6 +4470,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) @@ -3680,6 +4491,12 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -3723,6 +4540,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -4104,40 +4924,6 @@ func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { return list, nil } -func UnmarshalInputSticker(data json.RawMessage) (InputSticker, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInputSticker(dataList []json.RawMessage) ([]InputSticker, error) { - list := []InputSticker{} - - for _, data := range dataList { - entity, err := UnmarshalInputSticker(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { var meta meta @@ -4334,6 +5120,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -4364,14 +5153,17 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) @@ -4388,6 +5180,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -4412,6 +5207,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) @@ -4469,6 +5267,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -4511,6 +5321,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -4529,6 +5342,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -4649,14 +5474,6 @@ func UnmarshalOk(data json.RawMessage) (*Ok, error) { return &resp, err } -func UnmarshalTdlibParameters(data json.RawMessage) (*TdlibParameters, error) { - var resp TdlibParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalAuthenticationCodeTypeTelegramMessage(data json.RawMessage) (*AuthenticationCodeTypeTelegramMessage, error) { var resp AuthenticationCodeTypeTelegramMessage @@ -4697,6 +5514,14 @@ func UnmarshalAuthenticationCodeTypeMissedCall(data json.RawMessage) (*Authentic return &resp, err } +func UnmarshalAuthenticationCodeTypeFragment(data json.RawMessage) (*AuthenticationCodeTypeFragment, error) { + var resp AuthenticationCodeTypeFragment + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthenticationCodeInfo(data json.RawMessage) (*AuthenticationCodeInfo, error) { var resp AuthenticationCodeInfo @@ -4713,6 +5538,30 @@ func UnmarshalEmailAddressAuthenticationCodeInfo(data json.RawMessage) (*EmailAd return &resp, err } +func UnmarshalEmailAddressAuthenticationCode(data json.RawMessage) (*EmailAddressAuthenticationCode, error) { + var resp EmailAddressAuthenticationCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmailAddressAuthenticationAppleId(data json.RawMessage) (*EmailAddressAuthenticationAppleId, error) { + var resp EmailAddressAuthenticationAppleId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmailAddressAuthenticationGoogleId(data json.RawMessage) (*EmailAddressAuthenticationGoogleId, error) { + var resp EmailAddressAuthenticationGoogleId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntity(data json.RawMessage) (*TextEntity, error) { var resp TextEntity @@ -4753,16 +5602,24 @@ func UnmarshalAuthorizationStateWaitTdlibParameters(data json.RawMessage) (*Auth return &resp, err } -func UnmarshalAuthorizationStateWaitEncryptionKey(data json.RawMessage) (*AuthorizationStateWaitEncryptionKey, error) { - var resp AuthorizationStateWaitEncryptionKey +func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*AuthorizationStateWaitPhoneNumber, error) { + var resp AuthorizationStateWaitPhoneNumber err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*AuthorizationStateWaitPhoneNumber, error) { - var resp AuthorizationStateWaitPhoneNumber +func UnmarshalAuthorizationStateWaitEmailAddress(data json.RawMessage) (*AuthorizationStateWaitEmailAddress, error) { + var resp AuthorizationStateWaitEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuthorizationStateWaitEmailCode(data json.RawMessage) (*AuthorizationStateWaitEmailCode, error) { + var resp AuthorizationStateWaitEmailCode err := json.Unmarshal(data, &resp) @@ -4937,22 +5794,6 @@ func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, e return &resp, err } -func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { - var resp ThumbnailFormatPng - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { - var resp ThumbnailFormatWebp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { var resp ThumbnailFormatGif @@ -4961,6 +5802,22 @@ func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, err return &resp, err } +func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { + var resp ThumbnailFormatMpeg4 + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { + var resp ThumbnailFormatPng + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, error) { var resp ThumbnailFormatTgs @@ -4969,8 +5826,16 @@ func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, err return &resp, err } -func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { - var resp ThumbnailFormatMpeg4 +func UnmarshalThumbnailFormatWebm(data json.RawMessage) (*ThumbnailFormatWebm, error) { + var resp ThumbnailFormatWebm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { + var resp ThumbnailFormatWebp err := json.Unmarshal(data, &resp) @@ -5025,6 +5890,78 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { return &resp, err } +func UnmarshalStickerFormatWebp(data json.RawMessage) (*StickerFormatWebp, error) { + var resp StickerFormatWebp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFormatTgs(data json.RawMessage) (*StickerFormatTgs, error) { + var resp StickerFormatTgs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFormatWebm(data json.RawMessage) (*StickerFormatWebm, error) { + var resp StickerFormatWebm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeRegular(data json.RawMessage) (*StickerTypeRegular, error) { + var resp StickerTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) { + var resp StickerTypeMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeCustomEmoji(data json.RawMessage) (*StickerTypeCustomEmoji, error) { + var resp StickerTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeRegular(data json.RawMessage) (*StickerFullTypeRegular, error) { + var resp StickerFullTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeMask(data json.RawMessage) (*StickerFullTypeMask, error) { + var resp StickerFullTypeMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeCustomEmoji(data json.RawMessage) (*StickerFullTypeCustomEmoji, error) { + var resp StickerFullTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { var resp ClosedVectorPath @@ -5233,6 +6170,14 @@ func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { return &resp, err } +func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { + var resp BotMenuButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { var resp ChatLocation @@ -5289,6 +6234,54 @@ func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnim return &resp, err } +func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { + var resp ChatPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { + var resp ChatAdministratorRights + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumPaymentOption(data json.RawMessage) (*PremiumPaymentOption, error) { + var resp PremiumPaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { + var resp EmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) { + var resp EmojiStatuses + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) { + var resp Usernames + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -5297,6 +6290,14 @@ func UnmarshalUser(data json.RawMessage) (*User, error) { return &resp, err } +func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { + var resp BotInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { var resp UserFullInfo @@ -5329,14 +6330,6 @@ func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, err return &resp, err } -func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { - var resp ChatPermissions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { var resp ChatMemberStatusCreator @@ -5689,6 +6682,22 @@ func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) { return &resp, err } +func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) { + var resp ChatMessageSender + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) { + var resp ChatMessageSenders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { var resp MessageForwardOriginUser @@ -5729,6 +6738,22 @@ func UnmarshalMessageForwardOriginMessageImport(data json.RawMessage) (*MessageF return &resp, err } +func UnmarshalReactionTypeEmoji(data json.RawMessage) (*ReactionTypeEmoji, error) { + var resp ReactionTypeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionTypeCustomEmoji(data json.RawMessage) (*ReactionTypeCustomEmoji, error) { + var resp ReactionTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { var resp MessageForwardInfo @@ -5745,6 +6770,14 @@ func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) return &resp, err } +func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { + var resp MessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { var resp MessageInteractionInfo @@ -5753,6 +6786,14 @@ func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionI return &resp, err } +func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { + var resp UnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { var resp MessageSendingStatePending @@ -5793,6 +6834,14 @@ func UnmarshalFoundMessages(data json.RawMessage) (*FoundMessages, error) { return &resp, err } +func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error) { + var resp FoundChatMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { var resp MessagePosition @@ -5833,6 +6882,38 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) return &resp, err } +func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) { + var resp SponsoredMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { + var resp FileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { + var resp DownloadedFileCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { + var resp FoundFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { var resp NotificationSettingsScopePrivateChats @@ -6001,6 +7082,22 @@ func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { return &resp, err } +func UnmarshalChatAvailableReactionsAll(data json.RawMessage) (*ChatAvailableReactionsAll, error) { + var resp ChatAvailableReactionsAll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAvailableReactionsSome(data json.RawMessage) (*ChatAvailableReactionsSome, error) { + var resp ChatAvailableReactionsSome + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { var resp VideoChat @@ -6145,6 +7242,14 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt return &resp, err } +func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { + var resp KeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { var resp KeyboardButton @@ -6169,6 +7274,14 @@ func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { + var resp InlineKeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { var resp InlineKeyboardButtonTypeCallback @@ -6273,6 +7386,14 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn return &resp, err } +func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { + var resp WebAppInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -6281,6 +7402,38 @@ func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error return &resp, err } +func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) { + var resp ForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) { + var resp ForumTopicInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) { + var resp ForumTopic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { + var resp ForumTopics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -6793,6 +7946,14 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) { return &resp, err } +func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { + var resp ThemeParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { var resp LabeledPricePart @@ -6865,16 +8026,32 @@ func UnmarshalInputCredentialsGooglePay(data json.RawMessage) (*InputCredentials return &resp, err } -func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStripe, error) { - var resp PaymentsProviderStripe +func UnmarshalPaymentProviderSmartGlocal(data json.RawMessage) (*PaymentProviderSmartGlocal, error) { + var resp PaymentProviderSmartGlocal err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) { - var resp PaymentFormTheme +func UnmarshalPaymentProviderStripe(data json.RawMessage) (*PaymentProviderStripe, error) { + var resp PaymentProviderStripe + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentProviderOther(data json.RawMessage) (*PaymentProviderOther, error) { + var resp PaymentProviderOther + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentOption(data json.RawMessage) (*PaymentOption, error) { + var resp PaymentOption err := json.Unmarshal(data, &resp) @@ -6913,6 +8090,54 @@ func UnmarshalPaymentReceipt(data json.RawMessage) (*PaymentReceipt, error) { return &resp, err } +func UnmarshalInputInvoiceMessage(data json.RawMessage) (*InputInvoiceMessage, error) { + var resp InputInvoiceMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error) { + var resp InputInvoiceName + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) { + var resp MessageExtendedMediaPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) { + var resp MessageExtendedMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) { + var resp MessageExtendedMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) { + var resp MessageExtendedMediaUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { var resp DatedFile @@ -7801,8 +9026,48 @@ func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, e return &resp, err } -func UnmarshalMessageChatSetTtl(data json.RawMessage) (*MessageChatSetTtl, error) { - var resp MessageChatSetTtl +func UnmarshalMessageChatSetMessageAutoDeleteTime(data json.RawMessage) (*MessageChatSetMessageAutoDeleteTime, error) { + var resp MessageChatSetMessageAutoDeleteTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) { + var resp MessageForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) { + var resp MessageForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) { + var resp MessageForumTopicIsClosedToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsHiddenToggled(data json.RawMessage) (*MessageForumTopicIsHiddenToggled, error) { + var resp MessageForumTopicIsHiddenToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestProfilePhoto, error) { + var resp MessageSuggestProfilePhoto err := json.Unmarshal(data, &resp) @@ -7841,6 +9106,14 @@ func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePayment return &resp, err } +func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) { + var resp MessageGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -7857,6 +9130,30 @@ func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConn return &resp, err } +func UnmarshalMessageBotWriteAccessAllowed(data json.RawMessage) (*MessageBotWriteAccessAllowed, error) { + var resp MessageBotWriteAccessAllowed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { + var resp MessageWebAppDataSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { + var resp MessageWebAppDataReceived + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) { var resp MessagePassportDataSent @@ -7985,6 +9282,14 @@ func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityType return &resp, err } +func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { + var resp TextEntityTypeSpoiler + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { var resp TextEntityTypeCode @@ -8025,6 +9330,14 @@ func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMe return &resp, err } +func UnmarshalTextEntityTypeCustomEmoji(data json.RawMessage) (*TextEntityTypeCustomEmoji, error) { + var resp TextEntityTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { var resp TextEntityTypeMediaTimestamp @@ -8321,6 +9634,14 @@ func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMe return &resp, err } +func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { + var resp SearchMessagesFilterUnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { var resp SearchMessagesFilterFailedToSend @@ -8545,6 +9866,14 @@ func UnmarshalStickerSets(data json.RawMessage) (*StickerSets, error) { return &resp, err } +func UnmarshalTrendingStickerSets(data json.RawMessage) (*TrendingStickerSets, error) { + var resp TrendingStickerSets + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) { var resp CallDiscardReasonEmpty @@ -8705,6 +10034,30 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { + var resp RtmpUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { var resp GroupCallRecentSpeaker @@ -8833,6 +10186,46 @@ func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNum return &resp, err } +func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { + var resp AddedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { + var resp AddedReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReaction(data json.RawMessage) (*AvailableReaction, error) { + var resp AvailableReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { + var resp AvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiReaction(data json.RawMessage) (*EmojiReaction, error) { + var resp EmojiReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { var resp Animations @@ -8865,6 +10258,54 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) return &resp, err } +func UnmarshalSpeechRecognitionResultPending(data json.RawMessage) (*SpeechRecognitionResultPending, error) { + var resp SpeechRecognitionResultPending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultText(data json.RawMessage) (*SpeechRecognitionResultText, error) { + var resp SpeechRecognitionResultText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecognitionResultError, error) { + var resp SpeechRecognitionResultError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { + var resp AttachmentMenuBotColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { + var resp AttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { + var resp SentWebAppMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { var resp HttpUrl @@ -8873,6 +10314,14 @@ func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { return &resp, err } +func UnmarshalUserLink(data json.RawMessage) (*UserLink, error) { + var resp UserLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) { var resp InputInlineQueryResultAnimation @@ -9145,14 +10594,6 @@ func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDe return &resp, err } -func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { - var resp ChatEventPollStopped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { var resp ChatEventMessagePinned @@ -9169,6 +10610,14 @@ func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageU return &resp, err } +func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { + var resp ChatEventPollStopped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { var resp ChatEventMemberJoined @@ -9193,16 +10642,16 @@ func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMe return &resp, err } -func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { - var resp ChatEventMemberLeft +func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { + var resp ChatEventMemberInvited err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { - var resp ChatEventMemberInvited +func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { + var resp ChatEventMemberLeft err := json.Unmarshal(data, &resp) @@ -9225,16 +10674,8 @@ func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberR return &resp, err } -func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { - var resp ChatEventTitleChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { - var resp ChatEventPermissionsChanged +func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { + var resp ChatEventAvailableReactionsChanged err := json.Unmarshal(data, &resp) @@ -9249,30 +10690,6 @@ func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescr return &resp, err } -func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { - var resp ChatEventUsernameChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { - var resp ChatEventPhotoChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { - var resp ChatEventInvitesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { var resp ChatEventLinkedChatChanged @@ -9281,46 +10698,6 @@ func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinked return &resp, err } -func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { - var resp ChatEventSlowModeDelayChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { - var resp ChatEventMessageTtlChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { - var resp ChatEventSignMessagesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { - var resp ChatEventHasProtectedContentToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { - var resp ChatEventStickerSetChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { var resp ChatEventLocationChanged @@ -9329,6 +10706,86 @@ func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocation return &resp, err } +func UnmarshalChatEventMessageAutoDeleteTimeChanged(data json.RawMessage) (*ChatEventMessageAutoDeleteTimeChanged, error) { + var resp ChatEventMessageAutoDeleteTimeChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { + var resp ChatEventPermissionsChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { + var resp ChatEventPhotoChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { + var resp ChatEventStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { + var resp ChatEventTitleChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { + var resp ChatEventUsernameChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) { + var resp ChatEventActiveUsernamesChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { + var resp ChatEventInvitesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { var resp ChatEventIsAllHistoryAvailableToggled @@ -9337,6 +10794,22 @@ func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*Chat return &resp, err } +func UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data json.RawMessage) (*ChatEventHasAggressiveAntiSpamEnabledToggled, error) { + var resp ChatEventHasAggressiveAntiSpamEnabledToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { + var resp ChatEventSignMessagesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { var resp ChatEventInviteLinkEdited @@ -9377,6 +10850,14 @@ func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChat return &resp, err } +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { var resp ChatEventVideoChatParticipantIsMutedToggled @@ -9393,8 +10874,56 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa return &resp, err } -func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { - var resp ChatEventVideoChatMuteNewParticipantsToggled +func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) { + var resp ChatEventIsForumToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) { + var resp ChatEventForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) { + var resp ChatEventForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) { + var resp ChatEventForumTopicToggleIsClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsHidden(data json.RawMessage) (*ChatEventForumTopicToggleIsHidden, error) { + var resp ChatEventForumTopicToggleIsHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) { + var resp ChatEventForumTopicDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) { + var resp ChatEventForumTopicPinned err := json.Unmarshal(data, &resp) @@ -9481,6 +11010,278 @@ func UnmarshalLocalizationTargetInfo(data json.RawMessage) (*LocalizationTargetI return &resp, err } +func UnmarshalPremiumLimitTypeSupergroupCount(data json.RawMessage) (*PremiumLimitTypeSupergroupCount, error) { + var resp PremiumLimitTypeSupergroupCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedChatCount, error) { + var resp PremiumLimitTypePinnedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCreatedPublicChatCount(data json.RawMessage) (*PremiumLimitTypeCreatedPublicChatCount, error) { + var resp PremiumLimitTypeCreatedPublicChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeSavedAnimationCount(data json.RawMessage) (*PremiumLimitTypeSavedAnimationCount, error) { + var resp PremiumLimitTypeSavedAnimationCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeFavoriteStickerCount(data json.RawMessage) (*PremiumLimitTypeFavoriteStickerCount, error) { + var resp PremiumLimitTypeFavoriteStickerCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFilterCount(data json.RawMessage) (*PremiumLimitTypeChatFilterCount, error) { + var resp PremiumLimitTypeChatFilterCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFilterChosenChatCount, error) { + var resp PremiumLimitTypeChatFilterChosenChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedArchivedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedArchivedChatCount, error) { + var resp PremiumLimitTypePinnedArchivedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) { + var resp PremiumLimitTypeCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeBioLength(data json.RawMessage) (*PremiumLimitTypeBioLength, error) { + var resp PremiumLimitTypeBioLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { + var resp PremiumFeatureIncreasedLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedUploadFileSize(data json.RawMessage) (*PremiumFeatureIncreasedUploadFileSize, error) { + var resp PremiumFeatureIncreasedUploadFileSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureImprovedDownloadSpeed(data json.RawMessage) (*PremiumFeatureImprovedDownloadSpeed, error) { + var resp PremiumFeatureImprovedDownloadSpeed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureVoiceRecognition(data json.RawMessage) (*PremiumFeatureVoiceRecognition, error) { + var resp PremiumFeatureVoiceRecognition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureDisabledAds(data json.RawMessage) (*PremiumFeatureDisabledAds, error) { + var resp PremiumFeatureDisabledAds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueReactions(data json.RawMessage) (*PremiumFeatureUniqueReactions, error) { + var resp PremiumFeatureUniqueReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueStickers(data json.RawMessage) (*PremiumFeatureUniqueStickers, error) { + var resp PremiumFeatureUniqueStickers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureCustomEmoji(data json.RawMessage) (*PremiumFeatureCustomEmoji, error) { + var resp PremiumFeatureCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) { + var resp PremiumFeatureAdvancedChatManagement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureProfileBadge(data json.RawMessage) (*PremiumFeatureProfileBadge, error) { + var resp PremiumFeatureProfileBadge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureEmojiStatus(data json.RawMessage) (*PremiumFeatureEmojiStatus, error) { + var resp PremiumFeatureEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*PremiumFeatureAnimatedProfilePhoto, error) { + var resp PremiumFeatureAnimatedProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) { + var resp PremiumFeatureForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) { + var resp PremiumFeatureAppIcons + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimit(data json.RawMessage) (*PremiumLimit, error) { + var resp PremiumLimit + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatures(data json.RawMessage) (*PremiumFeatures, error) { + var resp PremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLimitExceeded(data json.RawMessage) (*PremiumSourceLimitExceeded, error) { + var resp PremiumSourceLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, error) { + var resp PremiumSourceFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLink(data json.RawMessage) (*PremiumSourceLink, error) { + var resp PremiumSourceLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceSettings(data json.RawMessage) (*PremiumSourceSettings, error) { + var resp PremiumSourceSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeaturePromotionAnimation(data json.RawMessage) (*PremiumFeaturePromotionAnimation, error) { + var resp PremiumFeaturePromotionAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) { + var resp PremiumState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*StorePaymentPurposePremiumSubscription, error) { + var resp StorePaymentPurposePremiumSubscription + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) { + var resp StorePaymentPurposeGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { var resp DeviceTokenFirebaseCloudMessaging @@ -9737,8 +11538,16 @@ func UnmarshalCheckChatUsernameResultUsernameOccupied(data json.RawMessage) (*Ch return &resp, err } -func UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMuch, error) { - var resp CheckChatUsernameResultPublicChatsTooMuch +func UnmarshalCheckChatUsernameResultUsernamePurchasable(data json.RawMessage) (*CheckChatUsernameResultUsernamePurchasable, error) { + var resp CheckChatUsernameResultUsernamePurchasable + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCheckChatUsernameResultPublicChatsTooMany(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMany, error) { + var resp CheckChatUsernameResultPublicChatsTooMany err := json.Unmarshal(data, &resp) @@ -10033,6 +11842,22 @@ func UnmarshalPushMessageContentChatJoinByRequest(data json.RawMessage) (*PushMe return &resp, err } +func UnmarshalPushMessageContentRecurringPayment(data json.RawMessage) (*PushMessageContentRecurringPayment, error) { + var resp PushMessageContentRecurringPayment + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*PushMessageContentSuggestProfilePhoto, error) { + var resp PushMessageContentSuggestProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { var resp PushMessageContentMessageForwards @@ -10113,6 +11938,22 @@ func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGro return &resp, err } +func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) { + var resp NotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) { + var resp NotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotification(data json.RawMessage) (*Notification, error) { var resp Notification @@ -10353,6 +12194,14 @@ func UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data json.RawMessage) return &resp, err } +func UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data json.RawMessage) (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages, error) { + var resp UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { var resp AccountTtl @@ -10361,6 +12210,150 @@ func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { return &resp, err } +func UnmarshalMessageAutoDeleteTime(data json.RawMessage) (*MessageAutoDeleteTime, error) { + var resp MessageAutoDeleteTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeAndroid(data json.RawMessage) (*SessionTypeAndroid, error) { + var resp SessionTypeAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeApple(data json.RawMessage) (*SessionTypeApple, error) { + var resp SessionTypeApple + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeBrave(data json.RawMessage) (*SessionTypeBrave, error) { + var resp SessionTypeBrave + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeChrome(data json.RawMessage) (*SessionTypeChrome, error) { + var resp SessionTypeChrome + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeEdge(data json.RawMessage) (*SessionTypeEdge, error) { + var resp SessionTypeEdge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeFirefox(data json.RawMessage) (*SessionTypeFirefox, error) { + var resp SessionTypeFirefox + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeIpad(data json.RawMessage) (*SessionTypeIpad, error) { + var resp SessionTypeIpad + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeIphone(data json.RawMessage) (*SessionTypeIphone, error) { + var resp SessionTypeIphone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeLinux(data json.RawMessage) (*SessionTypeLinux, error) { + var resp SessionTypeLinux + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeMac(data json.RawMessage) (*SessionTypeMac, error) { + var resp SessionTypeMac + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeOpera(data json.RawMessage) (*SessionTypeOpera, error) { + var resp SessionTypeOpera + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeSafari(data json.RawMessage) (*SessionTypeSafari, error) { + var resp SessionTypeSafari + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeUbuntu(data json.RawMessage) (*SessionTypeUbuntu, error) { + var resp SessionTypeUbuntu + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeUnknown(data json.RawMessage) (*SessionTypeUnknown, error) { + var resp SessionTypeUnknown + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeVivaldi(data json.RawMessage) (*SessionTypeVivaldi, error) { + var resp SessionTypeVivaldi + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeWindows(data json.RawMessage) (*SessionTypeWindows, error) { + var resp SessionTypeWindows + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeXbox(data json.RawMessage) (*SessionTypeXbox, error) { + var resp SessionTypeXbox + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSession(data json.RawMessage) (*Session, error) { var resp Session @@ -10449,6 +12442,22 @@ func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, return &resp, err } +func UnmarshalChatReportReasonIllegalDrugs(data json.RawMessage) (*ChatReportReasonIllegalDrugs, error) { + var resp ChatReportReasonIllegalDrugs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatReportReasonPersonalDetails(data json.RawMessage) (*ChatReportReasonPersonalDetails, error) { + var resp ChatReportReasonPersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { var resp ChatReportReasonCustom @@ -10457,6 +12466,30 @@ func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCus return &resp, err } +func UnmarshalTargetChatCurrent(data json.RawMessage) (*TargetChatCurrent, error) { + var resp TargetChatCurrent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTargetChatChosen(data json.RawMessage) (*TargetChatChosen, error) { + var resp TargetChatChosen + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTargetChatInternalLink(data json.RawMessage) (*TargetChatInternalLink, error) { + var resp TargetChatInternalLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { var resp InternalLinkTypeActiveSessions @@ -10465,6 +12498,14 @@ func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLin return &resp, err } +func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) { + var resp InternalLinkTypeAttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { var resp InternalLinkTypeAuthenticationCode @@ -10497,6 +12538,14 @@ func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) { + var resp InternalLinkTypeBotAddToChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { var resp InternalLinkTypeChangePhoneNumber @@ -10513,6 +12562,22 @@ func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTyp return &resp, err } +func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { + var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { + var resp InternalLinkTypeEditProfileSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeFilterSettings(data json.RawMessage) (*InternalLinkTypeFilterSettings, error) { var resp InternalLinkTypeFilterSettings @@ -10529,6 +12594,22 @@ func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, return &resp, err } +func UnmarshalInternalLinkTypeInstantView(data json.RawMessage) (*InternalLinkTypeInstantView, error) { + var resp InternalLinkTypeInstantView + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeInvoice(data json.RawMessage) (*InternalLinkTypeInvoice, error) { + var resp InternalLinkTypeInvoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkTypeLanguagePack, error) { var resp InternalLinkTypeLanguagePack @@ -10537,6 +12618,14 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } +func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { + var resp InternalLinkTypeLanguageSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { var resp InternalLinkTypeMessage @@ -10569,6 +12658,22 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } +func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { + var resp InternalLinkTypePremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { + var resp InternalLinkTypePrivacyAndSecuritySettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { var resp InternalLinkTypeProxy @@ -10593,6 +12698,14 @@ func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*Inter return &resp, err } +func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalLinkTypeRestorePurchases, error) { + var resp InternalLinkTypeRestorePurchases + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { var resp InternalLinkTypeSettings @@ -10641,6 +12754,22 @@ func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { + var resp InternalLinkTypeUserPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeUserToken(data json.RawMessage) (*InternalLinkTypeUserToken, error) { + var resp InternalLinkTypeUserToken + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { var resp InternalLinkTypeVideoChat @@ -10705,6 +12834,14 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) return &resp, err } +func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { + var resp FileTypeNotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { var resp FileTypePhoto @@ -11137,6 +13274,14 @@ func UnmarshalSeconds(data json.RawMessage) (*Seconds, error) { return &resp, err } +func UnmarshalFileDownloadedPrefixSize(data json.RawMessage) (*FileDownloadedPrefixSize, error) { + var resp FileDownloadedPrefixSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeepLinkInfo(data json.RawMessage) (*DeepLinkInfo, error) { var resp DeepLinkInfo @@ -11201,16 +13346,8 @@ func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { return &resp, err } -func UnmarshalInputStickerStatic(data json.RawMessage) (*InputStickerStatic, error) { - var resp InputStickerStatic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputStickerAnimated(data json.RawMessage) (*InputStickerAnimated, error) { - var resp InputStickerAnimated +func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { + var resp InputSticker err := json.Unmarshal(data, &resp) @@ -11481,6 +13618,14 @@ func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMent return &resp, err } +func UnmarshalUpdateMessageUnreadReactions(data json.RawMessage) (*UpdateMessageUnreadReactions, error) { + var resp UpdateMessageUnreadReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { var resp UpdateMessageLiveLocationViewed @@ -11561,6 +13706,14 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } +func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { + var resp UpdateChatAvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { var resp UpdateChatDraftMessage @@ -11577,8 +13730,8 @@ func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageS return &resp, err } -func UnmarshalUpdateChatMessageTtl(data json.RawMessage) (*UpdateChatMessageTtl, error) { - var resp UpdateChatMessageTtl +func UnmarshalUpdateChatMessageAutoDeleteTime(data json.RawMessage) (*UpdateChatMessageAutoDeleteTime, error) { + var resp UpdateChatMessageAutoDeleteTime err := json.Unmarshal(data, &resp) @@ -11625,6 +13778,14 @@ func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnr return &resp, err } +func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUnreadReactionCount, error) { + var resp UpdateChatUnreadReactionCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { var resp UpdateChatVideoChat @@ -11689,6 +13850,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli return &resp, err } +func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) { + var resp UpdateForumTopicInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { var resp UpdateScopeNotificationSettings @@ -11841,6 +14010,38 @@ func UnmarshalUpdateFileGenerationStop(data json.RawMessage) (*UpdateFileGenerat return &resp, err } +func UnmarshalUpdateFileDownloads(data json.RawMessage) (*UpdateFileDownloads, error) { + var resp UpdateFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileAddedToDownloads(data json.RawMessage) (*UpdateFileAddedToDownloads, error) { + var resp UpdateFileAddedToDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileDownload(data json.RawMessage) (*UpdateFileDownload, error) { + var resp UpdateFileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileRemovedFromDownloads(data json.RawMessage) (*UpdateFileRemovedFromDownloads, error) { + var resp UpdateFileRemovedFromDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { var resp UpdateCall @@ -11953,6 +14154,14 @@ func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimation return &resp, err } +func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) { + var resp UpdateSavedNotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { var resp UpdateSelectedBackground @@ -12001,6 +14210,38 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error return &resp, err } +func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) { + var resp UpdateAttachmentMenuBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) { + var resp UpdateWebAppMessageSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateActiveEmojiReactions(data json.RawMessage) (*UpdateActiveEmojiReactions, error) { + var resp UpdateActiveEmojiReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateDefaultReactionType(data json.RawMessage) (*UpdateDefaultReactionType, error) { + var resp UpdateDefaultReactionType + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -12177,6 +14418,14 @@ func UnmarshalLogTags(data json.RawMessage) (*LogTags, error) { return &resp, err } +func UnmarshalUserSupportInfo(data json.RawMessage) (*UserSupportInfo, error) { + var resp UserSupportInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTestInt(data json.RawMessage) (*TestInt, error) { var resp TestInt @@ -12248,9 +14497,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeOk: return UnmarshalOk(data) - case TypeTdlibParameters: - return UnmarshalTdlibParameters(data) - case TypeAuthenticationCodeTypeTelegramMessage: return UnmarshalAuthenticationCodeTypeTelegramMessage(data) @@ -12266,12 +14512,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthenticationCodeTypeMissedCall: return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) + case TypeAuthenticationCodeInfo: return UnmarshalAuthenticationCodeInfo(data) case TypeEmailAddressAuthenticationCodeInfo: return UnmarshalEmailAddressAuthenticationCodeInfo(data) + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) + + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) + + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) + case TypeTextEntity: return UnmarshalTextEntity(data) @@ -12287,12 +14545,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) @@ -12356,20 +14617,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) case TypeThumbnail: return UnmarshalThumbnail(data) @@ -12389,6 +14653,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMaskPosition: return UnmarshalMaskPosition(data) + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) + + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) + + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) + + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) + + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) + + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) + + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) + case TypeClosedVectorPath: return UnmarshalClosedVectorPath(data) @@ -12467,6 +14758,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommands: return UnmarshalBotCommands(data) + case TypeBotMenuButton: + return UnmarshalBotMenuButton(data) + case TypeChatLocation: return UnmarshalChatLocation(data) @@ -12488,9 +14782,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputChatPhotoAnimation: return UnmarshalInputChatPhotoAnimation(data) + case TypeChatPermissions: + return UnmarshalChatPermissions(data) + + case TypeChatAdministratorRights: + return UnmarshalChatAdministratorRights(data) + + case TypePremiumPaymentOption: + return UnmarshalPremiumPaymentOption(data) + + case TypeEmojiStatus: + return UnmarshalEmojiStatus(data) + + case TypeEmojiStatuses: + return UnmarshalEmojiStatuses(data) + + case TypeUsernames: + return UnmarshalUsernames(data) + case TypeUser: return UnmarshalUser(data) + case TypeBotInfo: + return UnmarshalBotInfo(data) + case TypeUserFullInfo: return UnmarshalUserFullInfo(data) @@ -12503,9 +14818,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministrators: return UnmarshalChatAdministrators(data) - case TypeChatPermissions: - return UnmarshalChatPermissions(data) - case TypeChatMemberStatusCreator: return UnmarshalChatMemberStatusCreator(data) @@ -12638,6 +14950,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSenders: return UnmarshalMessageSenders(data) + case TypeChatMessageSender: + return UnmarshalChatMessageSender(data) + + case TypeChatMessageSenders: + return UnmarshalChatMessageSenders(data) + case TypeMessageForwardOriginUser: return UnmarshalMessageForwardOriginUser(data) @@ -12653,15 +14971,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageForwardOriginMessageImport: return UnmarshalMessageForwardOriginMessageImport(data) + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) + + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) + case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) case TypeMessageReplyInfo: return UnmarshalMessageReplyInfo(data) + case TypeMessageReaction: + return UnmarshalMessageReaction(data) + case TypeMessageInteractionInfo: return UnmarshalMessageInteractionInfo(data) + case TypeUnreadReaction: + return UnmarshalUnreadReaction(data) + case TypeMessageSendingStatePending: return UnmarshalMessageSendingStatePending(data) @@ -12677,6 +15007,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundMessages: return UnmarshalFoundMessages(data) + case TypeFoundChatMessages: + return UnmarshalFoundChatMessages(data) + case TypeMessagePosition: return UnmarshalMessagePosition(data) @@ -12692,6 +15025,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) + case TypeSponsoredMessages: + return UnmarshalSponsoredMessages(data) + + case TypeFileDownload: + return UnmarshalFileDownload(data) + + case TypeDownloadedFileCounts: + return UnmarshalDownloadedFileCounts(data) + + case TypeFoundFileDownloads: + return UnmarshalFoundFileDownloads(data) + case TypeNotificationSettingsScopePrivateChats: return UnmarshalNotificationSettingsScopePrivateChats(data) @@ -12755,6 +15100,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPosition: return UnmarshalChatPosition(data) + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) + + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) + case TypeVideoChat: return UnmarshalVideoChat(data) @@ -12809,6 +15160,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + case TypeKeyboardButton: return UnmarshalKeyboardButton(data) @@ -12818,6 +15172,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -12857,9 +15214,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLoginUrlInfoRequestConfirmation: return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeWebAppInfo: + return UnmarshalWebAppInfo(data) + case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) + case TypeForumTopicIcon: + return UnmarshalForumTopicIcon(data) + + case TypeForumTopicInfo: + return UnmarshalForumTopicInfo(data) + + case TypeForumTopic: + return UnmarshalForumTopic(data) + + case TypeForumTopics: + return UnmarshalForumTopics(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -13052,6 +15424,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddress: return UnmarshalAddress(data) + case TypeThemeParameters: + return UnmarshalThemeParameters(data) + case TypeLabeledPricePart: return UnmarshalLabeledPricePart(data) @@ -13079,11 +15454,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputCredentialsGooglePay: return UnmarshalInputCredentialsGooglePay(data) - case TypePaymentsProviderStripe: - return UnmarshalPaymentsProviderStripe(data) + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) - case TypePaymentFormTheme: - return UnmarshalPaymentFormTheme(data) + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) + + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) + + case TypePaymentOption: + return UnmarshalPaymentOption(data) case TypePaymentForm: return UnmarshalPaymentForm(data) @@ -13097,6 +15478,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaymentReceipt: return UnmarshalPaymentReceipt(data) + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) + + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) + + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) + + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) + + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) + + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) + case TypeDatedFile: return UnmarshalDatedFile(data) @@ -13430,8 +15829,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) - case TypeMessageChatSetTtl: - return UnmarshalMessageChatSetTtl(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) + + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) + + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) + + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) + + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -13445,12 +15859,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) case TypeMessageWebsiteConnected: return UnmarshalMessageWebsiteConnected(data) + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) + + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) + case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -13499,6 +15925,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -13514,6 +15943,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeTextEntityTypeMediaTimestamp: return UnmarshalTextEntityTypeMediaTimestamp(data) @@ -13625,6 +16057,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -13709,6 +16144,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStickerSets: return UnmarshalStickerSets(data) + case TypeTrendingStickerSets: + return UnmarshalTrendingStickerSets(data) + case TypeCallDiscardReasonEmpty: return UnmarshalCallDiscardReasonEmpty(data) @@ -13769,6 +16207,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) + + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) + + case TypeRtmpUrl: + return UnmarshalRtmpUrl(data) + case TypeGroupCallRecentSpeaker: return UnmarshalGroupCallRecentSpeaker(data) @@ -13817,6 +16264,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePhoneNumberAuthenticationSettings: return UnmarshalPhoneNumberAuthenticationSettings(data) + case TypeAddedReaction: + return UnmarshalAddedReaction(data) + + case TypeAddedReactions: + return UnmarshalAddedReactions(data) + + case TypeAvailableReaction: + return UnmarshalAvailableReaction(data) + + case TypeAvailableReactions: + return UnmarshalAvailableReactions(data) + + case TypeEmojiReaction: + return UnmarshalEmojiReaction(data) + case TypeAnimations: return UnmarshalAnimations(data) @@ -13829,9 +16291,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeImportedContacts: return UnmarshalImportedContacts(data) + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) + + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) + + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) + + case TypeAttachmentMenuBotColor: + return UnmarshalAttachmentMenuBotColor(data) + + case TypeAttachmentMenuBot: + return UnmarshalAttachmentMenuBot(data) + + case TypeSentWebAppMessage: + return UnmarshalSentWebAppMessage(data) + case TypeHttpUrl: return UnmarshalHttpUrl(data) + case TypeUserLink: + return UnmarshalUserLink(data) + case TypeInputInlineQueryResultAnimation: return UnmarshalInputInlineQueryResultAnimation(data) @@ -13934,15 +16417,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -13952,60 +16435,69 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -14021,14 +16513,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) + + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) + + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) + + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) + + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) + + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) + + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) case TypeChatEvent: return UnmarshalChatEvent(data) @@ -14060,6 +16573,108 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLocalizationTargetInfo: return UnmarshalLocalizationTargetInfo(data) + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) + + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) + + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + + case TypePremiumLimitTypeChatFilterCount: + return UnmarshalPremiumLimitTypeChatFilterCount(data) + + case TypePremiumLimitTypeChatFilterChosenChatCount: + return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) + + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) + + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) + + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) + + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) + + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) + + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) + + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) + + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) + + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) + + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) + + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) + + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) + + case TypePremiumLimit: + return UnmarshalPremiumLimit(data) + + case TypePremiumFeatures: + return UnmarshalPremiumFeatures(data) + + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) + + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) + + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) + + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) + + case TypePremiumFeaturePromotionAnimation: + return UnmarshalPremiumFeaturePromotionAnimation(data) + + case TypePremiumState: + return UnmarshalPremiumState(data) + + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) + + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) + case TypeDeviceTokenFirebaseCloudMessaging: return UnmarshalDeviceTokenFirebaseCloudMessaging(data) @@ -14156,8 +16771,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) @@ -14267,6 +16885,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChatJoinByRequest: return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) + + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -14297,6 +16921,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroupTypeCalls: return UnmarshalNotificationGroupTypeCalls(data) + case TypeNotificationSound: + return UnmarshalNotificationSound(data) + + case TypeNotificationSounds: + return UnmarshalNotificationSounds(data) + case TypeNotification: return UnmarshalNotification(data) @@ -14387,9 +17017,66 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingAllowFindingByPhoneNumber: return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + case TypeAccountTtl: return UnmarshalAccountTtl(data) + case TypeMessageAutoDeleteTime: + return UnmarshalMessageAutoDeleteTime(data) + + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(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 TypeSession: return UnmarshalSession(data) @@ -14423,12 +17110,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonFake: return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonIllegalDrugs: + return UnmarshalChatReportReasonIllegalDrugs(data) + + case TypeChatReportReasonPersonalDetails: + return UnmarshalChatReportReasonPersonalDetails(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) + + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) + + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) + case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) @@ -14441,21 +17146,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypeInternalLinkTypeFilterSettings: return UnmarshalInternalLinkTypeFilterSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -14468,6 +17191,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -14477,6 +17206,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) @@ -14495,6 +17227,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) @@ -14519,6 +17257,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) @@ -14681,6 +17422,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSeconds: return UnmarshalSeconds(data) + case TypeFileDownloadedPrefixSize: + return UnmarshalFileDownloadedPrefixSize(data) + case TypeDeepLinkInfo: return UnmarshalDeepLinkInfo(data) @@ -14705,11 +17449,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxies: return UnmarshalProxies(data) - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) + case TypeInputSticker: + return UnmarshalInputSticker(data) case TypeDateRange: return UnmarshalDateRange(data) @@ -14810,6 +17551,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -14840,14 +17584,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) @@ -14864,6 +17611,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -14888,6 +17638,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) @@ -14945,6 +17698,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -14987,6 +17752,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) @@ -15005,6 +17773,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -15071,6 +17851,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLogTags: return UnmarshalLogTags(data) + case TypeUserSupportInfo: + return UnmarshalUserSupportInfo(data) + case TypeTestInt: return UnmarshalTestInt(data) diff --git a/data/td_api.json b/data/td_api.json index fd374de..94a4212 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -77,88 +77,6 @@ "class": "Ok", "properties": [] }, - { - "name": "tdlibParameters", - "description": "Contains parameters for TDLib initialization", - "class": "TdlibParameters", - "properties": [ - { - "name": "use_test_dc", - "type": "Bool", - "description": "If set to true, the Telegram test environment will be used instead of the production environment" - }, - { - "name": "database_directory", - "type": "string", - "description": "The path to the directory for the persistent database; if empty, the current working directory will be used" - }, - { - "name": "files_directory", - "type": "string", - "description": "The path to the directory for storing files; if empty, database_directory will be used" - }, - { - "name": "use_file_database", - "type": "Bool", - "description": "If set to true, information about downloaded and uploaded files will be saved between application restarts" - }, - { - "name": "use_chat_info_database", - "type": "Bool", - "description": "If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database" - }, - { - "name": "use_message_database", - "type": "Bool", - "description": "If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database" - }, - { - "name": "use_secret_chats", - "type": "Bool", - "description": "If set to true, support for secret chats will be enabled" - }, - { - "name": "api_id", - "type": "int32", - "description": "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org" - }, - { - "name": "api_hash", - "type": "string", - "description": "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org" - }, - { - "name": "system_language_code", - "type": "string", - "description": "IETF language tag of the user's operating system language; must be non-empty" - }, - { - "name": "device_model", - "type": "string", - "description": "Model of the device the application is being run on; must be non-empty" - }, - { - "name": "system_version", - "type": "string", - "description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib" - }, - { - "name": "application_version", - "type": "string", - "description": "Application version; must be non-empty" - }, - { - "name": "enable_storage_optimizer", - "type": "Bool", - "description": "If set to true, old files will automatically be deleted" - }, - { - "name": "ignore_file_names", - "type": "Bool", - "description": "If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name" - } - ] - }, { "name": "authenticationCodeTypeTelegramMessage", "description": "An authentication code is delivered via a private Telegram message, which can be viewed from another active session", @@ -224,6 +142,23 @@ } ] }, + { + "name": "authenticationCodeTypeFragment", + "description": "An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to open to receive the code" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, { "name": "authenticationCodeInfo", "description": "Information about the authentication code that was sent", @@ -268,6 +203,42 @@ } ] }, + { + "name": "emailAddressAuthenticationCode", + "description": "An authentication code delivered to a user's email address", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code" + } + ] + }, + { + "name": "emailAddressAuthenticationAppleId", + "description": "An authentication token received through Apple ID", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, + { + "name": "emailAddressAuthenticationGoogleId", + "description": "An authentication token received through Google ID", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, { "name": "textEntity", "description": "Represents a part of the text that needs to be formatted in some unusual way", @@ -315,7 +286,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other" + "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other 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" } ] }, @@ -332,7 +303,7 @@ { "name": "min_user_age", "type": "int32", - "description": "The minimum age of a user to be able to accept the terms; 0 if any" + "description": "The minimum age of a user to be able to accept the terms; 0 if age isn't restricted" }, { "name": "show_popup", @@ -343,31 +314,63 @@ }, { "name": "authorizationStateWaitTdlibParameters", - "description": "TDLib needs TdlibParameters for initialization", + "description": "Initializetion parameters are needed. Call setTdlibParameters to provide them", "class": "AuthorizationState", "properties": [] }, { - "name": "authorizationStateWaitEncryptionKey", - "description": "TDLib needs an encryption key to decrypt the local database", + "name": "authorizationStateWaitPhoneNumber", + "description": "TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options", + "class": "AuthorizationState", + "properties": [] + }, + { + "name": "authorizationStateWaitEmailAddress", + "description": "TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed", "class": "AuthorizationState", "properties": [ { - "name": "is_encrypted", + "name": "allow_apple_id", "type": "Bool", - "description": "True, if the database is currently encrypted" + "description": "True, if authorization through Apple ID is allowed" + }, + { + "name": "allow_google_id", + "type": "Bool", + "description": "True, if authorization through Google ID is allowed" } ] }, { - "name": "authorizationStateWaitPhoneNumber", - "description": "TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options", + "name": "authorizationStateWaitEmailCode", + "description": "TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code", "class": "AuthorizationState", - "properties": [] + "properties": [ + { + "name": "allow_apple_id", + "type": "Bool", + "description": "True, if authorization through Apple ID is allowed" + }, + { + "name": "allow_google_id", + "type": "Bool", + "description": "True, if authorization through Google ID is allowed" + }, + { + "name": "code_info", + "type": "emailAddressAuthenticationCodeInfo", + "description": "Information about the sent authentication code" + }, + { + "name": "next_phone_number_authorization_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown" + } + ] }, { "name": "authorizationStateWaitCode", - "description": "TDLib needs the user's authentication code to authorize", + "description": "TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code", "class": "AuthorizationState", "properties": [ { @@ -391,7 +394,7 @@ }, { "name": "authorizationStateWaitRegistration", - "description": "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration", + "description": "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data", "class": "AuthorizationState", "properties": [ { @@ -403,7 +406,7 @@ }, { "name": "authorizationStateWaitPassword", - "description": "The user has been authorized, but needs to enter a password to start using the application", + "description": "The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week", "class": "AuthorizationState", "properties": [ { @@ -425,7 +428,7 @@ }, { "name": "authorizationStateReady", - "description": "The user has been successfully authorized. TDLib is now ready to answer queries", + "description": "The user has been successfully authorized. TDLib is now ready to answer general requests", "class": "AuthorizationState", "properties": [] }, @@ -477,10 +480,15 @@ "type": "emailAddressAuthenticationCodeInfo", "description": "Information about the recovery email address to which the confirmation email was sent; may be null" }, + { + "name": "login_email_address_pattern", + "type": "string", + "description": "Pattern of the email address set up for logging in" + }, { "name": "pending_reset_date", "type": "int32", - "description": "If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword" + "description": "If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword" } ] }, @@ -545,17 +553,17 @@ }, { "name": "download_offset", - "type": "int32", + "type": "int53", "description": "Download will be started from this offset. downloaded_prefix_size is calculated from this offset" }, { "name": "downloaded_prefix_size", - "type": "int32", + "type": "int53", "description": "If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes" }, { "name": "downloaded_size", - "type": "int32", + "type": "int53", "description": "Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage" } ] @@ -568,7 +576,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" + "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -587,7 +595,7 @@ }, { "name": "uploaded_size", - "type": "int32", + "type": "int53", "description": "Size of the remote available part of the file, in bytes; 0 if unknown" } ] @@ -604,12 +612,12 @@ }, { "name": "size", - "type": "int32", + "type": "int53", "description": "File size, in bytes; 0 if unknown" }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress" }, { @@ -677,7 +685,7 @@ }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Expected size of the generated file, in bytes; 0 if unknown" } ] @@ -742,18 +750,6 @@ "class": "ThumbnailFormat", "properties": [] }, - { - "name": "thumbnailFormatPng", - "description": "The thumbnail is in PNG format. It will be used only for background patterns", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatWebp", - "description": "The thumbnail is in WEBP format. It will be used only for some stickers", - "class": "ThumbnailFormat", - "properties": [] - }, { "name": "thumbnailFormatGif", "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", @@ -761,14 +757,32 @@ "properties": [] }, { - "name": "thumbnailFormatTgs", - "description": "The thumbnail is in TGS format. It will be used only for animated sticker sets", + "name": "thumbnailFormatMpeg4", + "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", "class": "ThumbnailFormat", "properties": [] }, { - "name": "thumbnailFormatMpeg4", - "description": "The thumbnail is in MPEG4 format. It will be used only for some animations and videos", + "name": "thumbnailFormatPng", + "description": "The thumbnail is in PNG format. It will be used only for background patterns", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatTgs", + "description": "The thumbnail is in TGS format. It will be used only for TGS sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebm", + "description": "The thumbnail is in WEBM format. It will be used only for WEBM sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebp", + "description": "The thumbnail is in WEBP format. It will be used only for some stickers", "class": "ThumbnailFormat", "properties": [] }, @@ -850,6 +864,83 @@ } ] }, + { + "name": "stickerFormatWebp", + "description": "The sticker is an image in WEBP format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerFormatTgs", + "description": "The sticker is an animation in TGS format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerFormatWebm", + "description": "The sticker is a video in WEBM format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerTypeRegular", + "description": "The sticker is a regular sticker", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeMask", + "description": "The sticker is a mask in WEBP format to be placed on photos or videos", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeCustomEmoji", + "description": "The sticker is a custom emoji to be used inside message text and caption", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerFullTypeRegular", + "description": "The sticker is a regular sticker", + "class": "StickerFullType", + "properties": [ + { + "name": "premium_animation", + "type": "file", + "description": "Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker" + } + ] + }, + { + "name": "stickerFullTypeMask", + "description": "The sticker is a mask in WEBP format to be placed on photos or videos", + "class": "StickerFullType", + "properties": [ + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; may be null" + } + ] + }, + { + "name": "stickerFullTypeCustomEmoji", + "description": "The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji", + "class": "StickerFullType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji" + }, + { + "name": "needs_repainting", + "type": "Bool", + "description": "True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places" + } + ] + }, { "name": "closedVectorPath", "description": "Represents a closed vector path. The path begins at the end point of the last command", @@ -1013,7 +1104,12 @@ { "name": "album_cover_thumbnail", "type": "thumbnail", - "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null" + "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null" + }, + { + "name": "external_album_covers", + "type": "vector\u003cthumbnail\u003e", + "description": "Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate" }, { "name": "audio", @@ -1102,19 +1198,14 @@ "description": "Emoji corresponding to the sticker" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, if the sticker is an animated sticker in TGS format" + "name": "format", + "type": "StickerFormat", + "description": "Sticker format" }, { - "name": "is_mask", - "type": "Bool", - "description": "True, if the sticker is a mask" - }, - { - "name": "mask_position", - "type": "maskPosition", - "description": "Position where the mask is placed; may be null" + "name": "full_type", + "type": "StickerFullType", + "description": "Sticker's full type" }, { "name": "outline", @@ -1200,6 +1291,11 @@ "type": "int32", "description": "Duration of the video, in seconds; as defined by the sender" }, + { + "name": "waveform", + "type": "bytes", + "description": "A waveform representation of the video note's audio in 5-bit format; may be empty if unknown" + }, { "name": "length", "type": "int32", @@ -1215,6 +1311,11 @@ "type": "thumbnail", "description": "Video thumbnail in JPEG format; as defined by the sender; may be null" }, + { + "name": "speech_recognition_result", + "type": "SpeechRecognitionResult", + "description": "Result of speech recognition in the video note; may be null" + }, { "name": "video", "type": "file", @@ -1242,6 +1343,11 @@ "type": "string", "description": "MIME type of the file; as defined by the sender" }, + { + "name": "speech_recognition_result", + "type": "SpeechRecognitionResult", + "description": "Result of speech recognition in the voice note; may be null" + }, { "name": "voice", "type": "file", @@ -1251,13 +1357,23 @@ }, { "name": "animatedEmoji", - "description": "Describes an animated representation of an emoji", + "description": "Describes an animated or custom representation of an emoji", "class": "AnimatedEmoji", "properties": [ { "name": "sticker", "type": "sticker", - "description": "Animated sticker for the emoji" + "description": "Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs" + }, + { + "name": "sticker_width", + "type": "int32", + "description": "Expected width of the sticker, which can be used if the sticker is null" + }, + { + "name": "sticker_height", + "type": "int32", + "description": "Expected height of the sticker, which can be used if the sticker is null" }, { "name": "fitzpatrick_type", @@ -1267,7 +1383,7 @@ { "name": "sound", "type": "file", - "description": "File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" + "description": "File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" } ] }, @@ -1370,7 +1486,7 @@ { "name": "id", "type": "int64", - "description": "Game ID" + "description": "Unique game identifier" }, { "name": "short_name", @@ -1490,6 +1606,11 @@ "name": "has_animation", "type": "Bool", "description": "True, if the photo has animated variant" + }, + { + "name": "is_personal", + "type": "Bool", + "description": "True, if the photo is visible only for the current user" } ] }, @@ -1517,6 +1638,11 @@ "name": "has_animation", "type": "Bool", "description": "True, if the photo has animated variant" + }, + { + "name": "is_personal", + "type": "Bool", + "description": "True, if the photo is visible only for the current user" } ] }, @@ -1561,6 +1687,11 @@ "name": "need_location", "type": "Bool", "description": "True, if the location of the user is expected to be sent with every inline query to this bot" + }, + { + "name": "can_be_added_to_attachment_menu", + "type": "Bool", + "description": "True, if the bot can be added to attachment menu" } ] }, @@ -1604,6 +1735,23 @@ } ] }, + { + "name": "botMenuButton", + "description": "Describes a button to be shown instead of bot commands menu button", + "class": "BotMenuButton", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text of the button" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "chatLocation", "description": "Represents a location to which a chat is connected", @@ -1671,7 +1819,12 @@ { "name": "animation", "type": "animatedChatPhoto", - "description": "Animated variant of the photo in MPEG4 format; may be null" + "description": "A big (640x640) animated variant of the photo in MPEG4 format; may be null" + }, + { + "name": "small_animation", + "type": "animatedChatPhoto", + "description": "A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available" } ] }, @@ -1733,216 +1886,6 @@ } ] }, - { - "name": "user", - "description": "Represents a user", - "class": "User", - "properties": [ - { - "name": "id", - "type": "int53", - "description": "User identifier" - }, - { - "name": "first_name", - "type": "string", - "description": "First name of the user" - }, - { - "name": "last_name", - "type": "string", - "description": "Last name of the user" - }, - { - "name": "username", - "type": "string", - "description": "Username of the user" - }, - { - "name": "phone_number", - "type": "string", - "description": "Phone number of the user" - }, - { - "name": "status", - "type": "UserStatus", - "description": "Current online status of the user" - }, - { - "name": "profile_photo", - "type": "profilePhoto", - "description": "Profile photo of the user; may be null" - }, - { - "name": "is_contact", - "type": "Bool", - "description": "The user is a contact of the current user" - }, - { - "name": "is_mutual_contact", - "type": "Bool", - "description": "The user is a contact of the current user and the current user is a contact of the user" - }, - { - "name": "is_verified", - "type": "Bool", - "description": "True, if the user is verified" - }, - { - "name": "is_support", - "type": "Bool", - "description": "True, if the user is Telegram support account" - }, - { - "name": "restriction_reason", - "type": "string", - "description": "If non-empty, it contains a human-readable description of the reason why access to this user must be restricted" - }, - { - "name": "is_scam", - "type": "Bool", - "description": "True, if many users reported this user as a scam" - }, - { - "name": "is_fake", - "type": "Bool", - "description": "True, if many users reported this user as a fake account" - }, - { - "name": "have_access", - "type": "Bool", - "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser" - }, - { - "name": "type", - "type": "UserType", - "description": "Type of the user" - }, - { - "name": "language_code", - "type": "string", - "description": "IETF language tag of the user's language; only available to bots" - } - ] - }, - { - "name": "userFullInfo", - "description": "Contains full information about a user", - "class": "UserFullInfo", - "properties": [ - { - "name": "photo", - "type": "chatPhoto", - "description": "User profile photo; may be null" - }, - { - "name": "is_blocked", - "type": "Bool", - "description": "True, if the user is blocked by the current user" - }, - { - "name": "can_be_called", - "type": "Bool", - "description": "True, if the user can be called" - }, - { - "name": "supports_video_calls", - "type": "Bool", - "description": "True, if a video call can be created with the user" - }, - { - "name": "has_private_calls", - "type": "Bool", - "description": "True, if the user can't be called due to their privacy settings" - }, - { - "name": "has_private_forwards", - "type": "Bool", - "description": "True, if the user can't be linked in forwarded messages due to their privacy settings" - }, - { - "name": "need_phone_number_privacy_exception", - "type": "Bool", - "description": "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used" - }, - { - "name": "bio", - "type": "string", - "description": "A short user bio" - }, - { - "name": "share_text", - "type": "string", - "description": "For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot" - }, - { - "name": "description", - "type": "string", - "description": "For bots, the text shown in the chat with the bot if the chat is empty" - }, - { - "name": "group_in_common_count", - "type": "int32", - "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" - }, - { - "name": "commands", - "type": "vector\u003cbotCommand\u003e", - "description": "For bots, list of the bot commands" - } - ] - }, - { - "name": "users", - "description": "Represents a list of users", - "class": "Users", - "properties": [ - { - "name": "total_count", - "type": "int32", - "description": "Approximate total count of users found" - }, - { - "name": "user_ids", - "type": "vector\u003cint53\u003e", - "description": "A list of user identifiers" - } - ] - }, - { - "name": "chatAdministrator", - "description": "Contains information about a chat administrator", - "class": "ChatAdministrator", - "properties": [ - { - "name": "user_id", - "type": "int53", - "description": "User identifier of the administrator" - }, - { - "name": "custom_title", - "type": "string", - "description": "Custom title of the administrator" - }, - { - "name": "is_owner", - "type": "Bool", - "description": "True, if the user is the owner of the chat" - } - ] - }, - { - "name": "chatAdministrators", - "description": "Represents a list of chat administrators", - "class": "ChatAdministrators", - "properties": [ - { - "name": "administrators", - "type": "vector\u003cchatAdministrator\u003e", - "description": "A list of chat administrators" - } - ] - }, { "name": "chatPermissions", "description": "Describes actions that a user is allowed to take in a chat", @@ -1987,46 +1930,19 @@ "name": "can_pin_messages", "type": "Bool", "description": "True, if the user can pin messages" + }, + { + "name": "can_manage_topics", + "type": "Bool", + "description": "True, if the user can manage topics" } ] }, { - "name": "chatMemberStatusCreator", - "description": "The user is the owner of the chat and has all the administrator privileges", - "class": "ChatMemberStatus", + "name": "chatAdministratorRights", + "description": "Describes rights of the administrator", + "class": "ChatAdministratorRights", "properties": [ - { - "name": "custom_title", - "type": "string", - "description": "A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only" - }, - { - "name": "is_anonymous", - "type": "Bool", - "description": "True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" - }, - { - "name": "is_member", - "type": "Bool", - "description": "True, if the user is a member of the chat" - } - ] - }, - { - "name": "chatMemberStatusAdministrator", - "description": "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", - "class": "ChatMemberStatus", - "properties": [ - { - "name": "custom_title", - "type": "string", - "description": "A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only" - }, - { - "name": "can_be_edited", - "type": "Bool", - "description": "True, if the current user can edit the administrator privileges for the called user" - }, { "name": "can_manage_chat", "type": "Bool", @@ -2067,6 +1983,11 @@ "type": "Bool", "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" }, + { + "name": "can_manage_topics", + "type": "Bool", + "description": "True, if the administrator can manage topics; applicable to forum supergroups only" + }, { "name": "can_promote_members", "type": "Bool", @@ -2084,6 +2005,415 @@ } ] }, + { + "name": "premiumPaymentOption", + "description": "Describes an option for buying Telegram Premium to a user", + "class": "PremiumPaymentOption", + "properties": [ + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code for Telegram Premium subscription payment" + }, + { + "name": "amount", + "type": "int53", + "description": "The amount to pay, in the smallest units of the currency" + }, + { + "name": "discount_percentage", + "type": "int32", + "description": "The discount associated with this option, as a percentage" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the store product associated with the option" + }, + { + "name": "payment_link", + "type": "InternalLinkType", + "description": "An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available" + } + ] + }, + { + "name": "emojiStatus", + "description": "Describes a custom emoji to be shown instead of the Telegram Premium badge", + "class": "EmojiStatus", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji in stickerFormatTgs format" + } + ] + }, + { + "name": "emojiStatuses", + "description": "Contains a list of emoji statuses", + "class": "EmojiStatuses", + "properties": [ + { + "name": "emoji_statuses", + "type": "vector\u003cemojiStatus\u003e", + "description": "The list of emoji statuses" + } + ] + }, + { + "name": "usernames", + "description": "Describes usernames assigned to a user, a supergroup, or a channel", + "class": "Usernames", + "properties": [ + { + "name": "active_usernames", + "type": "vector\u003cstring\u003e", + "description": "List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames" + }, + { + "name": "disabled_usernames", + "type": "vector\u003cstring\u003e", + "description": "List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive" + }, + { + "name": "editable_username", + "type": "string", + "description": "The active username, which can be changed with setUsername/setSupergroupUsername" + } + ] + }, + { + "name": "user", + "description": "Represents a user", + "class": "User", + "properties": [ + { + "name": "id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "first_name", + "type": "string", + "description": "First name of the user" + }, + { + "name": "last_name", + "type": "string", + "description": "Last name of the user" + }, + { + "name": "usernames", + "type": "usernames", + "description": "Usernames of the user; may be null" + }, + { + "name": "phone_number", + "type": "string", + "description": "Phone number of the user" + }, + { + "name": "status", + "type": "UserStatus", + "description": "Current online status of the user" + }, + { + "name": "profile_photo", + "type": "profilePhoto", + "description": "Profile photo of the user; may be null" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only" + }, + { + "name": "is_contact", + "type": "Bool", + "description": "The user is a contact of the current user" + }, + { + "name": "is_mutual_contact", + "type": "Bool", + "description": "The user is a contact of the current user and the current user is a contact of the user" + }, + { + "name": "is_verified", + "type": "Bool", + "description": "True, if the user is verified" + }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if the user is a Telegram Premium user" + }, + { + "name": "is_support", + "type": "Bool", + "description": "True, if the user is Telegram support account" + }, + { + "name": "restriction_reason", + "type": "string", + "description": "If non-empty, it contains a human-readable description of the reason why access to this user must be restricted" + }, + { + "name": "is_scam", + "type": "Bool", + "description": "True, if many users reported this user as a scam" + }, + { + "name": "is_fake", + "type": "Bool", + "description": "True, if many users reported this user as a fake account" + }, + { + "name": "have_access", + "type": "Bool", + "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method" + }, + { + "name": "type", + "type": "UserType", + "description": "Type of the user" + }, + { + "name": "language_code", + "type": "string", + "description": "IETF language tag of the user's language; only available to bots" + }, + { + "name": "added_to_attachment_menu", + "type": "Bool", + "description": "True, if the user added the current bot to attachment menu; only available to bots" + } + ] + }, + { + "name": "botInfo", + "description": "Contains information about a bot", + "class": "BotInfo", + "properties": [ + { + "name": "share_text", + "type": "string", + "description": "The text that is shown on the bot's profile page and is sent together with the link when users share the bot" + }, + { + "name": "description", + "type": "string", + "description": "The text shown in the chat with the bot if the chat is empty" + }, + { + "name": "photo", + "type": "photo", + "description": "Photo shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "animation", + "type": "animation", + "description": "Animation shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown" + }, + { + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "List of the bot commands" + }, + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + }, + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; may be null" + } + ] + }, + { + "name": "userFullInfo", + "description": "Contains full information about a user", + "class": "UserFullInfo", + "properties": [ + { + "name": "personal_photo", + "type": "chatPhoto", + "description": "User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-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" + }, + { + "name": "photo", + "type": "chatPhoto", + "description": "User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo" + }, + { + "name": "public_photo", + "type": "chatPhoto", + "description": "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 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" + }, + { + "name": "is_blocked", + "type": "Bool", + "description": "True, if the user is blocked by the current user" + }, + { + "name": "can_be_called", + "type": "Bool", + "description": "True, if the user can be called" + }, + { + "name": "supports_video_calls", + "type": "Bool", + "description": "True, if a video call can be created with the user" + }, + { + "name": "has_private_calls", + "type": "Bool", + "description": "True, if the user can't be called due to their privacy settings" + }, + { + "name": "has_private_forwards", + "type": "Bool", + "description": "True, if the user can't be linked in forwarded messages due to their privacy settings" + }, + { + "name": "has_restricted_voice_and_video_note_messages", + "type": "Bool", + "description": "True, if voice and video notes can't be sent or forwarded to the user" + }, + { + "name": "need_phone_number_privacy_exception", + "type": "Bool", + "description": "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used" + }, + { + "name": "bio", + "type": "formattedText", + "description": "A short user bio; may be null for bots" + }, + { + "name": "premium_gift_options", + "type": "vector\u003cpremiumPaymentOption\u003e", + "description": "The list of available options for gifting Telegram Premium to the user" + }, + { + "name": "group_in_common_count", + "type": "int32", + "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" + }, + { + "name": "bot_info", + "type": "botInfo", + "description": "For bots, information about the bot; may be null" + } + ] + }, + { + "name": "users", + "description": "Represents a list of users", + "class": "Users", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of users found" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "A list of user identifiers" + } + ] + }, + { + "name": "chatAdministrator", + "description": "Contains information about a chat administrator", + "class": "ChatAdministrator", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier of the administrator" + }, + { + "name": "custom_title", + "type": "string", + "description": "Custom title of the administrator" + }, + { + "name": "is_owner", + "type": "Bool", + "description": "True, if the user is the owner of the chat" + } + ] + }, + { + "name": "chatAdministrators", + "description": "Represents a list of chat administrators", + "class": "ChatAdministrators", + "properties": [ + { + "name": "administrators", + "type": "vector\u003cchatAdministrator\u003e", + "description": "A list of chat administrators" + } + ] + }, + { + "name": "chatMemberStatusCreator", + "description": "The user is the owner of the chat and has all the administrator privileges", + "class": "ChatMemberStatus", + "properties": [ + { + "name": "custom_title", + "type": "string", + "description": "A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" + }, + { + "name": "is_member", + "type": "Bool", + "description": "True, if the user is a member of the chat" + } + ] + }, + { + "name": "chatMemberStatusAdministrator", + "description": "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", + "class": "ChatMemberStatus", + "properties": [ + { + "name": "custom_title", + "type": "string", + "description": "A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only" + }, + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the current user can edit the administrator privileges for the called user" + }, + { + "name": "rights", + "type": "chatAdministratorRights", + "description": "Rights of the administrator" + } + ] + }, { "name": "chatMemberStatusMember", "description": "The user is a member of the chat, without any additional privileges or restrictions", @@ -2148,7 +2478,7 @@ { "name": "joined_chat_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user joined the chat" + "description": "Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat" }, { "name": "status", @@ -2165,7 +2495,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", @@ -2380,7 +2710,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat invite links found" + "description": "Approximate total number of chat invite links found" }, { "name": "invite_links", @@ -2453,7 +2783,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", @@ -2549,7 +2879,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of requests found" + "description": "Approximate total number of requests found" }, { "name": "requests", @@ -2615,7 +2945,7 @@ { "name": "photo", "type": "chatPhoto", - "description": "Chat photo; may be null" + "description": "Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo" }, { "name": "description", @@ -2632,6 +2962,16 @@ "type": "vector\u003cchatMember\u003e", "description": "Group members" }, + { + "name": "can_hide_members", + "type": "Bool", + "description": "True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup" + }, + { + "name": "can_toggle_aggressive_anti_spam", + "type": "Bool", + "description": "True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup" + }, { "name": "invite_link", "type": "chatInviteLink", @@ -2655,9 +2995,9 @@ "description": "Supergroup or channel identifier" }, { - "name": "username", - "type": "string", - "description": "Username of the supergroup or channel; empty for private supergroups or channels" + "name": "usernames", + "type": "usernames", + "description": "Usernames of the supergroup or channel; may be null" }, { "name": "date", @@ -2667,7 +3007,7 @@ { "name": "status", "type": "ChatMemberStatus", - "description": "Status of the current user in the supergroup or channel; custom title will be always empty" + "description": "Status of the current user in the supergroup or channel; custom title will always be empty" }, { "name": "member_count", @@ -2689,6 +3029,16 @@ "type": "Bool", "description": "True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels" }, + { + "name": "join_to_send_messages", + "type": "Bool", + "description": "True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups" + }, + { + "name": "join_by_request", + "type": "Bool", + "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat" + }, { "name": "is_slow_mode_enabled", "type": "Bool", @@ -2704,6 +3054,11 @@ "type": "Bool", "description": "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" }, + { + "name": "is_forum", + "type": "Bool", + "description": "True, if the supergroup must be shown as a forum by default" + }, { "name": "is_verified", "type": "Bool", @@ -2734,7 +3089,7 @@ { "name": "photo", "type": "chatPhoto", - "description": "Chat photo; may be null" + "description": "Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo" }, { "name": "description", @@ -2779,7 +3134,17 @@ { "name": "can_get_members", "type": "Bool", - "description": "True, if members of the chat can be retrieved" + "description": "True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers" + }, + { + "name": "has_hidden_members", + "type": "Bool", + "description": "True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers" + }, + { + "name": "can_hide_members", + "type": "Bool", + "description": "True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators" }, { "name": "can_set_username", @@ -2801,10 +3166,20 @@ "type": "Bool", "description": "True, if the supergroup or channel statistics are available" }, + { + "name": "can_toggle_aggressive_anti_spam", + "type": "Bool", + "description": "True, if aggressive anti-spam checks can be enabled or disabled in the supergroup" + }, { "name": "is_all_history_available", "type": "Bool", - "description": "True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators" + "description": "True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators" + }, + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators" }, { "name": "sticker_set_id", @@ -2819,7 +3194,7 @@ { "name": "invite_link", "type": "chatInviteLink", - "description": "Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only" + "description": "Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only" }, { "name": "bot_commands", @@ -2889,7 +3264,7 @@ { "name": "layer", "type": "int32", - "description": "Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101" + "description": "Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101, files bigger than 2000MB are supported if the layer \u003e= 143, spoiler and custom emoji text entities are supported if the layer \u003e= 144" } ] }, @@ -2925,7 +3300,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages senders found" + "description": "Approximate total number of messages senders found" }, { "name": "senders", @@ -2934,6 +3309,35 @@ } ] }, + { + "name": "chatMessageSender", + "description": "Represents a message sender, which can be used to send messages in a chat", + "class": "ChatMessageSender", + "properties": [ + { + "name": "sender", + "type": "MessageSender", + "description": "Available message senders" + }, + { + "name": "needs_premium", + "type": "Bool", + "description": "True, if Telegram Premium is needed to use the message sender" + } + ] + }, + { + "name": "chatMessageSenders", + "description": "Represents a list of message senders, which can be used to send messages in a chat", + "class": "ChatMessageSenders", + "properties": [ + { + "name": "senders", + "type": "vector\u003cchatMessageSender\u003e", + "description": "List of available message senders" + } + ] + }, { "name": "messageForwardOriginUser", "description": "The message was originally sent by a known user", @@ -3009,6 +3413,30 @@ } ] }, + { + "name": "reactionTypeEmoji", + "description": "A reaction with an emoji", + "class": "ReactionType", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Text representation of the reaction" + } + ] + }, + { + "name": "reactionTypeCustomEmoji", + "description": "A reaction with a custom emoji", + "class": "ReactionType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji" + } + ] + }, { "name": "messageForwardInfo", "description": "Contains information about a forwarded message", @@ -3073,6 +3501,33 @@ } ] }, + { + "name": "messageReaction", + "description": "Contains information about a reaction to a message", + "class": "MessageReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "total_count", + "type": "int32", + "description": "Number of times the reaction was added" + }, + { + "name": "is_chosen", + "type": "Bool", + "description": "True, if the reaction is chosen by the current user" + }, + { + "name": "recent_sender_ids", + "type": "vector\u003cMessageSender\u003e", + "description": "Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats" + } + ] + }, { "name": "messageInteractionInfo", "description": "Contains information about interactions with a message", @@ -3092,6 +3547,33 @@ "name": "reply_info", "type": "messageReplyInfo", "description": "Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself" + }, + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "The list of reactions added to the message" + } + ] + }, + { + "name": "unreadReaction", + "description": "Contains information about an unread reaction to a message", + "class": "UnreadReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender, added the reaction" + }, + { + "name": "is_big", + "type": "Bool", + "description": "True, if the reaction was added with a big animation" } ] }, @@ -3198,15 +3680,20 @@ "type": "Bool", "description": "True, if the message can be deleted for all users" }, + { + "name": "can_get_added_reactions", + "type": "Bool", + "description": "True, if the list of added reactions is available through getMessageAddedReactions" + }, { "name": "can_get_statistics", "type": "Bool", - "description": "True, if the message statistics are available" + "description": "True, if the message statistics are available through getMessageStatistics" }, { "name": "can_get_message_thread", "type": "Bool", - "description": "True, if the message thread info is available" + "description": "True, if information about the message thread is available through getMessageThread and getMessageThreadHistory" }, { "name": "can_get_viewers", @@ -3216,7 +3703,12 @@ { "name": "can_get_media_timestamp_links", "type": "Bool", - "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description" + "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink" + }, + { + "name": "can_report_reactions", + "type": "Bool", + "description": "True, if reactions on the message can be reported through reportMessageReactions" }, { "name": "has_timestamped_media", @@ -3228,6 +3720,11 @@ "type": "Bool", "description": "True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts" }, + { + "name": "is_topic_message", + "type": "Bool", + "description": "True, if the message is a forum topic message" + }, { "name": "contains_unread_mention", "type": "Bool", @@ -3253,6 +3750,11 @@ "type": "messageInteractionInfo", "description": "Information about interactions with the message; may be null" }, + { + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "Information about unread reactions added to the message" + }, { "name": "reply_in_chat_id", "type": "int53", @@ -3269,14 +3771,19 @@ "description": "If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs" }, { - "name": "ttl", + "name": "self_destruct_time", "type": "int32", - "description": "For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires" + "description": "The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires" }, { - "name": "ttl_expires_in", + "name": "self_destruct_in", "type": "double", - "description": "Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field" + "description": "Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field" + }, + { + "name": "auto_delete_in", + "type": "double", + "description": "Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires" }, { "name": "via_bot_user_id", @@ -3318,7 +3825,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found" + "description": "Approximate total number of messages found" }, { "name": "messages", @@ -3335,7 +3842,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found; -1 if unknown" + "description": "Approximate total number of messages found; -1 if unknown" }, { "name": "messages", @@ -3349,6 +3856,28 @@ } ] }, + { + "name": "foundChatMessages", + "description": "Contains a list of messages found by a search in a given chat", + "class": "FoundChatMessages", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of messages found; -1 if unknown" + }, + { + "name": "messages", + "type": "vector\u003cmessage\u003e", + "description": "List of messages" + }, + { + "name": "next_from_message_id", + "type": "int53", + "description": "The offset for the next request. If 0, there are no more results" + } + ] + }, { "name": "messagePosition", "description": "Contains information about a message in a specific position", @@ -3379,7 +3908,7 @@ { "name": "total_count", "type": "int32", - "description": "Total count of messages found" + "description": "Total number of messages found" }, { "name": "positions", @@ -3432,15 +3961,30 @@ "type": "int53", "description": "Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages" }, + { + "name": "is_recommended", + "type": "Bool", + "description": "True, if the message needs to be labeled as \"recommended\" instead of \"sponsored\"" + }, { "name": "sponsor_chat_id", "type": "int53", - "description": "Chat identifier" + "description": "Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link" + }, + { + "name": "sponsor_chat_info", + "type": "chatInviteLinkInfo", + "description": "Information about the sponsor chat; may be null unless sponsor_chat_id == 0" + }, + { + "name": "show_chat_photo", + "type": "Bool", + "description": "True, if the sponsor's chat photo must be shown" }, { "name": "link", "type": "InternalLinkType", - "description": "An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead" + "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" }, { "name": "content", @@ -3449,6 +3993,99 @@ } ] }, + { + "name": "sponsoredMessages", + "description": "Contains a list of sponsored messages", + "class": "SponsoredMessages", + "properties": [ + { + "name": "messages", + "type": "vector\u003csponsoredMessage\u003e", + "description": "List of sponsored messages" + }, + { + "name": "messages_between", + "type": "int32", + "description": "The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages" + } + ] + }, + { + "name": "fileDownload", + "description": "Describes a file added to file download list", + "class": "FileDownload", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "message", + "type": "message", + "description": "The message with the file" + }, + { + "name": "add_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file was added to the download list" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + } + ] + }, + { + "name": "downloadedFileCounts", + "description": "Contains number of being downloaded and recently downloaded files found", + "class": "DownloadedFileCounts", + "properties": [ + { + "name": "active_count", + "type": "int32", + "description": "Number of active file downloads found, including paused" + }, + { + "name": "paused_count", + "type": "int32", + "description": "Number of paused file downloads found" + }, + { + "name": "completed_count", + "type": "int32", + "description": "Number of completed file downloads found" + } + ] + }, + { + "name": "foundFileDownloads", + "description": "Contains a list of downloaded files, found by a search", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "total_counts", + "type": "downloadedFileCounts", + "description": "Total number of suitable files, ignoring offset" + }, + { + "name": "files", + "type": "vector\u003cfileDownload\u003e", + "description": "The list of files" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, { "name": "notificationSettingsScopePrivateChats", "description": "Notification settings applied to all private and secret chats when the corresponding chat setting has a default value", @@ -3457,25 +4094,25 @@ }, { "name": "notificationSettingsScopeGroupChats", - "description": "Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value", + "description": "Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "notificationSettingsScopeChannelChats", - "description": "Notification settings applied to all channels when the corresponding chat setting has a default value", + "description": "Notification settings applied to all channel chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "chatNotificationSettings", - "description": "Contains information about notification settings for a chat", + "description": "Contains information about notification settings for a chat or a froum topic", "class": "ChatNotificationSettings", "properties": [ { "name": "use_default_mute_for", "type": "Bool", - "description": "If true, mute_for is ignored and the value for the relevant type of chat is used instead" + "description": "If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "mute_for", @@ -3485,17 +4122,17 @@ { "name": "use_default_sound", "type": "Bool", - "description": "If true, sound is ignored and the value for the relevant type of chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of sound_id" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "use_default_show_preview", "type": "Bool", - "description": "If true, show_preview is ignored and the value for the relevant type of chat is used instead" + "description": "If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "show_preview", @@ -3505,7 +4142,7 @@ { "name": "use_default_disable_pinned_message_notifications", "type": "Bool", - "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead" + "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "disable_pinned_message_notifications", @@ -3515,7 +4152,7 @@ { "name": "use_default_disable_mention_notifications", "type": "Bool", - "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead" + "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "disable_mention_notifications", @@ -3535,9 +4172,9 @@ "description": "Time left before notifications will be unmuted, in seconds" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "show_preview", @@ -3564,7 +4201,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to; 0 if none" + "description": "Identifier of the replied message; 0 if none" }, { "name": "date", @@ -3649,22 +4286,22 @@ { "name": "icon_name", "type": "string", - "description": "The chosen icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" + "description": "The chosen icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" }, { "name": "pinned_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of pinned chats in the filtered chat list" + "description": "The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "included_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always included chats in the filtered chat list" + "description": "The chat identifiers of always included chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "excluded_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always excluded chats in the filtered chat list" + "description": "The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "exclude_muted", @@ -3726,7 +4363,7 @@ { "name": "icon_name", "type": "string", - "description": "The chosen or default icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" + "description": "The chosen or default icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\"" } ] }, @@ -3845,6 +4482,24 @@ } ] }, + { + "name": "chatAvailableReactionsAll", + "description": "All reactions are available in the chat", + "class": "ChatAvailableReactions", + "properties": [] + }, + { + "name": "chatAvailableReactionsSome", + "description": "Only specific reactions are available in the chat", + "class": "ChatAvailableReactions", + "properties": [ + { + "name": "reactions", + "type": "vector\u003cReactionType\u003e", + "description": "The list of reactions" + } + ] + }, { "name": "videoChat", "description": "Describes a video chat", @@ -3973,14 +4628,24 @@ "description": "Number of unread messages with a mention/reply in the chat" }, { - "name": "notification_settings", - "type": "chatNotificationSettings", - "description": "Notification settings for this chat" + "name": "unread_reaction_count", + "type": "int32", + "description": "Number of messages with unread reactions in the chat" }, { - "name": "message_ttl", + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "Notification settings for the chat" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "Types of reaction, available in the chat" + }, + { + "name": "message_auto_delete_time", "type": "int32", - "description": "Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats" + "description": "Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date" }, { "name": "theme_name", @@ -4027,7 +4692,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chats found" + "description": "Approximate total number of chats found" }, { "name": "chat_ids", @@ -4072,7 +4737,7 @@ }, { "name": "publicChatTypeHasUsername", - "description": "The chat is public, because it has username", + "description": "The chat is public, because it has an active username", "class": "PublicChatType", "properties": [] }, @@ -4084,7 +4749,7 @@ }, { "name": "chatActionBarReportSpam", - "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam", + "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4108,7 +4773,7 @@ }, { "name": "chatActionBarReportAddBlock", - "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact", + "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4192,6 +4857,18 @@ } ] }, + { + "name": "keyboardButtonTypeWebApp", + "description": "A button that opens a Web App by calling getWebAppUrl", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to getWebAppUrl" + } + ] + }, { "name": "keyboardButton", "description": "Represents a single button in a bot keyboard", @@ -4223,13 +4900,13 @@ }, { "name": "inlineKeyboardButtonTypeLoginUrl", - "description": "A button that opens a specified URL and automatically authorize the current user if allowed to do so", + "description": "A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo", "class": "InlineKeyboardButtonType", "properties": [ { "name": "url", "type": "string", - "description": "An HTTP URL to open" + "description": "An HTTP URL to pass to getLoginUrlInfo" }, { "name": "id", @@ -4243,6 +4920,18 @@ } ] }, + { + "name": "inlineKeyboardButtonTypeWebApp", + "description": "A button that opens a Web App by calling openWebApp", + "class": "InlineKeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to openWebApp" + } + ] + }, { "name": "inlineKeyboardButtonTypeCallback", "description": "A button that sends a callback query to a bot", @@ -4257,7 +4946,7 @@ }, { "name": "inlineKeyboardButtonTypeCallbackWithPassword", - "description": "A button that asks for password of the current user and then sends a callback query to a bot", + "description": "A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot", "class": "InlineKeyboardButtonType", "properties": [ { @@ -4327,7 +5016,7 @@ }, { "name": "replyMarkupRemoveKeyboard", - "description": "Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent", + "description": "Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent", "class": "ReplyMarkup", "properties": [ { @@ -4364,6 +5053,11 @@ "type": "vector\u003cvector\u003ckeyboardButton\u003e\u003e", "description": "A list of rows of bot keyboard buttons" }, + { + "name": "is_persistent", + "type": "Bool", + "description": "True, if the keyboard is supposed to be always shown when the ordinary keyboard is hidden" + }, { "name": "resize_keyboard", "type": "Bool", @@ -4442,6 +5136,23 @@ } ] }, + { + "name": "webAppInfo", + "description": "Contains information about a Web App", + "class": "WebAppInfo", + "properties": [ + { + "name": "launch_id", + "type": "int64", + "description": "Unique identifier for the Web App launch" + }, + { + "name": "url", + "type": "string", + "description": "A Web App URL to open in a web view" + } + ] + }, { "name": "messageThreadInfo", "description": "Contains information about a message thread", @@ -4460,7 +5171,7 @@ { "name": "reply_info", "type": "messageReplyInfo", - "description": "Information about the message thread" + "description": "Information about the message thread; may be null for forum topic threads" }, { "name": "unread_message_count", @@ -4479,6 +5190,164 @@ } ] }, + { + "name": "forumTopicIcon", + "description": "Describes a forum topic icon", + "class": "ForumTopicIcon", + "properties": [ + { + "name": "color", + "type": "int32", + "description": "Color of the topic icon in RGB format" + }, + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji shown on the topic icon; 0 if none" + } + ] + }, + { + "name": "forumTopicInfo", + "description": "Contains basic information about a forum topic", + "class": "ForumTopicInfo", + "properties": [ + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the topic" + }, + { + "name": "name", + "type": "string", + "description": "Name of the topic" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic" + }, + { + "name": "creation_date", + "type": "int32", + "description": "Date the topic was created" + }, + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of the creator of the topic" + }, + { + "name": "is_general", + "type": "Bool", + "description": "True, if the topic is the General topic list" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the topic was created by the current user" + }, + { + "name": "is_closed", + "type": "Bool", + "description": "True, if the topic is closed" + }, + { + "name": "is_hidden", + "type": "Bool", + "description": "True, if the topic is hidden above the topic list and closed; for General topic only" + } + ] + }, + { + "name": "forumTopic", + "description": "Describes a forum topic", + "class": "ForumTopic", + "properties": [ + { + "name": "info", + "type": "forumTopicInfo", + "description": "Basic information about the topic" + }, + { + "name": "last_message", + "type": "message", + "description": "Last message in the topic; may be null if unknown" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the topic is pinned in the topic list" + }, + { + "name": "unread_count", + "type": "int32", + "description": "Number of unread messages in the topic" + }, + { + "name": "last_read_inbox_message_id", + "type": "int53", + "description": "Identifier of the last read incoming message" + }, + { + "name": "last_read_outbox_message_id", + "type": "int53", + "description": "Identifier of the last read outgoing message" + }, + { + "name": "unread_mention_count", + "type": "int32", + "description": "Number of unread messages with a mention/reply in the topic" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "Number of messages with unread reactions in the topic" + }, + { + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "Notification settings for the topic" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "A draft of a message in the topic; may be null" + } + ] + }, + { + "name": "forumTopics", + "description": "Describes a list of forum topics", + "class": "ForumTopics", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of forum topics found" + }, + { + "name": "topics", + "type": "vector\u003cforumTopic\u003e", + "description": "List of forum topics" + }, + { + "name": "next_offset_date", + "type": "int32", + "description": "Offset date for the next getForumTopics request" + }, + { + "name": "next_offset_message_id", + "type": "int53", + "description": "Offset message identifier for the next getForumTopics request" + }, + { + "name": "next_offset_message_thread_id", + "type": "int53", + "description": "Offset message thread identifier for the next getForumTopics request" + } + ] + }, { "name": "richTextPlain", "description": "A plain text", @@ -5312,7 +6181,7 @@ { "name": "username", "type": "string", - "description": "Chat username, by which all other information about the chat can be resolved" + "description": "Chat username by which all other information about the chat can be resolved" } ] }, @@ -5559,7 +6428,7 @@ { "name": "instant_view_version", "type": "int32", - "description": "Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none" + "description": "Version of web page instant view (currently, can be 1 or 2); 0 if none" } ] }, @@ -5626,6 +6495,11 @@ "name": "formatted_phone_number", "type": "string", "description": "The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the phone number was bought on Fragment and isn't tied to a SIM card" } ] }, @@ -5700,6 +6574,48 @@ } ] }, + { + "name": "themeParameters", + "description": "Contains parameters of the application theme", + "class": "ThemeParameters", + "properties": [ + { + "name": "background_color", + "type": "int32", + "description": "A color of the background in the RGB24 format" + }, + { + "name": "secondary_background_color", + "type": "int32", + "description": "A secondary color for the background in the RGB24 format" + }, + { + "name": "text_color", + "type": "int32", + "description": "A color of text in the RGB24 format" + }, + { + "name": "hint_color", + "type": "int32", + "description": "A color of hints in the RGB24 format" + }, + { + "name": "link_color", + "type": "int32", + "description": "A color of links in the RGB24 format" + }, + { + "name": "button_color", + "type": "int32", + "description": "A color of the buttons in the RGB24 format" + }, + { + "name": "button_text_color", + "type": "int32", + "description": "A color of text on the buttons in the RGB24 format" + } + ] + }, { "name": "labeledPricePart", "description": "Portion of the price of a product (e.g., \"delivery cost\", \"tax amount\")", @@ -5742,6 +6658,11 @@ "type": "vector\u003cint53\u003e", "description": "Suggested amounts of tip in the smallest units of the currency" }, + { + "name": "recurring_payment_terms_of_service_url", + "type": "string", + "description": "An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay" + }, { "name": "is_test", "type": "Bool", @@ -5835,7 +6756,7 @@ }, { "name": "savedCredentials", - "description": "Contains information about saved card credentials", + "description": "Contains information about saved payment credentials", "class": "SavedCredentials", "properties": [ { @@ -5904,9 +6825,21 @@ ] }, { - "name": "paymentsProviderStripe", + "name": "paymentProviderSmartGlocal", + "description": "Smart Glocal payment provider", + "class": "PaymentProvider", + "properties": [ + { + "name": "public_token", + "type": "string", + "description": "Public payment token" + } + ] + }, + { + "name": "paymentProviderStripe", "description": "Stripe payment provider", - "class": "PaymentsProviderStripe", + "class": "PaymentProvider", "properties": [ { "name": "publishable_key", @@ -5931,39 +6864,31 @@ ] }, { - "name": "paymentFormTheme", - "description": "Theme colors for a payment form", - "class": "PaymentFormTheme", + "name": "paymentProviderOther", + "description": "Some other payment provider, for which a web payment form must be shown", + "class": "PaymentProvider", "properties": [ { - "name": "background_color", - "type": "int32", - "description": "A color of the payment form background in the RGB24 format" + "name": "url", + "type": "string", + "description": "Payment form URL" + } + ] + }, + { + "name": "paymentOption", + "description": "Describes an additional payment option", + "class": "PaymentOption", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title for the payment option" }, { - "name": "text_color", - "type": "int32", - "description": "A color of text in the RGB24 format" - }, - { - "name": "hint_color", - "type": "int32", - "description": "A color of hints in the RGB24 format" - }, - { - "name": "link_color", - "type": "int32", - "description": "A color of links in the RGB24 format" - }, - { - "name": "button_color", - "type": "int32", - "description": "A color of the buttons in the RGB24 format" - }, - { - "name": "button_text_color", - "type": "int32", - "description": "A color of text on the buttons in the RGB24 format" + "name": "url", + "type": "string", + "description": "Payment form URL to be opened in a web view" } ] }, @@ -5980,12 +6905,7 @@ { "name": "invoice", "type": "invoice", - "description": "Full information of the invoice" - }, - { - "name": "url", - "type": "string", - "description": "Payment form URL" + "description": "Full information about the invoice" }, { "name": "seller_bot_user_id", @@ -5993,14 +6913,19 @@ "description": "User identifier of the seller bot" }, { - "name": "payments_provider_user_id", + "name": "payment_provider_user_id", "type": "int53", "description": "User identifier of the payment provider bot" }, { - "name": "payments_provider", - "type": "paymentsProviderStripe", - "description": "Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null" + "name": "payment_provider", + "type": "PaymentProvider", + "description": "Information about the payment provider" + }, + { + "name": "additional_payment_options", + "type": "vector\u003cpaymentOption\u003e", + "description": "The list of additional payment options" }, { "name": "saved_order_info", @@ -6009,8 +6934,8 @@ }, { "name": "saved_credentials", - "type": "savedCredentials", - "description": "Information about saved card credentials; may be null" + "type": "vector\u003csavedCredentials\u003e", + "description": "The list of saved payment credentials" }, { "name": "can_save_credentials", @@ -6020,7 +6945,22 @@ { "name": "need_password", "type": "Bool", - "description": "True, if the user will be able to save credentials protected by a password they set up" + "description": "True, if the user will be able to save credentials, if sets up a 2-step verification password" + }, + { + "name": "product_title", + "type": "string", + "description": "Product title" + }, + { + "name": "product_description", + "type": "formattedText", + "description": "Product description" + }, + { + "name": "product_photo", + "type": "photo", + "description": "Product photo; may be null" } ] }, @@ -6070,7 +7010,7 @@ }, { "name": "description", - "type": "string", + "type": "formattedText", "description": "Product description" }, { @@ -6089,7 +7029,7 @@ "description": "User identifier of the seller bot" }, { - "name": "payments_provider_user_id", + "name": "payment_provider_user_id", "type": "int53", "description": "User identifier of the payment provider bot" }, @@ -6120,6 +7060,113 @@ } ] }, + { + "name": "inputInvoiceMessage", + "description": "An invoice from a message of the type messageInvoice", + "class": "InputInvoice", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + } + ] + }, + { + "name": "inputInvoiceName", + "description": "An invoice from a link of the type internalLinkTypeInvoice", + "class": "InputInvoice", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the invoice" + } + ] + }, + { + "name": "messageExtendedMediaPreview", + "description": "The media is hidden until the invoice is paid", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "width", + "type": "int32", + "description": "Media width; 0 if unknown" + }, + { + "name": "height", + "type": "int32", + "description": "Media height; 0 if unknown" + }, + { + "name": "duration", + "type": "int32", + "description": "Media duration; 0 if unknown" + }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Media minithumbnail; may be null" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Media caption" + } + ] + }, + { + "name": "messageExtendedMediaPhoto", + "description": "The media is a photo", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "photo", + "type": "photo", + "description": "The photo" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Photo caption" + } + ] + }, + { + "name": "messageExtendedMediaVideo", + "description": "The media is a video", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "video", + "type": "video", + "description": "The video" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Photo caption" + } + ] + }, + { + "name": "messageExtendedMediaUnsupported", + "description": "The media is unuspported", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "caption", + "type": "formattedText", + "description": "Media caption" + } + ] + }, { "name": "datedFile", "description": "File with the date it was uploaded", @@ -7139,6 +8186,11 @@ "type": "formattedText", "description": "Animation caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the animation preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7188,13 +8240,18 @@ { "name": "photo", "type": "photo", - "description": "The photo description" + "description": "The photo" }, { "name": "caption", "type": "formattedText", "description": "Photo caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the photo preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7204,7 +8261,7 @@ }, { "name": "messageExpiredPhoto", - "description": "An expired photo message (self-destructed after TTL has elapsed)", + "description": "A self-destructed photo message", "class": "MessageContent", "properties": [] }, @@ -7217,6 +8274,11 @@ "name": "sticker", "type": "sticker", "description": "The sticker description" + }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if premium animation of the sticker must be played" } ] }, @@ -7235,6 +8297,11 @@ "type": "formattedText", "description": "Video caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the video preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7244,7 +8311,7 @@ }, { "name": "messageExpiredVideo", - "description": "An expired video message (self-destructed after TTL has elapsed)", + "description": "A self-destructed video message", "class": "MessageContent", "properties": [] }, @@ -7320,7 +8387,7 @@ { "name": "proximity_alert_radius", "type": "int32", - "description": "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 for the message sender" + "description": "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" } ] }, @@ -7433,7 +8500,7 @@ }, { "name": "description", - "type": "string", + "type": "formattedText", "description": "Product description" }, { @@ -7470,6 +8537,11 @@ "name": "receipt_message_id", "type": "int53", "description": "The identifier of the message with the receipt, after the product has been purchased" + }, + { + "name": "extended_media", + "type": "MessageExtendedMedia", + "description": "Extended media attached to the invoice; may be null" } ] }, @@ -7708,14 +8780,94 @@ ] }, { - "name": "messageChatSetTtl", - "description": "The TTL (Time To Live) setting for messages in the chat has been changed", + "name": "messageChatSetMessageAutoDeleteTime", + "description": "The auto-delete or self-destruct timer for messages in the chat has been changed", "class": "MessageContent", "properties": [ { - "name": "ttl", + "name": "message_auto_delete_time", "type": "int32", - "description": "New message TTL" + "description": "New value auto-delete or self-destruct time, in seconds; 0 if disabled" + }, + { + "name": "from_user_id", + "type": "int53", + "description": "If not 0, a user identifier, which default setting was automatically applied" + } + ] + }, + { + "name": "messageForumTopicCreated", + "description": "A forum topic has been created", + "class": "MessageContent", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the topic" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic" + } + ] + }, + { + "name": "messageForumTopicEdited", + "description": "A forum topic has been edited", + "class": "MessageContent", + "properties": [ + { + "name": "name", + "type": "string", + "description": "If non-empty, the new name of the topic" + }, + { + "name": "edit_icon_custom_emoji_id", + "type": "Bool", + "description": "True, if icon's custom_emoji_id is changed" + }, + { + "name": "icon_custom_emoji_id", + "type": "int64", + "description": "New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false" + } + ] + }, + { + "name": "messageForumTopicIsClosedToggled", + "description": "A forum topic has been closed or opened", + "class": "MessageContent", + "properties": [ + { + "name": "is_closed", + "type": "Bool", + "description": "True, if the topic was closed, otherwise the topic was reopened" + } + ] + }, + { + "name": "messageForumTopicIsHiddenToggled", + "description": "A General forum topic has been hidden or unhidden", + "class": "MessageContent", + "properties": [ + { + "name": "is_hidden", + "type": "Bool", + "description": "True, if the topic was hidden, otherwise the topic was unhidden" + } + ] + }, + { + "name": "messageSuggestProfilePhoto", + "description": "A profile photo was suggested to a user in a private chat", + "class": "MessageContent", + "properties": [ + { + "name": "photo", + "type": "chatPhoto", + "description": "The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo" } ] }, @@ -7761,12 +8913,12 @@ { "name": "invoice_chat_id", "type": "int53", - "description": "Identifier of the chat, containing the corresponding invoice message; 0 if unknown" + "description": "Identifier of the chat, containing the corresponding invoice message" }, { "name": "invoice_message_id", "type": "int53", - "description": "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message" + "description": "Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message" }, { "name": "currency", @@ -7777,6 +8929,21 @@ "name": "total_amount", "type": "int53", "description": "Total price for the product, in the smallest units of the currency" + }, + { + "name": "is_recurring", + "type": "Bool", + "description": "True, if this is a recurring payment" + }, + { + "name": "is_first_recurring", + "type": "Bool", + "description": "True, if this is the first recurring payment" + }, + { + "name": "invoice_name", + "type": "string", + "description": "Name of the invoice; may be empty if unknown" } ] }, @@ -7795,6 +8962,16 @@ "type": "int53", "description": "Total price for the product, in the smallest units of the currency" }, + { + "name": "is_recurring", + "type": "Bool", + "description": "True, if this is a recurring payment" + }, + { + "name": "is_first_recurring", + "type": "Bool", + "description": "True, if this is the first recurring payment" + }, { "name": "invoice_payload", "type": "bytes", @@ -7822,6 +8999,33 @@ } ] }, + { + "name": "messageGiftedPremium", + "description": "Telegram Premium was gifted to the user", + "class": "MessageContent", + "properties": [ + { + "name": "currency", + "type": "string", + "description": "Currency for the paid amount" + }, + { + "name": "amount", + "type": "int53", + "description": "The paid amount, in the smallest units of the currency" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + } + ] + }, { "name": "messageContactRegistered", "description": "A contact has registered with Telegram", @@ -7840,9 +9044,44 @@ } ] }, + { + "name": "messageBotWriteAccessAllowed", + "description": "The user allowed the bot to send messages", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messageWebAppDataSent", + "description": "Data from a Web App has been sent to a bot", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + } + ] + }, + { + "name": "messageWebAppDataReceived", + "description": "Data from a Web App has been received; for bots only", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + }, + { + "name": "data", + "type": "string", + "description": "Received data" + } + ] + }, { "name": "messagePassportDataSent", - "description": "Telegram Passport data has been sent", + "description": "Telegram Passport data has been sent to a bot", "class": "MessageContent", "properties": [ { @@ -7899,7 +9138,7 @@ }, { "name": "textEntityTypeMention", - "description": "A mention of a user by their username", + "description": "A mention of a user, a supergroup, or a channel by their username", "class": "TextEntityType", "properties": [] }, @@ -7969,6 +9208,12 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypeSpoiler", + "description": "A spoiler text", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeCode", "description": "Text that must be formatted as if inside a code HTML tag", @@ -8017,6 +9262,18 @@ } ] }, + { + "name": "textEntityTypeCustomEmoji", + "description": "A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji", + "class": "TextEntityType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji" + } + ] + }, { "name": "textEntityTypeMediaTimestamp", "description": "A media timestamp", @@ -8084,6 +9341,16 @@ "type": "Bool", "description": "Pass true if the message is sent from the background" }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the message must be protected from forwarding and saving; for bots only" + }, + { + "name": "update_order_of_installed_sticker_sets", + "type": "Bool", + "description": "Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum" + }, { "name": "scheduling_state", "type": "MessageSchedulingState", @@ -8121,7 +9388,7 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" + "description": "Formatted text to be sent; 1-getOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { "name": "disable_web_page_preview", @@ -8173,7 +9440,12 @@ { "name": "caption", "type": "formattedText", - "description": "Animation caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Animation caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the animation preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8210,7 +9482,7 @@ { "name": "caption", "type": "formattedText", - "description": "Audio caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Audio caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8232,12 +9504,12 @@ { "name": "disable_content_type_detection", "type": "Bool", - "description": "If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats" + "description": "If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats" }, { "name": "caption", "type": "formattedText", - "description": "Document caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Document caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8249,7 +9521,7 @@ { "name": "photo", "type": "InputFile", - "description": "Photo to send" + "description": "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" }, { "name": "thumbnail", @@ -8274,12 +9546,17 @@ { "name": "caption", "type": "formattedText", - "description": "Photo caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Photo caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "ttl", + "name": "self_destruct_time", "type": "int32", - "description": "Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats" + "description": "Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the photo preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8358,12 +9635,17 @@ { "name": "caption", "type": "formattedText", - "description": "Video caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Video caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "ttl", + "name": "self_destruct_time", "type": "int32", - "description": "Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats" + "description": "Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the video preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8412,12 +9694,12 @@ { "name": "waveform", "type": "bytes", - "description": "Waveform representation of the voice note, in 5-bit format" + "description": "Waveform representation of the voice note in 5-bit format" }, { "name": "caption", "type": "formattedText", - "description": "Voice note caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Voice note caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8565,6 +9847,11 @@ "name": "start_parameter", "type": "string", "description": "Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message" + }, + { + "name": "extended_media_content", + "type": "InputMessageContent", + "description": "The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo" } ] }, @@ -8721,6 +10008,12 @@ "class": "SearchMessagesFilter", "properties": [] }, + { + "name": "searchMessagesFilterUnreadReaction", + "description": "Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user", + "class": "SearchMessagesFilter", + "properties": [] + }, { "name": "searchMessagesFilterFailedToSend", "description": "Returns only failed to send messages. This filter can be used only if the message database is used", @@ -8954,7 +10247,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" }, { "name": "thumbnail_outline", @@ -8977,14 +10270,14 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" + "name": "sticker_format", + "type": "StickerFormat", + "description": "Format of the stickers in the set" }, { - "name": "is_masks", - "type": "Bool", - "description": "True, if the stickers in the set are masks" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" }, { "name": "is_viewed", @@ -9026,7 +10319,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" }, { "name": "thumbnail_outline", @@ -9049,14 +10342,14 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" + "name": "sticker_format", + "type": "StickerFormat", + "description": "Format of the stickers in the set" }, { - "name": "is_masks", - "type": "Bool", - "description": "True, if the stickers in the set are masks" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" }, { "name": "is_viewed", @@ -9092,6 +10385,28 @@ } ] }, + { + "name": "trendingStickerSets", + "description": "Represents a list of trending sticker sets", + "class": "TrendingStickerSets", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of trending sticker sets" + }, + { + "name": "sets", + "type": "vector\u003cstickerSetInfo\u003e", + "description": "List of trending sticker sets" + }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if the list contains sticker sets with premium stickers" + } + ] + }, { "name": "callDiscardReasonEmpty", "description": "The call wasn't discarded, or the reason is unknown", @@ -9163,6 +10478,11 @@ "name": "peer_tag", "type": "bytes", "description": "A peer tag to be used with the reflector" + }, + { + "name": "is_tcp", + "type": "Bool", + "description": "True, if the server uses TCP instead of UDP" } ] }, @@ -9334,6 +10654,11 @@ "name": "need_debug_information", "type": "Bool", "description": "True, if the call debug information must be sent to the server" + }, + { + "name": "need_log", + "type": "Bool", + "description": "True, if the call log must be sent to the server" } ] }, @@ -9367,6 +10692,57 @@ "class": "GroupCallVideoQuality", "properties": [] }, + { + "name": "groupCallStream", + "description": "Describes an available stream in a group call", + "class": "GroupCallStream", + "properties": [ + { + "name": "channel_id", + "type": "int32", + "description": "Identifier of an audio/video channel" + }, + { + "name": "scale", + "type": "int32", + "description": "Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds" + }, + { + "name": "time_offset", + "type": "int53", + "description": "Point in time when the stream currently ends; Unix timestamp in milliseconds" + } + ] + }, + { + "name": "groupCallStreams", + "description": "Represents a list of group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "streams", + "type": "vector\u003cgroupCallStream\u003e", + "description": "A list of group call streams" + } + ] + }, + { + "name": "rtmpUrl", + "description": "Represents an RTMP url", + "class": "RtmpUrl", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL" + }, + { + "name": "stream_key", + "type": "string", + "description": "Stream key" + } + ] + }, { "name": "groupCallRecentSpeaker", "description": "Describes a recently speaking participant in a group call", @@ -9414,6 +10790,11 @@ "type": "Bool", "description": "True, if the call is active" }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "True, if the chat is an RTMP stream instead of an ordinary video chat" + }, { "name": "is_joined", "type": "Bool", @@ -9434,6 +10815,11 @@ "type": "int32", "description": "Number of participants in the group call" }, + { + "name": "has_hidden_listeners", + "type": "Bool", + "description": "True, if group call participants, which are muted, aren't returned in participant list" + }, { "name": "loaded_all_participants", "type": "Bool", @@ -9521,7 +10907,7 @@ { "name": "is_paused", "type": "Bool", - "description": "True if the video is paused. This flag needs to be ignored, if new video frames are received" + "description": "True, if the video is paused. This flag needs to be ignored, if new video frames are received" } ] }, @@ -9740,6 +11126,146 @@ } ] }, + { + "name": "addedReaction", + "description": "Represents a reaction applied to a message", + "class": "AddedReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the chat member, applied the reaction" + } + ] + }, + { + "name": "addedReactions", + "description": "Represents a list of reactions added to a message", + "class": "AddedReactions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "The total number of found reactions" + }, + { + "name": "reactions", + "type": "vector\u003caddedReaction\u003e", + "description": "The list of added reactions" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, + { + "name": "availableReaction", + "description": "Represents an available reaction", + "class": "AvailableReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "needs_premium", + "type": "Bool", + "description": "True, if Telegram Premium is needed to send the reaction" + } + ] + }, + { + "name": "availableReactions", + "description": "Represents a list of reactions that can be added to a message", + "class": "AvailableReactions", + "properties": [ + { + "name": "top_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of reactions to be shown at the top" + }, + { + "name": "recent_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of recently used reactions" + }, + { + "name": "popular_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of popular reactions" + }, + { + "name": "allow_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji reactions could be added by Telegram Premium subscribers" + } + ] + }, + { + "name": "emojiReaction", + "description": "Contains information about a emoji reaction", + "class": "EmojiReaction", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "title", + "type": "string", + "description": "Reaction title" + }, + { + "name": "is_active", + "type": "Bool", + "description": "True, if the reaction can be added to new messages and enabled in chats" + }, + { + "name": "static_icon", + "type": "sticker", + "description": "Static icon for the reaction" + }, + { + "name": "appear_animation", + "type": "sticker", + "description": "Appear animation for the reaction" + }, + { + "name": "select_animation", + "type": "sticker", + "description": "Select animation for the reaction" + }, + { + "name": "activate_animation", + "type": "sticker", + "description": "Activate animation for the reaction" + }, + { + "name": "effect_animation", + "type": "sticker", + "description": "Effect animation for the reaction" + }, + { + "name": "around_animation", + "type": "sticker", + "description": "Around animation for the reaction; may be null" + }, + { + "name": "center_animation", + "type": "sticker", + "description": "Center animation for the reaction; may be null" + } + ] + }, { "name": "animations", "description": "Represents a list of animations", @@ -9798,7 +11324,7 @@ }, { "name": "importedContacts", - "description": "Represents the result of an ImportContacts request", + "description": "Represents the result of an importContacts request", "class": "ImportedContacts", "properties": [ { @@ -9813,6 +11339,163 @@ } ] }, + { + "name": "speechRecognitionResultPending", + "description": "The speech recognition is ongoing", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "partial_text", + "type": "string", + "description": "Partially recognized text" + } + ] + }, + { + "name": "speechRecognitionResultText", + "description": "The speech recognition successfully finished", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Recognized text" + } + ] + }, + { + "name": "speechRecognitionResultError", + "description": "The speech recognition failed", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "error", + "type": "error", + "description": "Received error" + } + ] + }, + { + "name": "attachmentMenuBotColor", + "description": "Describes a color to highlight a bot added to attachment menu", + "class": "AttachmentMenuBotColor", + "properties": [ + { + "name": "light_color", + "type": "int32", + "description": "Color in the RGB24 format for light themes" + }, + { + "name": "dark_color", + "type": "int32", + "description": "Color in the RGB24 format for dark themes" + } + ] + }, + { + "name": "attachmentMenuBot", + "description": "Represents a bot, which can be added to attachment menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot added to attachment menu" + }, + { + "name": "supports_self_chat", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in the chat with the bot" + }, + { + "name": "supports_user_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in private chats with ordinary users" + }, + { + "name": "supports_bot_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in private chats with other bots" + }, + { + "name": "supports_group_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in basic group and supergroup chats" + }, + { + "name": "supports_channel_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in channel chats" + }, + { + "name": "supports_settings", + "type": "Bool", + "description": "True, if the bot supports \"settings_button_pressed\" event" + }, + { + "name": "request_write_access", + "type": "Bool", + "description": "True, if the user needs to be requested to give the permission to the bot to send them messages" + }, + { + "name": "name", + "type": "string", + "description": "Name for the bot in attachment menu" + }, + { + "name": "name_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected name of the bot if appropriate; may be null" + }, + { + "name": "default_icon", + "type": "file", + "description": "Default attachment menu icon for the bot in SVG format; may be null" + }, + { + "name": "ios_static_icon", + "type": "file", + "description": "Attachment menu icon for the bot in SVG format for the official iOS app; may be null" + }, + { + "name": "ios_animated_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official iOS app; may be null" + }, + { + "name": "android_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official Android app; may be null" + }, + { + "name": "macos_icon", + "type": "file", + "description": "Attachment menu icon for the bot in TGS format for the official native macOS app; may be null" + }, + { + "name": "icon_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected icon of the bot if appropriate; may be null" + }, + { + "name": "web_app_placeholder", + "type": "file", + "description": "Default placeholder for opened Web Apps in SVG format; may be null" + } + ] + }, + { + "name": "sentWebAppMessage", + "description": "Information about the message sent by answerWebAppQuery", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "inline_message_id", + "type": "string", + "description": "Identifier of the sent inline message, if known" + } + ] + }, { "name": "httpUrl", "description": "Contains an HTTP URL", @@ -9825,6 +11508,23 @@ } ] }, + { + "name": "userLink", + "description": "Contains an HTTPS URL, which can be used to get information about a user", + "class": "UserLink", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL" + }, + { + "name": "expires_in", + "type": "int32", + "description": "Left time for which the link is valid, in seconds; 0 if the link is a public username link" + } + ] + }, { "name": "inputInlineQueryResultAnimation", "description": "Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video", @@ -10213,7 +11913,7 @@ }, { "name": "inputInlineQueryResultSticker", - "description": "Represents a link to a WEBP or TGS sticker", + "description": "Represents a link to a WEBP, TGS, or WEBM sticker", "class": "InputInlineQueryResult", "properties": [ { @@ -10229,7 +11929,7 @@ { "name": "sticker_url", "type": "string", - "description": "The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)" + "description": "The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)" }, { "name": "sticker_width", @@ -10730,7 +12430,7 @@ { "name": "password", "type": "string", - "description": "The password for the current user" + "description": "The 2-step verification password for the current user" }, { "name": "data", @@ -10845,18 +12545,11 @@ "name": "message", "type": "message", "description": "Deleted message" - } - ] - }, - { - "name": "chatEventPollStopped", - "description": "A poll in a message was stopped", - "class": "ChatEventAction", - "properties": [ + }, { - "name": "message", - "type": "message", - "description": "The message with the poll" + "name": "can_report_anti_spam_false_positive", + "type": "Bool", + "description": "True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive" } ] }, @@ -10884,6 +12577,18 @@ } ] }, + { + "name": "chatEventPollStopped", + "description": "A poll in a message was stopped", + "class": "ChatEventAction", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with the poll" + } + ] + }, { "name": "chatEventMemberJoined", "description": "A new member joined the chat", @@ -10919,12 +12624,6 @@ } ] }, - { - "name": "chatEventMemberLeft", - "description": "A member left the chat", - "class": "ChatEventAction", - "properties": [] - }, { "name": "chatEventMemberInvited", "description": "A new chat member was invited", @@ -10942,6 +12641,12 @@ } ] }, + { + "name": "chatEventMemberLeft", + "description": "A member left the chat", + "class": "ChatEventAction", + "properties": [] + }, { "name": "chatEventMemberPromoted", "description": "A chat member has gained/lost administrator status, or the list of their administrator privileges has changed", @@ -10987,36 +12692,19 @@ ] }, { - "name": "chatEventTitleChanged", - "description": "The chat title was changed", + "name": "chatEventAvailableReactionsChanged", + "description": "The chat available reactions were changed", "class": "ChatEventAction", "properties": [ { - "name": "old_title", - "type": "string", - "description": "Previous chat title" + "name": "old_available_reactions", + "type": "ChatAvailableReactions", + "description": "Previous chat available reactions" }, { - "name": "new_title", - "type": "string", - "description": "New chat title" - } - ] - }, - { - "name": "chatEventPermissionsChanged", - "description": "The chat permissions was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_permissions", - "type": "chatPermissions", - "description": "Previous chat permissions" - }, - { - "name": "new_permissions", - "type": "chatPermissions", - "description": "New chat permissions" + "name": "new_available_reactions", + "type": "ChatAvailableReactions", + "description": "New chat available reactions" } ] }, @@ -11037,52 +12725,6 @@ } ] }, - { - "name": "chatEventUsernameChanged", - "description": "The chat username was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_username", - "type": "string", - "description": "Previous chat username" - }, - { - "name": "new_username", - "type": "string", - "description": "New chat username" - } - ] - }, - { - "name": "chatEventPhotoChanged", - "description": "The chat photo was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_photo", - "type": "chatPhoto", - "description": "Previous chat photo value; may be null" - }, - { - "name": "new_photo", - "type": "chatPhoto", - "description": "New chat photo value; may be null" - } - ] - }, - { - "name": "chatEventInvitesToggled", - "description": "The can_invite_users permission of a supergroup chat was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "can_invite_users", - "type": "Bool", - "description": "New value of can_invite_users permission" - } - ] - }, { "name": "chatEventLinkedChatChanged", "description": "The linked chat of a supergroup was changed", @@ -11100,81 +12742,6 @@ } ] }, - { - "name": "chatEventSlowModeDelayChanged", - "description": "The slow_mode_delay setting of a supergroup was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_slow_mode_delay", - "type": "int32", - "description": "Previous value of slow_mode_delay, in seconds" - }, - { - "name": "new_slow_mode_delay", - "type": "int32", - "description": "New value of slow_mode_delay, in seconds" - } - ] - }, - { - "name": "chatEventMessageTtlChanged", - "description": "The message TTL was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_message_ttl", - "type": "int32", - "description": "Previous value of message_ttl" - }, - { - "name": "new_message_ttl", - "type": "int32", - "description": "New value of message_ttl" - } - ] - }, - { - "name": "chatEventSignMessagesToggled", - "description": "The sign_messages setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "sign_messages", - "type": "Bool", - "description": "New value of sign_messages" - } - ] - }, - { - "name": "chatEventHasProtectedContentToggled", - "description": "The has_protected_content setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "has_protected_content", - "type": "Bool", - "description": "New value of has_protected_content" - } - ] - }, - { - "name": "chatEventStickerSetChanged", - "description": "The supergroup sticker set was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_sticker_set_id", - "type": "int64", - "description": "Previous identifier of the chat sticker set; 0 if none" - }, - { - "name": "new_sticker_set_id", - "type": "int64", - "description": "New identifier of the chat sticker set; 0 if none" - } - ] - }, { "name": "chatEventLocationChanged", "description": "The supergroup location was changed", @@ -11192,6 +12759,166 @@ } ] }, + { + "name": "chatEventMessageAutoDeleteTimeChanged", + "description": "The message auto-delete timer was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_message_auto_delete_time", + "type": "int32", + "description": "Previous value of message_auto_delete_time" + }, + { + "name": "new_message_auto_delete_time", + "type": "int32", + "description": "New value of message_auto_delete_time" + } + ] + }, + { + "name": "chatEventPermissionsChanged", + "description": "The chat permissions was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_permissions", + "type": "chatPermissions", + "description": "Previous chat permissions" + }, + { + "name": "new_permissions", + "type": "chatPermissions", + "description": "New chat permissions" + } + ] + }, + { + "name": "chatEventPhotoChanged", + "description": "The chat photo was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_photo", + "type": "chatPhoto", + "description": "Previous chat photo value; may be null" + }, + { + "name": "new_photo", + "type": "chatPhoto", + "description": "New chat photo value; may be null" + } + ] + }, + { + "name": "chatEventSlowModeDelayChanged", + "description": "The slow_mode_delay setting of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_slow_mode_delay", + "type": "int32", + "description": "Previous value of slow_mode_delay, in seconds" + }, + { + "name": "new_slow_mode_delay", + "type": "int32", + "description": "New value of slow_mode_delay, in seconds" + } + ] + }, + { + "name": "chatEventStickerSetChanged", + "description": "The supergroup sticker set was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_sticker_set_id", + "type": "int64", + "description": "Previous identifier of the chat sticker set; 0 if none" + }, + { + "name": "new_sticker_set_id", + "type": "int64", + "description": "New identifier of the chat sticker set; 0 if none" + } + ] + }, + { + "name": "chatEventTitleChanged", + "description": "The chat title was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_title", + "type": "string", + "description": "Previous chat title" + }, + { + "name": "new_title", + "type": "string", + "description": "New chat title" + } + ] + }, + { + "name": "chatEventUsernameChanged", + "description": "The chat editable username was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_username", + "type": "string", + "description": "Previous chat username" + }, + { + "name": "new_username", + "type": "string", + "description": "New chat username" + } + ] + }, + { + "name": "chatEventActiveUsernamesChanged", + "description": "The chat active usernames were changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_usernames", + "type": "vector\u003cstring\u003e", + "description": "Previous list of active usernames" + }, + { + "name": "new_usernames", + "type": "vector\u003cstring\u003e", + "description": "New list of active usernames" + } + ] + }, + { + "name": "chatEventHasProtectedContentToggled", + "description": "The has_protected_content setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "chatEventInvitesToggled", + "description": "The can_invite_users permission of a supergroup chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "can_invite_users", + "type": "Bool", + "description": "New value of can_invite_users permission" + } + ] + }, { "name": "chatEventIsAllHistoryAvailableToggled", "description": "The is_all_history_available setting of a supergroup was toggled", @@ -11204,6 +12931,30 @@ } ] }, + { + "name": "chatEventHasAggressiveAntiSpamEnabledToggled", + "description": "The has_aggressive_anti_spam_enabled setting of a supergroup was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "New value of has_aggressive_anti_spam_enabled" + } + ] + }, + { + "name": "chatEventSignMessagesToggled", + "description": "The sign_messages setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "sign_messages", + "type": "Bool", + "description": "New value of sign_messages" + } + ] + }, { "name": "chatEventInviteLinkEdited", "description": "A chat invite link was edited", @@ -11269,6 +13020,18 @@ } ] }, + { + "name": "chatEventVideoChatMuteNewParticipantsToggled", + "description": "The mute_new_participants setting of a video chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ] + }, { "name": "chatEventVideoChatParticipantIsMutedToggled", "description": "A video chat participant was muted or unmuted", @@ -11304,14 +13067,96 @@ ] }, { - "name": "chatEventVideoChatMuteNewParticipantsToggled", - "description": "The mute_new_participants setting of a video chat was toggled", + "name": "chatEventIsForumToggled", + "description": "The is_forum setting of a channel was toggled", "class": "ChatEventAction", "properties": [ { - "name": "mute_new_participants", + "name": "is_forum", "type": "Bool", - "description": "New value of the mute_new_participants setting" + "description": "New value of is_forum" + } + ] + }, + { + "name": "chatEventForumTopicCreated", + "description": "A new forum topic was created", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "Information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicEdited", + "description": "A forum topic was edited", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_topic_info", + "type": "forumTopicInfo", + "description": "Old information about the topic" + }, + { + "name": "new_topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicToggleIsClosed", + "description": "A forum topic was closed or reopened", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicToggleIsHidden", + "description": "The General forum topic was hidden or unhidden", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicDeleted", + "description": "A forum topic was deleted", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "Information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicPinned", + "description": "A pinned forum topic was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_topic_info", + "type": "forumTopicInfo", + "description": "Information about the old pinned topic; may be null" + }, + { + "name": "new_topic_info", + "type": "forumTopicInfo", + "description": "Information about the new pinned topic; may be null" } ] }, @@ -11418,6 +13263,11 @@ "name": "video_chat_changes", "type": "Bool", "description": "True, if video chat actions need to be returned" + }, + { + "name": "forum_changes", + "type": "Bool", + "description": "True, if forum-related actions need to be returned" } ] }, @@ -11435,7 +13285,7 @@ }, { "name": "languagePackStringValuePluralized", - "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info", + "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information", "class": "LanguagePackStringValue", "properties": [ { @@ -11533,7 +13383,7 @@ { "name": "plural_code", "type": "string", - "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info" + "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information" }, { "name": "is_official", @@ -11589,6 +13439,309 @@ } ] }, + { + "name": "premiumLimitTypeSupergroupCount", + "description": "The maximum number of joined supergroups and channels", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypePinnedChatCount", + "description": "The maximum number of pinned chats in the main chat list", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeCreatedPublicChatCount", + "description": "The maximum number of created public chats", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeSavedAnimationCount", + "description": "The maximum number of saved animations", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeFavoriteStickerCount", + "description": "The maximum number of favorite stickers", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeChatFilterCount", + "description": "The maximum number of chat filters", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeChatFilterChosenChatCount", + "description": "The maximum number of pinned and always included, or always excluded chats in a chat filter", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypePinnedArchivedChatCount", + "description": "The maximum number of pinned chats in the archive chat list", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeCaptionLength", + "description": "The maximum length of sent media caption", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeBioLength", + "description": "The maximum length of the user's bio", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumFeatureIncreasedLimits", + "description": "Increased limits", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureIncreasedUploadFileSize", + "description": "Increased maximum upload file size", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureImprovedDownloadSpeed", + "description": "Improved download speed", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureVoiceRecognition", + "description": "The ability to convert voice notes to text", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureDisabledAds", + "description": "Disabled ads", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUniqueReactions", + "description": "Allowed to use more reactions", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUniqueStickers", + "description": "Allowed to use premium stickers with unique effects", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureCustomEmoji", + "description": "Allowed to use custom emoji stickers in message texts and captions", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAdvancedChatManagement", + "description": "Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureProfileBadge", + "description": "A badge in the user's profile", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureEmojiStatus", + "description": "A emoji status shown along with the user's name", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAnimatedProfilePhoto", + "description": "Profile photo animation on message and chat screens", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureForumTopicIcon", + "description": "The ability to set a custom emoji as a forum topic icon", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAppIcons", + "description": "Allowed to set a premium appllication icons", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumLimit", + "description": "Contains information about a limit, increased for Premium users", + "class": "PremiumLimit", + "properties": [ + { + "name": "type", + "type": "PremiumLimitType", + "description": "The type of the limit" + }, + { + "name": "default_value", + "type": "int32", + "description": "Default value of the limit" + }, + { + "name": "premium_value", + "type": "int32", + "description": "Value of the limit for Premium users" + } + ] + }, + { + "name": "premiumFeatures", + "description": "Contains information about features, available to Premium users", + "class": "PremiumFeatures", + "properties": [ + { + "name": "features", + "type": "vector\u003cPremiumFeature\u003e", + "description": "The list of available features" + }, + { + "name": "limits", + "type": "vector\u003cpremiumLimit\u003e", + "description": "The list of limits, increased for Premium users" + }, + { + "name": "payment_link", + "type": "InternalLinkType", + "description": "An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available" + } + ] + }, + { + "name": "premiumSourceLimitExceeded", + "description": "A limit was exceeded", + "class": "PremiumSource", + "properties": [ + { + "name": "limit_type", + "type": "PremiumLimitType", + "description": "Type of the exceeded limit" + } + ] + }, + { + "name": "premiumSourceFeature", + "description": "A user tried to use a Premium feature", + "class": "PremiumSource", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "The used feature" + } + ] + }, + { + "name": "premiumSourceLink", + "description": "A user opened an internal link of the type internalLinkTypePremiumFeatures", + "class": "PremiumSource", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "The referrer from the link" + } + ] + }, + { + "name": "premiumSourceSettings", + "description": "A user opened the Premium features screen from settings", + "class": "PremiumSource", + "properties": [] + }, + { + "name": "premiumFeaturePromotionAnimation", + "description": "Describes a promotion animation for a Premium feature", + "class": "PremiumFeaturePromotionAnimation", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "Premium feature" + }, + { + "name": "animation", + "type": "animation", + "description": "Promotion animation for the feature" + } + ] + }, + { + "name": "premiumState", + "description": "Contains state of Telegram Premium subscription and promotion videos for Premium features", + "class": "PremiumState", + "properties": [ + { + "name": "state", + "type": "formattedText", + "description": "Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription" + }, + { + "name": "payment_options", + "type": "vector\u003cpremiumPaymentOption\u003e", + "description": "The list of available options for buying Telegram Premium" + }, + { + "name": "animations", + "type": "vector\u003cpremiumFeaturePromotionAnimation\u003e", + "description": "The list of available promotion animations for Premium features" + } + ] + }, + { + "name": "storePaymentPurposePremiumSubscription", + "description": "The user subscribed to Telegram Premium", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "is_restore", + "type": "Bool", + "description": "Pass true if this is a restore of a Telegram Premium purchase; only for App Store" + } + ] + }, + { + "name": "storePaymentPurposeGiftedPremium", + "description": "The user gifted Telegram Premium to another user", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user for which Premium was gifted" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + } + ] + }, { "name": "deviceTokenFirebaseCloudMessaging", "description": "A token for Firebase Cloud Messaging", @@ -11793,7 +13946,7 @@ { "name": "rotation_angle", "type": "int32", - "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45" + "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45" } ] }, @@ -12059,8 +14212,14 @@ "properties": [] }, { - "name": "checkChatUsernameResultPublicChatsTooMuch", - "description": "The user has too much chats with username, one of them must be made private first", + "name": "checkChatUsernameResultUsernamePurchasable", + "description": "The username can be purchased at fragment.com", + "class": "CheckChatUsernameResult", + "properties": [] + }, + { + "name": "checkChatUsernameResultPublicChatsTooMany", + "description": "The user has too many chats with username, one of them must be made private first", "class": "CheckChatUsernameResult", "properties": [] }, @@ -12559,6 +14718,24 @@ "class": "PushMessageContent", "properties": [] }, + { + "name": "pushMessageContentRecurringPayment", + "description": "A new recurrent payment was made by the current user", + "class": "PushMessageContent", + "properties": [ + { + "name": "amount", + "type": "string", + "description": "The paid amount" + } + ] + }, + { + "name": "pushMessageContentSuggestProfilePhoto", + "description": "A profile photo was suggested to the user", + "class": "PushMessageContent", + "properties": [] + }, { "name": "pushMessageContentMessageForwards", "description": "A forwarded messages", @@ -12589,7 +14766,7 @@ { "name": "has_videos", "type": "Bool", - "description": "True, if the album has at least one video" + "description": "True, if the album has at least one video file" }, { "name": "has_audios", @@ -12612,6 +14789,11 @@ "name": "message", "type": "message", "description": "The message" + }, + { + "name": "show_preview", + "type": "Bool", + "description": "True, if message content must be displayed in notifications" } ] }, @@ -12689,6 +14871,55 @@ "class": "NotificationGroupType", "properties": [] }, + { + "name": "notificationSound", + "description": "Describes a notification sound in MP3 format", + "class": "NotificationSound", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique identifier of the notification sound" + }, + { + "name": "duration", + "type": "int32", + "description": "Duration of the sound, in seconds" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the sound was created" + }, + { + "name": "title", + "type": "string", + "description": "Title of the notification sound" + }, + { + "name": "data", + "type": "string", + "description": "Arbitrary data, defined while the sound was uploaded" + }, + { + "name": "sound", + "type": "file", + "description": "File containing the sound" + } + ] + }, + { + "name": "notificationSounds", + "description": "Contains a list of notification sounds", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sounds", + "type": "vector\u003cnotificationSound\u003e", + "description": "A list of notification sounds" + } + ] + }, { "name": "notification", "description": "Contains information about a notification", @@ -12707,7 +14938,7 @@ { "name": "is_silent", "type": "Bool", - "description": "True, if the notification was initially silent" + "description": "True, if the notification was explicitly sent without sound" }, { "name": "type", @@ -13005,6 +15236,12 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages", + "description": "A privacy setting for managing whether the user can receive voice and video messages in private chats", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "accountTtl", "description": "Contains information about the period of inactivity after which the current user's account will automatically be deleted", @@ -13017,6 +15254,120 @@ } ] }, + { + "name": "messageAutoDeleteTime", + "description": "Contains default auto-delete timer setting for new chats", + "class": "MessageAutoDeleteTime", + "properties": [ + { + "name": "time", + "type": "int32", + "description": "Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically" + } + ] + }, + { + "name": "sessionTypeAndroid", + "description": "The session is running on an Android device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeApple", + "description": "The session is running on a generic Apple device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeBrave", + "description": "The session is running on the Brave browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeChrome", + "description": "The session is running on the Chrome browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeEdge", + "description": "The session is running on the Edge browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeFirefox", + "description": "The session is running on the Firefox browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeIpad", + "description": "The session is running on an iPad device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeIphone", + "description": "The session is running on an iPhone device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeLinux", + "description": "The session is running on a Linux device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeMac", + "description": "The session is running on a Mac device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeOpera", + "description": "The session is running on the Opera browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeSafari", + "description": "The session is running on the Safari browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeUbuntu", + "description": "The session is running on an Ubuntu device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeUnknown", + "description": "The session is running on an unknown type of device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeVivaldi", + "description": "The session is running on the Vivaldi browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeWindows", + "description": "The session is running on a Windows device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeXbox", + "description": "The session is running on an Xbox console", + "class": "SessionType", + "properties": [] + }, { "name": "session", "description": "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", @@ -13035,7 +15386,7 @@ { "name": "is_password_pending", "type": "Bool", - "description": "True, if a password is needed to complete authorization of the session" + "description": "True, if a 2-step verification password is needed to complete authorization of the session" }, { "name": "can_accept_secret_chats", @@ -13047,6 +15398,11 @@ "type": "Bool", "description": "True, if incoming calls can be accepted by the session" }, + { + "name": "type", + "type": "SessionType", + "description": "Session type based on the system and application version, which can be used to display a corresponding icon" + }, { "name": "api_id", "type": "int32", @@ -13174,7 +15530,7 @@ { "name": "location", "type": "string", - "description": "Human-readable description of a country and a region, from which the user was logged in, based on the IP address" + "description": "Human-readable description of a country and a region from which the user was logged in, based on the IP address" } ] }, @@ -13232,18 +15588,97 @@ "class": "ChatReportReason", "properties": [] }, + { + "name": "chatReportReasonIllegalDrugs", + "description": "The chat has illegal drugs related content", + "class": "ChatReportReason", + "properties": [] + }, + { + "name": "chatReportReasonPersonalDetails", + "description": "The chat contains messages with personal details", + "class": "ChatReportReason", + "properties": [] + }, { "name": "chatReportReasonCustom", "description": "A custom reason provided by the user", "class": "ChatReportReason", "properties": [] }, + { + "name": "targetChatCurrent", + "description": "The currently opened chat needs to be kept", + "class": "TargetChat", + "properties": [] + }, + { + "name": "targetChatChosen", + "description": "The chat needs to be chosen by the user among chats of the specified types", + "class": "TargetChat", + "properties": [ + { + "name": "allow_user_chats", + "type": "Bool", + "description": "True, if private chats with ordinary users are allowed" + }, + { + "name": "allow_bot_chats", + "type": "Bool", + "description": "True, if private chats with other bots are allowed" + }, + { + "name": "allow_group_chats", + "type": "Bool", + "description": "True, if basic group and supergroup chats are allowed" + }, + { + "name": "allow_channel_chats", + "type": "Bool", + "description": "True, if channel chats are allowed" + } + ] + }, + { + "name": "targetChatInternalLink", + "description": "The chat needs to be open with the provided internal link", + "class": "TargetChat", + "properties": [ + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link pointing to the chat" + } + ] + }, { "name": "internalLinkTypeActiveSessions", - "description": "The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link", + "description": "The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link", "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeAttachmentMenuBot", + "description": "The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL", + "class": "InternalLinkType", + "properties": [ + { + "name": "target_chat", + "type": "TargetChat", + "description": "Target chat to be opened" + }, + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "internalLinkTypeAuthenticationCode", "description": "The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode", @@ -13282,12 +15717,17 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" + }, + { + "name": "autostart", + "type": "Bool", + "description": "True, if sendBotStartMessage must be called automatically without showing the START button" } ] }, { "name": "internalLinkTypeBotStartInGroup", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat.", "class": "InternalLinkType", "properties": [ { @@ -13299,6 +15739,28 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot; may be null" + } + ] + }, + { + "name": "internalLinkTypeBotAddToChannel", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot" } ] }, @@ -13320,9 +15782,21 @@ } ] }, + { + "name": "internalLinkTypeDefaultMessageAutoDeleteTimerSettings", + "description": "The link is a link to the default message auto-delete timer settings section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeEditProfileSettings", + "description": "The link is a link to the edit profile section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeFilterSettings", - "description": "The link is a link to the filter settings section of the app", + "description": "The link is a link to the filter section of the app settings", "class": "InternalLinkType", "properties": [] }, @@ -13343,6 +15817,35 @@ } ] }, + { + "name": "internalLinkTypeInstantView", + "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to be passed to getWebPageInstantView" + }, + { + "name": "fallback_url", + "type": "string", + "description": "An URL to open if getWebPageInstantView fails" + } + ] + }, + { + "name": "internalLinkTypeInvoice", + "description": "The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "invoice_name", + "type": "string", + "description": "Name of the invoice" + } + ] + }, { "name": "internalLinkTypeLanguagePack", "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link", @@ -13355,9 +15858,15 @@ } ] }, + { + "name": "internalLinkTypeLanguageSettings", + "description": "The link is a link to the language section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeMessage", - "description": "The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link", + "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link", "class": "InternalLinkType", "properties": [ { @@ -13386,7 +15895,7 @@ }, { "name": "internalLinkTypePassportDataRequest", - "description": "The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it", + "description": "The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application, otherwise ignore it", "class": "InternalLinkType", "properties": [ { @@ -13433,6 +15942,24 @@ } ] }, + { + "name": "internalLinkTypePremiumFeatures", + "description": "The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "Referrer specified in the link" + } + ] + }, + { + "name": "internalLinkTypePrivacyAndSecuritySettings", + "description": "The link is a link to the privacy and security section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeProxy", "description": "The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy", @@ -13473,9 +16000,15 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeRestorePurchases", + "description": "The link forces restore of App Store purchases when opened. For official iOS application only", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeSettings", - "description": "The link is a link to app settings", + "description": "The link is a link to application settings", "class": "InternalLinkType", "properties": [] }, @@ -13488,6 +16021,11 @@ "name": "sticker_set_name", "type": "string", "description": "Name of the sticker set" + }, + { + "name": "expect_custom_emoji", + "type": "Bool", + "description": "True, if the sticker set is expected to contain custom emoji" } ] }, @@ -13505,7 +16043,7 @@ }, { "name": "internalLinkTypeThemeSettings", - "description": "The link is a link to the theme settings section of the app", + "description": "The link is a link to the theme section of the app settings", "class": "InternalLinkType", "properties": [] }, @@ -13527,9 +16065,33 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeUserPhoneNumber", + "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number of the user" + } + ] + }, + { + "name": "internalLinkTypeUserToken", + "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, { "name": "internalLinkTypeVideoChat", - "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link", + "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link", "class": "InternalLinkType", "properties": [ { @@ -13551,13 +16113,13 @@ }, { "name": "messageLink", - "description": "Contains an HTTPS link to a message in a supergroup or channel", + "description": "Contains an HTTPS link to a message in a supergroup or channel, or a forum topic", "class": "MessageLink", "properties": [ { "name": "link", "type": "string", - "description": "Message link" + "description": "The link" }, { "name": "is_public", @@ -13568,18 +16130,23 @@ }, { "name": "messageLinkInfo", - "description": "Contains information about a link to a message in a chat", + "description": "Contains information about a link to a message or a forum topic in a chat", "class": "MessageLinkInfo", "properties": [ { "name": "is_public", "type": "Bool", - "description": "True, if the link is a public link for a message in a chat" + "description": "True, if the link is a public link for a message or a forum topic in a chat" }, { "name": "chat_id", "type": "int53", - "description": "If found, identifier of the chat to which the message belongs, 0 otherwise" + "description": "If found, identifier of the chat to which the link points, 0 otherwise" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing" }, { "name": "message", @@ -13595,11 +16162,6 @@ "name": "for_album", "type": "Bool", "description": "True, if the whole media album to which the message belongs is linked" - }, - { - "name": "for_comment", - "type": "Bool", - "description": "True, if the message is linked as a channel post comment or from a message thread" } ] }, @@ -13639,6 +16201,12 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypeNotificationSound", + "description": "The file is a notification sound", + "class": "FileType", + "properties": [] + }, { "name": "fileTypePhoto", "description": "The file is a photo", @@ -13944,12 +16512,12 @@ }, { "name": "max_video_file_size", - "type": "int32", + "type": "int53", "description": "The maximum size of a video file to be auto-downloaded, in bytes" }, { "name": "max_other_file_size", - "type": "int32", + "type": "int53", "description": "The maximum size of other file types to be auto-downloaded, in bytes" }, { @@ -14100,7 +16668,7 @@ { "name": "info", "type": "chatInviteLinkInfo", - "description": "Chat invite link info" + "description": "Information about the chat invite link" } ] }, @@ -14229,6 +16797,18 @@ } ] }, + { + "name": "fileDownloadedPrefixSize", + "description": "Contains size of downloaded prefix of a file", + "class": "FileDownloadedPrefixSize", + "properties": [ + { + "name": "size", + "type": "int53", + "description": "The prefix size, in bytes" + } + ] + }, { "name": "deepLinkInfo", "description": "Contains information about a tg: deep link", @@ -14365,41 +16945,29 @@ ] }, { - "name": "inputStickerStatic", - "description": "A static sticker in PNG format, which will be converted to WEBP server-side", + "name": "inputSticker", + "description": "A sticker to be added to a sticker set", "class": "InputSticker", "properties": [ { "name": "sticker", "type": "InputFile", - "description": "PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square" + "description": "File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" }, { "name": "emojis", "type": "string", "description": "Emojis corresponding to the sticker" }, + { + "name": "format", + "type": "StickerFormat", + "description": "Sticker format" + }, { "name": "mask_position", "type": "maskPosition", - "description": "For masks, position where the mask is placed; pass null if unspecified" - } - ] - }, - { - "name": "inputStickerAnimated", - "description": "An animated sticker in TGS format", - "class": "InputSticker", - "properties": [ - { - "name": "sticker", - "type": "InputFile", - "description": "File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" - }, - { - "name": "emojis", - "type": "string", - "description": "Emojis corresponding to the sticker" + "description": "Position where the mask is placed; pass null if not specified" } ] }, @@ -15048,7 +17616,7 @@ }, { "name": "updateMessageContentOpened", - "description": "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the TTL timer for self-destructing messages", + "description": "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the self-destruct timer", "class": "Update", "properties": [ { @@ -15085,6 +17653,33 @@ } ] }, + { + "name": "updateMessageUnreadReactions", + "description": "The list of unread reactions added to a message was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "The new list of unread reactions" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The new number of messages with unread reactions left in the chat" + } + ] + }, { "name": "updateMessageLiveLocationViewed", "description": "A message with a live location was viewed. When the update is received, the application is supposed to update the live location", @@ -15260,6 +17855,23 @@ } ] }, + { + "name": "updateChatAvailableReactions", + "description": "The chat available reactions were changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "The new reactions, available in the chat" + } + ] + }, { "name": "updateChatDraftMessage", "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", @@ -15300,8 +17912,8 @@ ] }, { - "name": "updateChatMessageTtl", - "description": "The message Time To Live setting for a chat was changed", + "name": "updateChatMessageAutoDeleteTime", + "description": "The message auto-delete or self-destruct timer setting for a chat was changed", "class": "Update", "properties": [ { @@ -15310,9 +17922,9 @@ "description": "Chat identifier" }, { - "name": "message_ttl", + "name": "message_auto_delete_time", "type": "int32", - "description": "New value of message_ttl" + "description": "New value of message_auto_delete_time" } ] }, @@ -15401,6 +18013,23 @@ } ] }, + { + "name": "updateChatUnreadReactionCount", + "description": "The chat unread_reaction_count has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The number of messages with unread reactions left in the chat" + } + ] + }, { "name": "updateChatVideoChat", "description": "A chat video chat state has changed", @@ -15512,12 +18141,17 @@ "name": "chat_filters", "type": "vector\u003cchatFilterInfo\u003e", "description": "The new list of chat filters" + }, + { + "name": "main_chat_list_position", + "type": "int32", + "description": "Position of the main chat list among chat filters, 0-based" } ] }, { "name": "updateChatOnlineMemberCount", - "description": "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed", + "description": "The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed", "class": "Update", "properties": [ { @@ -15532,6 +18166,23 @@ } ] }, + { + "name": "updateForumTopicInfo", + "description": "Basic information about a topic in a forum chat was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, { "name": "updateScopeNotificationSettings", "description": "Notification settings for some type of chats were updated", @@ -15592,9 +18243,9 @@ "description": "Chat identifier, which notification settings must be applied to the added notifications" }, { - "name": "is_silent", - "type": "Bool", - "description": "True, if the notifications must be shown without sound" + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "total_count", @@ -15880,6 +18531,89 @@ } ] }, + { + "name": "updateFileDownloads", + "description": "The state of the file download list has changed", + "class": "Update", + "properties": [ + { + "name": "total_size", + "type": "int53", + "description": "Total size of files in the file download list, in bytes" + }, + { + "name": "total_count", + "type": "int32", + "description": "Total number of files in the file download list" + }, + { + "name": "downloaded_size", + "type": "int53", + "description": "Total downloaded size of files in the file download list, in bytes" + } + ] + }, + { + "name": "updateFileAddedToDownloads", + "description": "A file was added to the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_download", + "type": "fileDownload", + "description": "The added file download" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileDownload", + "description": "A file download was changed. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileRemovedFromDownloads", + "description": "A file was removed from the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, { "name": "updateCall", "description": "New call was created or information about a call was updated", @@ -16049,9 +18783,9 @@ "class": "Update", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "True, if the list of installed mask sticker sets was updated" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the affected stickers" }, { "name": "sticker_set_ids", @@ -16065,9 +18799,14 @@ "description": "The list of trending sticker sets was updated or some of them were viewed", "class": "Update", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the affected stickers" + }, { "name": "sticker_sets", - "type": "stickerSets", + "type": "trendingStickerSets", "description": "The prefix of the list of trending sticker sets with the newest trending sticker sets" } ] @@ -16113,6 +18852,18 @@ } ] }, + { + "name": "updateSavedNotificationSounds", + "description": "The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", + "class": "Update", + "properties": [ + { + "name": "notification_sound_ids", + "type": "vector\u003cint64\u003e", + "description": "The new list of identifiers of saved notification sounds" + } + ] + }, { "name": "updateSelectedBackground", "description": "The selected background has changed", @@ -16205,6 +18956,54 @@ } ] }, + { + "name": "updateAttachmentMenuBots", + "description": "The list of bots added to attachment menu has changed", + "class": "Update", + "properties": [ + { + "name": "bots", + "type": "vector\u003cattachmentMenuBot\u003e", + "description": "The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen" + } + ] + }, + { + "name": "updateWebAppMessageSent", + "description": "A message was sent by an opened Web App, so the Web App needs to be closed", + "class": "Update", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of Web App launch" + } + ] + }, + { + "name": "updateActiveEmojiReactions", + "description": "The list of active emoji reactions has changed", + "class": "Update", + "properties": [ + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "The new list of active emoji reactions" + } + ] + }, + { + "name": "updateDefaultReactionType", + "description": "The type of default reaction has changed", + "class": "Update", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "The new type of the default reaction" + } + ] + }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -16241,7 +19040,7 @@ }, { "name": "updateAnimationSearchParameters", - "description": "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed", + "description": "The parameters of animation search through getOption(\"animation_search_bot_username\") bot has changed", "class": "Update", "properties": [ { @@ -16296,7 +19095,7 @@ { "name": "chat_type", "type": "ChatType", - "description": "The type of the chat, from which the query originated; may be null if unknown" + "description": "The type of the chat from which the query originated; may be null if unknown" }, { "name": "query", @@ -16365,7 +19164,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message, from which the query originated" + "description": "Identifier of the message from which the query originated" }, { "name": "chat_instance", @@ -16397,7 +19196,7 @@ { "name": "inline_message_id", "type": "string", - "description": "Identifier of the inline message, from which the query originated" + "description": "Identifier of the inline message from which the query originated" }, { "name": "chat_instance", @@ -16677,6 +19476,28 @@ } ] }, + { + "name": "userSupportInfo", + "description": "Contains custom information about the user", + "class": "UserSupportInfo", + "properties": [ + { + "name": "message", + "type": "formattedText", + "description": "Information message" + }, + { + "name": "author", + "type": "string", + "description": "Information author" + }, + { + "name": "date", + "type": "int32", + "description": "Information change date" + } + ] + }, { "name": "testInt", "description": "A simple object containing a number; for testing only", @@ -16767,6 +19588,10 @@ "name": "AuthenticationCodeType", "description": "Provides information about the method by which an authentication code is delivered to the user" }, + { + "name": "EmailAddressAuthentication", + "description": "Contains authentication data for a email address" + }, { "name": "AuthorizationState", "description": "Represents the current authorization state of the TDLib client" @@ -16777,12 +19602,24 @@ }, { "name": "ThumbnailFormat", - "description": "Describes format of the thumbnail" + "description": "Describes format of a thumbnail" }, { "name": "MaskPoint", "description": "Part of the face, relative to which a mask is placed" }, + { + "name": "StickerFormat", + "description": "Describes format of a sticker" + }, + { + "name": "StickerType", + "description": "Describes type of a sticker" + }, + { + "name": "StickerFullType", + "description": "Contains full information about sticker type" + }, { "name": "PollType", "description": "Describes the type of a poll" @@ -16819,6 +19656,10 @@ "name": "MessageForwardOrigin", "description": "Contains information about the origin of a forwarded message" }, + { + "name": "ReactionType", + "description": "Describes type of message reaction" + }, { "name": "MessageSendingState", "description": "Contains information about the sending state of the message" @@ -16839,6 +19680,10 @@ "name": "ChatSource", "description": "Describes a reason why an external chat is shown in a chat list" }, + { + "name": "ChatAvailableReactions", + "description": "Describes reactions available in the chat" + }, { "name": "PublicChatType", "description": "Describes a type of public chats" @@ -16883,6 +19728,18 @@ "name": "InputCredentials", "description": "Contains information about the payment method chosen by the user" }, + { + "name": "PaymentProvider", + "description": "Contains information about a payment provider" + }, + { + "name": "InputInvoice", + "description": "Describes an invoice to process" + }, + { + "name": "MessageExtendedMedia", + "description": "Describes a media, which is attached to an invoice" + }, { "name": "PassportElementType", "description": "Contains the type of a Telegram Passport element" @@ -16955,6 +19812,10 @@ "name": "DiceStickers", "description": "Contains animated stickers which must be used for dice animation rendering" }, + { + "name": "SpeechRecognitionResult", + "description": "Describes result of speech recognition in a voice note" + }, { "name": "InputInlineQueryResult", "description": "Represents a single result of an inline query; for bots only" @@ -16975,6 +19836,22 @@ "name": "LanguagePackStringValue", "description": "Represents the value of a string in a language pack" }, + { + "name": "PremiumLimitType", + "description": "Describes type of a limit, increased for Premium users" + }, + { + "name": "PremiumFeature", + "description": "Describes a feature available to Premium users" + }, + { + "name": "PremiumSource", + "description": "Describes a source from which the Premium features screen is opened" + }, + { + "name": "StorePaymentPurpose", + "description": "Describes a purpose of an in-store payment" + }, { "name": "DeviceToken", "description": "Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org" @@ -17039,13 +19916,21 @@ "name": "UserPrivacySetting", "description": "Describes available user privacy settings" }, + { + "name": "SessionType", + "description": "Represents the type of a session" + }, { "name": "ChatReportReason", "description": "Describes the reason why a chat is reported" }, + { + "name": "TargetChat", + "description": "Describes the target chat to be opened" + }, { "name": "InternalLinkType", - "description": "Describes an internal https://t.me or tg: link, which must be processed by the app in a special way" + "description": "Describes an internal https://t.me or tg: link, which must be processed by the application in a special way" }, { "name": "FileType", @@ -17077,16 +19962,12 @@ }, { "name": "TextParseMode", - "description": "Describes the way the text needs to be parsed for TextEntities" + "description": "Describes the way the text needs to be parsed for text entities" }, { "name": "ProxyType", "description": "Describes the type of a proxy server" }, - { - "name": "InputSticker", - "description": "Describes a sticker that needs to be added to a sticker set" - }, { "name": "StatisticalGraph", "description": "Describes a statistical graph" @@ -17127,23 +20008,84 @@ "class": "Ok", "properties": [ { - "name": "parameters", - "type": "tdlibParameters", - "description": "Parameters for TDLib initialization" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "checkDatabaseEncryptionKey", - "description": "Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey", - "class": "Ok", - "properties": [ + "name": "use_test_dc", + "type": "Bool", + "description": "Pass true to use Telegram test environment instead of the production environment" + }, { - "name": "encryption_key", + "name": "database_directory", + "type": "string", + "description": "The path to the directory for the persistent database; if empty, the current working directory will be used" + }, + { + "name": "files_directory", + "type": "string", + "description": "The path to the directory for storing files; if empty, database_directory will be used" + }, + { + "name": "database_encryption_key", "type": "bytes", - "description": "Encryption key to check or set up" + "description": "Encryption key for the database" + }, + { + "name": "use_file_database", + "type": "Bool", + "description": "Pass true to keep information about downloaded and uploaded files between application restarts" + }, + { + "name": "use_chat_info_database", + "type": "Bool", + "description": "Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database" + }, + { + "name": "use_message_database", + "type": "Bool", + "description": "Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database" + }, + { + "name": "use_secret_chats", + "type": "Bool", + "description": "Pass true to enable support for secret chats" + }, + { + "name": "api_id", + "type": "int32", + "description": "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org" + }, + { + "name": "api_hash", + "type": "string", + "description": "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org" + }, + { + "name": "system_language_code", + "type": "string", + "description": "IETF language tag of the user's operating system language; must be non-empty" + }, + { + "name": "device_model", + "type": "string", + "description": "Model of the device the application is being run on; must be non-empty" + }, + { + "name": "system_version", + "type": "string", + "description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib" + }, + { + "name": "application_version", + "type": "string", + "description": "Application version; must be non-empty" + }, + { + "name": "enable_storage_optimizer", + "type": "Bool", + "description": "Pass true to automatically delete old files in background" + }, + { + "name": "ignore_file_names", + "type": "Bool", + "description": "Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name" } ], "is_synchronous": false, @@ -17168,14 +20110,42 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setAuthenticationEmailAddress", + "description": "Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress", + "class": "Ok", + "properties": [ + { + "name": "email_address", + "type": "string", + "description": "The email address of the user" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "resendAuthenticationCode", - "description": "Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed", + "description": "Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode", "class": "Ok", "properties": [], "is_synchronous": false, "type": 1 }, + { + "name": "checkAuthenticationEmailCode", + "description": "Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "EmailAddressAuthentication", + "description": "Email address authentication to check" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationCode", "description": "Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode", @@ -17225,13 +20195,13 @@ }, { "name": "checkAuthenticationPassword", - "description": "Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { "name": "password", "type": "string", - "description": "The password to check" + "description": "The 2-step verification password to check" } ], "is_synchronous": false, @@ -17239,7 +20209,7 @@ }, { "name": "requestAuthenticationPasswordRecovery", - "description": "Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [], "is_synchronous": false, @@ -17247,7 +20217,7 @@ }, { "name": "checkAuthenticationPasswordRecoveryCode", - "description": "Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17261,7 +20231,7 @@ }, { "name": "recoverAuthenticationPassword", - "description": "Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17272,7 +20242,7 @@ { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17337,7 +20307,7 @@ }, { "name": "getCurrentState", - "description": "Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization", + "description": "Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization", "class": "Updates", "properties": [], "is_synchronous": false, @@ -17367,18 +20337,18 @@ }, { "name": "setPassword", - "description": "Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", + "description": "Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", "class": "PasswordState", "properties": [ { "name": "old_password", "type": "string", - "description": "Previous password of the user" + "description": "Previous 2-step verification password of the user" }, { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17388,7 +20358,7 @@ { "name": "set_recovery_email_address", "type": "Bool", - "description": "Pass true if the recovery email address must be changed" + "description": "Pass true to change also the recovery email address" }, { "name": "new_recovery_email_address", @@ -17399,6 +20369,42 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setLoginEmailAddress", + "description": "Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly", + "class": "EmailAddressAuthenticationCodeInfo", + "properties": [ + { + "name": "new_login_email_address", + "type": "string", + "description": "New login email address" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "resendLoginEmailAddressCode", + "description": "Resends the login email address verification code", + "class": "EmailAddressAuthenticationCodeInfo", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkLoginEmailAddressCode", + "description": "Checks the login email address authentication", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "EmailAddressAuthentication", + "description": "Email address authentication to check" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getRecoveryEmailAddress", "description": "Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user", @@ -17407,7 +20413,7 @@ { "name": "password", "type": "string", - "description": "The password for the current user" + "description": "The 2-step verification password for the current user" } ], "is_synchronous": false, @@ -17421,7 +20427,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" }, { "name": "new_recovery_email_address", @@ -17489,7 +20495,7 @@ { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17524,7 +20530,7 @@ { "name": "password", "type": "string", - "description": "Persistent user password" + "description": "The 2-step verification password of the current user" }, { "name": "valid_for", @@ -17684,7 +20690,7 @@ }, { "name": "getMessageLocally", - "description": "Returns information about a message, if it is available locally without sending network request. This is an offline request", + "description": "Returns information about a message, if it is available without sending network request. This is an offline request", "class": "Message", "properties": [ { @@ -17703,7 +20709,7 @@ }, { "name": "getRepliedMessage", - "description": "Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively", + "description": "Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively", "class": "Message", "properties": [ { @@ -18089,7 +21095,7 @@ }, { "name": "checkCreatedPublicChatsLimit", - "description": "Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached", + "description": "Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium", "class": "Ok", "properties": [ { @@ -18111,7 +21117,7 @@ }, { "name": "getInactiveSupergroupChats", - "description": "Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error", + "description": "Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium", "class": "Chats", "properties": [], "is_synchronous": false, @@ -18169,7 +21175,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only messages that are available locally without sending network requests" + "description": "Pass true to get only messages that are available without sending network requests" } ], "is_synchronous": false, @@ -18222,7 +21228,7 @@ { "name": "remove_from_chat_list", "type": "Bool", - "description": "Pass true if the chat needs to be removed from the chat list" + "description": "Pass true to remove the chat from all chat lists" }, { "name": "revoke", @@ -18235,7 +21241,7 @@ }, { "name": "deleteChat", - "description": "Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method", + "description": "Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat", "class": "Ok", "properties": [ { @@ -18249,8 +21255,8 @@ }, { "name": "searchChatMessages", - "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", - "class": "Messages", + "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation", + "class": "FoundChatMessages", "properties": [ { "name": "chat_id", @@ -18299,7 +21305,7 @@ { "name": "searchMessages", "description": "Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", - "class": "Messages", + "class": "FoundMessages", "properties": [ { "name": "chat_list", @@ -18312,19 +21318,9 @@ "description": "Query to search for" }, { - "name": "offset_date", - "type": "int32", - "description": "The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message" - }, - { - "name": "offset_chat_id", - "type": "int53", - "description": "The chat identifier of the last found message, or 0 for the first request" - }, - { - "name": "offset_message_id", - "type": "int53", - "description": "The message identifier of the last found message, or 0 for the first request" + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18334,7 +21330,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" + "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function" }, { "name": "min_date", @@ -18368,7 +21364,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18386,13 +21382,13 @@ }, { "name": "searchCallMessages", - "description": "Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", - "class": "Messages", + "description": "Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", + "class": "FoundMessages", "properties": [ { - "name": "from_message_id", - "type": "int53", - "description": "Identifier of the message from which to search; use 0 to get results from the last message" + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18402,7 +21398,26 @@ { "name": "only_missed", "type": "Bool", - "description": "If true, returns only messages with missed/declined calls" + "description": "Pass true to search only for messages with missed/declined calls" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchOutgoingDocumentMessages", + "description": "Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order", + "class": "FoundMessages", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for in document file name and message caption" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; up to 100" } ], "is_synchronous": false, @@ -18481,7 +21496,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18510,7 +21525,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18539,7 +21554,36 @@ { "name": "return_local", "type": "Bool", - "description": "If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown" + "description": "Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatMessagePosition", + "description": "Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats", + "class": "Count", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which to find message position" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "filter", + "type": "SearchMessagesFilter", + "description": "Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, only messages in the specified thread will be considered; supergroups only" } ], "is_synchronous": false, @@ -18577,7 +21621,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18589,9 +21633,9 @@ "type": 2 }, { - "name": "getChatSponsoredMessage", - "description": "Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat", - "class": "SponsoredMessage", + "name": "getChatSponsoredMessages", + "description": "Returns sponsored messages to be shown in a chat; for channel chats only", + "class": "SponsoredMessages", "properties": [ { "name": "chat_id", @@ -18666,9 +21710,9 @@ "description": "Pass true to create a link for the whole media album" }, { - "name": "for_comment", + "name": "in_message_thread", "type": "Bool", - "description": "Pass true to create a link to the message as a channel post comment, or from a message thread" + "description": "Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic" } ], "is_synchronous": false, @@ -18712,10 +21756,77 @@ "is_synchronous": false, "type": 1 }, + { + "name": "translateText", + "description": "Translates a text to the given language. Returns a 404 error if the translation can't be performed", + "class": "Text", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text to translate" + }, + { + "name": "from_language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically" + }, + { + "name": "to_language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code of the language to which the message is translated" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "recognizeSpeech", + "description": "Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message \"MSG_VOICE_TOO_LONG\" if media duration is too big to be recognized", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "rateSpeechRecognition", + "description": "Rates recognized speech in a video note or a voice note message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "is_good", + "type": "Bool", + "description": "Pass true if the speech recognition is good" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatAvailableMessageSenders", "description": "Returns list of message sender identifiers, which can be used to send messages in a chat", - "class": "MessageSenders", + "class": "ChatMessageSenders", "properties": [ { "name": "chat_id", @@ -18763,7 +21874,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to or 0" + "description": "Identifier of the replied message; 0 if none" }, { "name": "options", @@ -18802,7 +21913,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a message to reply to or 0" + "description": "Identifier of a replied message; 0 if none" }, { "name": "options", @@ -18813,6 +21924,11 @@ "name": "input_message_contents", "type": "vector\u003cInputMessageContent\u003e", "description": "Contents of messages to be sent. At most 10 messages can be added to an album" + }, + { + "name": "only_preview", + "type": "Bool", + "description": "Pass true to get fake messages instead of actually sending them" } ], "is_synchronous": false, @@ -18860,7 +21976,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of a message to reply to or 0" + "description": "Identifier of a replied message; 0 if none" }, { "name": "options", @@ -18880,7 +21996,7 @@ { "name": "hide_via_bot", "type": "Bool", - "description": "If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\") and GetOption(\"venue_search_bot_username\")" + "description": "Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption(\"animation_search_bot_username\"), getOption(\"photo_search_bot_username\"), and getOption(\"venue_search_bot_username\")" } ], "is_synchronous": false, @@ -18896,6 +22012,11 @@ "type": "int53", "description": "Identifier of the chat to which to forward messages" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the message will be sent; for forum threads only" + }, { "name": "from_chat_id", "type": "int53", @@ -18914,17 +22035,17 @@ { "name": "send_copy", "type": "Bool", - "description": "If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" + "description": "Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" }, { "name": "remove_caption", "type": "Bool", - "description": "If true, media caption of message copies will be removed. Ignored if send_copy is false" + "description": "Pass true to remove media captions of message copies. Ignored if send_copy is false" }, { "name": "only_preview", "type": "Bool", - "description": "If true, messages will not be forwarded and instead fake messages will be returned" + "description": "Pass true to get fake messages instead of actually forwarding them" } ], "is_synchronous": false, @@ -18981,7 +22102,7 @@ { "name": "reply_to_message_id", "type": "int53", - "description": "Identifier of the message to reply to or 0" + "description": "Identifier of the replied message; 0 if none" }, { "name": "disable_notification", @@ -19189,7 +22310,7 @@ { "name": "caption", "type": "formattedText", - "description": "New message content caption; 0-GetOption(\"message_caption_length_max\") characters; pass null to remove caption" + "description": "New message content caption; 0-getOption(\"message_caption_length_max\") characters; pass null to remove caption" } ], "is_synchronous": false, @@ -19319,7 +22440,7 @@ { "name": "caption", "type": "formattedText", - "description": "New message content caption; pass null to remove caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "New message content caption; pass null to remove caption; 0-getOption(\"message_caption_length_max\") characters" } ], "is_synchronous": false, @@ -19368,9 +22489,441 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getForumTopicDefaultIcons", + "description": "Returns list of custom emojis, which can be used as forum topic icon by all users", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 1 + }, + { + "name": "createForumTopic", + "description": "Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup", + "class": "ForumTopicInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "name", + "type": "string", + "description": "Name of the topic; 1-128 characters" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "editForumTopic", + "description": "Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "name", + "type": "string", + "description": "New name of the topic; 0-128 characters. If empty, the previous topic name is kept" + }, + { + "name": "edit_icon_custom_emoji", + "type": "Bool", + "description": "Pass true to edit the icon of the topic. Icon of the General topic can't be edited" + }, + { + "name": "icon_custom_emoji_id", + "type": "int64", + "description": "Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopic", + "description": "Returns information about a forum topic", + "class": "ForumTopic", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopicLink", + "description": "Returns an HTTPS link to a topic in a forum chat. This is an offline request", + "class": "MessageLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopics", + "description": "Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server", + "class": "ForumTopics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the forum chat" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for in the forum topic's name" + }, + { + "name": "offset_date", + "type": "int32", + "description": "The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic" + }, + { + "name": "offset_message_id", + "type": "int53", + "description": "The message identifier of the last message in the last found topic, or 0 for the first request" + }, + { + "name": "offset_message_thread_id", + "type": "int53", + "description": "The message thread identifier of the last found topic, or 0 for the first request" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setForumTopicNotificationSettings", + "description": "Changes the notification settings of a forum topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleForumTopicIsClosed", + "description": "Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "is_closed", + "type": "Bool", + "description": "Pass true to close the topic; pass false to reopen it" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleGeneralForumTopicIsHidden", + "description": "Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "is_hidden", + "type": "Bool", + "description": "Pass true to hide and close the General topic; pass false to unhide it" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleForumTopicIsPinned", + "description": "Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption(\"pinned_forum_topic_count_max\") pinned forum topics", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to pin the topic; pass false to unpin it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setPinnedForumTopics", + "description": "Changes the order of pinned forum topics", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_ids", + "type": "vector\u003cint53\u003e", + "description": "The new list of pinned forum topics" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteForumTopic", + "description": "Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getEmojiReaction", + "description": "Returns information about a emoji reaction. Returns a 404 error if the reaction is not found", + "class": "EmojiReaction", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Text representation of the reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getCustomEmojiReactionAnimations", + "description": "Returns TGS stickers with generic animations for custom emoji reactions", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageAvailableReactions", + "description": "Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message", + "class": "AvailableReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "row_size", + "type": "int32", + "description": "Number of reaction per row, 5-25" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearRecentReactions", + "description": "Clears the list of recently used reactions", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addMessageReaction", + "description": "Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to add" + }, + { + "name": "is_big", + "type": "Bool", + "description": "Pass true if the reaction is added with a big animation" + }, + { + "name": "update_recent_reactions", + "type": "Bool", + "description": "Pass true if the reaction needs to be added to recent reactions" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeMessageReaction", + "description": "Removes a reaction from a message. A chosen reaction can always be removed", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to remove" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageAddedReactions", + "description": "Returns reactions added for a message, along with their sender", + "class": "AddedReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reactions to return; pass null to return all added reactions" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of reactions to be returned; must be positive and can't be greater than 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setDefaultReactionType", + "description": "Changes type of default reaction for the current user", + "class": "Ok", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "New type of the default reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getTextEntities", - "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously", + "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously", "class": "TextEntities", "properties": [ { @@ -19384,7 +22937,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -19409,7 +22962,7 @@ { "name": "text", "type": "formattedText", - "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" + "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" } ], "is_synchronous": true, @@ -19528,6 +23081,20 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getThemeParametersJsonString", + "description": "Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously", + "class": "Text", + "properties": [ + { + "name": "theme", + "type": "themeParameters", + "description": "Theme parameters to convert to JSON" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "setPollAnswer", "description": "Changes the user answer to a poll. A poll in quiz mode can be answered only once", @@ -19671,7 +23238,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the user allowed the bot to send them messages" + "description": "Pass true to allow the bot to send messages to the current user" } ], "is_synchronous": false, @@ -19724,7 +23291,7 @@ { "name": "is_personal", "type": "Bool", - "description": "True, if the result of the query can be cached for the specified user" + "description": "Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query" }, { "name": "results", @@ -19755,6 +23322,136 @@ "is_synchronous": false, "type": 3 }, + { + "name": "getWebAppUrl", + "description": "Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp button is pressed", + "class": "HttpUrl", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "url", + "type": "string", + "description": "The URL from the keyboardButtonTypeWebApp button" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendWebAppData", + "description": "Sends data received from a keyboardButtonTypeWebApp Web App to a bot", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + }, + { + "name": "data", + "type": "string", + "description": "Received data" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openWebApp", + "description": "Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", + "class": "WebAppInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which the Web App is opened" + }, + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the bot, providing the Web App" + }, + { + "name": "url", + "type": "string", + "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the message will be sent" + }, + { + "name": "reply_to_message_id", + "type": "int53", + "description": "Identifier of the replied message for the message sent by the Web App; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "closeWebApp", + "description": "Informs TDLib that a previously opened Web App was closed", + "class": "Ok", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of Web App launch, received from openWebApp" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "answerWebAppQuery", + "description": "Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "web_app_query_id", + "type": "string", + "description": "Identifier of the Web App query" + }, + { + "name": "result", + "type": "InputInlineQueryResult", + "description": "The result of the query" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getCallbackQueryAnswer", "description": "Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires", @@ -19797,7 +23494,7 @@ { "name": "show_alert", "type": "Bool", - "description": "If true, an alert must be shown to the user instead of a toast notification" + "description": "Pass true to show an alert to the user instead of a toast notification" }, { "name": "url", @@ -19874,7 +23571,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -19908,7 +23605,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -19974,7 +23671,7 @@ }, { "name": "deleteChatReplyMarkup", - "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed", + "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed", "class": "Ok", "properties": [ { @@ -20066,7 +23763,7 @@ { "name": "force_read", "type": "Bool", - "description": "True, if messages in closed chats must be marked as read by the request" + "description": "Pass true to mark as read the specified messages even the chat is closed" } ], "is_synchronous": false, @@ -20151,7 +23848,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" + "description": "Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" } ], "is_synchronous": false, @@ -20171,6 +23868,58 @@ "is_synchronous": false, "type": 2 }, + { + "name": "readAllMessageThreadMentions", + "description": "Marks all mentions in a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which mentions are marked as read" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "readAllChatReactions", + "description": "Marks all reactions in a chat or a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "readAllMessageThreadReactions", + "description": "Marks all reactions in a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which reactions are marked as read" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "createPrivateChat", "description": "Returns an existing chat corresponding to a given user", @@ -20184,7 +23933,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20203,7 +23952,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20222,7 +23971,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20256,6 +24005,11 @@ "name": "title", "type": "string", "description": "Title of the new basic group; 1-128 characters" + }, + { + "name": "message_auto_delete_time", + "type": "int32", + "description": "Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" } ], "is_synchronous": false, @@ -20274,7 +24028,7 @@ { "name": "is_channel", "type": "Bool", - "description": "True, if a channel chat needs to be created" + "description": "Pass true to create a channel chat" }, { "name": "description", @@ -20286,10 +24040,15 @@ "type": "chatLocation", "description": "Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat" }, + { + "name": "message_auto_delete_time", + "type": "int32", + "description": "Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" + }, { "name": "for_import", "type": "Bool", - "description": "True, if the supergroup is created for importing messages using importMessage" + "description": "Pass true to create a supergroup for importing messages using importMessage" } ], "is_synchronous": false, @@ -20372,7 +24131,7 @@ }, { "name": "createChatFilter", - "description": "Creates new chat filter. Returns information about the created chat filter", + "description": "Creates new chat filter. Returns information about the created chat filter. There can be up to getOption(\"chat_filter_count_max\") chat filters, but the limit can be increased with Telegram Premium", "class": "ChatFilterInfo", "properties": [ { @@ -20426,6 +24185,11 @@ "name": "chat_filter_ids", "type": "vector\u003cint32\u003e", "description": "Identifiers of chat filters in the new correct order" + }, + { + "name": "main_chat_list_position", + "type": "int32", + "description": "Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users" } ], "is_synchronous": false, @@ -20492,8 +24256,8 @@ "type": 1 }, { - "name": "setChatMessageTtl", - "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)", + "name": "setChatMessageAutoDeleteTime", + "description": "Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).", "class": "Ok", "properties": [ { @@ -20502,9 +24266,9 @@ "description": "Chat identifier" }, { - "name": "ttl", + "name": "message_auto_delete_time", "type": "int32", - "description": "New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret" + "description": "New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" } ], "is_synchronous": false, @@ -20585,7 +24349,7 @@ { "name": "notification_settings", "type": "chatNotificationSettings", - "description": "New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever" + "description": "New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever" } ], "is_synchronous": false, @@ -20604,7 +24368,7 @@ { "name": "has_protected_content", "type": "Bool", - "description": "True, if chat content can't be saved locally, forwarded, or copied" + "description": "New value of has_protected_content" } ], "is_synchronous": false, @@ -20648,6 +24412,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setChatAvailableReactions", + "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "Reactions available in the chat. All emoji reactions must be active" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "setChatClientData", "description": "Changes application-specific data associated with a chat", @@ -20761,12 +24544,12 @@ { "name": "disable_notification", "type": "Bool", - "description": "True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats" + "description": "Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats" }, { "name": "only_for_self", "type": "Bool", - "description": "True, if the message needs to be pinned for one side only; private chats only" + "description": "Pass true to pin the message only for self; private chats only" } ], "is_synchronous": false, @@ -20805,9 +24588,28 @@ "is_synchronous": false, "type": 1 }, + { + "name": "unpinAllMessageThreadMessages", + "description": "Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which messages will be unpinned" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "joinChat", - "description": "Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method", + "description": "Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message \"INVITE_REQUEST_SENT\" if only a join request was created", "class": "Ok", "properties": [ { @@ -20955,7 +24757,7 @@ { "name": "password", "type": "string", - "description": "The password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -20982,7 +24784,7 @@ }, { "name": "searchChatMembers", - "description": "Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels", + "description": "Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels", "class": "ChatMembers", "properties": [ { @@ -21025,13 +24827,63 @@ }, { "name": "clearAllDraftMessages", - "description": "Clears draft messages in all chats", + "description": "Clears message drafts in all chats", "class": "Ok", "properties": [ { "name": "exclude_secret_chats", "type": "Bool", - "description": "If true, local draft messages in secret chats will not be cleared" + "description": "Pass true to keep local message drafts in secret chats" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSound", + "description": "Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSounds", + "description": "Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used", + "class": "NotificationSounds", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addSavedNotificationSound", + "description": "Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed", + "class": "NotificationSound", + "properties": [ + { + "name": "sound", + "type": "InputFile", + "description": "Notification sound file to add" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeSavedNotificationSound", + "description": "Removes a notification sound from the list of saved notification sounds", + "class": "Ok", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" } ], "is_synchronous": false, @@ -21050,7 +24902,7 @@ { "name": "compare_sound", "type": "Bool", - "description": "If true, also chats with non-default sound will be returned" + "description": "Pass true to include in the response chats with only non-default sound" } ], "is_synchronous": false, @@ -21091,7 +24943,7 @@ }, { "name": "resetAllNotificationSettings", - "description": "Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to \"default\" and message previews are shown", + "description": "Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown", "class": "Ok", "properties": [], "is_synchronous": false, @@ -21099,7 +24951,7 @@ }, { "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/arhive chat list", + "description": "Changes the pinned state of a chat. There can be up to getOption(\"pinned_chat_count_max\")/getOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium", "class": "Ok", "properties": [ { @@ -21115,7 +24967,7 @@ { "name": "is_pinned", "type": "Bool", - "description": "True, if the chat is pinned" + "description": "Pass true to pin the chat; pass false to unpin it" } ], "is_synchronous": false, @@ -21140,6 +24992,76 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAttachmentMenuBot", + "description": "Returns information about a bot that can be added to attachment menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleBotIsAddedToAttachmentMenu", + "description": "Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + }, + { + "name": "is_added", + "type": "Bool", + "description": "Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getThemedEmojiStatuses", + "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getRecentEmojiStatuses", + "description": "Returns recent emoji statuses", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultEmojiStatuses", + "description": "Returns default emoji statuses", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearRecentEmojiStatuses", + "description": "Clears the list of recently used emoji statuses", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -21153,22 +25075,22 @@ { "name": "priority", "type": "int32", - "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first" + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The starting position from which the file needs to be downloaded" }, { "name": "limit", - "type": "int32", + "type": "int53", "description": "Number of bytes which need to be downloaded starting from the \"offset\" position before the download will automatically be canceled; use 0 to download without a limit" }, { "name": "synchronous", "type": "Bool", - "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent" + "description": "Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started" } ], "is_synchronous": false, @@ -21177,7 +25099,7 @@ { "name": "getFileDownloadedPrefixSize", "description": "Returns file downloaded prefix size from a given offset, in bytes", - "class": "Count", + "class": "FileDownloadedPrefixSize", "properties": [ { "name": "file_id", @@ -21186,7 +25108,7 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "Offset from which downloaded prefix size needs to be calculated" } ], @@ -21232,8 +25154,8 @@ "type": 1 }, { - "name": "uploadFile", - "description": "Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", + "name": "preliminaryUploadFile", + "description": "Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", "class": "File", "properties": [ { @@ -21249,15 +25171,15 @@ { "name": "priority", "type": "int32", - "description": "Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first" + "description": "Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first" } ], "is_synchronous": false, "type": 1 }, { - "name": "cancelUploadFile", - "description": "Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined", + "name": "cancelPreliminaryUploadFile", + "description": "Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined", "class": "Ok", "properties": [ { @@ -21281,7 +25203,7 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The offset from which to write the data to the file" }, { @@ -21305,12 +25227,12 @@ }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Expected size of the generated file, in bytes; 0 if unknown" }, { "name": "local_prefix_size", - "type": "int32", + "type": "int53", "description": "The number of bytes already generated" } ], @@ -21348,12 +25270,12 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The offset from which to read the file" }, { "name": "count", - "type": "int32", + "type": "int53", "description": "Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position" } ], @@ -21374,9 +25296,148 @@ "is_synchronous": false, "type": 1 }, + { + "name": "addFileToDownloads", + "description": "Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file", + "class": "File", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the file to download" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message with the file" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "priority", + "type": "int32", + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleDownloadIsPaused", + "description": "Changes pause state of a file in the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "Pass true if the download is paused" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleAllDownloadsArePaused", + "description": "Changes pause state of all files in the file download list", + "class": "Ok", + "properties": [ + { + "name": "are_paused", + "type": "Bool", + "description": "Pass true to pause all downloads; pass false to unpause them" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeFileFromDownloads", + "description": "Removes a file from the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeAllFilesFromDownloads", + "description": "Removes all files from the file download list", + "class": "Ok", + "properties": [ + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to remove only active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to remove only completed downloads" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "searchFileDownloads", + "description": "Searches for files in the file download list or recently downloaded files from the list", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for; may be empty to return all downloaded files" + }, + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to search only for active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to search only for completed downloads" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of files to be returned" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getMessageFileType", - "description": "Returns information about a file with messages exported from another app", + "description": "Returns information about a file with messages exported from another application", "class": "MessageFileType", "properties": [ { @@ -21468,7 +25529,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21507,7 +25568,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21687,7 +25748,7 @@ }, { "name": "joinChatByInviteLink", - "description": "Uses an invite link to add the current user to the chat if possible", + "description": "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", "class": "Chat", "properties": [ { @@ -21751,7 +25812,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the request is approved. Otherwise the request is declived" + "description": "Pass true to approve the request; pass false to decline it" } ], "is_synchronous": false, @@ -21775,7 +25836,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the requests are approved. Otherwise the requests are declived" + "description": "Pass true to approve all requests; pass false to decline them" } ], "is_synchronous": false, @@ -21799,7 +25860,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if a video call needs to be created" + "description": "Pass true to create a video call" } ], "is_synchronous": false, @@ -21856,7 +25917,7 @@ { "name": "is_disconnected", "type": "Bool", - "description": "True, if the user was disconnected" + "description": "Pass true if the user was disconnected" }, { "name": "duration", @@ -21866,7 +25927,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if the call was a video call" + "description": "Pass true if the call was a video call" }, { "name": "connection_id", @@ -21908,7 +25969,7 @@ }, { "name": "sendCallDebugInformation", - "description": "Sends debug information for a call", + "description": "Sends debug information for a call to Telegram servers", "class": "Ok", "properties": [ { @@ -21925,6 +25986,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "sendCallLog", + "description": "Sends log file for a call to Telegram servers", + "class": "Ok", + "properties": [ + { + "name": "call_id", + "type": "int32", + "description": "Call identifier" + }, + { + "name": "log_file", + "type": "InputFile", + "description": "Call log file. Only inputFileLocal and inputFileGenerated are supported" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getVideoChatAvailableParticipants", "description": "Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined", @@ -21966,7 +26046,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier, in which the video chat will be created" + "description": "Identifier of a chat in which the video chat will be created" }, { "name": "title", @@ -21977,6 +26057,39 @@ "name": "start_date", "type": "int32", "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future" + }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getVideoChatRtmpUrl", + "description": "Returns RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "replaceVideoChatRtmpUrl", + "description": "Replaces the current RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" } ], "is_synchronous": false, @@ -22057,12 +26170,12 @@ { "name": "is_muted", "type": "Bool", - "description": "True, if the user's microphone is muted" + "description": "Pass true to join the call with muted microphone" }, { "name": "is_my_video_enabled", "type": "Bool", - "description": "True, if the user's video is enabled" + "description": "Pass true if the user's video is enabled" }, { "name": "invite_hash", @@ -22110,7 +26223,7 @@ { "name": "is_paused", "type": "Bool", - "description": "True if screen sharing is paused" + "description": "Pass true to pause screen sharing; pass false to unpause it" } ], "is_synchronous": false, @@ -22319,7 +26432,7 @@ { "name": "is_speaking", "type": "Bool", - "description": "True, if the user is speaking" + "description": "Pass true if the user is speaking" } ], "is_synchronous": false, @@ -22343,7 +26456,7 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true if the user must be muted and false otherwise" + "description": "Pass true to mute the user; pass false to unmute the them" } ], "is_synchronous": false, @@ -22444,6 +26557,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getGroupCallStreams", + "description": "Returns information about available group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getGroupCallStreamSegment", "description": "Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video", @@ -22510,17 +26637,17 @@ { "name": "delete_message", "type": "Bool", - "description": "Pass true if the message must be deleted" + "description": "Pass true to delete the message" }, { "name": "delete_all_messages", "type": "Bool", - "description": "Pass true if all messages from the same sender must be deleted" + "description": "Pass true to delete all messages from the same sender" }, { "name": "report_spam", "type": "Bool", - "description": "Pass true if the sender must be reported to the Telegram moderators" + "description": "Pass true to report the sender to the Telegram moderators" } ], "is_synchronous": false, @@ -22553,12 +26680,12 @@ { "name": "contact", "type": "contact", - "description": "The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored" + "description": "The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored" }, { "name": "share_phone_number", "type": "Bool", - "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" + "description": "Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" } ], "is_synchronous": false, @@ -22649,6 +26776,58 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setUserPersonalProfilePhoto", + "description": "Changes a personal profile photo of a contact user", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "suggestUserProfilePhoto", + "description": "Suggests a profile photo to another regular user with common messages", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchUserByPhoneNumber", + "description": "Searches a user by their phone number. Returns a 404 error if the user can't be found", + "class": "User", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number to search for" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "sharePhoneNumber", "description": "Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber", @@ -22665,7 +26844,7 @@ }, { "name": "getUserProfilePhotos", - "description": "Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already", + "description": "Returns the profile photos of a user. Personal and public photo aren't returned", "class": "ChatPhotos", "properties": [ { @@ -22689,18 +26868,28 @@ }, { "name": "getStickers", - "description": "Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned", + "description": "Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned", "class": "Stickers", "properties": [ { - "name": "emoji", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to return" + }, + { + "name": "query", "type": "string", - "description": "String representation of emoji. If empty, returns all known installed stickers" + "description": "Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers" }, { "name": "limit", "type": "int32", "description": "The maximum number of stickers to be returned" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats" } ], "is_synchronous": false, @@ -22719,7 +26908,21 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of stickers to be returned" + "description": "The maximum number of stickers to be returned; 0-100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumStickers", + "description": "Returns premium stickers from regular sticker sets", + "class": "Stickers", + "properties": [ + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stickers to be returned; 0-100" } ], "is_synchronous": false, @@ -22731,9 +26934,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask sticker sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" } ], "is_synchronous": false, @@ -22745,9 +26948,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask stickers sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" }, { "name": "offset_sticker_set_id", @@ -22766,8 +26969,13 @@ { "name": "getTrendingStickerSets", "description": "Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib", - "class": "StickerSets", + "class": "TrendingStickerSets", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" + }, { "name": "offset", "type": "int32", @@ -22784,7 +26992,7 @@ }, { "name": "getAttachedStickerSets", - "description": "Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets", + "description": "Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets", "class": "StickerSets", "properties": [ { @@ -22830,9 +27038,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask sticker sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to search for" }, { "name": "query", @@ -22906,9 +27114,9 @@ "class": "Ok", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to reorder" }, { "name": "sticker_set_ids", @@ -22935,7 +27143,7 @@ }, { "name": "addRecentSticker", - "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list", + "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers", "class": "Stickers", "properties": [ { @@ -22995,7 +27203,7 @@ }, { "name": "addFavoriteSticker", - "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list", + "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers", "class": "Ok", "properties": [ { @@ -23048,7 +27256,7 @@ { "name": "exact_match", "type": "Bool", - "description": "True, if only emojis, which exactly match text needs to be returned" + "description": "Pass true if only emojis, which exactly match the text, needs to be returned" }, { "name": "input_language_codes", @@ -23087,6 +27295,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getCustomEmojiStickers", + "description": "Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned", + "class": "Stickers", + "properties": [ + { + "name": "custom_emoji_ids", + "type": "vector\u003cint64\u003e", + "description": "Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getSavedAnimations", "description": "Returns saved animations", @@ -23191,7 +27413,7 @@ { "name": "force_full", "type": "Bool", - "description": "If true, the full instant view for the web page will be returned" + "description": "Pass true to get full instant view for the web page" } ], "is_synchronous": false, @@ -23206,6 +27428,11 @@ "name": "photo", "type": "InputChatPhoto", "description": "Profile photo to set" + }, + { + "name": "is_public", + "type": "Bool", + "description": "Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings" } ], "is_synchronous": false, @@ -23252,7 +27479,7 @@ { "name": "bio", "type": "string", - "description": "The new value of the user bio; 0-70 characters without line feeds" + "description": "The new value of the user bio; 0-getOption(\"bio_length_max\") characters without line feeds" } ], "is_synchronous": false, @@ -23260,13 +27487,65 @@ }, { "name": "setUsername", - "description": "Changes the username of the current user", + "description": "Changes the editable username of the current user", "class": "Ok", "properties": [ { "name": "username", "type": "string", - "description": "The new value of the username. Use an empty string to remove the username" + "description": "The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleUsernameIsActive", + "description": "Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached", + "class": "Ok", + "properties": [ + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderActiveUsernames", + "description": "Changes order of active usernames of the current user", + "class": "Ok", + "properties": [ + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setEmojiStatus", + "description": "Changes the emoji status of the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "New emoji status; pass null to switch to the default badge" + }, + { + "name": "duration", + "type": "int32", + "description": "Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually" } ], "is_synchronous": false, @@ -23274,7 +27553,7 @@ }, { "name": "setLocation", - "description": "Changes the location of the current user. Needs to be called if GetOption(\"is_location_visible\") is true and location changes for more than 1 kilometer", + "description": "Changes the location of the current user. Needs to be called if getOption(\"is_location_visible\") is true and location changes for more than 1 kilometer", "class": "Ok", "properties": [ { @@ -23307,7 +27586,7 @@ }, { "name": "resendChangePhoneNumberCode", - "description": "Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed", + "description": "Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed", "class": "AuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -23327,6 +27606,28 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getUserLink", + "description": "Returns an HTTPS link, which can be used to get information about the current user", + "class": "UserLink", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchUserByToken", + "description": "Searches a user by a token from the user's link", + "class": "User", + "properties": [ + { + "name": "token", + "type": "string", + "description": "Token to search for" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setCommands", "description": "Sets the list of commands supported by the bot for the given user scope and language; for bots only", @@ -23340,7 +27641,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" + "description": "A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" }, { "name": "commands", @@ -23364,7 +27665,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" } ], "is_synchronous": false, @@ -23383,7 +27684,68 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setMenuButton", + "description": "Sets menu button for the given user or for all users; for bots only", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to set menu button for all users" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "New menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "getMenuButton", + "description": "Returns menu button set by the bot for the given user; for bots only", + "class": "BotMenuButton", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to get the default menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultGroupAdministratorRights", + "description": "Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultChannelAdministratorRights", + "description": "Sets default administrator rights for adding the bot to channel chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; may be null" } ], "is_synchronous": false, @@ -23432,7 +27794,7 @@ { "name": "can_accept_calls", "type": "Bool", - "description": "True, if incoming calls can be accepted by the session" + "description": "Pass true to allow accepting incoming calls by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23451,7 +27813,7 @@ { "name": "can_accept_secret_chats", "type": "Bool", - "description": "True, if incoming secret chats can be accepted by the session" + "description": "Pass true to allow accepring secret chats by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23503,7 +27865,7 @@ }, { "name": "setSupergroupUsername", - "description": "Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel", + "description": "Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel", "class": "Ok", "properties": [ { @@ -23514,7 +27876,64 @@ { "name": "username", "type": "string", - "description": "New value of the username. Use an empty string to remove the username" + "description": "New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupUsernameIsActive", + "description": "Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + }, + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "disableAllSupergroupUsernames", + "description": "Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderSupergroupActiveUsernames", + "description": "Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + }, + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" } ], "is_synchronous": false, @@ -23558,6 +27977,44 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleSupergroupJoinToSendMessages", + "description": "Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "join_to_send_messages", + "type": "Bool", + "description": "New value of join_to_send_messages" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupJoinByRequest", + "description": "Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the channel" + }, + { + "name": "join_by_request", + "type": "Bool", + "description": "New value of join_by_request" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSupergroupIsAllHistoryAvailable", "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right", @@ -23577,6 +28034,63 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleSupergroupHasHiddenMembers", + "description": "Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "has_hidden_members", + "type": "Bool", + "description": "New value of has_hidden_members" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupHasAggressiveAntiSpamEnabled", + "description": "Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "The identifier of the supergroup, which isn't a broadcast group" + }, + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "The new value of has_aggressive_anti_spam_enabled" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupIsForum", + "description": "Toggles whether the supergroup is a forum; requires owner privileges in the supergroup", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "is_forum", + "type": "Bool", + "description": "New value of is_forum. A supergroup can be converted to a forum, only if it has at least getOption(\"forum_member_count_min\") members" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSupergroupIsBroadcastGroup", "description": "Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup", @@ -23610,6 +28124,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "reportSupergroupAntiSpamFalsePositive", + "description": "Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Supergroup identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the erroneously deleted message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getSupergroupMembers", "description": "Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters", @@ -23655,7 +28188,7 @@ }, { "name": "getChatEventLog", - "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)", + "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id)", "class": "ChatEvents", "properties": [ { @@ -23698,18 +28231,13 @@ "class": "PaymentForm", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "theme", - "type": "paymentFormTheme", + "type": "themeParameters", "description": "Preferred payment form theme; pass null to use the default theme" } ], @@ -23722,14 +28250,9 @@ "class": "ValidatedOrderInfo", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "order_info", @@ -23739,7 +28262,7 @@ { "name": "allow_save", "type": "Bool", - "description": "True, if the order information can be saved" + "description": "Pass true to save the order information" } ], "is_synchronous": false, @@ -23751,14 +28274,9 @@ "class": "PaymentResult", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "payment_form_id", @@ -23797,7 +28315,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier of the PaymentSuccessful message" + "description": "Chat identifier of the messagePaymentSuccessful message" }, { "name": "message_id", @@ -23810,7 +28328,7 @@ }, { "name": "getSavedOrderInfo", - "description": "Returns saved order info, if any", + "description": "Returns saved order information. Returns a 404 error if there is no saved order information", "class": "OrderInfo", "properties": [], "is_synchronous": false, @@ -23818,7 +28336,7 @@ }, { "name": "deleteSavedOrderInfo", - "description": "Deletes saved order info", + "description": "Deletes saved order information", "class": "Ok", "properties": [], "is_synchronous": false, @@ -23832,6 +28350,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "createInvoiceLink", + "description": "Creates a link for the given invoice; for bots only", + "class": "HttpUrl", + "properties": [ + { + "name": "invoice", + "type": "InputMessageContent", + "description": "Information about the invoice of the type inputMessageInvoice" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getSupportUser", "description": "Returns a user that can be contacted to get support", @@ -23848,7 +28380,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the backgrounds must be ordered for dark theme" + "description": "Pass true to order returned backgrounds for a dark theme" } ], "is_synchronous": false, @@ -23905,7 +28437,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the background is chosen for dark theme" + "description": "Pass true if the background is changed for a dark theme" } ], "is_synchronous": false, @@ -23941,7 +28473,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only locally available information without sending network requests" + "description": "Pass true to get only locally available information without sending network requests" } ], "is_synchronous": false, @@ -24170,7 +28702,7 @@ }, { "name": "getOption", - "description": "Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization", + "description": "Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options \"version\" and \"commit_hash\"", "class": "OptionValue", "properties": [ { @@ -24179,7 +28711,7 @@ "description": "The name of the option" } ], - "is_synchronous": false, + "is_synchronous": true, "type": 1 }, { @@ -24232,11 +28764,38 @@ "name": "reason", "type": "string", "description": "The reason why the account was deleted; optional" + }, + { + "name": "password", + "type": "string", + "description": "The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week" } ], "is_synchronous": false, "type": 2 }, + { + "name": "setDefaultMessageAutoDeleteTime", + "description": "Changes the default message auto-delete time for new chats", + "class": "Ok", + "properties": [ + { + "name": "message_auto_delete_time", + "type": "messageAutoDeleteTime", + "description": "New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultMessageAutoDeleteTime", + "description": "Returns default message auto-delete time setting for new chats", + "class": "MessageAutoDeleteTime", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "removeChatActionBar", "description": "Removes a chat action bar without any other action", @@ -24264,7 +28823,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of reported messages, if any" + "description": "Identifiers of reported messages; may be empty to report the whole chat" }, { "name": "reason", @@ -24309,6 +28868,30 @@ "is_synchronous": false, "type": 2 }, + { + "name": "reportMessageReactions", + "description": "Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender, which added the reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatStatistics", "description": "Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true", @@ -24396,7 +28979,7 @@ "class": "StorageStatisticsFast", "properties": [], "is_synchronous": false, - "type": 1 + "type": 2 }, { "name": "getDatabaseStatistics", @@ -24424,7 +29007,7 @@ { "name": "count", "type": "int32", - "description": "Limit on the total count of files after deletion. Pass -1 to use the default limit" + "description": "Limit on the total number of files after deletion. Pass -1 to use the default limit" }, { "name": "immunity_delay", @@ -24482,7 +29065,7 @@ { "name": "only_current", "type": "Bool", - "description": "If true, returns only data for the current library launch" + "description": "Pass true to get statistics only for the current library launch" } ], "is_synchronous": false, @@ -24564,7 +29147,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24578,7 +29161,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24597,7 +29180,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24671,7 +29254,7 @@ }, { "name": "resendPhoneNumberVerificationCode", - "description": "Re-sends the code to verify a phone number to be added to a user's Telegram Passport", + "description": "Resends the code to verify a phone number to be added to a user's Telegram Passport", "class": "AuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -24707,7 +29290,7 @@ }, { "name": "resendEmailAddressVerificationCode", - "description": "Re-sends the code to verify an email address to be added to a user's Telegram Passport", + "description": "Resends the code to verify an email address to be added to a user's Telegram Passport", "class": "EmailAddressAuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -24762,14 +29345,14 @@ "class": "PassportElementsWithErrors", "properties": [ { - "name": "autorization_form_id", + "name": "authorization_form_id", "type": "int32", "description": "Authorization form identifier" }, { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24781,7 +29364,7 @@ "class": "Ok", "properties": [ { - "name": "autorization_form_id", + "name": "authorization_form_id", "type": "int32", "description": "Authorization form identifier" }, @@ -24871,7 +29454,7 @@ }, { "name": "sticker", - "type": "InputSticker", + "type": "inputSticker", "description": "Sticker file to upload" } ], @@ -24927,14 +29510,14 @@ "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" }, { - "name": "is_masks", - "type": "Bool", - "description": "True, if stickers are masks. Animated stickers can't be masks" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" }, { "name": "stickers", - "type": "vector\u003cInputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown" + "type": "vector\u003cinputSticker\u003e", + "description": "List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown" }, { "name": "source", @@ -24962,7 +29545,7 @@ }, { "name": "sticker", - "type": "InputSticker", + "type": "inputSticker", "description": "Sticker to add to the set" } ], @@ -24987,7 +29570,7 @@ { "name": "thumbnail", "type": "InputFile", - "description": "Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them" + "description": "Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set" } ], "is_synchronous": false, @@ -25006,7 +29589,7 @@ { "name": "position", "type": "int32", - "description": "New position of the sticker in the set, zero-based" + "description": "New position of the sticker in the set, 0-based" } ], "is_synchronous": false, @@ -25059,12 +29642,140 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown" + "description": "Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown" } ], "is_synchronous": false, "type": 1 }, + { + "name": "getPremiumLimit", + "description": "Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown", + "class": "PremiumLimit", + "properties": [ + { + "name": "limit_type", + "type": "PremiumLimitType", + "description": "Type of the limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumFeatures", + "description": "Returns information about features, available to Premium users", + "class": "PremiumFeatures", + "properties": [ + { + "name": "source", + "type": "PremiumSource", + "description": "Source of the request; pass null if the method is called from some non-standard source" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumStickerExamples", + "description": "Returns examples of premium stickers for demonstration purposes", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "viewPremiumFeature", + "description": "Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen", + "class": "Ok", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "The viewed premium feature" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clickPremiumSubscriptionButton", + "description": "Informs TDLib that the user clicked Premium subscription button on the Premium features screen", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumState", + "description": "Returns state of Telegram Premium subscription and promotion videos for Premium features", + "class": "PremiumState", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "canPurchasePremium", + "description": "Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase", + "class": "Ok", + "properties": [ + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "assignAppStoreTransaction", + "description": "Informs server about a purchase through App Store. For official applications only", + "class": "Ok", + "properties": [ + { + "name": "receipt", + "type": "bytes", + "description": "App Store receipt" + }, + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "assignGooglePlayTransaction", + "description": "Informs server about a purchase through Google Play. For official applications only", + "class": "Ok", + "properties": [ + { + "name": "package_name", + "type": "string", + "description": "Application package name" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the purchased store product" + }, + { + "name": "purchase_token", + "type": "string", + "description": "Google Play purchase token" + }, + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "acceptTermsOfService", "description": "Accepts Telegram terms of services", @@ -25169,7 +29880,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code for country information localization" + "description": "A two-letter ISO 639-1 language code for country information localization" }, { "name": "phone_number_prefix", @@ -25252,7 +29963,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25286,7 +29997,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25473,6 +30184,39 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getUserSupportInfo", + "description": "Returns support information for the given user; for Telegram support only", + "class": "UserSupportInfo", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setUserSupportInfo", + "description": "Sets support information for the given user; for Telegram support only", + "class": "UserSupportInfo", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "message", + "type": "formattedText", + "description": "New information message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "testCallEmpty", "description": "Does nothing; for testing only. This is an offline method. Can be called before authorization", @@ -25610,7 +30354,7 @@ { "name": "dc_id", "type": "int32", - "description": "Identifier of a datacenter, with which to test connection" + "description": "Identifier of a datacenter with which to test connection" }, { "name": "timeout", diff --git a/data/td_api.tl b/data/td_api.tl index d973c2b..10f53a4 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -22,50 +22,60 @@ error code:int32 message:string = Error; ok = Ok; -//@description Contains parameters for TDLib initialization -//@use_test_dc If set to true, the Telegram test environment will be used instead of the production environment -//@database_directory The path to the directory for the persistent database; if empty, the current working directory will be used -//@files_directory The path to the directory for storing files; if empty, database_directory will be used -//@use_file_database If set to true, information about downloaded and uploaded files will be saved between application restarts -//@use_chat_info_database If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database -//@use_message_database If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database -//@use_secret_chats If set to true, support for secret chats will be enabled -//@api_id Application identifier for Telegram API access, which can be obtained at https://my.telegram.org -//@api_hash Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org -//@system_language_code IETF language tag of the user's operating system language; must be non-empty -//@device_model Model of the device the application is being run on; must be non-empty -//@system_version Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib -//@application_version Application version; must be non-empty -//@enable_storage_optimizer If set to true, old files will automatically be deleted -//@ignore_file_names If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name -tdlibParameters use_test_dc:Bool database_directory:string files_directory:string use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string enable_storage_optimizer:Bool ignore_file_names:Bool = TdlibParameters; - - //@class AuthenticationCodeType @description Provides information about the method by which an authentication code is delivered to the user -//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session @length Length of the code +//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session +//@length Length of the code authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via an SMS message to the specified phone number @length Length of the code +//@description An authentication code is delivered via an SMS message to the specified phone number +//@length Length of the code authenticationCodeTypeSms length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via a phone call to the specified phone number @length Length of the code +//@description An authentication code is delivered via a phone call to the specified phone number +//@length Length of the code authenticationCodeTypeCall length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically @pattern Pattern of the phone number from which the call will be made +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically +//@pattern Pattern of the phone number from which the call will be made authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user @phone_number_prefix Prefix of the phone number from which the call will be made @length Number of digits in the code, excluding the prefix +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user +//@phone_number_prefix Prefix of the phone number from which the call will be made +//@length Number of digits in the code, excluding the prefix authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType; +//@description An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT +//@url URL to open to receive the code +//@length Length of the code +authenticationCodeTypeFragment url:string length:int32 = AuthenticationCodeType; -//@description Information about the authentication code that was sent @phone_number A phone number that is being authenticated @type The way the code was sent to the user @next_type The way the next code will be sent to the user; may be null @timeout Timeout before the code can be re-sent, in seconds + +//@description Information about the authentication code that was sent +//@phone_number A phone number that is being authenticated +//@type The way the code was sent to the user +//@next_type The way the next code will be sent to the user; may be null +//@timeout Timeout before the code can be re-sent, in seconds authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type:AuthenticationCodeType timeout:int32 = AuthenticationCodeInfo; -//@description Information about the email address authentication code that was sent @email_address_pattern Pattern of the email address to which an authentication code was sent @length Length of the code; 0 if unknown +//@description Information about the email address authentication code that was sent +//@email_address_pattern Pattern of the email address to which an authentication code was sent +//@length Length of the code; 0 if unknown emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo; +//@class EmailAddressAuthentication @description Contains authentication data for a email address + +//@description An authentication code delivered to a user's email address @code The code +emailAddressAuthenticationCode code:string = EmailAddressAuthentication; + +//@description An authentication token received through Apple ID @token The token +emailAddressAuthenticationAppleId token:string = EmailAddressAuthentication; + +//@description An authentication token received through Google ID @token The token +emailAddressAuthenticationGoogleId token:string = EmailAddressAuthentication; + + //@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; @@ -73,39 +83,51 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other 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 Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user +//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; //@class AuthorizationState @description Represents the current authorization state of the TDLib client -//@description TDLib needs TdlibParameters for initialization +//@description Initializetion parameters are needed. Call setTdlibParameters to provide them authorizationStateWaitTdlibParameters = AuthorizationState; -//@description TDLib needs an encryption key to decrypt the local database @is_encrypted True, if the database is currently encrypted -authorizationStateWaitEncryptionKey is_encrypted:Bool = AuthorizationState; - -//@description TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options +//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; -//@description TDLib needs the user's authentication code to authorize @code_info Information about the authorization code that was sent +//@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed +//@allow_apple_id True, if authorization through Apple ID is allowed +//@allow_google_id True, if authorization through Google ID is allowed +authorizationStateWaitEmailAddress allow_apple_id:Bool allow_google_id:Bool = AuthorizationState; + +//@description TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code +//@allow_apple_id True, if authorization through Apple ID is allowed +//@allow_google_id True, if authorization through Google ID is allowed +//@code_info Information about the sent authentication code +//@next_phone_number_authorization_date Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown +authorizationStateWaitEmailCode allow_apple_id:Bool allow_google_id:Bool code_info:emailAddressAuthenticationCodeInfo next_phone_number_authorization_date:int32 = AuthorizationState; + +//@description TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code @code_info Information about the authorization code that was sent authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState; //@description The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link @link A tg:// URL for the QR code. The link will be updated frequently authorizationStateWaitOtherDeviceConfirmation link:string = AuthorizationState; -//@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration @terms_of_service Telegram terms of service +//@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data @terms_of_service Telegram terms of service authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState; -//@description The user has been authorized, but needs to enter a password to start using the application @password_hint Hint for the password; may be empty @has_recovery_email_address True, if a recovery email address has been set up +//@description The user has been authorized, but needs to enter a 2-step verification password to start using the application. +//-Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week +//@password_hint Hint for the password; may be empty +//@has_recovery_email_address True, if a recovery email address has been set up //@recovery_email_address_pattern Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool recovery_email_address_pattern:string = AuthorizationState; -//@description The user has been successfully authorized. TDLib is now ready to answer queries +//@description The user has been successfully authorized. TDLib is now ready to answer general requests authorizationStateReady = AuthorizationState; //@description The user is currently logging out @@ -119,11 +141,15 @@ authorizationStateClosing = AuthorizationState; authorizationStateClosed = AuthorizationState; -//@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty -//@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved +//@description Represents the current state of 2-step verification +//@has_password True, if a 2-step verification password is set +//@password_hint Hint for the password; may be empty +//@has_recovery_email_address True, if a recovery email is set +//@has_passport_data True, if some Telegram Passport elements were saved //@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null -//@pending_reset_date If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword -passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState; +//@login_email_address_pattern Pattern of the email address set up for logging in +//@pending_reset_date If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword +passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo login_email_address_pattern:string pending_reset_date:int32 = PasswordState; //@description Contains information about the current recovery email address @recovery_email_address Recovery email address recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress; @@ -142,17 +168,18 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat //@download_offset Download will be started from this offset. downloaded_prefix_size is calculated from this offset //@downloaded_prefix_size If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes //@downloaded_size Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage -localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int32 downloaded_prefix_size:int32 downloaded_size:int32 = LocalFile; +localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int53 downloaded_prefix_size:int53 downloaded_size:int53 = LocalFile; //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. //-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location +//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. +//-Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) //@is_uploading_completed True, if a remote copy is fully available //@uploaded_size Size of the remote available part of the file, in bytes; 0 if unknown -remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int32 = RemoteFile; +remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int53 = RemoteFile; //@description Represents a file //@id Unique file identifier @@ -160,7 +187,7 @@ remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_comp //@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress //@local Information about the local copy of the file //@remote Information about the remote copy of the file -file id:int32 size:int32 expected_size:int32 local:localFile remote:remoteFile = File; +file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File; //@class InputFile @description Points to a file @@ -176,14 +203,18 @@ inputFileRemote id:string = InputFile; //@description A file defined by a local path @path Local path to the file inputFileLocal path:string = InputFile; -//@description A file generated by the application @original_path Local path to a file from which the file is generated; may be empty if there is no such file +//@description A file generated by the application +//@original_path Local path to a file from which the file is generated; may be empty if there is no such file //@conversion String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage //@expected_size Expected size of the generated file, in bytes; 0 if unknown -inputFileGenerated original_path:string conversion:string expected_size:int32 = InputFile; +inputFileGenerated original_path:string conversion:string expected_size:int53 = InputFile; -//@description Describes an image in JPEG format @type Image type (see https://core.telegram.org/constructor/photoSize) -//@photo Information about the image file @width Image width @height Image height +//@description Describes an image in JPEG format +//@type Image type (see https://core.telegram.org/constructor/photoSize) +//@photo Information about the image file +//@width Image width +//@height Image height //@progressive_sizes Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector = PhotoSize; @@ -191,28 +222,35 @@ photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vect minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; -//@class ThumbnailFormat @description Describes format of the thumbnail +//@class ThumbnailFormat @description Describes format of a thumbnail //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in PNG format. It will be used only for background patterns -thumbnailFormatPng = ThumbnailFormat; - -//@description The thumbnail is in WEBP format. It will be used only for some stickers -thumbnailFormatWebp = ThumbnailFormat; - //@description The thumbnail is in static GIF format. It will be used only for some bot inline results thumbnailFormatGif = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for animated sticker sets -thumbnailFormatTgs = ThumbnailFormat; - //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos thumbnailFormatMpeg4 = ThumbnailFormat; +//@description The thumbnail is in PNG format. It will be used only for background patterns +thumbnailFormatPng = ThumbnailFormat; -//@description Represents a thumbnail @format Thumbnail format @width Thumbnail width @height Thumbnail height @file The thumbnail +//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets +thumbnailFormatTgs = ThumbnailFormat; + +//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +thumbnailFormatWebm = ThumbnailFormat; + +//@description The thumbnail is in WEBP format. It will be used only for some stickers +thumbnailFormatWebp = ThumbnailFormat; + + +//@description Represents a thumbnail +//@format Thumbnail format +//@width Thumbnail width +//@height Thumbnail height +//@file The thumbnail thumbnail format:ThumbnailFormat width:int32 height:int32 file:file = Thumbnail; @@ -230,19 +268,62 @@ maskPointMouth = MaskPoint; //@description The mask is placed relatively to the chin maskPointChin = MaskPoint; -//@description Position on a photo where a mask is placed @point Part of the face, relative to which the mask is placed +//@description Position on a photo where a mask is placed +//@point Part of the face, relative to which the mask is placed //@x_shift Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) //@y_shift Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position) //@scale Mask scaling coefficient. (For example, 2.0 means a doubled size) maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; +//@class StickerFormat @description Describes format of a sticker + +//@description The sticker is an image in WEBP format +stickerFormatWebp = StickerFormat; + +//@description The sticker is an animation in TGS format +stickerFormatTgs = StickerFormat; + +//@description The sticker is a video in WEBM format +stickerFormatWebm = StickerFormat; + + +//@class StickerType @description Describes type of a sticker + +//@description The sticker is a regular sticker +stickerTypeRegular = StickerType; + +//@description The sticker is a mask in WEBP format to be placed on photos or videos +stickerTypeMask = StickerType; + +//@description The sticker is a custom emoji to be used inside message text and caption +stickerTypeCustomEmoji = StickerType; + + +//@class StickerFullType @description Contains full information about sticker type + +//@description The sticker is a regular sticker @premium_animation Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker +stickerFullTypeRegular premium_animation:file = StickerFullType; + +//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null +stickerFullTypeMask mask_position:maskPosition = StickerFullType; + +//@description The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji +//@custom_emoji_id Identifier of the custom emoji +//@needs_repainting True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places +stickerFullTypeCustomEmoji custom_emoji_id:int64 needs_repainting:Bool = StickerFullType; + + //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands closedVectorPath commands:vector = ClosedVectorPath; -//@description Describes one answer option of a poll @text Option text; 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option; 0-100 -//@is_chosen True, if the option was chosen by the user @is_being_chosen True, if the option is being chosen by a pending setPollAnswer request +//@description Describes one answer option of a poll +//@text Option text; 1-100 characters +//@voter_count Number of voters for this option, available only for closed or voted polls +//@vote_percentage The percentage of votes for this option; 0-100 +//@is_chosen True, if the option was chosen by the user +//@is_being_chosen True, if the option is being chosen by a pending setPollAnswer request pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; @@ -257,87 +338,158 @@ pollTypeRegular allow_multiple_answers:Bool = PollType; pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType; -//@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format @duration Duration of the animation, in seconds; as defined by the sender @width Width of the animation @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" +//@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format +//@duration Duration of the animation, in seconds; as defined by the sender +//@width Width of the animation +//@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 -//@minithumbnail Animation minithumbnail; may be null @thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null @animation File containing the animation +//@minithumbnail Animation minithumbnail; may be null +//@thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null +//@animation File containing the animation animation duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool minithumbnail:minithumbnail thumbnail:thumbnail animation:file = Animation; -//@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender -//@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null -//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null @audio File containing the audio -audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail audio:file = Audio; +//@description Describes an audio file. Audio is usually in MP3 or M4A format +//@duration Duration of the audio, in seconds; as defined by the sender +//@title Title of the audio; as defined by the sender +//@performer Performer of the audio; as defined by the sender +//@file_name Original name of the file; as defined by the sender +//@mime_type The MIME type of the file; as defined by the sender +//@album_cover_minithumbnail The minithumbnail of the album cover; may be null +//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null +//@external_album_covers Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate +//@audio File containing the audio +audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector audio:file = Audio; -//@description Describes a document of any type @file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender -//@minithumbnail Document minithumbnail; may be null @thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null @document File containing the document +//@description Describes a document of any type +//@file_name Original name of the file; as defined by the sender +//@mime_type MIME type of the file; as defined by the sender +//@minithumbnail Document minithumbnail; may be null +//@thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null +//@document File containing the document document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail:thumbnail document:file = Document; -//@description Describes a photo @has_stickers True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets -//@minithumbnail Photo minithumbnail; may be null @sizes Available variants of the photo, in different sizes +//@description Describes a photo +//@has_stickers True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets +//@minithumbnail Photo minithumbnail; may be null +//@sizes Available variants of the photo, in different sizes photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Photo; -//@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask is placed; may be null -//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker -sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition outline:vector thumbnail:thumbnail sticker:file = Sticker; +//@description Describes a sticker +//@set_id The identifier of the sticker set to which the sticker belongs; 0 if none +//@width Sticker width; as defined by the sender +//@height Sticker height; as defined by the sender +//@emoji Emoji corresponding to the sticker +//@format Sticker format +//@full_type Sticker's full type +//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null +//@sticker File containing the sticker +sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerFullType outline:vector thumbnail:thumbnail sticker:file = Sticker; -//@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender -//@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender +//@description Describes a video file +//@duration Duration of the video, in seconds; as defined by the sender +//@width Video width; as defined by the sender +//@height Video height; as defined by the sender +//@file_name Original name of the file; as defined by the sender +//@mime_type MIME type of the file; as defined by the sender //@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets -//@supports_streaming True, if the video is supposed to be streamed @minithumbnail Video minithumbnail; may be null -//@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null @video File containing the video +//@supports_streaming True, if the video is supposed to be streamed +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null +//@video File containing the video video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video; -//@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format @duration Duration of the video, in seconds; as defined by the sender -//@length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null -//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @video File containing the video -videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thumbnail video:file = VideoNote; +//@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format +//@duration Duration of the video, in seconds; as defined by the sender +//@waveform A waveform representation of the video note's audio in 5-bit format; may be empty if unknown +//@length Video width and height; as defined by the sender +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null +//@speech_recognition_result Result of speech recognition in the video note; may be null +//@video File containing the video +videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote; -//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel @duration Duration of the voice note, in seconds; as defined by the sender -//@waveform A waveform representation of the voice note in 5-bit format @mime_type MIME type of the file; as defined by the sender @voice File containing the voice note -voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; +//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel +//@duration Duration of the voice note, in seconds; as defined by the sender +//@waveform A waveform representation of the voice note in 5-bit format +//@mime_type MIME type of the file; as defined by the sender +//@speech_recognition_result Result of speech recognition in the voice note; may be null +//@voice File containing the voice note +voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote; -//@description Describes an animated representation of an emoji -//@sticker Animated sticker for the emoji +//@description Describes an animated or custom representation of an emoji +//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs +//@sticker_width Expected width of the sticker, which can be used if the sticker is null +//@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none -//@sound File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container -animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; +//@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container +animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji; -//@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 +//@description Describes a user contact +//@phone_number Phone number of the user +//@first_name First name of the user; 1-255 characters in length +//@last_name Last name of the user +//@vcard Additional data about the user in a form of vCard; 0-2048 bytes in length +//@user_id Identifier of the user, if known; otherwise 0 contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; -//@description Describes a location on planet Earth @latitude Latitude of the location in degrees; as defined by the sender @longitude Longitude of the location, in degrees; as defined by the sender +//@description Describes a location on planet Earth +//@latitude Latitude of the location in degrees; as defined by the sender +//@longitude Longitude of the location, in degrees; as defined by the sender //@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 Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported -//@id Identifier of the venue in the provider database; as defined by the sender @type Type of the venue in the provider database; as defined by the sender +//@description Describes a venue +//@location Venue location; as defined by the sender +//@title Venue name; as defined by the sender +//@address Venue address; as defined by the sender +//@provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported +//@id Identifier of the venue in the provider database; as defined by the sender +//@type Type of the venue in the provider database; as defined by the sender venue location:location title:string address:string provider:string id:string type:string = Venue; -//@description Describes a game @id Game ID @short_name Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} @title Game title @text Game text, usually containing scoreboards for a game -//@param_description Game description @photo Game photo @animation Game animation; may be null +//@description Describes a game +//@id Unique game identifier +//@short_name Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} +//@title Game title +//@text Game text, usually containing scoreboards for a game +//@param_description Game description +//@photo Game photo +//@animation Game animation; may be null game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game; -//@description Describes a poll @id Unique poll identifier @question Poll question; 1-300 characters @options List of poll answer options -//@total_voter_count Total number of voters, participating in the poll @recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous -//@is_anonymous True, if the poll is anonymous @type Type of the poll -//@open_period Amount of time the poll will be active after creation, in seconds @close_date Point in time (Unix timestamp) when the poll will automatically be closed @is_closed True, if the poll is closed +//@description Describes a poll +//@id Unique poll identifier +//@question Poll question; 1-300 characters +//@options List of poll answer options +//@total_voter_count Total number of voters, participating in the poll +//@recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous +//@is_anonymous True, if the poll is anonymous +//@type Type of the poll +//@open_period Amount of time the poll will be active after creation, in seconds +//@close_date Point in time (Unix timestamp) when the poll will automatically be closed +//@is_closed True, if the poll is closed poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; -//@description Describes a user profile photo @id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos +//@description Describes a user profile photo +//@id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos //@small A small (160x160) user profile photo. The file can be downloaded only before the photo is changed //@big A big (640x640) user profile photo. The file can be downloaded only before the photo is changed //@minithumbnail User profile photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animation:Bool = ProfilePhoto; +//@is_personal True, if the photo is visible only for the current user +profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ProfilePhoto; //@description Contains basic information about the photo of a chat //@small A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed //@big A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed //@minithumbnail Chat photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool = ChatPhotoInfo; +//@is_personal True, if the photo is visible only for the current user +chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ChatPhotoInfo; //@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots @@ -348,10 +500,14 @@ userTypeRegular = UserType; //@description A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user userTypeDeleted = UserType; -//@description A bot (see https://core.telegram.org/bots) @can_join_groups True, if the bot can be invited to basic group and supergroup chats +//@description A bot (see https://core.telegram.org/bots) +//@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages -//@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the application input field) @need_location True, if the location of the user is expected to be sent with every inline query to this bot -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = UserType; +//@is_inline True, if the bot supports inline queries +//@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) +//@need_location True, if the location of the user is expected to be sent with every inline query to this bot +//@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu +userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = 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; @@ -363,6 +519,9 @@ botCommand command:string description:string = 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; +//@description Describes a button to be shown instead of bot commands menu button @text Text of the button @url URL to be passed to openWebApp +botMenuButton text:string url:string = BotMenuButton; + //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner chatLocation location:location address:string = ChatLocation; @@ -380,8 +539,9 @@ animatedChatPhoto length:int32 file:file main_frame_timestamp:double = AnimatedC //@added_date Point in time (Unix timestamp) when the photo has been added //@minithumbnail Photo minithumbnail; may be null //@sizes Available variants of the photo in JPEG format, in different size -//@animation Animated variant of the photo in MPEG4 format; may be null -chatPhoto id:int64 added_date:int32 minithumbnail:minithumbnail sizes:vector animation:animatedChatPhoto = ChatPhoto; +//@animation A big (640x640) animated variant of the photo in MPEG4 format; may be null +//@small_animation A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available +chatPhoto id:int64 added_date:int32 minithumbnail:minithumbnail sizes:vector animation:animatedChatPhoto small_animation:animatedChatPhoto = ChatPhoto; //@description Contains a list of chat or user profile photos @total_count Total number of photos @photos List of photos chatPhotos total_count:int32 photos:vector = ChatPhotos; @@ -401,42 +561,111 @@ inputChatPhotoStatic photo:InputFile = InputChatPhoto; inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputChatPhoto; +//@description Describes actions that a user is allowed to take in a chat +//@can_send_messages True, if the user can send text messages, contacts, locations, and venues +//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions +//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions +//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions +//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions +//@can_change_info True, if the user can change the chat title, photo, and other settings +//@can_invite_users True, if the user can invite new users to the chat +//@can_pin_messages True, if the user can pin messages +//@can_manage_topics True, if the user can manage topics +chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions; + +//@description Describes rights of the administrator +//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_change_info True, if the administrator can change the chat title, photo, and other settings +//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only +//@can_delete_messages True, if the administrator can delete messages of other users +//@can_invite_users True, if the administrator can invite new users to the chat +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only +//@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only +//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +//@can_manage_video_chats True, if the administrator can manage video chats +//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; + + +//@description Describes an option for buying Telegram Premium to a user +//@currency ISO 4217 currency code for Telegram Premium subscription payment +//@amount The amount to pay, in the smallest units of the currency +//@discount_percentage The discount associated with this option, as a percentage +//@month_count Number of month the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option +//@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available +premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; + + +//@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format +emojiStatus custom_emoji_id:int64 = EmojiStatus; + +//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses +emojiStatuses emoji_statuses:vector = EmojiStatuses; + + +//@description Describes usernames assigned to a user, a supergroup, or a channel +//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames +//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive +//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername +usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; + + //@description Represents a user //@id User identifier //@first_name First name of the user //@last_name Last name of the user -//@username Username of the user +//@usernames Usernames of the user; may be null //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null +//@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user //@is_verified True, if the user is verified +//@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account -//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser +//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots -user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User; +//@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; + + +//@description Contains information about a bot +//@share_text The text that is shown on the bot's profile page and is sent together with the link when users share the bot +//@param_description The text shown in the chat with the bot if the chat is empty +//@photo Photo shown in the chat with the bot if the chat is empty; may be null +//@animation Animation shown in the chat with the bot if the chat is empty; may be null +//@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown +//@commands List of the bot commands +//@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; //@description Contains full information about a user -//@photo User profile photo; may be null +//@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-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 +//@photo User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo +//@public_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 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 //@is_blocked True, if the user is blocked by the current user //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings +//@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used -//@bio A short user bio -//@share_text For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot -//@param_description For bots, the text shown in the chat with the bot if the chat is empty +//@bio A short user bio; may be null for bots +//@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@commands For bots, list of the bot commands -userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector = UserFullInfo; +//@bot_info For bots, information about the bot; may be null +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; -//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers +//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -447,18 +676,6 @@ chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdminist chatAdministrators administrators:vector = ChatAdministrators; -//@description Describes actions that a user is allowed to take in a chat -//@can_send_messages True, if the user can send text messages, contacts, locations, and venues -//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions -//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions -//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions -//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions -//@can_change_info True, if the user can change the chat title, photo, and other settings -//@can_invite_users True, if the user can invite new users to the chat -//@can_pin_messages True, if the user can pin messages -chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; - - //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges @@ -467,21 +684,12 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@is_member True, if the user is a member of the chat chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; -//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators 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 +//@description 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 //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only -//@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only -//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only -//@can_delete_messages True, if the administrator can delete messages of other users -//@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels -//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only -//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them -//@can_manage_video_chats True, if the administrator can manage video chats -//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; +//@rights Rights of the administrator +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -503,11 +711,11 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@description Describes a user or a chat as a member of another chat //@member_id Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels //@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown -//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; -//@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members +//@description Contains a list of chat members @total_count Approximate total number of chat members found @members A list of chat members chatMembers total_count:int32 members:vector = ChatMembers; @@ -577,7 +785,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@is_revoked True, if the link was revoked chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; -//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links +//@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; //@description Describes a chat administrator with a number of active and revoked chat invite links @@ -592,7 +800,7 @@ chatInviteLinkCounts invite_link_counts:vector = ChatInvite //@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; -//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat via an invite link +//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; //@description Contains information about a chat invite link @@ -611,7 +819,7 @@ chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; -//@description Contains a list of requests to join a chat @total_count Approximate total count of requests found @requests List of the requests +//@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; //@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests @@ -627,35 +835,43 @@ chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequests basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; //@description Contains full information about a basic group -//@photo Chat photo; may be null +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@param_description Group description. Updated only after the basic group is opened //@creator_user_id User identifier of the creator of the group; 0 if unknown //@members Group members +//@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup +//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup //@invite_link Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened //@bot_commands List of commands of bots in the group -basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector invite_link:chatInviteLink bot_commands:vector = BasicGroupFullInfo; +basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector can_hide_members:Bool can_toggle_aggressive_anti_spam:Bool invite_link:chatInviteLink bot_commands:vector = BasicGroupFullInfo; -//@description 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 +//@description 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 //@id Supergroup or channel identifier -//@username Username of the supergroup or channel; empty for private supergroups or channels +//@usernames Usernames of the supergroup or channel; may be null //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member -//@status Status of the current user in the supergroup or channel; custom title will be always empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//@status Status of the current user in the supergroup or channel; custom title will always be empty +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received +//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels +//@join_to_send_messages True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups +//@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members +//@is_forum True, if the supergroup must be shown as a forum by default //@is_verified True, if the supergroup or channel is verified //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; //@description Contains full information about a supergroup or channel -//@photo Chat photo; may be null +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@param_description Supergroup or channel description //@member_count Number of members in the supergroup or channel; 0 if unknown //@administrator_count Number of privileged users in the supergroup or channel; 0 if unknown @@ -664,19 +880,24 @@ supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_co //@linked_chat_id Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown //@slow_mode_delay Delay between consecutive sent messages for non-administrator supergroup members, in seconds //@slow_mode_delay_expires_in Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero -//@can_get_members True, if members of the chat can be retrieved +//@can_get_members True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers +//@has_hidden_members True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers +//@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators //@can_set_username True, if the chat username can be changed //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available -//@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators +//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup +//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, +//-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators +//@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators //@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@location Location to which the supergroup is connected; may be null -//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only +//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -698,7 +919,8 @@ secretChatStateClosed = SecretChatState; //@is_outbound True, if the chat was created by the current user; otherwise false //@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. //-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers -//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 +//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, +//-files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat; @@ -711,10 +933,17 @@ messageSenderUser user_id:int53 = MessageSender; messageSenderChat chat_id:int53 = MessageSender; -//@description Represents a list of message senders @total_count Approximate total count of messages senders found @senders List of message senders +//@description Represents a list of message senders @total_count Approximate total number of messages senders found @senders List of message senders messageSenders total_count:int32 senders:vector = MessageSenders; +//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; + +//@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders +chatMessageSenders senders:vector = ChatMessageSenders; + + //@class MessageForwardOrigin @description Contains information about the origin of a forwarded message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message @@ -738,6 +967,15 @@ messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:stri messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; +//@class ReactionType @description Describes type of message reaction + +//@description A reaction with an emoji @emoji Text representation of the reaction +reactionTypeEmoji emoji:string = ReactionType; + +//@description A reaction with a custom emoji @custom_emoji_id Unique identifier of the custom emoji +reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; + + //@description Contains information about a forwarded message //@origin Origin of a forwarded message //@date Point in time (Unix timestamp) when the message was originally sent @@ -754,11 +992,25 @@ messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announc //@last_message_id Identifier of the last reply to the message messageReplyInfo reply_count:int32 recent_replier_ids:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; +//@description Contains information about a reaction to a message +//@type Type of the reaction +//@total_count Number of times the reaction was added +//@is_chosen True, if the reaction is chosen by the current user +//@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats +messageReaction type:ReactionType total_count:int32 is_chosen:Bool recent_sender_ids:vector = MessageReaction; + //@description Contains information about interactions with a message //@view_count Number of times the message was viewed //@forward_count Number of times the message was forwarded //@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself -messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo; +//@reactions The list of reactions added to the message +messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector = MessageInteractionInfo; + +//@description Contains information about an unread reaction to a message +//@type Type of the reaction +//@sender_id Identifier of the sender, added the reaction +//@is_big True, if the reaction was added with a big animation +unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadReaction; //@class MessageSendingState @description Contains information about the sending state of the message @@ -766,7 +1018,9 @@ messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageRe //@description The message is being sent now, but has not yet been delivered to the server messageSendingStatePending = MessageSendingState; -//@description The message failed to be sent @error_code An error code; 0 if unknown @error_message Error message +//@description The message failed to be sent +//@error_code An error code; 0 if unknown +//@error_message Error message //@can_retry True, if the message can be re-sent //@need_another_sender True, if the message can be re-sent only on behalf of a different sender //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes @@ -786,40 +1040,48 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_statistics True, if the message statistics are available -//@can_get_message_thread True, if the message thread info is available +//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions +//@can_get_statistics True, if the message statistics are available through getMessageStatistics +//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink +//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts +//@is_topic_message True, if the message is a forum topic message //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited //@forward_info Information about the initial message sender; may be null //@interaction_info Information about interactions with the message; may be null +//@unread_reactions Information about unread reactions added to the message //@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id //@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs -//@ttl For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires -//@ttl_expires_in Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field +//@self_destruct_time The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires +//@self_destruct_in Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field +//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent //@author_signature For channel posts and anonymous group messages, optional author signature //@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; -//@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null +//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total count of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; +//@description Contains a list of messages found by a search in a given chat @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_from_message_id The offset for the next request. If 0, there are no more results +foundChatMessages total_count:int32 messages:vector next_from_message_id:int53 = FoundChatMessages; + //@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; -//@description Contains a list of message positions @total_count Total count of messages found @positions List of message positions +//@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions messagePositions total_count:int32 positions:vector = MessagePositions; //@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day @@ -831,10 +1093,37 @@ messageCalendar total_count:int32 days:vector = MessageCalen //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages -//@sponsor_chat_id Chat identifier -//@link An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead +//@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" +//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link +//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 +//@show_chat_photo True, if the sponsor's chat photo must be shown +//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead //@content Content of the message. Currently, can be only of the type messageText -sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType content:MessageContent = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent = SponsoredMessage; + +//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages +sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; + + +//@description Describes a file added to file download list +//@file_id File identifier +//@message The message with the file +//@add_date Point in time (Unix timestamp) when the file was added to the download list +//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed +//@is_paused True, if downloading of the file is paused +fileDownload file_id:int32 message:message add_date:int32 complete_date:int32 is_paused:Bool = FileDownload; + +//@description Contains number of being downloaded and recently downloaded files found +//@active_count Number of active file downloads found, including paused +//@paused_count Number of paused file downloads found +//@completed_count Number of completed file downloads found +downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 = DownloadedFileCounts; + +//@description Contains a list of downloaded files, found by a search +//@total_counts Total number of suitable files, ignoring offset +//@files The list of files +//@next_offset The offset for the next request. If empty, there are no more results +foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; //@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant @@ -842,32 +1131,37 @@ sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType co //@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value notificationSettingsScopePrivateChats = NotificationSettingsScope; -//@description Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value notificationSettingsScopeGroupChats = NotificationSettingsScope; -//@description Notification settings applied to all channels when the corresponding chat setting has a default value +//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value notificationSettingsScopeChannelChats = NotificationSettingsScope; -//@description Contains information about notification settings for a chat -//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat is used instead @mute_for Time left before notifications will be unmuted, in seconds -//@use_default_sound If true, sound is ignored and the value for the relevant type of chat is used instead @sound The name of an audio file to be used for notification sounds; only applies to iOS applications -//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content must be displayed in notifications -//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead @disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message -//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead @disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound:string use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +//@description Contains information about notification settings for a chat or a froum topic +//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead +//@mute_for Time left before notifications will be unmuted, in seconds +//@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead +//@show_preview True, if message content must be displayed in notifications +//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message +//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds -//@sound The name of an audio file to be used for notification sounds; only applies to iOS applications +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the message to reply to; 0 if none +//@reply_to_message_id Identifier of the replied message; 0 if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; @@ -890,11 +1184,12 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@description Represents a filter of user chats //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". +//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". //-If empty, use getChatFilterDefaultIconName to get default icon name for the filter -//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list -//@included_chat_ids The chat identifiers of always included chats in the filtered chat list -//@excluded_chat_ids The chat identifiers of always excluded chats in the filtered chat list +//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@included_chat_ids The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@excluded_chat_ids The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@exclude_muted True, if muted chats need to be excluded //@exclude_read True, if read chats need to be excluded //@exclude_archived True, if archived chats need to be excluded @@ -908,7 +1203,8 @@ chatFilter title:string icon_name:string pinned_chat_ids:vector included_ //@description Contains basic information about a chat filter //@id Unique chat filter identifier //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" +//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; //@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description @@ -950,6 +1246,15 @@ chatSourcePublicServiceAnnouncement type:string text:string = ChatSource; chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition; +//@class ChatAvailableReactions @description Describes reactions available in the chat + +//@description All reactions are available in the chat +chatAvailableReactionsAll = ChatAvailableReactions; + +//@description Only specific reactions are available in the chat @reactions The list of reactions +chatAvailableReactionsSome reactions:vector = ChatAvailableReactions; + + //@description Describes a video chat //@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall //@has_participants True, if the video chat has participants @@ -978,8 +1283,10 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the chat -//@notification_settings Notification settings for this chat -//@message_ttl Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats +//@unread_reaction_count Number of messages with unread reactions in the chat +//@notification_settings Notification settings for the chat +//@available_reactions Types of reaction, available in the chat +//@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null //@video_chat Information about video chat of the chat @@ -987,9 +1294,9 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; -//@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers +//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1002,7 +1309,7 @@ chatsNearby users_nearby:vector supergroups_nearby:vector